1/*! For license information please see chunk-vendors.69da4d1b.js.LICENSE.txt */ 2(self.webpackChunkts_boilerplate=self.webpackChunkts_boilerplate||[]).push([[504],{121:function(e){e.exports=function(e,t){if(null==e)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i},e.exports.default=e.exports,e.exports.__esModule=!0},276:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(97590);Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})});var i=n(84999);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var s=n(68837);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})});var o=n(76993);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})})},314:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i,s=n(35285),o=[];t.LogLevel=void 0,(i=t.LogLevel||(t.LogLevel={}))[i.DEBUG=0]="DEBUG",i[i.VERBOSE=1]="VERBOSE",i[i.INFO=2]="INFO",i[i.WARN=3]="WARN",i[i.ERROR=4]="ERROR",i[i.SILENT=5]="SILENT";var a={debug:t.LogLevel.DEBUG,verbose:t.LogLevel.VERBOSE,info:t.LogLevel.INFO,warn:t.LogLevel.WARN,error:t.LogLevel.ERROR,silent:t.LogLevel.SILENT},c=t.LogLevel.INFO,u=((r={})[t.LogLevel.DEBUG]="log",r[t.LogLevel.VERBOSE]="log",r[t.LogLevel.INFO]="info",r[t.LogLevel.WARN]="warn",r[t.LogLevel.ERROR]="error",r),l=function(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!(t<e.logLevel)){var i=(new Date).toISOString(),o=u[t];if(!o)throw new Error("Attempted to log a message with an invalid logType (value: ".concat(t,")"));console[o].apply(console,s.__spreadArray(["[".concat(i,"] ").concat(e.name,":")],n,!1))}},h=function(){function e(e){this.name=e,this._logLevel=c,this._logHandler=l,this._userLogHandler=null,o.push(this)}return Object.defineProperty(e.prototype,"logLevel",{get:function(){return this._logLevel},set:function(e){if(!(e in t.LogLevel))throw new TypeError('Invalid value "'.concat(e,'" assigned to `logLevel`'));this._logLevel=e},enumerable:!1,configurable:!0}),e.prototype.setLogLevel=function(e){this._logLevel="string"==typeof e?a[e]:e},Object.defineProperty(e.prototype,"logHandler",{get:function(){return this._logHandler},set:function(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"userLogHandler",{get:function(){return this._userLogHandler},set:function(e){this._userLogHandler=e},enumerable:!1,configurable:!0}),e.prototype.debug=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,s.__spreadArray([this,t.LogLevel.DEBUG],e,!1)),this._logHandler.apply(this,s.__spreadArray([this,t.LogLevel.DEBUG],e,!1))},e.prototype.log=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,s.__spreadArray([this,t.LogLevel.VERBOSE],e,!1)),this._logHandler.apply(this,s.__spreadArray([this,t.LogLevel.VERBOSE],e,!1))},e.prototype.info=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,s.__spreadArray([this,t.LogLevel.INFO],e,!1)),this._logHandler.apply(this,s.__spreadArray([this,t.LogLevel.INFO],e,!1))},e.prototype.warn=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,s.__spreadArray([this,t.LogLevel.WARN],e,!1)),this._logHandler.apply(this,s.__spreadArray([this,t.LogLevel.WARN],e,!1))},e.prototype.error=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this._userLogHandler&&this._userLogHandler.apply(this,s.__spreadArray([this,t.LogLevel.ERROR],e,!1)),this._logHandler.apply(this,s.__spreadArray([this,t.LogLevel.ERROR],e,!1))},e}();t.Logger=h,t.setLogLevel=function(e){o.forEach(function(t){t.setLogLevel(e)}
2)},t.setUserLogHandler=function(e,n){for(var r=function(r){var i=null;n&&n.level&&(i=a[n.level]),r.userLogHandler=null===e?null:function(n,r){for(var s=[],o=2;o<arguments.length;o++)s[o-2]=arguments[o];var a=s.map(function(e){if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}}).filter(function(e){return e}).join(" ");r>=(null!=i?i:n.logLevel)&&e({level:t.LogLevel[r].toLowerCase(),message:a,args:s,type:n.name})}},i=0,s=o;i<s.length;i++)r(s[i])}},474:function(e,t,n){var r=n(12368),i=n(16054),s=n(85929)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[s])?!!t:"RegExp"==i(e))}},762:function(e,t,n){var r=n(63661),i=n(61387),s=n(92636),o=n(22554),a=n(88113),c=n(7257),u=function(e,t){this.stopped=e,this.result=t};e.exports=function(e,t,n){var l,h,d,f,p,g,m,v=n&&n.that,y=!(!n||!n.AS_ENTRIES),w=!(!n||!n.IS_ITERATOR),b=!(!n||!n.INTERRUPTED),_=o(t,v,1+y+b),I=function(e){return l&&c(l),new u(!0,e)},E=function(e){return y?(r(e),b?_(e[0],e[1],I):_(e[0],e[1])):b?_(e,I):_(e)};if(w)l=e;else{if("function"!=typeof(h=a(e)))throw TypeError("Target is not iterable");if(i(h)){for(d=0,f=s(e.length);f>d;d++)if((p=E(e[d]))&&p instanceof u)return p;return new u(!1)}l=h.call(e)}for(g=l.next;!(m=g.call(l)).done;){try{p=E(m.value)}catch(e){throw c(l),e}if("object"==typeof p&&p&&p instanceof u)return p}return new u(!1)}},1106:function(e,t,n){var r,i,s=n(61581),o=n(72134),a=s.process,c=a&&a.versions,u=c&&c.v8;u?i=(r=u.split("."))[0]<4?1:r[0]+r[1]:o&&(!(r=o.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=o.match(/Chrome\/(\d+)/))&&(i=r[1]),e.exports=i&&+i},1266:function(e,t,n){"use strict";n.d(t,{Am:function(){return R},Bd:function(){return w},FA:function(){return A},Fy:function(){return g},I9:function(){return P},Im:function(){return O},Ku:function(){return U},Ll:function(){return y},T9:function(){return d},Uj:function(){return o},XA:function(){return f},ZQ:function(){return m},bD:function(){return D},cY:function(){return p},eX:function(){return S},g:function(){return k},gR:function(){return x},hp:function(){return L},jZ:function(){return v},lT:function(){return I},lV:function(){return _},nr:function(){return E},sr:function(){return b},tD:function(){return M},u:function(){return a},yU:function(){return h},zW:function(){return T},zw:function(){return c}});const r=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296==(64512&i)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},i={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let t=0;t<e.length;
vendor: 4,758 bytes, line 2
2t+=3){const i=e[t],s=t+1<e.length,o=s?e[t+1]:0,a=t+2<e.length,c=a?e[t+2]:0,u=i>>2,l=(3&i)<<4|o>>4;let h=(15&o)<<2|c>>6,d=63&c;a||(d=64,s||(h=64)),r.push(n[u],n[l],n[h],n[d])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(r(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&s)}else if(i>239&&i<365){const s=((7&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(s>>10)),t[r++]=String.fromCharCode(56320+(1023&s))}else{const s=e[n++],o=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&s)<<6|63&o)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let t=0;t<e.length;){const i=n[e.charAt(t++)],o=t<e.length?n[e.charAt(t)]:0;++t;const a=t<e.length?n[e.charAt(t)]:64;++t;const c=t<e.length?n[e.charAt(t)]:64;if(++t,null==i||null==o||null==a||null==c)throw new s;const u=i<<2|o>>4;if(r.push(u),64!==a){const e=o<<4&240|a>>2;if(r.push(e),64!==c){const e=a<<6&192|c;r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class s extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const o=function(e){return function(e){const t=r(e);return i.encodeByteArray(t,!0)}(e).replace(/\./g,"")},a=function(e){try{return i.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function c(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(const n in t)t.hasOwnProperty(n)&&u(n)&&(e[n]=c(e[n],t[n]));return e}function u(e){return"__proto__"!==e}const l=()=>{try{return function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;throw new Error("Unable to locate global object.")}().__FIREBASE_DEFAULTS__||(()=>{if("undefined"==typeof process||void 0===process.env)return;const e=process.env.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0})()||(()=>{if("undefined"==typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}const t=e&&a(e[1]);return t&&JSON.parse(t)})()}catch(e){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`)}},h=e=>{const t=(e=>{var t,n;return null===(n=null===(t=l())||void 0===t?void 0:t.emulatorHosts)||void 0===n?void 0:n[e]})(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const r=parseInt(t.substring(n+1),10);return"["===t[0]?[t.substring(1,n-1),r]:[t.substring(0,n),r]},d=()=>{var e;return null===(e=l())||void 0===e?void 0:e.config},f=e=>{var t;return null===(t=l())||void 0===t?void 0:t[`_${e}`]};class p{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,n))}}}function g(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=t||"demo-project",r=e.iat||0,i=e.sub||e.user_id;if(!i)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const s=Object.assign({iss:`https://securetoken.google.com/${n}`,aud:n,iat:r,exp:r+3600,auth_time:r,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},e);return[o(JSON.stringify({alg:"none",type:"JWT"})),o(JSON.stringify(s)),""].join(".")}function m(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function v(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(m())}function y(){var e;const t=null===(e=l())||void 0===e?void 0:e.forceEnvironment;if("node"===t)return!0;
2if("browser"===t)return!1;try{return"[object process]"===Object.prototype.toString.call(n.g.process)}catch(e){return!1}}function w(){return"object"==typeof self&&self.self===self}function b(){const e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id}function _(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function I(){const e=m();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function E(){return!y()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function T(){try{return"object"==typeof indexedDB}catch(e){return!1}}function S(){return new Promise((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}})}class k extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,k.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,A.prototype.create)}}class A{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},r=`${this.service}/${e}`,i=this.errors[e],s=i?function(e,t){return e.replace(C,(e,n)=>{const r=t[n];return null!=r?String(r):`<${n}?>`})}(i,n):"Error",o=`${this.serviceName}: ${s} (${r}).`;return new k(r,o,n)}}const C=/\{\$([^}]+)}/g;function x(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function O(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function D(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const i of n){if(!r.includes(i))return!1;const n=e[i],s=t[i];if(N(n)&&N(s)){if(!D(n,s))return!1}else if(n!==s)return!1}for(const e of r)if(!n.includes(e))return!1;return!0}function N(e){return null!==e&&"object"==typeof e}function R(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(e=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function P(e){const t={};return e.replace(/^\?/,"").split("&").forEach(e=>{if(e){const[n,r]=e.split("=");
2t[decodeURIComponent(n)]=decodeURIComponent(r)}}),t}function L(e){const t=e.indexOf("?");if(!t)return"";const n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)}function M(e,t){const n=new F(e,t);return n.subscribe.bind(n)}class F{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,n){let r;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");r=function(e){if("object"!=typeof e||null===e)return!1;for(const t of["next","error","complete"])if(t in e&&"function"==typeof e[t])return!0;return!1}(e)?e:{next:e,error:t,complete:n},void 0===r.next&&(r.next=j),void 0===r.error&&(r.error=j),void 0===r.complete&&(r.complete=j);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch(e){}}),this.observers.push(r),i}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function j(){}function U(e){return e&&e._delegate?e._delegate:e}},1391:function(e,t,n){var r=n(86333),i=n(51983);(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.15.1",mode:r?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},1404:function(e){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},1422:function(e,t,n){var r=n(24060),i=n(84263),s=n(39571).indexOf,o=n(96331);e.exports=function(e,t){var n,a=i(e),c=0,u=[];for(n in a)!r(o,n)&&r(a,n)&&u.push(n);for(;t.length>c;)r(a,n=t[c++])&&(~s(u,n)||u.push(n));return u}},1633:function(e,t,n){var r=n(96331),i=n(12368),s=n(24060),o=n(96435).f,a=n(18002),c=n(84154),u=a("meta"),l=0,h=Object.isExtensible||function(){return!0},d=function(e){o(e,u,{value:{objectID:"O"+ ++l,weakData:{}}})},f=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!s(e,u)){if(!h(e))return"F";if(!t)return"E";d(e)}return e[u].objectID},getWeakData:function(e,t){if(!s(e,u)){if(!h(e))return!0;if(!t)return!1;d(e)}return e[u].weakData},onFreeze:function(e){return c&&f.REQUIRED&&h(e)&&!s(e,u)&&d(e),e}};r[u]=!0},1724:function(e,t,n){"use strict";n.d(t,{q:function(){return r}});var r=function(e,t,n){var r=t-e;return 0===r?1:(n-e)/r}},1918:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.default=e.exports,e.exports.__esModule=!0},2825:function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},3027:function(e,t,n){var r=n(61581);e.exports=function(e,t){var n=r.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},3650:function(e,t,n){var r=n(1918);Object.defineProperty(t,"__esModule",{value:!0}),t.withDocumentDatesParsed=function(e,t){var n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach(function(t){(0,i.default)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e);return null==t||t.forEach(function(e){if("string"==typeof e){var t=(0,s.default)(n,e);if(t){var r,i=null===(r=t.toDate)||void 0===r?void 0:r.call(t);i&&(0,o.default)(n,e,i)}}}),n};var i=r(n(49145)),s=r(n(19535)),o=r(n(37022));function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}},4026:function(e,t,n){"use strict";var r=n(51624),i=n(1266),s=n(26891),o=n(35285),a=n(8474),c=n(94762);const u=function(){return{"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must al
2ways have a verified email.","email-already-in-use":"The email address is already in use by another account.","emulator-config-failed":'Auth instance has already been used to make a network call. Auth can no longer be configured to use the emulator. Try calling "connectAuthEmulator()" sooner.',"expired-action-code":"The action code has expired.","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal AuthError has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not 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 AuthError has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-emulator-scheme":"Emulator URL must start with a valid scheme (http:// or https://).","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is
vendor: 7,825 bytes, line 2
2 malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","login-blocked":"Login blocked by user-provided method: {$originalMessage}","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal AuthError has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-password":"A non-empty password must be provided","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal AuthError has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled.","already-initialized":"initializeAuth() has already been called with different options. To avoid this error, call initializeAuth() with the same options as when it was originally called, or call getAuth() to return the already initialized instance.","missing-recaptcha-token":"The reCAPTCHA token is missing when sending request to the backend.","invalid-recaptcha-token":"The reCAPTCHA token is invalid when sending request to the backend.","invalid-recaptcha-action":"The reCAPTCHA action is invalid when sending request to the backend.","recaptcha-not-enabled":"reCAPTCHA Enterprise integration is not enabled for this project.","missing-client-type":"The reCAPTCHA client type is missing when sending request to the backend.","missing-recaptcha-version":"The reCAPTCHA version is missing when sending request to the backend.","invalid-req-type":"Invalid request parameters.","invalid-recaptcha-version":"The reCAPTCHA version is invalid when sending request to the backend."
2}},l=function(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}},h=new i.FA("auth","Firebase",{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}),d=new a.Vy("@firebase/auth");function f(e,...t){d.logLevel<=a.$b.ERROR&&d.error(`Auth (${s.SDK_VERSION}): ${e}`,...t)}function p(e,...t){throw y(e,...t)}function g(e,...t){return y(e,...t)}function m(e,t,n){const r=Object.assign(Object.assign({},l()),{[t]:n});return new i.FA("auth","Firebase",r).create(t,{appName:e.name})}function v(e,t,n){if(!(t instanceof n))throw n.name!==t.constructor.name&&p(e,"argument-error"),m(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function y(e,...t){if("string"!=typeof e){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return h.create(e,...t)}function w(e,t,...n){if(!e)throw y(t,...n)}function b(e){const t="INTERNAL ASSERTION FAILED: "+e;throw f(t),new Error(t)}function _(e,t){e||b(t)}function I(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.href)||""}function E(){return"http:"===T()||"https:"===T()}function T(){var e;return"undefined"!=typeof self&&(null===(e=self.location)||void 0===e?void 0:e.protocol)||null}class S{constructor(e,t){this.shortDelay=e,this.longDelay=t,_(t>e,"Short delay should be less than long delay!"),this.isMobile=(0,i.jZ)()||(0,i.lV)()}get(){return"undefined"!=typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(E()||(0,i.sr)()||"connection"in navigator)&&!navigator.onLine?Math.min(5e3,this.shortDelay):this.isMobile?this.longDelay:this.shortDelay}}function k(e,t){_(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}class A{static initialize(e,t,n){this.fetchImpl=e,t&&(this.headersImpl=t),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:void b("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){return this.headersImpl?this.headersImpl:"undefined"!=typeof self&&"Headers"in self?self.Headers:void b("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){return this.responseImpl?this.responseImpl:"undefined"!=typeof self&&"Response"in self?self.Response:void b("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const C={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-rec
2aptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"},x=new S(3e4,6e4);function O(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}async function D(e,t,n,r,s={}){return N(e,s,async()=>{let s={},o={};r&&("GET"===t?o=r:s={body:JSON.stringify(r)});const a=(0,i.Am)(Object.assign({key:e.config.apiKey},o)).slice(1),c=await e._getAdditionalHeaders();return c["Content-Type"]="application/json",e.languageCode&&(c["X-Firebase-Locale"]=e.languageCode),A.fetch()(P(e,e.config.apiHost,n,a),Object.assign({method:t,headers:c,referrerPolicy:"no-referrer"},s))})}async function N(e,t,n){e._canInitEmulator=!1;const r=Object.assign(Object.assign({},C),t);try{const t=new L(e),i=await Promise.race([n(),t.promise]);t.clearNetworkTimeout();const s=await i.json();if("needConfirmation"in s)throw M(e,"account-exists-with-different-credential",s);if(i.ok&&!("errorMessage"in s))return s;{const t=i.ok?s.errorMessage:s.error.message,[n,o]=t.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw M(e,"credential-already-in-use",s);if("EMAIL_EXISTS"===n)throw M(e,"email-already-in-use",s);if("USER_DISABLED"===n)throw M(e,"user-disabled",s);const a=r[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(o)throw m(e,a,o);p(e,a)}}catch(t){if(t instanceof i.g)throw t;p(e,"network-request-failed",{message:String(t)})}}async function R(e,t,n,r,i={}){const s=await D(e,t,n,r,i);return"mfaPendingCredential"in s&&p(e,"multi-factor-auth-required",{_serverResponse:s}),s}function P(e,t,n,r){const i=`${t}${n}?${r}`;return e.config.emulator?k(e.config,i):`${e.config.apiScheme}://${i}`}class L{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((e,t)=>{this.timer=setTimeout(()=>t(g(this.auth,"network-request-failed")),x.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function M(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=g(e,t,r);return i.customData._tokenResponse=n,i}function F(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(e){}}function j(e){return 1e3*Number(e)}function U(e){const[t,n,r]=e.split(".");if(void 0===t||void 0===n||void 0===r)return f("JWT malformed, contained fewer than 3 sections"),null;try{const e=(0,i.u)(n);return e?JSON.parse(e):(f("Failed to decode base64 JWT payload"),null)}catch(e){return f("Caught error parsing JWT payload as JSON",null==e?void 0:e.toString()),null}}async function V(e,t,n=!1){if(n)return t;try{return await t}catch(t){throw t instanceof i.g&&function({code:e}){return"auth/user-disabled"===e||"auth/user-token-expired"===e}(t)&&e.auth.currentUser===e&&await e.auth.signOut(),t}}class B{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,null!==this.timerId&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const e=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),e}{this.errorBackoff=3e4;const e=(null!==(t=this.user.stsTokenManager.expirationTime)&&void 0!==t?t:0)-Date.now()-3e5;return Math.max(0,e)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){return void("auth/network-request-failed"===(null==e?void 0:e.code)&&this.schedule(!0))}this.schedule()}}class q{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=F(this.lastLoginAt),this.creationTime=F(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function z(e){var t;const n=e.auth,r=await e.getIdToken(),i=await V(e,async function(e,t){return D(e,"POST","/v1/accounts:lookup",t)}(n,{idToken:r}));w(null==i?void 0:i.users.length,n,"internal-error");const s=i.users[0];e._notifyReloadListener(s);const a=(null===(t=s.providerUserInfo)||void 0===t?void 0:t.length)?s.providerUserInfo.map(e=>{var{providerId:t}=e,n=(0,o.__rest)(e,["providerId"]);
vendor: 9,086 bytes, line 2
2return{providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}}):[],c=(u=e.providerData,l=a,[...u.filter(e=>!l.some(t=>t.providerId===e.providerId)),...l]);var u,l;const h=e.isAnonymous,d=!(e.email&&s.passwordHash||(null==c?void 0:c.length)),f=!!h&&d,p={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:c,metadata:new q(s.createdAt,s.lastLoginAt),isAnonymous:f};Object.assign(e,p)}class ${constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){w(e.idToken,"internal-error"),w(void 0!==e.idToken,"internal-error"),w(void 0!==e.refreshToken,"internal-error");const t="expiresIn"in e&&void 0!==e.expiresIn?Number(e.expiresIn):function(e){const t=U(e);return w(t,"internal-error"),w(void 0!==t.exp,"internal-error"),w(void 0!==t.iat,"internal-error"),Number(t.exp)-Number(t.iat)}(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}async getToken(e,t=!1){return w(!this.accessToken||this.refreshToken,e,"user-token-expired"),t||!this.accessToken||this.isExpired?this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null:this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:n,refreshToken:r,expiresIn:s}=await async function(e,t){const n=await N(e,{},async()=>{const n=(0,i.Am)({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:r,apiKey:s}=e.config,o=P(e,r,"/v1/token",`key=${s}`),a=await e._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",A.fetch()(o,{method:"POST",headers:a,body:n})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(e,t);this.updateTokensAndExpiration(n,r,Number(s))}updateTokensAndExpiration(e,t,n){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(e,t){const{refreshToken:n,accessToken:r,expirationTime:i}=t,s=new $;return n&&(w("string"==typeof n,"internal-error",{appName:e}),s.refreshToken=n),r&&(w("string"==typeof r,"internal-error",{appName:e}),s.accessToken=r),i&&(w("number"==typeof i,"internal-error",{appName:e}),s.expirationTime=i),s}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new $,this.toJSON())}_performRefresh(){return b("not implemented")}}function G(e,t){w("string"==typeof e||void 0===e,"internal-error",{appName:t})}class K{constructor(e){var{uid:t,auth:n,stsTokenManager:r}=e,i=(0,o.__rest)(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new B(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new q(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){const t=await V(this,this.stsTokenManager.getToken(this.auth,e));return w(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return async function(e,t=!1){const n=(0,i.Ku)(e),r=await n.getIdToken(t),s=U(r);w(s&&s.exp&&s.auth_time&&s.iat,n.auth,"internal-error");const o="object"==typeof s.firebase?s.firebase:void 0,a=null==o?void 0:o.sign_in_provider;return{claims:s,token:r,authTime:F(j(s.auth_time)),issuedAtTime:F(j(s.iat)),expirationTime:F(j(s.exp)),signInProvider:a||null,signInSecondFactor:(null==o?void 0:o.sign_in_second_factor)||null}}(this,e)}reload(){return async function(e){const t=(0,i.Ku)(e);await z(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}(this)}_assign(e){this!==e&&(w(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(e=>Object.assign({},e)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new K(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){w(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),t&&await z(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){const e=await this.getIdToken();return await V(this,async function(e,t){return D(e,"POST","/v1/accounts:delete",t)}(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var n,r,i,s,o,a,c,u;const l=null!==(n=t.displayName)&&void 0!==n?n:void 0,h=null!==(r=t.email)&&void 0!==r?r:void 0,d=null!==(i=t.phoneNumber)&&void 0!==i?i:void 0,f=null!==(s=t.photoURL)&&void 0!==s?s:void 0,p=null!==(o=t.tenantId)&&void 0!==o?o:void 0,g=null!==(a=t._redirectEventId)&&void 0!==a?a:void 0,m=null!==(c=t.createdAt)&&void 0!==c?c:void 0,v=null!==(u=t.lastLoginAt)&&void 0!==u?u:void 0,{uid:y,emailVerified:b,isAnonymous:_,providerData:I,stsTokenManager:E}=t;w(y&&E,e,"internal-error");const T=$.fromJSON(this.name,E);w("string"==typeof y,e,"internal-error"),G(l,e.name),G(h,e.name),w("boolean"==typeof b,e,"internal-error"),w("boolean"==typeof _,e,"internal-error"),G(d,e.name),G(f,e.name),G(p,e.name),G(g,e.name),G(m,e.name),G(v,e.name);const S=new K({uid:y,auth:e,email:h,emailVerified:b,displayName:l,isAnonymous:_,photoURL:f,phoneNumber:d,tenantId:p,stsTokenManager:T,createdAt:m,lastLoginAt:v});return I&&Array.isArray(I)&&(S.providerData=I.map(e=>Object.assign({},e))),g&&(S._redirectEventId=g),S}static async _fromIdTokenResponse(e,t,n=!1){const r=new $;r.updateFromServerResponse(t);const i=new K({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:n});return await z(i),i}}const W=new Map;function H(e){_(e instanceof Function,"Expected a class definition");let t=W.get(e);return t?(_(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,W.set(e,t),t)}class Q{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return void 0===t?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}Q.type="NONE";const Y=Q;function X(e,t,n){return`firebase:${e}:${t}:${n}`}class J{constructor(e,t,n){this.persistence=e,this.auth=t,this.userKey=n;const{config:r,name:i}=this.auth;this.fullUserKey=X(this.userKey,r.apiKey,i),this.fullPersistenceKey=X("persistence",r.apiKey,i),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?K._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=e,t?this.setCurrentUser(t):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}
2static async create(e,t,n="authUser"){if(!t.length)return new J(H(Y),e,n);const r=(await Promise.all(t.map(async e=>{if(await e._isAvailable())return e}))).filter(e=>e);let i=r[0]||H(Y);const s=X(n,e.config.apiKey,e.name);let o=null;for(const n of t)try{const t=await n._get(s);if(t){const r=K._fromJSON(e,t);n!==i&&(o=r),i=n;break}}catch(e){}const a=r.filter(e=>e._shouldAllowMigration);return i._shouldAllowMigration&&a.length?(i=a[0],o&&await i._set(s,o.toJSON()),await Promise.all(t.map(async e=>{if(e!==i)try{await e._remove(s)}catch(e){}})),new J(i,e,n)):new J(i,e,n)}}function Z(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(re(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(ee(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(se(t))return"Blackberry";if(oe(t))return"Webos";if(te(t))return"Safari";if((t.includes("chrome/")||ne(t))&&!t.includes("edge/"))return"Chrome";if(ie(t))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=e.match(t);if(2===(null==n?void 0:n.length))return n[1]}return"Other"}function ee(e=(0,i.ZQ)()){return/firefox\//i.test(e)}function te(e=(0,i.ZQ)()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function ne(e=(0,i.ZQ)()){return/crios\//i.test(e)}function re(e=(0,i.ZQ)()){return/iemobile/i.test(e)}function ie(e=(0,i.ZQ)()){return/android/i.test(e)}function se(e=(0,i.ZQ)()){return/blackberry/i.test(e)}function oe(e=(0,i.ZQ)()){return/webos/i.test(e)}function ae(e=(0,i.ZQ)()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function ce(e=(0,i.ZQ)()){return ae(e)||ie(e)||oe(e)||se(e)||/windows phone/i.test(e)||re(e)}function ue(e,t=[]){let n;switch(e){case"Browser":n=Z((0,i.ZQ)());break;case"Worker":n=`${Z((0,i.ZQ)())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${s.SDK_VERSION}/${r}`}async function le(e,t){return D(e,"GET","/v2/recaptchaConfig",O(e,t))}function he(e){return void 0!==e&&void 0!==e.getResponse}function de(e){return void 0!==e&&void 0!==e.enterprise}class fe{constructor(e){if(this.siteKey="",this.emailPasswordEnabled=!1,void 0===e.recaptchaKey)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.emailPasswordEnabled=e.recaptchaEnforcementState.some(e=>"EMAIL_PASSWORD_PROVIDER"===e.provider&&"OFF"!==e.enforcementState)}}function pe(e){return new Promise((t,n)=>{const r=document.createElement("script");var i,s;r.setAttribute("src",e),r.onload=t,r.onerror=e=>{const t=g("internal-error");t.customData=e,n(t)},r.type="text/javascript",r.charset="UTF-8",(null!==(s=null===(i=document.getElementsByTagName("head"))||void 0===i?void 0:i[0])&&void 0!==s?s:document).appendChild(r)})}function ge(e){return`__${e}${Math.floor(1e6*Math.random())}`}class me{constructor(e){this.type="recaptcha-enterprise",this.auth=be(e)}async verify(e="verify",t=!1){function n(t,n,r){const i=window.grecaptcha;de(i)?i.enterprise.ready(()=>{i.enterprise.execute(t,{action:e}).then(e=>{n(e)}).catch(()=>{n("NO_RECAPTCHA")})}):r(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((e,r)=>{(async function(e){if(!t){if(null==e.tenantId&&null!=e._agentRecaptchaConfig)return e._agentRecaptchaConfig.siteKey;if(null!=e.tenantId&&void 0!==e._tenantRecaptchaConfigs[e.tenantId])return e._tenantRecaptchaConfigs[e.tenantId].siteKey}return new Promise(async(t,n)=>{le(e,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(r=>{if(void 0!==r.recaptchaKey){const n=new fe(r);return null==e.tenantId?e._agentRecaptchaConfig=n:e._tenantRecaptchaConfigs[e.tenantId]=n,t(n.siteKey)}n(new Error("recaptcha Enterprise site key undefined"))}).catch(e=>{n(e)})})})(this.auth).then(i=>{if(!t&&de(window.grecaptcha))n(i,e,r);else{if("undefined"==typeof window)return void r(new Error("RecaptchaVerifier is only supported in browser"));pe("https://www.google.com/recaptcha/enterprise.js?render="+i).then(()=>{n(i,e,r)}
2).catch(e=>{r(e)})}}).catch(e=>{r(e)})})}}async function ve(e,t,n,r=!1){const i=new me(e);let s;try{s=await i.verify(n)}catch(e){s=await i.verify(n,!0)}const o=Object.assign({},t);return r?Object.assign(o,{captchaResp:s}):Object.assign(o,{captchaResponse:s}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}class ye{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const n=t=>new Promise((n,r)=>{try{n(e(t))}catch(e){r(e)}});n.onAbort=t,this.queue.push(n);const r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const n of this.queue)await n(e),n.onAbort&&t.push(n.onAbort)}catch(e){t.reverse();for(const e of t)try{e()}catch(e){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:null==e?void 0:e.message})}}}class we{constructor(e,t,n,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=n,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new _e(this),this.idTokenSubscription=new _e(this),this.beforeStateQueue=new ye(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=h,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=H(t)),this._initializationPromise=this.queue(async()=>{var n,r;if(!this._deleted&&(this.persistenceManager=await J.create(this,e),!this._deleted)){if(null===(n=this._popupRedirectResolver)||void 0===n?void 0:n._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(e){}await this.initializeCurrentUser(t),this.lastNotifiedUid=(null===(r=this.currentUser)||void 0===r?void 0:r.uid)||null,this._deleted||(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();return this.currentUser||e?this.currentUser&&e&&this.currentUser.uid===e.uid?(this._currentUser._assign(e),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(e,!0):void 0}async initializeCurrentUser(e){var t;const n=await this.assertedPersistence.getCurrentUser();let r=n,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const n=null===(t=this.redirectUser)||void 0===t?void 0:t._redirectEventId,s=null==r?void 0:r._redirectEventId,o=await this.tryRedirectSignIn(e);n&&n!==s||!(null==o?void 0:o.user)||(r=o.user,i=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(r)}catch(e){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(e))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return w(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(e){await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await z(e)}catch(e){if("auth/network-request-failed"!==(null==e?void 0:e.code))return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(e){const t=e?(0,i.Ku)(e):null;return t&&w(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&w(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0)}setPersistence(e){return this.queue(async()=>{await this.assertedPersistence.setPersistence(H(e))})}async initializeRecaptchaConfig(){const e=await le(this,{clientType:"CLIENT_TYPE_WEB",ver
2sion:"RECAPTCHA_ENTERPRISE"}),t=new fe(e);null==this.tenantId?this._agentRecaptchaConfig=t:this._tenantRecaptchaConfigs[this.tenantId]=t,t.emailPasswordEnabled&&new me(this).verify()}_getRecaptchaConfig(){return null==this.tenantId?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new i.FA("auth","Firebase",e())}onAuthStateChanged(e,t,n){return this.registerStateListener(this.authStateSubscription,e,t,n)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,n){return this.registerStateListener(this.idTokenSubscription,e,t,n)}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(e=this._currentUser)||void 0===e?void 0:e.toJSON()}}async _setRedirectUser(e,t){const n=await this.getOrInitRedirectPersistenceManager(t);return null===e?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&H(e)||this._popupRedirectResolver;w(t,this,"argument-error"),this.redirectPersistenceManager=await J.create(this,[H(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,n;return this._isInitialized&&await this.queue(async()=>{}),(null===(t=this._currentUser)||void 0===t?void 0:t._redirectEventId)===e?this._currentUser:(null===(n=this.redirectUser)||void 0===n?void 0:n._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const n=null!==(t=null===(e=this.currentUser)||void 0===e?void 0:e.uid)&&void 0!==t?t:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,n,r){if(this._deleted)return()=>{};const i="function"==typeof t?t:t.next.bind(t),s=this._isInitialized?Promise.resolve():this._initializationPromise;return w(s,this,"internal-error"),s.then(()=>i(this.currentUser)),"function"==typeof t?e.addObserver(t,n,r):e.addObserver(t)}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return w(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){e&&!this.frameworks.includes(e)&&(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=ue(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await(null===(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var e;const t=await(null===(e=this.appCheckServiceProvider.getImmediate({optional:!0}))||void 0===e?void 0:e.getToken());return(null==t?void 0:t.error)&&function(e,...t){d.logLevel<=a.$b.WARN&&d.warn(`Auth (${s.SDK_VERSION}): ${e}`,...t)}(`Error while retrieving App Check token: ${t.error}`),null==t?void 0:t.token}}function be(e){return(0,i.Ku)(e)}class _e{constructor(e){this.auth=e,this.observer=null,this.addObserver=(0,i.tD)(e=>this.observer=e)}get next(){return w(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}function Ie(e){const t=e.indexOf(":");
2return t<0?"":e.substr(0,t+1)}function Ee(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}class Te{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return b("not implemented")}_getIdTokenResponse(e){return b("not implemented")}_linkToIdToken(e,t){return b("not implemented")}_getReauthenticationResolver(e){return b("not implemented")}}async function Se(e,t){return D(e,"POST","/v1/accounts:resetPassword",O(e,t))}async function ke(e,t){return D(e,"POST","/v1/accounts:update",t)}async function Ae(e,t){return R(e,"POST","/v1/accounts:signInWithPassword",O(e,t))}async function Ce(e,t){return D(e,"POST","/v1/accounts:sendOobCode",O(e,t))}async function xe(e,t){return Ce(e,t)}async function Oe(e,t){return Ce(e,t)}class De extends Te{constructor(e,t,n,r=null){super("password",n),this._email=e,this._password=t,this._tenantId=r}static _fromEmailAndPassword(e,t){return new De(e,t,"password")}static _fromEmailAndCode(e,t,n=null){return new De(e,t,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e;if((null==t?void 0:t.email)&&(null==t?void 0:t.password)){if("password"===t.signInMethod)return this._fromEmailAndPassword(t.email,t.password);if("emailLink"===t.signInMethod)return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){var t;switch(this.signInMethod){case"password":const n={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};if(null===(t=e._getRecaptchaConfig())||void 0===t?void 0:t.emailPasswordEnabled){const t=await ve(e,n,"signInWithPassword");return Ae(e,t)}return Ae(e,n).catch(async t=>{if("auth/missing-recaptcha-token"===t.code){console.log("Sign-in with email address and password is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow.");const t=await ve(e,n,"signInWithPassword");return Ae(e,t)}return Promise.reject(t)});case"emailLink":return async function(e,t){return R(e,"POST","/v1/accounts:signInWithEmailLink",O(e,t))}(e,{email:this._email,oobCode:this._password});default:p(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":return ke(e,{idToken:t,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return async function(e,t){return R(e,"POST","/v1/accounts:signInWithEmailLink",O(e,t))}(e,{idToken:t,email:this._email,oobCode:this._password});default:p(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}async function Ne(e,t){return R(e,"POST","/v1/accounts:signInWithIdp",O(e,t))}class Re extends Te{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new Re(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):p("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
2once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e,{providerId:n,signInMethod:r}=t,i=(0,o.__rest)(t,["providerId","signInMethod"]);if(!n||!r)return null;const s=new Re(n,r);return s.idToken=i.idToken||void 0,s.accessToken=i.accessToken||void 0,s.secret=i.secret,s.nonce=i.nonce,s.pendingToken=i.pendingToken||null,s}_getIdTokenResponse(e){return Ne(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,Ne(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Ne(e,t)}buildRequest(){const e={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=(0,i.Am)(t)}return e}}const Pe={USER_NOT_FOUND:"user-not-found"};class Le extends Te{constructor(e){super("phone","phone"),this.params=e}static _fromVerification(e,t){return new Le({verificationId:e,verificationCode:t})}static _fromTokenResponse(e,t){return new Le({phoneNumber:e,temporaryProof:t})}_getIdTokenResponse(e){return async function(e,t){return R(e,"POST","/v1/accounts:signInWithPhoneNumber",O(e,t))}(e,this._makeVerificationRequest())}_linkToIdToken(e,t){return async function(e,t){const n=await R(e,"POST","/v1/accounts:signInWithPhoneNumber",O(e,t));if(n.temporaryProof)throw M(e,"account-exists-with-different-credential",n);return n}(e,Object.assign({idToken:t},this._makeVerificationRequest()))}_getReauthenticationResolver(e){return async function(e,t){return R(e,"POST","/v1/accounts:signInWithPhoneNumber",O(e,Object.assign(Object.assign({},t),{operation:"REAUTH"})),Pe)}(e,this._makeVerificationRequest())}_makeVerificationRequest(){const{temporaryProof:e,phoneNumber:t,verificationId:n,verificationCode:r}=this.params;return e&&t?{temporaryProof:e,phoneNumber:t}:{sessionInfo:n,code:r}}toJSON(){const e={providerId:this.providerId};return this.params.phoneNumber&&(e.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(e.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(e.verificationCode=this.params.verificationCode),this.params.verificationId&&(e.verificationId=this.params.verificationId),e}static fromJSON(e){"string"==typeof e&&(e=JSON.parse(e));const{verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}=e;return n||t||r||i?new Le({verificationId:t,verificationCode:n,phoneNumber:r,temporaryProof:i}):null}}class Me{constructor(e){var t,n,r,s,o,a;const c=(0,i.I9)((0,i.hp)(e)),u=null!==(t=c.apiKey)&&void 0!==t?t:null,l=null!==(n=c.oobCode)&&void 0!==n?n:null,h=function(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(r=c.mode)&&void 0!==r?r:null);w(u&&l&&h,"argument-error"),this.apiKey=u,this.operation=h,this.code=l,this.continueUrl=null!==(s=c.continueUrl)&&void 0!==s?s:null,this.languageCode=null!==(o=c.languageCode)&&void 0!==o?o:null,this.tenantId=null!==(a=c.tenantId)&&void 0!==a?a:null}static parseLink(e){const t=function(e){const t=(0,i.I9)((0,i.hp)(e)).link,n=t?(0,i.I9)((0,i.hp)(t)).deep_link_id:null,r=(0,i.I9)((0,i.hp)(e)).deep_link_id;return(r?(0,i.I9)((0,i.hp)(r)).link:null)||r||n||t||e}(e);try{return new Me(t)}catch(e){return null}}}class Fe{constructor(){this.providerId=Fe.PROVIDER_ID}static credential(e,t){return De._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const n=Me.parseLink(t);return w(n,"argument-error"),De._fromEmailAndCode(e,n.code,n.tenantId)}}Fe.PROVIDER_ID="password",Fe.EMAIL_PASSWORD_SIGN_IN_METHOD="password",Fe.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class je{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class Ue extends je{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class Ve extends Ue{static credentialFromJSON(e){const t="string"==typeof e?JSON.parse(e):e;return w("providerId"in t&&"signInMethod"in t,"argument-error"),Re._fromParams(t)}credential(e){return this._credential(Object.assign(Object.assign({},e),{nonce:e.rawNonce}))}_credential(e){return w(e.idToken||e.accessToken,"argument-error"),Re._fromParams(Object.assign(Object.assign({}
vendor: 4,693 bytes, line 2
2,e),{providerId:this.providerId,signInMethod:this.providerId}))}static credentialFromResult(e){return Ve.oauthCredentialFromTaggedObject(e)}static credentialFromError(e){return Ve.oauthCredentialFromTaggedObject(e.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:n,oauthTokenSecret:r,pendingToken:i,nonce:s,providerId:o}=e;if(!(n||r||t||i))return null;if(!o)return null;try{return new Ve(o)._credential({idToken:t,accessToken:n,nonce:s,pendingToken:i})}catch(e){return null}}}class Be extends Ue{constructor(){super("facebook.com")}static credential(e){return Re._fromParams({providerId:Be.PROVIDER_ID,signInMethod:Be.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Be.credentialFromTaggedObject(e)}static credentialFromError(e){return Be.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return Be.credential(e.oauthAccessToken)}catch(e){return null}}}Be.FACEBOOK_SIGN_IN_METHOD="facebook.com",Be.PROVIDER_ID="facebook.com";class qe extends Ue{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return Re._fromParams({providerId:qe.PROVIDER_ID,signInMethod:qe.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return qe.credentialFromTaggedObject(e)}static credentialFromError(e){return qe.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:n}=e;if(!t&&!n)return null;try{return qe.credential(t,n)}catch(e){return null}}}qe.GOOGLE_SIGN_IN_METHOD="google.com",qe.PROVIDER_ID="google.com";class ze extends Ue{constructor(){super("github.com")}static credential(e){return Re._fromParams({providerId:ze.PROVIDER_ID,signInMethod:ze.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return ze.credentialFromTaggedObject(e)}static credentialFromError(e){return ze.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e))return null;if(!e.oauthAccessToken)return null;try{return ze.credential(e.oauthAccessToken)}catch(e){return null}}}ze.GITHUB_SIGN_IN_METHOD="github.com",ze.PROVIDER_ID="github.com";class $e extends Te{constructor(e,t){super(e,e),this.pendingToken=t}_getIdTokenResponse(e){return Ne(e,this.buildRequest())}_linkToIdToken(e,t){const n=this.buildRequest();return n.idToken=t,Ne(e,n)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,Ne(e,t)}toJSON(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}static fromJSON(e){const t="string"==typeof e?JSON.parse(e):e,{providerId:n,signInMethod:r,pendingToken:i}=t;return n&&r&&i&&n===r?new $e(n,i):null}static _create(e,t){return new $e(e,t)}buildRequest(){return{requestUri:"http://localhost",returnSecureToken:!0,pendingToken:this.pendingToken}}}class Ge extends je{constructor(e){w(e.startsWith("saml."),"argument-error"),super(e)}static credentialFromResult(e){return Ge.samlCredentialFromTaggedObject(e)}static credentialFromError(e){return Ge.samlCredentialFromTaggedObject(e.customData||{})}static credentialFromJSON(e){const t=$e.fromJSON(e);return w(t,"argument-error"),t}static samlCredentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{pendingToken:t,providerId:n}=e;if(!t||!n)return null;try{return $e._create(n,t)}catch(e){return null}}}class Ke extends Ue{constructor(){super("twitter.com")}static credential(e,t){return Re._fromParams({providerId:Ke.PROVIDER_ID,signInMethod:Ke.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return Ke.credentialFromTaggedObject(e)}static credentialFromError(e){return Ke.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:n}=e;if(!t||!n)return null;try{return Ke.credential(t,n)}catch(e){return null}}}async function We(e,t){return R(e,"POST","/v1/accounts:signUp",O(e,t))}Ke.TWITTER_SIGN_IN_METHOD="twitter.com",Ke.PROVIDER_ID="twitter.com";class He{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,n,r=!1){const i=await K._fromIdTokenResponse(e,n,r),s=Qe(n);return new He({user:i,providerId:s,_tokenResponse:n,operationType:t})}static async _forOperation(e,t,n){await e._updateTokensIfNecessary(n,!0);const r=Qe(n);
2return new He({user:e,providerId:r,_tokenResponse:n,operationType:t})}}function Qe(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}class Ye extends i.g{constructor(e,t,n,r){var i;super(t.code,t.message),this.operationType=n,this.user=r,Object.setPrototypeOf(this,Ye.prototype),this.customData={appName:e.name,tenantId:null!==(i=e.tenantId)&&void 0!==i?i:void 0,_serverResponse:t.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,t,n,r){return new Ye(e,t,n,r)}}function Xe(e,t,n,r){return("reauthenticate"===t?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(n=>{if("auth/multi-factor-auth-required"===n.code)throw Ye._fromErrorAndOperation(e,n,t,r);throw n})}function Je(e){return new Set(e.map(({providerId:e})=>e).filter(e=>!!e))}async function Ze(e,t,n=!1){const r=await V(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return He._forOperation(e,"link",r)}async function et(e,t,n){await z(t);const r=!1===e?"provider-already-linked":"no-such-provider";w(Je(t.providerData).has(n)===e,t.auth,r)}async function tt(e,t,n=!1){const{auth:r}=e,i="reauthenticate";try{const s=await V(e,Xe(r,i,t,e),n);w(s.idToken,r,"internal-error");const o=U(s.idToken);w(o,r,"internal-error");const{sub:a}=o;return w(e.uid===a,r,"user-mismatch"),He._forOperation(e,i,s)}catch(e){throw"auth/user-not-found"===(null==e?void 0:e.code)&&p(r,"user-mismatch"),e}}async function nt(e,t,n=!1){const r="signIn",i=await Xe(e,r,t),s=await He._fromIdTokenResponse(e,r,i);return n||await e._updateCurrentUser(s.user),s}async function rt(e,t){return nt(be(e),t)}async function it(e,t){const n=(0,i.Ku)(e);return await et(!1,n,t.providerId),Ze(n,t)}async function st(e,t){return tt((0,i.Ku)(e),t)}class ot{constructor(e,t){this.factorId=e,this.uid=t.mfaEnrollmentId,this.enrollmentTime=new Date(t.enrolledAt).toUTCString(),this.displayName=t.displayName}static _fromServerResponse(e,t){return"phoneInfo"in t?at._fromServerResponse(e,t):"totpInfo"in t?ct._fromServerResponse(e,t):p(e,"internal-error")}}class at extends ot{constructor(e){super("phone",e),this.phoneNumber=e.phoneInfo}static _fromServerResponse(e,t){return new at(t)}}class ct extends ot{constructor(e){super("totp",e)}static _fromServerResponse(e,t){return new ct(t)}}function ut(e,t,n){var r;w((null===(r=n.url)||void 0===r?void 0:r.length)>0,e,"invalid-continue-uri"),w(void 0===n.dynamicLinkDomain||n.dynamicLinkDomain.length>0,e,"invalid-dynamic-link-domain"),t.continueUrl=n.url,t.dynamicLinkDomain=n.dynamicLinkDomain,t.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(w(n.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iOSBundleId=n.iOS.bundleId),n.android&&(w(n.android.packageName.length>0,e,"missing-android-pkg-name"),t.androidInstallApp=n.android.installApp,t.androidMinimumVersionCode=n.android.minimumVersion,t.androidPackageName=n.android.packageName)}async function lt(e,t){const n=(0,i.Ku)(e),r=await Se(n,{oobCode:t}),s=r.requestType;switch(w(s,n,"internal-error"),s){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":w(r.newEmail,n,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":w(r.mfaInfo,n,"internal-error");default:w(r.email,n,"internal-error")}let o=null;return r.mfaInfo&&(o=ot._fromServerResponse(be(n),r.mfaInfo)),{data:{email:("VERIFY_AND_CHANGE_EMAIL"===r.requestType?r.newEmail:r.email)||null,previousEmail:("VERIFY_AND_CHANGE_EMAIL"===r.requestType?r.email:r.newEmail)||null,multiFactorInfo:o},operation:s}}async function ht(e,t,n){const{auth:r}=e,i={idToken:await e.getIdToken(),returnSecureToken:!0};t&&(i.email=t),n&&(i.password=n);const s=await V(e,ke(r,i));await e._updateTokensIfNecessary(s,!0)}class dt{constructor(e,t,n={}){this.isNewUser=e,this.providerId=t,this.profile=n}}class ft extends dt{constructor(e,t,n,r){super(e,t,n),this.username=r}}class pt extends dt{constructor(e,t){super(e,"facebook.com",t)}}class gt extends ft{constructor(e,t){super(e,"github.com",t,"string"==typeof(null==t?void 0:t.login)?null==t?void 0:t.login:null)}}class mt extends dt{constructor(e,t){super(e,"google.com",t)}}class vt extends ft{constructor(e,t,n){super(e,"twitter.com",t,n)}}
2function yt(e){const{user:t,_tokenResponse:n}=e;return t.isAnonymous&&!n?{providerId:null,isNewUser:!1,profile:null}:function(e){var t,n;if(!e)return null;const{providerId:r}=e,i=e.rawUserInfo?JSON.parse(e.rawUserInfo):{},s=e.isNewUser||"identitytoolkit#SignupNewUserResponse"===e.kind;if(!r&&(null==e?void 0:e.idToken)){const r=null===(n=null===(t=U(e.idToken))||void 0===t?void 0:t.firebase)||void 0===n?void 0:n.sign_in_provider;if(r)return new dt(s,"anonymous"!==r&&"custom"!==r?r:null)}if(!r)return null;switch(r){case"facebook.com":return new pt(s,i);case"github.com":return new gt(s,i);case"google.com":return new mt(s,i);case"twitter.com":return new vt(s,i,e.screenName||null);case"custom":case"anonymous":return new dt(s,null);default:return new dt(s,r,i)}}(n)}class wt{constructor(e,t,n){this.type=e,this.credential=t,this.auth=n}static _fromIdtoken(e,t){return new wt("enroll",e,t)}static _fromMfaPendingCredential(e){return new wt("signin",e)}toJSON(){const e="enroll"===this.type?"idToken":"pendingCredential";return{multiFactorSession:{[e]:this.credential}}}static fromJSON(e){var t,n;if(null==e?void 0:e.multiFactorSession){if(null===(t=e.multiFactorSession)||void 0===t?void 0:t.pendingCredential)return wt._fromMfaPendingCredential(e.multiFactorSession.pendingCredential);if(null===(n=e.multiFactorSession)||void 0===n?void 0:n.idToken)return wt._fromIdtoken(e.multiFactorSession.idToken)}return null}}class bt{constructor(e,t,n){this.session=e,this.hints=t,this.signInResolver=n}static _fromError(e,t){const n=be(e),r=t.customData._serverResponse,i=(r.mfaInfo||[]).map(e=>ot._fromServerResponse(n,e));w(r.mfaPendingCredential,n,"internal-error");const s=wt._fromMfaPendingCredential(r.mfaPendingCredential);return new bt(s,i,async e=>{const i=await e._process(n,s);delete r.mfaInfo,delete r.mfaPendingCredential;const o=Object.assign(Object.assign({},r),{idToken:i.idToken,refreshToken:i.refreshToken});switch(t.operationType){case"signIn":const e=await He._fromIdTokenResponse(n,t.operationType,o);return await n._updateCurrentUser(e.user),e;case"reauthenticate":return w(t.user,n,"internal-error"),He._forOperation(t.user,t.operationType,o);default:p(n,"internal-error")}})}async resolveSignIn(e){const t=e;return this.signInResolver(t)}}class _t{constructor(e){this.user=e,this.enrolledFactors=[],e._onReload(t=>{t.mfaInfo&&(this.enrolledFactors=t.mfaInfo.map(t=>ot._fromServerResponse(e.auth,t)))})}static _fromUser(e){return new _t(e)}async getSession(){return wt._fromIdtoken(await this.user.getIdToken(),this.user.auth)}
2async enroll(e,t){const n=e,r=await this.getSession(),i=await V(this.user,n._process(this.user.auth,r,t));return await this.user._updateTokensIfNecessary(i),this.user.reload()}async unenroll(e){const t="string"==typeof e?e:e.uid,n=await this.user.getIdToken();try{const e=await V(this.user,(r=this.user.auth,i={idToken:n,mfaEnrollmentId:t},D(r,"POST","/v2/accounts/mfaEnrollment:withdraw",O(r,i))));this.enrolledFactors=this.enrolledFactors.filter(({uid:e})=>e!==t),await this.user._updateTokensIfNecessary(e),await this.user.reload()}catch(e){throw e}var r,i}}const It=new WeakMap,Et="__sak";class Tt{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(Et,"1"),this.storage.removeItem(Et),Promise.resolve(!0)):Promise.resolve(!1)}catch(e){return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}class St extends Tt{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=function(){const e=(0,i.ZQ)();return te(e)||ae(e)}()&&function(){try{return!(!window||window===window.top)}catch(e){return!1}}(),this.fallbackToPolling=ce(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const n=this.storage.getItem(t),r=this.localCache[t];n!==r&&e(t,r,n)}}onStorageEvent(e,t=!1){if(!e.key)return void this.forAllChangedKeys((e,t,n)=>{this.notifyListeners(e,n)});const n=e.key;if(t?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const r=this.storage.getItem(n);if(e.newValue!==r)null!==e.newValue?this.storage.setItem(n,e.newValue):this.storage.removeItem(n);else if(this.localCache[n]===e.newValue&&!t)return}const r=()=>{const e=this.storage.getItem(n);(t||this.localCache[n]!==e)&&this.notifyListeners(n,e)},s=this.storage.getItem(n);(0,i.lT)()&&10===document.documentMode&&s!==e.newValue&&e.newValue!==e.oldValue?setTimeout(r,10):r()}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const e of Array.from(n))e(t?JSON.parse(t):t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:n}),!0)})},1e3)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}St.type="LOCAL";const kt=St;class At extends Tt{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}At.type="SESSION";const Ct=At;class xt{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(t=>t.isListeningto(e));if(t)return t;const n=new xt(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:n,eventType:r,data:i}=t.data,s=this.handlersMap[r];if(!(null==s?void 0:s.size))return;t.ports[0].postMessage({status:"ack",eventId:n,eventType:r});const o=Array.from(s).map(async e=>e(t.origin,i)),a=await function(e){return Promise.all(e.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(e){return{fulfilled:!1,reason:e}}}))}(o);t.ports[0].postMessage({status:"done",eventId:n,eventType:r,response:a})}_subscribe(e,t){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),t&&0!==this.handlersMap[e].size||delete this.handlersMap[e],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}function Ot(e="",t=10){let n="";for(let e=0;e<t;e++)n+=Math.floor(10*Math.random());return e+n}
2xt.receivers=[];class Dt{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,n=50){const r="undefined"!=typeof MessageChannel?new MessageChannel:null;if(!r)throw new Error("connection_unavailable");let i,s;return new Promise((o,a)=>{const c=Ot("",20);r.port1.start();const u=setTimeout(()=>{a(new Error("unsupported_event"))},n);s={messageChannel:r,onMessage(e){const t=e;if(t.data.eventId===c)switch(t.data.status){case"ack":clearTimeout(u),i=setTimeout(()=>{a(new Error("timeout"))},3e3);break;case"done":clearTimeout(i),o(t.data.response);break;default:clearTimeout(u),clearTimeout(i),a(new Error("invalid_response"))}}},this.handlers.add(s),r.port1.addEventListener("message",s.onMessage),this.target.postMessage({eventType:e,eventId:c,data:t},[r.port2])}).finally(()=>{s&&this.removeMessageHandler(s)})}}function Nt(){return window}function Rt(){return void 0!==Nt().WorkerGlobalScope&&"function"==typeof Nt().importScripts}const Pt="firebaseLocalStorageDb",Lt="firebaseLocalStorage",Mt="fbase_key";class Ft{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function jt(e,t){return e.transaction([Lt],t?"readwrite":"readonly").objectStore(Lt)}function Ut(){const e=indexedDB.open(Pt,1);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const t=e.result;try{t.createObjectStore(Lt,{keyPath:Mt})}catch(e){n(e)}}),e.addEventListener("success",async()=>{const n=e.result;n.objectStoreNames.contains(Lt)?t(n):(n.close(),await function(){const e=indexedDB.deleteDatabase(Pt);return new Ft(e).toPromise()}(),t(await Ut()))})})}async function Vt(e,t,n){const r=jt(e,!0).put({[Mt]:t,value:n});return new Ft(r).toPromise()}function Bt(e,t){const n=jt(e,!0).delete(t);return new Ft(n).toPromise()}class qt{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db||(this.db=await Ut()),this.db}async _withRetries(e){let t=0;for(;;)try{const t=await this._openDb();return await e(t)}catch(e){if(t++>3)throw e;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Rt()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=xt._getInstance(Rt()?self:null),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await async function(){if(!(null===navigator||void 0===navigator?void 0:navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch(e){return null}}(),!this.activeServiceWorker)return;this.sender=new Dt(this.activeServiceWorker);const n=await this.sender._send("ping",{},800);n&&(null===(e=n[0])||void 0===e?void 0:e.fulfilled)&&(null===(t=n[0])||void 0===t?void 0:t.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){var t;if(this.sender&&this.activeServiceWorker&&((null===(t=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===t?void 0:t.controller)||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch(t){}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await Ut();return await Vt(e,Et,"1"),await Bt(e,Et),!0}catch(e){}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(n=>Vt(n,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(t=>async function(e,t){const n=jt(e,!1).get(t),r=await new Ft(n).toPromise();return void 0===r?null:r.value}(t,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>Bt(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(e=>{const t=jt(e,!1).getAll();
2return new Ft(t).toPromise()});if(!e)return[];if(0!==this.pendingWrites)return[];const t=[],n=new Set;for(const{fbase_key:r,value:i}of e)n.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(i)&&(this.notifyListeners(r,i),t.push(r));for(const e of Object.keys(this.localCache))this.localCache[e]&&!n.has(e)&&(this.notifyListeners(e,null),t.push(e));return t}notifyListeners(e,t){this.localCache[e]=t;const n=this.listeners[e];if(n)for(const e of Array.from(n))e(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),0===this.listeners[e].size&&delete this.listeners[e]),0===Object.keys(this.listeners).length&&this.stopPolling()}}qt.type="LOCAL";const zt=qt,$t=1e12;class Gt{constructor(e){this.auth=e,this.counter=$t,this._widgets=new Map}render(e,t){const n=this.counter;return this._widgets.set(n,new Kt(e,this.auth.name,t||{})),this.counter++,n}reset(e){var t;const n=e||$t;null===(t=this._widgets.get(n))||void 0===t||t.delete(),this._widgets.delete(n)}getResponse(e){var t;const n=e||$t;return(null===(t=this._widgets.get(n))||void 0===t?void 0:t.getResponse())||""}async execute(e){var t;const n=e||$t;return null===(t=this._widgets.get(n))||void 0===t||t.execute(),""}}class Kt{constructor(e,t,n){this.params=n,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};const r="string"==typeof e?document.getElementById(e):e;w(r,"argument-error",{appName:t}),this.container=r,this.isVisible="invisible"!==this.params.size,this.isVisible?this.execute():this.container.addEventListener("click",this.clickHandler)}getResponse(){return this.checkIfDeleted(),this.responseToken}delete(){this.checkIfDeleted(),this.deleted=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.container.removeEventListener("click",this.clickHandler)}execute(){this.checkIfDeleted(),this.timerId||(this.timerId=window.setTimeout(()=>{this.responseToken=function(){const e=[],t="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let n=0;n<50;n++)e.push(t.charAt(Math.floor(62*Math.random())));return e.join("")}();const{callback:e,"expired-callback":t}=this.params;if(e)try{e(this.responseToken)}catch(e){}this.timerId=window.setTimeout(()=>{if(this.timerId=null,this.responseToken=null,t)try{t()}catch(e){}this.isVisible&&this.execute()},6e4)},500))}checkIfDeleted(){if(this.deleted)throw new Error("reCAPTCHA mock was already deleted!")}}const Wt=ge("rcb"),Ht=new S(3e4,6e4);class Qt{constructor(){var e;this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!!(null===(e=Nt().grecaptcha)||void 0===e?void 0:e.render)}load(e,t=""){return w(function(e){return e.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(e)}(t),e,"argument-error"),this.shouldResolveImmediately(t)&&he(Nt().grecaptcha)?Promise.resolve(Nt().grecaptcha):new Promise((n,r)=>{const s=Nt().setTimeout(()=>{r(g(e,"network-request-failed"))},Ht.get());Nt()[Wt]=()=>{Nt().clearTimeout(s),delete Nt()[Wt];const i=Nt().grecaptcha;if(!i||!he(i))return void r(g(e,"internal-error"));const o=i.render;i.render=(e,t)=>{const n=o(e,t);return this.counter++,n},this.hostLanguage=t,n(i)},pe(`https://www.google.com/recaptcha/api.js??${(0,i.Am)({onload:Wt,render:"explicit",hl:t})}`).catch(()=>{clearTimeout(s),r(g(e,"internal-error"))})})}clearedOneInstance(){this.counter--}shouldResolveImmediately(e){var t;return!!(null===(t=Nt().grecaptcha)||void 0===t?void 0:t.render)&&(e===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}}class Yt{async load(e){return new Gt(e)}clearedOneInstance(){}}const Xt="recaptcha",Jt={theme:"light",type:"image"};class Zt{constructor(e,t=Object.assign({},Jt),n){this.parameters=t,this.type=Xt,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=be(n),this.isInvisible="invisible"===this.parameters.size,w("undefined"!=typeof document,this.auth,"operation-not-supported-in-this-environment");const r="string"==typeof e?document.getElementById(e):e;w(r,this.auth,"argument-error"),this.container=r,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new Yt:new Qt,this.validateStartingState()}async verify(){this.assertNotDestroyed();const e=await this.render(),t=this.getAssertedRecaptcha();return t.getResponse(e)||new Promise(n=>{const r=e=>{e&&(this.tokenChangeListeners.delete(r),n(e))};this.tokenChangeListeners.add(r),this.isInvisible&&t.execute(e)})}render(){try{this.assertNotDestroyed()}catch(e){return Promise.reject(e)}return this.renderPromise||(this.renderPromise=this.makeRenderPromise().catch(e=>{throw this.renderPromise=null,e})),this.renderPromise}_reset(){this.assertNotDestroyed(),null!==this.widgetId&&this.getAssertedRecaptcha().reset(this.widgetId)}clear(){this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEac
vendor: 5,486 bytes, line 2
2h(e=>{this.container.removeChild(e)})}validateStartingState(){w(!this.parameters.sitekey,this.auth,"argument-error"),w(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),w("undefined"!=typeof document,this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(e){return t=>{if(this.tokenChangeListeners.forEach(e=>e(t)),"function"==typeof e)e(t);else if("string"==typeof e){const n=Nt()[e];"function"==typeof n&&n(t)}}}assertNotDestroyed(){w(!this.destroyed,this.auth,"internal-error")}async makeRenderPromise(){if(await this.init(),!this.widgetId){let e=this.container;if(!this.isInvisible){const t=document.createElement("div");e.appendChild(t),e=t}this.widgetId=this.getAssertedRecaptcha().render(e,this.parameters)}return this.widgetId}async init(){w(E()&&!Rt(),this.auth,"internal-error"),await function(){let e=null;return new Promise(t=>{"complete"!==document.readyState?(e=()=>t(),window.addEventListener("load",e)):t()}).catch(t=>{throw e&&window.removeEventListener("load",e),t})}(),this.recaptcha=await this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);const e=await async function(e){return(await D(e,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""}(this.auth);w(e,this.auth,"internal-error"),this.parameters.sitekey=e}getAssertedRecaptcha(){return w(this.recaptcha,this.auth,"internal-error"),this.recaptcha}}class en{constructor(e,t){this.verificationId=e,this.onConfirmation=t}confirm(e){const t=Le._fromVerification(this.verificationId,e);return this.onConfirmation(t)}}async function tn(e,t,n){var r;const i=await n.verify();try{let s;if(w("string"==typeof i,e,"argument-error"),w(n.type===Xt,e,"argument-error"),s="string"==typeof t?{phoneNumber:t}:t,"session"in s){const t=s.session;if("phoneNumber"in s){w("enroll"===t.type,e,"internal-error");const n=await function(e,t){return D(e,"POST","/v2/accounts/mfaEnrollment:start",O(e,t))}(e,{idToken:t.credential,phoneEnrollmentInfo:{phoneNumber:s.phoneNumber,recaptchaToken:i}});return n.phoneSessionInfo.sessionInfo}{w("signin"===t.type,e,"internal-error");const n=(null===(r=s.multiFactorHint)||void 0===r?void 0:r.uid)||s.multiFactorUid;w(n,e,"missing-multi-factor-info");const o=await function(e,t){return D(e,"POST","/v2/accounts/mfaSignIn:start",O(e,t))}(e,{mfaPendingCredential:t.credential,mfaEnrollmentId:n,phoneSignInInfo:{recaptchaToken:i}});return o.phoneResponseInfo.sessionInfo}}{const{sessionInfo:t}=await async function(e,t){return D(e,"POST","/v1/accounts:sendVerificationCode",O(e,t))}(e,{phoneNumber:s.phoneNumber,recaptchaToken:i});return t}}finally{n._reset()}}class nn{constructor(e){this.providerId=nn.PROVIDER_ID,this.auth=be(e)}verifyPhoneNumber(e,t){return tn(this.auth,e,(0,i.Ku)(t))}static credential(e,t){return Le._fromVerification(e,t)}static credentialFromResult(e){const t=e;return nn.credentialFromTaggedObject(t)}static credentialFromError(e){return nn.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{phoneNumber:t,temporaryProof:n}=e;return t&&n?Le._fromTokenResponse(t,n):null}}function rn(e,t){return t?H(t):(w(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}nn.PROVIDER_ID="phone",nn.PHONE_SIGN_IN_METHOD="phone";class sn extends Te{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Ne(e,this._buildIdpRequest())}_linkToIdToken(e,t){return Ne(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return Ne(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function on(e){return nt(e.auth,new sn(e),e.bypassAuthState)}function an(e){const{auth:t,user:n}=e;return w(n,t,"internal-error"),tt(n,new sn(e),e.bypassAuthState)}async function cn(e){const{auth:t,user:n}=e;return w(n,t,"internal-error"),Ze(n,new sn(e),e.bypassAuthState)}class un{constructor(e,t,n,r,i=!1){this.auth=e,this.resolver=n,this.user=r,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(e){this.reject(e)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:n,postBody:r,tenantId:i,error:s,type:o}=e;if(s)return void this.reject(s);const a={auth:this.auth,requestUri:t,sessionId:n,tenantId:i||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(o)(a))}catch(e){this.reject(e)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return on;case"linkViaPopup":case"linkViaRedirect":return cn;case"reauthViaPopup":case"reauthViaRedirect":return an;default:p(this.auth,"internal-error")}}resolve(e){_(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){_(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const ln=new S(2e3,1e4);
vendor: 4,281 bytes, line 2
2class hn extends un{constructor(e,t,n,r,i){super(e,t,r,i),this.provider=n,this.authWindow=null,this.pollId=null,hn.currentPopupAction&&hn.currentPopupAction.cancel(),hn.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return w(e,this.auth,"internal-error"),e}async onExecution(){_(1===this.filter.length,"Popup operations only handle one event");const e=Ot();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(e=>{this.reject(e)}),this.resolver._isIframeWebStorageSupported(this.auth,e=>{e||this.reject(g(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return(null===(e=this.authWindow)||void 0===e?void 0:e.associatedEvent)||null}cancel(){this.reject(g(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,hn.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,n;(null===(n=null===(t=this.authWindow)||void 0===t?void 0:t.window)||void 0===n?void 0:n.closed)?this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(g(this.auth,"popup-closed-by-user"))},8e3):this.pollId=window.setTimeout(e,ln.get())};e()}}hn.currentPopupAction=null;const dn=new Map;class fn extends un{constructor(e,t,n=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,n),this.eventId=null}async execute(){let e=dn.get(this.auth._key());if(!e){try{const t=await async function(e,t){const n=vn(t),r=mn(e);if(!await r._isAvailable())return!1;const i="true"===await r._get(n);return await r._remove(n),i}(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(t)}catch(t){e=()=>Promise.reject(t)}dn.set(this.auth._key(),e)}return this.bypassAuthState||dn.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if("signInViaRedirect"===e.type)return super.onAuthEvent(e);if("unknown"!==e.type){if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}async function pn(e,t){return mn(e)._set(vn(t),"true")}function gn(e,t){dn.set(e._key(),t)}function mn(e){return H(e._redirectPersistence)}function vn(e){return X("pendingRedirect",e.config.apiKey,e.name)}async function yn(e,t,n=!1){const r=be(e),i=rn(r,t),s=new fn(r,i,n),o=await s.execute();return o&&!n&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,t)),o}async function wn(e){const t=Ot(`${e.uid}:::`);return e._redirectEventId=t,await e.auth._setRedirectUser(e),await e.auth._persistUserIfCurrent(e),t}class bn{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(n=>{this.isEventForConsumer(e,n)&&(t=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!function(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return In(e);default:return!1}}(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var n;if(e.error&&!In(e)){const r=(null===(n=e.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";t.onError(g(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const n=null===t.eventId||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(_n(e))}saveEventToCache(e){this.cachedEventUids.add(_n(e)),this.lastProcessedEventTime=
vendor: 4,401 bytes, line 2
2Date.now()}}function _n(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(e=>e).join("-")}function In({type:e,error:t}){return"unknown"===e&&"auth/no-auth-event"===(null==t?void 0:t.code)}async function En(e,t={}){return D(e,"GET","/v1/projects",t)}const Tn=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Sn=/^https?/;function kn(e){const t=I(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const i=new URL(e);return""===i.hostname&&""===r?"chrome-extension:"===n&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):"chrome-extension:"===n&&i.hostname===r}if(!Sn.test(n))return!1;if(Tn.test(e))return r===e;const i=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}const An=new S(3e4,6e4);function Cn(){const e=Nt().___jsl;if(null==e?void 0:e.H)for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let t=0;t<e.CP.length;t++)e.CP[t]=null}let xn=null;function On(e){return xn=xn||function(e){return new Promise((t,n)=>{var r,i,s;function o(){Cn(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{Cn(),n(g(e,"network-request-failed"))},timeout:An.get()})}if(null===(i=null===(r=Nt().gapi)||void 0===r?void 0:r.iframes)||void 0===i?void 0:i.Iframe)t(gapi.iframes.getContext());else{if(!(null===(s=Nt().gapi)||void 0===s?void 0:s.load)){const t=ge("iframefcb");return Nt()[t]=()=>{gapi.load?o():n(g(e,"network-request-failed"))},pe(`https://apis.google.com/js/api.js?onload=${t}`).catch(e=>n(e))}o()}}).catch(e=>{throw xn=null,e})}(e),xn}const Dn=new S(5e3,15e3),Nn={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Rn=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Pn(e){const t=e.config;w(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?k(t,"emulator/auth/iframe"):`https://${e.config.authDomain}/__/auth/iframe`,r={apiKey:t.apiKey,appName:e.name,v:s.SDK_VERSION},o=Rn.get(e.config.apiHost);o&&(r.eid=o);const a=e._getFrameworks();return a.length&&(r.fw=a.join(",")),`${n}?${(0,i.Am)(r).slice(1)}`}const Ln={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class Mn{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(e){}}}const Fn=encodeURIComponent("fac");async function jn(e,t,n,r,o,a){w(e.config.authDomain,e,"auth-domain-config-required"),w(e.config.apiKey,e,"invalid-api-key");const c={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:s.SDK_VERSION,eventId:o};if(t instanceof je){t.setDefaultLanguage(e.languageCode),c.providerId=t.providerId||"",(0,i.Im)(t.getCustomParameters())||(c.customParameters=JSON.stringify(t.getCustomParameters()));for(const[e,t]of Object.entries(a||{}))c[e]=t}if(t instanceof Ue){const e=t.getScopes().filter(e=>""!==e);e.length>0&&(c.scopes=e.join(","))}e.tenantId&&(c.tid=e.tenantId);const u=c;for(const e of Object.keys(u))void 0===u[e]&&delete u[e];const l=await e._getAppCheckToken(),h=l?`#${Fn}=${encodeURIComponent(l)}`:"";return`${function({config:e}){return e.emulator?k(e,"emulator/auth/handler"):`https://${e.authDomain}/__/auth/handler`}(e)}?${(0,i.Am)(u).slice(1)}${h}`}const Un="webStorageSupport",Vn=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Ct,this._completeRedirectFn=yn,this._overrideRedirectResult=gn}async _openPopup(e,t,n,r){var s;return _(null===(s=this.eventManagers[e._key()])||void 0===s?void 0:s.manager,"_initialize() not called before _openPopup()"),function(e,t,n,r=500,s=600){const o=Math.max((window.screen.availHeight-s)/2,0).toString(),a=Math.max((window.screen.availWidth-r)/2,0).toString();let c="";const u=Object.assign(Object.assign({},Ln),{width:r.toString(),height:s.toString(),top:o,left:a}),l=(0,i.ZQ)().toLowerCase();n&&(c=ne(l)?"_blank":n),ee(l)&&(t=t||"http://localhost",u.scrollbars="yes");const h=Object.entries(u).reduce((e,[t,n])=>`${e}${t}=${n},`,"");if(function(e=(0,i.ZQ)()){var t;return ae(e)&&!!(null===(t=window.navigator)||void 0===t?void 0:t.standalone)}(l)&&"_self"!==c)return function(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");
2r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}(t||"",c),new Mn(null);const d=window.open(t||"",c,h);w(d,e,"popup-blocked");try{d.focus()}catch(e){}return new Mn(d)}(e,await jn(e,t,n,I(),r),Ot())}async _openRedirect(e,t,n,r){return await this._originValidation(e),i=await jn(e,t,n,I(),r),Nt().location.href=i,new Promise(()=>{});var i}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:e,promise:n}=this.eventManagers[t];return e?Promise.resolve(e):(_(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(e);return this.eventManagers[t]={promise:n},n.catch(()=>{delete this.eventManagers[t]}),n}async initAndGetManager(e){const t=await async function(e){const t=await On(e),n=Nt().gapi;return w(n,e,"internal-error"),t.open({where:document.body,url:Pn(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Nn,dontclear:!0},t=>new Promise(async(n,r)=>{await t.restyle({setHideOnLeave:!1});const i=g(e,"network-request-failed"),s=Nt().setTimeout(()=>{r(i)},Dn.get());function o(){Nt().clearTimeout(s),n(t)}t.ping(o).then(o,()=>{r(i)})}))}(e),n=new bn(e);return t.register("authEvent",t=>(w(null==t?void 0:t.authEvent,e,"invalid-auth-event"),{status:n.onEvent(t.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=t,n}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(Un,{type:Un},n=>{var r;const i=null===(r=null==n?void 0:n[0])||void 0===r?void 0:r[Un];void 0!==i&&t(!!i),p(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=async function(e){if(e.config.emulator)return;const{authorizedDomains:t}=await En(e);for(const e of t)try{if(kn(e))return}catch(e){}p(e,"unauthorized-domain")}(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return ce()||te()||ae()}};class Bn{constructor(e){this.factorId=e}_process(e,t,n){switch(t.type){case"enroll":return this._finalizeEnroll(e,t.credential,n);case"signin":return this._finalizeSignIn(e,t.credential);default:return b("unexpected MultiFactorSessionType")}}}class qn extends Bn{constructor(e){super("phone"),this.credential=e}static _fromCredential(e){return new qn(e)}_finalizeEnroll(e,t,n){return function(e,t){return D(e,"POST","/v2/accounts/mfaEnrollment:finalize",O(e,t))}(e,{idToken:t,displayName:n,phoneVerificationInfo:this.credential._makeVerificationRequest()})}_finalizeSignIn(e,t){return function(e,t){return D(e,"POST","/v2/accounts/mfaSignIn:finalize",O(e,t))}(e,{mfaPendingCredential:t,phoneVerificationInfo:this.credential._makeVerificationRequest()})}}class zn{constructor(){}static assertion(e){return qn._fromCredential(e)}}zn.FACTOR_ID="phone";var $n,Gn="@firebase/auth",Kn="0.23.2";class Wn{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),(null===(e=this.auth.currentUser)||void 0===e?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(t=>{e((null==t?void 0:t.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){w(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}function Hn(){return window}(0,i.XA)("authIdTokenMaxAge"),$n="Browser",(0,s._registerComponent)(new c.uA("auth",(e,{options:t})=>{const n=e.getProvider("app").getImmediate(),r=e.getProvider("heartbeat"),i=e.getProvider("app-check-internal"),{apiKey:s,authDomain:o}=n.options;w(s&&!s.includes(":"),"invalid-api-key",{appName:n.name});const a={apiKey:s,authDomain:o,clientPlatform:$n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:ue($n)},c=new we(n,r,i,a);return function(e,t){const n=(null==t?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(H);(null==t?void 0:t.errorMap)&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,null==t?void 0:t.popupRedirectResolver)}(c,t),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,n)=>{e.getProvider("auth-internal").initialize()})),(0,s._registerComponent)(new c.uA("auth-internal",e=>{return t=be(e.getProvider("auth").getImmediate()),new Wn(t);var t},"PRIVATE").setInstantiationMode("EXPLICIT")),(0,s.registerVersion)(Gn,Kn,function(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}($n)),(0,s.registerVersion)(Gn,Kn,"esm2017");class Qn extends bn{constructor(){super(...arguments),this.passiveListeners=new Set,this.initPromise=new Promise(e=>{this.resolveInialized=e})}addPassiveListener(e){this.passiveListeners.add(e)}removePassiveListener(e){this.passiveListeners.delete(e)}resetRedirect(){this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1}onEvent(e){return this.resolveInialized(),this.passiveListeners.forEac
2h(t=>t(e)),super.onEvent(e)}async initialized(){await this.initPromise}}async function Yn(e){const t=await Jn()._get(Zn(e));return t&&await Jn()._remove(Zn(e)),t}function Xn(){const e=[];for(let t=0;t<20;t++){const t=Math.floor(62*Math.random());e.push("1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(t))}return e.join("")}function Jn(){return H(kt)}function Zn(e){return X("authEvent",e.config.apiKey,e.name)}function er(e){if(!(null==e?void 0:e.includes("?")))return{};const[t,...n]=e.split("?");return(0,i.I9)(n.join("?"))}const tr=class{constructor(){this._redirectPersistence=Ct,this._shouldInitProactively=!0,this.eventManagers=new Map,this.originValidationPromises={},this._completeRedirectFn=yn,this._overrideRedirectResult=gn}async _initialize(e){const t=e._key();let n=this.eventManagers.get(t);return n||(n=new Qn(e),this.eventManagers.set(t,n),this.attachCallbackListeners(e,n)),n}_openPopup(e){p(e,"operation-not-supported-in-this-environment")}async _openRedirect(e,t,n,r){!function(e){var t,n,r,i,s,o,a,c,u,l;const h=Hn();w("function"==typeof(null===(t=null==h?void 0:h.universalLinks)||void 0===t?void 0:t.subscribe),e,"invalid-cordova-configuration",{missingPlugin:"cordova-universal-links-plugin-fix"}),w(void 0!==(null===(n=null==h?void 0:h.BuildInfo)||void 0===n?void 0:n.packageName),e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-buildInfo"}),w("function"==typeof(null===(s=null===(i=null===(r=null==h?void 0:h.cordova)||void 0===r?void 0:r.plugins)||void 0===i?void 0:i.browsertab)||void 0===s?void 0:s.openUrl),e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),w("function"==typeof(null===(c=null===(a=null===(o=null==h?void 0:h.cordova)||void 0===o?void 0:o.plugins)||void 0===a?void 0:a.browsertab)||void 0===c?void 0:c.isAvailable),e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),w("function"==typeof(null===(l=null===(u=null==h?void 0:h.cordova)||void 0===u?void 0:u.InAppBrowser)||void 0===l?void 0:l.open),e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-inappbrowser"})}(e);const s=await this._initialize(e);await s.initialized(),s.resetRedirect(),dn.clear(),await this._originValidation(e);const o=function(e,t,n=null){return{type:t,eventId:n,urlResponse:null,sessionId:Xn(),postBody:null,tenantId:e.tenantId,error:g(e,"no-auth-event")}}(e,n,r);await function(e,t){return Jn()._set(Zn(e),t)}(e,o);const a=await async function(e,t,n){var r;const{BuildInfo:i}=Hn();_(t.sessionId,"AuthEvent did not contain a session ID");const s=await async function(e){const t=function(e){if(_(/[0-9a-zA-Z]+/.test(e),"Can only convert alpha-numeric strings"),"undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);const t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let t=0;t<e.length;t++)n[t]=e.charCodeAt(t);return n}(e),n=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,"0")).join("")}(t.sessionId),o={};return ae()?o.ibi=i.packageName:ie()?o.apn=i.packageName:p(e,"operation-not-supported-in-this-environment"),i.displayName&&(o.appDisplayName=i.displayName),o.sessionId=s,jn(e,n,t.type,void 0,null!==(r=t.eventId)&&void 0!==r?r:void 0,o)}(e,o,t);return async function(e,t,n){const{cordova:r}=Hn();let i=()=>{};try{await new Promise((s,o)=>{let a=null;function c(){var e;s();const t=null===(e=r.plugins.browsertab)||void 0===e?void 0:e.close;"function"==typeof t&&t(),"function"==typeof(null==n?void 0:n.close)&&n.close()}function u(){a||(a=window.setTimeout(()=>{o(g(e,"redirect-cancelled-by-user"))},2e3))}function l(){"visible"===(null===document||void 0===document?void 0:document.visibilityState)&&u()}t.addPassiveListener(c),document.addEventListener("resume",u,!1),ie()&&document.addEventListener("visibilitychange",l,!1),i=()=>{t.removePassiveListener(c),document.removeEventListener("resume",u,!1),document.removeEventListener("visibilitychange",l,!1),a&&window.clearTimeout(a)}})}finally{i()}}(e,s,await function(e){const{cordova:t}=Hn();return new Promise(n=>{t.plugins.browsertab.isAvailable(r=>{let s=null;r?t.plugins.browsertab.openUrl(e):s=t.InAppBrowser.open(e,function(e=(0,i.ZQ)()){return/(iPad|iPhone|iPod).*OS 7_\d/i.test(e)||/(iPad|iPhone|iPod).*OS 8_\d/i.test(e)}()?"_blank":"_system","location=yes"),n(s)})})}
2(a))}_isIframeWebStorageSupported(e,t){throw new Error("Method not implemented.")}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=async function(e){const{BuildInfo:t}=Hn(),n={};ae()?n.iosBundleId=t.packageName:ie()?n.androidPackageName=t.packageName:p(e,"operation-not-supported-in-this-environment"),await En(e,n)}(e)),this.originValidationPromises[t]}attachCallbackListeners(e,t){const{universalLinks:n,handleOpenURL:r,BuildInfo:i}=Hn(),s=setTimeout(async()=>{await Yn(e),t.onEvent(nr())},500),o=async n=>{clearTimeout(s);const r=await Yn(e);let i=null;r&&(null==n?void 0:n.url)&&(i=function(e,t){var n,r;const i=function(e){const t=er(e),n=t.link?decodeURIComponent(t.link):void 0,r=er(n).link,i=t.deep_link_id?decodeURIComponent(t.deep_link_id):void 0;return er(i).link||i||r||n||e}(t);if(i.includes("/__/auth/callback")){const t=er(i),s=t.firebaseError?function(e){try{return JSON.parse(e)}catch(e){return null}}(decodeURIComponent(t.firebaseError)):null,o=null===(r=null===(n=null==s?void 0:s.code)||void 0===n?void 0:n.split("auth/"))||void 0===r?void 0:r[1],a=o?g(o):null;return a?{type:e.type,eventId:e.eventId,tenantId:e.tenantId,error:a,urlResponse:null,sessionId:null,postBody:null}:{type:e.type,eventId:e.eventId,tenantId:e.tenantId,sessionId:e.sessionId,urlResponse:i,postBody:null}}return null}(r,n.url)),t.onEvent(i||nr())};void 0!==n&&"function"==typeof n.subscribe&&n.subscribe(null,o);const a=r,c=`${i.packageName.toLowerCase()}://`;Hn().handleOpenURL=async e=>{if(e.toLowerCase().startsWith(c)&&o({url:e}),"function"==typeof a)try{a(e)}catch(e){console.error(e)}}}};function nr(){return{type:"unknown",eventId:null,sessionId:null,urlResponse:null,postBody:null,tenantId:null,error:g("no-auth-event")}}function rr(){var e;return(null===(e=null===self||void 0===self?void 0:self.location)||void 0===e?void 0:e.protocol)||null}function ir(e=(0,i.ZQ)()){return!("file:"!==rr()&&"ionic:"!==rr()&&"capacitor:"!==rr()||!e.toLowerCase().match(/iphone|ipad|ipod|android/))}function sr(){try{const e=self.localStorage,t=Ot();if(e)return e.setItem(t,"1"),e.removeItem(t),!function(e=(0,i.ZQ)()){return(0,i.lT)()&&11===(null===document||void 0===document?void 0:document.documentMode)||function(e=(0,i.ZQ)()){return/Edge\/\d+/.test(e)}(e)}()||(0,i.zW)()}catch(e){return or()&&(0,i.zW)()}return!1}function or(){return void 0!==n.g&&"WorkerGlobalScope"in n.g&&"importScripts"in n.g}function ar(){return("http:"===rr()||"https:"===rr()||(0,i.sr)()||ir())&&!((0,i.lV)()||(0,i.Ll)())&&sr()&&!or()}function cr(){return ir()&&"undefined"!=typeof document}const ur={LOCAL:"local",NONE:"none",SESSION:"session"},lr=w,hr="persistence";async function dr(e){await e._initializationPromise;const t=fr(),n=X(hr,e.config.apiKey,e.name);t&&t.setItem(n,e._getPersistence())}function fr(){var e;try{return(null===(e="undefined"!=typeof window?window:null)||void 0===e?void 0:e.sessionStorage)||null}catch(e){return null}}const pr=w;class gr{constructor(){this.browserResolver=H(Vn),this.cordovaResolver=H(tr),this.underlyingResolver=null,this._redirectPersistence=Ct,this._completeRedirectFn=yn,this._overrideRedirectResult=gn}async _initialize(e){return await this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._initialize(e)}async _openPopup(e,t,n,r){return await this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._openPopup(e,t,n,r)}async _openRedirect(e,t,n,r){return await this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._openRedirect(e,t,n,r)}_isIframeWebStorageSupported(e,t){this.assertedUnderlyingResolver._isIframeWebStorageSupported(e,t)}_originValidation(e){return this.assertedUnderlyingResolver._originValidation(e)}get _shouldInitProactively(){return cr()||this.browserResolver._shouldInitProactively}get assertedUnderlyingResolver(){return pr(this.underlyingResolver,"internal-error"),this.underlyingResolver}async selectUnderlyingResolver(){if(this.underlyingResolver)return;const e=await async function(){return!!cr()&&new Promise(e=>{const t=setTimeout(()=>{e(!1)},1e3);document.addEventListener("deviceready",()=>{clearTimeout(t),e(!0)})})}();this.underlyingResolver=e?this.cordovaResolver:this.browserResolver}}function mr(e){return e.unwrap()}function vr(e){const{_tokenResponse:t}=e instanceof i.g?e.customData:e;if(!t)return null;if(!(e instanceof i.g)&&"temporaryProof"in t&&"phoneNumber"in t)return nn.credentialFromResult(e);const n=t.providerId;if(!n||"password"===n)return null;let r;switch(n){case"google.com":r=qe;break;case"facebook.com":r=Be;break;case"github.com":r=ze;break;case"twitter.com":r=Ke;break;default:const{oauthIdToken:e,oauthAccessToken:i,oauthTokenSecret:s,pendingToken:o,nonce:a}=t;return i||s||e||o?o?n.startsWith("saml.")?$e._create(n,o):Re._fromParams({providerId:n,signInMethod:n,pendingToken:o,idToken:e,accessToken:i}):new Ve(n).credential({idToken:e,accessToken:i,rawNonce:a}):null}return e instanceof i.g?r.credentialFromError(e):r.credentialFromResult(e)}function yr(e,t){return t.catch(t=>{throw t instanceof i.g&&function(e,t){var n;const r=null===(n=t.customData)||void 0===n?void 0:n._tokenResponse;if("auth/multi-factor-auth-required"===(null==t?void 0:t.code))t.resolver=new br(e,function(e,t){var n;const r=(0,i.Ku)(e),s=t;return w(t.customData.operationType,r,"argument-error"),w(null===(n=s.customData._serverResponse)||void 0===n?void 0:n.mfaPendingCredential,r,"argument-error"),bt._fromError(r,s)}(e,t));else if(r){const e=vr(t),n=t;e&&(n.credential=e,n.tenantId=r.tenantId||void 0,n.email=r.email||void 0,n.phoneNumber=r.phoneNumber||void 0)}}(e,t),t}).then(e=>{const t=e.operationType,n=e.user;return{operationType:t,credential:(r=e,vr(r)),additionalUserInfo:yt(e),user:_r.getOrCreate(n)};var r})}async function wr(e,t){const n=await t;return{verificationId:n.verificationId,confirm:t=>yr(e,n.confirm(t))}}
2class br{constructor(e,t){this.resolver=t,this.auth=e.wrapped()}get session(){return this.resolver.session}get hints(){return this.resolver.hints}resolveSignIn(e){return yr(mr(this.auth),this.resolver.resolveSignIn(e))}}class _r{constructor(e){this._delegate=e,this.multiFactor=function(e){const t=(0,i.Ku)(e);return It.has(t)||It.set(t,_t._fromUser(t)),It.get(t)}(e)}static getOrCreate(e){return _r.USER_MAP.has(e)||_r.USER_MAP.set(e,new _r(e)),_r.USER_MAP.get(e)}delete(){return this._delegate.delete()}reload(){return this._delegate.reload()}toJSON(){return this._delegate.toJSON()}getIdTokenResult(e){return this._delegate.getIdTokenResult(e)}getIdToken(e){return this._delegate.getIdToken(e)}linkAndRetrieveDataWithCredential(e){return this.linkWithCredential(e)}async linkWithCredential(e){return yr(this.auth,it(this._delegate,e))}async linkWithPhoneNumber(e,t){return wr(this.auth,async function(e,t,n){const r=(0,i.Ku)(e);await et(!1,r,"phone");const s=await tn(r.auth,t,(0,i.Ku)(n));return new en(s,e=>it(r,e))}(this._delegate,e,t))}async linkWithPopup(e){return yr(this.auth,async function(e,t,n){const r=(0,i.Ku)(e);v(r.auth,t,je);const s=rn(r.auth,n);return new hn(r.auth,"linkViaPopup",t,s,r).executeNotNull()}(this._delegate,e,gr))}async linkWithRedirect(e){return await dr(be(this.auth)),function(e,t,n){return async function(e,t,n){const r=(0,i.Ku)(e);v(r.auth,t,je),await r.auth._initializationPromise;const s=rn(r.auth,n);await et(!1,r,t.providerId),await pn(s,r.auth);const o=await wn(r);return s._openRedirect(r.auth,t,"linkViaRedirect",o)}(e,t,n)}(this._delegate,e,gr)}reauthenticateAndRetrieveDataWithCredential(e){return this.reauthenticateWithCredential(e)}async reauthenticateWithCredential(e){return yr(this.auth,st(this._delegate,e))}reauthenticateWithPhoneNumber(e,t){return wr(this.auth,async function(e,t,n){const r=(0,i.Ku)(e),s=await tn(r.auth,t,(0,i.Ku)(n));return new en(s,e=>st(r,e))}(this._delegate,e,t))}reauthenticateWithPopup(e){return yr(this.auth,async function(e,t,n){const r=(0,i.Ku)(e);v(r.auth,t,je);const s=rn(r.auth,n);return new hn(r.auth,"reauthViaPopup",t,s,r).executeNotNull()}(this._delegate,e,gr))}async reauthenticateWithRedirect(e){return await dr(be(this.auth)),function(e,t,n){return async function(e,t,n){const r=(0,i.Ku)(e);v(r.auth,t,je),await r.auth._initializationPromise;const s=rn(r.auth,n);await pn(s,r.auth);const o=await wn(r);return s._openRedirect(r.auth,t,"reauthViaRedirect",o)}(e,t,n)}(this._delegate,e,gr)}sendEmailVerification(e){return async function(e,t){const n=(0,i.Ku)(e),r={requestType:"VERIFY_EMAIL",idToken:await e.getIdToken()};t&&ut(n.auth,r,t);const{email:s}=await async function(e,t){return Ce(e,t)}(n.auth,r);s!==e.email&&await e.reload()}(this._delegate,e)}async unlink(e){return await async function(e,t){const n=(0,i.Ku)(e);await et(!0,n,t);const{providerUserInfo:r}=await async function(e,t){return D(e,"POST","/v1/accounts:update",t)}(n.auth,{idToken:await n.getIdToken(),deleteProvider:[t]}),s=Je(r||[]);return n.providerData=n.providerData.filter(e=>s.has(e.providerId)),s.has("phone")||(n.phoneNumber=null),await n.auth._persistUserIfCurrent(n),n}(this._delegate,e),this}updateEmail(e){return function(e,t){return ht((0,i.Ku)(e),t,null)}(this._delegate,e)}updatePassword(e){return function(e,t){return ht((0,i.Ku)(e),null,t)}(this._delegate,e)}updatePhoneNumber(e){return async function(e,t){await Ze((0,i.Ku)(e),t)}(this._delegate,e)}updateProfile(e){return async function(e,{displayName:t,photoURL:n}){if(void 0===t&&void 0===n)return;const r=(0,i.Ku)(e),s={idToken:await r.getIdToken(),displayName:t,photoUrl:n,returnSecureToken:!0},o=await V(r,async function(e,t){return D(e,"POST","/v1/accounts:update",t)}(r.auth,s));r.displayName=o.displayName||null,r.photoURL=o.photoUrl||null;const a=r.providerData.find(({providerId:e})=>"password"===e);a&&(a.displayName=r.displayName,a.photoURL=r.photoURL),await r._updateTokensIfNecessary(o)}(this._delegate,e)}verifyBeforeUpdateEmail(e,t){return async function(e,t,n){const r=(0,i.Ku)(e),s={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:await e.getIdToken(),newEmail:t};n&&ut(r.auth,s,n);const{email:o}=await async function(e,t){return Ce(e,t)}(r.auth,s);o!==e.email&&await e.reload()}(this._delegate,e,t)}get emailVerified(){return this._delegate.emailVerified}get isAnonymous(){return this._delegate.isAnonymous}get metadata(){return this._delegate.metadata}get phoneNumber(){return this._delegate.phoneNumber}get providerData(){return this._delegate.providerData}get refreshToken(){return this._delegate.refreshToken}get tenantId(){return this._delegate.tenantId}get displayName(){return this._delegate.displayName}get email(){return this._delegate.email}get photoURL(){return this._delegate.photoURL}get providerId(){return this._delegate.providerId}get uid(){return this._delegate.uid}get auth(){return this._delegate.auth}}_r.USER_MAP=new WeakMap;const Ir=w;class Er{constructor(e,t){if(this.app=e,t.isInitialized())return this._delegate=t.getImmediate(),void this.linkUnderlyingAuth();const{apiKey:n}=e.options;
2Ir(n,"invalid-api-key",{appName:e.name}),Ir(n,"invalid-api-key",{appName:e.name});const r="undefined"!=typeof window?gr:void 0;this._delegate=t.initialize({options:{persistence:Sr(n,e.name),popupRedirectResolver:r}}),this._delegate._updateErrorMap(u),this.linkUnderlyingAuth()}get emulatorConfig(){return this._delegate.emulatorConfig}get currentUser(){return this._delegate.currentUser?_r.getOrCreate(this._delegate.currentUser):null}get languageCode(){return this._delegate.languageCode}set languageCode(e){this._delegate.languageCode=e}get settings(){return this._delegate.settings}get tenantId(){return this._delegate.tenantId}set tenantId(e){this._delegate.tenantId=e}useDeviceLanguage(){this._delegate.useDeviceLanguage()}signOut(){return this._delegate.signOut()}useEmulator(e,t){!function(e,t,n){const r=be(e);w(r._canInitEmulator,r,"emulator-config-failed"),w(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const i=!!(null==n?void 0:n.disableWarnings),s=Ie(t),{host:o,port:a}=function(e){const t=Ie(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const e=i[1];return{host:e,port:Ee(r.substr(e.length+1))}}{const[e,t]=r.split(":");return{host:e,port:Ee(t)}}}(t),c=null===a?"":`:${a}`;r.config.emulator={url:`${s}//${o}${c}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:o,port:a,protocol:s.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||function(){function e(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}"undefined"!=typeof console&&"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."),"undefined"!=typeof window&&"undefined"!=typeof document&&("loading"===document.readyState?window.addEventListener("DOMContentLoaded",e):e())}()}(this._delegate,e,t)}applyActionCode(e){return async function(e,t){await async function(e,t){return D(e,"POST","/v1/accounts:update",O(e,t))}((0,i.Ku)(e),{oobCode:t})}(this._delegate,e)}checkActionCode(e){return lt(this._delegate,e)}confirmPasswordReset(e,t){return async function(e,t,n){await Se((0,i.Ku)(e),{oobCode:t,newPassword:n})}(this._delegate,e,t)}async createUserWithEmailAndPassword(e,t){return yr(this._delegate,async function(e,t,n){var r;const i=be(e),s={returnSecureToken:!0,email:t,password:n,clientType:"CLIENT_TYPE_WEB"};let o;if(null===(r=i._getRecaptchaConfig())||void 0===r?void 0:r.emailPasswordEnabled){const e=await ve(i,s,"signUpPassword");o=We(i,e)}else o=We(i,s).catch(async e=>{if("auth/missing-recaptcha-token"===e.code){console.log("Sign-up is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-up flow.");const e=await ve(i,s,"signUpPassword");return We(i,e)}return Promise.reject(e)});const a=await o.catch(e=>Promise.reject(e)),c=await He._fromIdTokenResponse(i,"signIn",a);return await i._updateCurrentUser(c.user),c}(this._delegate,e,t))}fetchProvidersForEmail(e){return this.fetchSignInMethodsForEmail(e)}fetchSignInMethodsForEmail(e){return async function(e,t){const n={identifier:t,continueUri:E()?I():"http://localhost"},{signinMethods:r}=await async function(e,t){return D(e,"POST","/v1/accounts:createAuthUri",O(e,t))}((0,i.Ku)(e),n);return r||[]}(this._delegate,e)}isSignInWithEmailLink(e){return function(e,t){const n=Me.parseLink(t);return"EMAIL_SIGNIN"===(null==n?void 0:n.operation)}(this._delegate,e)}async getRedirectResult(){Ir(ar(),this._delegate,"operation-not-supported-in-this-environment");const e=await async function(e,t){return await be(e)._initializationPromise,yn(e,t,!1)}(this._delegate,gr);return e?yr(this._delegate,Promise.resolve(e)):{credential:null,user:null}}addFrameworkForLogging(e){!function(e,t){be(e)._logFramework(t)}(this._delegate,e)}onAuthStateChanged(e,t,n){const{next:r,error:i,complete:s}=Tr(e,t,n);return this._delegate.onAuthStateChanged(r,i,s)}onIdTokenChanged(e,t,n){const{next:r,error:i,complete:s}=Tr(e,t,n);return this._delegate.onIdTokenChanged(r,i,s)}sendSignInLinkToEmail(e,t){return async function(e,t,n){var r;const i=be(e),s={requestType:"EMAIL_SIGNIN",email:t,clientType:"CLIENT_TYPE_WEB"};function o(e,t){w(t.handleCodeInApp,i,"argument-error"),t&&ut(i,e,t)}if(null===(r=i._getRecaptchaConfig())||void 0===r?void 0:r.emailPasswordEnabled){const e=await ve(i,s,"getOobCode",!0);o(e,n),await Oe(i,e)}else o(s,n),await Oe(i,s).catch(async e=>
2{if("auth/missing-recaptcha-token"!==e.code)return Promise.reject(e);{console.log("Email link sign-in is protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the sign-in flow.");const e=await ve(i,s,"getOobCode",!0);o(e,n),await Oe(i,e)}})}(this._delegate,e,t)}sendPasswordResetEmail(e,t){return async function(e,t,n){var r;const i=be(e),s={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"};if(null===(r=i._getRecaptchaConfig())||void 0===r?void 0:r.emailPasswordEnabled){const e=await ve(i,s,"getOobCode",!0);n&&ut(i,e,n),await xe(i,e)}else n&&ut(i,s,n),await xe(i,s).catch(async e=>{if("auth/missing-recaptcha-token"!==e.code)return Promise.reject(e);{console.log("Password resets are protected by reCAPTCHA for this project. Automatically triggering the reCAPTCHA flow and restarting the password reset flow.");const e=await ve(i,s,"getOobCode",!0);n&&ut(i,e,n),await xe(i,e)}})}(this._delegate,e,t||void 0)}async setPersistence(e){let t;switch(function(e,t){lr(Object.values(ur).includes(t),e,"invalid-persistence-type"),(0,i.lV)()?lr(t!==ur.SESSION,e,"unsupported-persistence-type"):(0,i.Ll)()?lr(t===ur.NONE,e,"unsupported-persistence-type"):or()?lr(t===ur.NONE||t===ur.LOCAL&&(0,i.zW)(),e,"unsupported-persistence-type"):lr(t===ur.NONE||sr(),e,"unsupported-persistence-type")}(this._delegate,e),e){case ur.SESSION:t=Ct;break;case ur.LOCAL:t=await H(zt)._isAvailable()?zt:kt;break;case ur.NONE:t=Y;break;default:return p("argument-error",{appName:this._delegate.name})}return this._delegate.setPersistence(t)}signInAndRetrieveDataWithCredential(e){return this.signInWithCredential(e)}signInAnonymously(){return yr(this._delegate,async function(e){var t;const n=be(e);if(await n._initializationPromise,null===(t=n.currentUser)||void 0===t?void 0:t.isAnonymous)return new He({user:n.currentUser,providerId:null,operationType:"signIn"});const r=await We(n,{returnSecureToken:!0}),i=await He._fromIdTokenResponse(n,"signIn",r,!0);return await n._updateCurrentUser(i.user),i}(this._delegate))}signInWithCredential(e){return yr(this._delegate,rt(this._delegate,e))}signInWithCustomToken(e){return yr(this._delegate,async function(e,t){const n=be(e),r=await async function(e,t){return R(e,"POST","/v1/accounts:signInWithCustomToken",O(e,t))}(n,{token:t,returnSecureToken:!0}),i=await He._fromIdTokenResponse(n,"signIn",r);return await n._updateCurrentUser(i.user),i}(this._delegate,e))}signInWithEmailAndPassword(e,t){return yr(this._delegate,function(e,t,n){return rt((0,i.Ku)(e),Fe.credential(t,n))}(this._delegate,e,t))}signInWithEmailLink(e,t){return yr(this._delegate,async function(e,t,n){const r=(0,i.Ku)(e),s=Fe.credentialWithLink(t,n||I());return w(s._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),rt(r,s)}(this._delegate,e,t))}signInWithPhoneNumber(e,t){return wr(this._delegate,async function(e,t,n){const r=be(e),s=await tn(r,t,(0,i.Ku)(n));return new en(s,e=>rt(r,e))}(this._delegate,e,t))}async signInWithPopup(e){return Ir(ar(),this._delegate,"operation-not-supported-in-this-environment"),yr(this._delegate,async function(e,t,n){const r=be(e);v(e,t,je);const i=rn(r,n);return new hn(r,"signInViaPopup",t,i).executeNotNull()}(this._delegate,e,gr))}async signInWithRedirect(e){return Ir(ar(),this._delegate,"operation-not-supported-in-this-environment"),await dr(this._delegate),function(e,t,n){return async function(e,t,n){const r=be(e);v(e,t,je),await r._initializationPromise;const i=rn(r,n);return await pn(i,r),i._openRedirect(r,t,"signInViaRedirect")}(e,t,n)}(this._delegate,e,gr)}updateCurrentUser(e){return this._delegate.updateCurrentUser(e)}verifyPasswordResetCode(e){return async function(e,t){const{data:n}=await lt((0,i.Ku)(e),t);return n.email}(this._delegate,e)}unwrap(){return this._delegate}_delete(){return this._delegate._delete()}linkUnderlyingAuth(){this._delegate.wrapped=()=>this}}function Tr(e,t,n){let r=e;"function"!=typeof e&&({next:r,error:t,complete:n}=e);const i=r;return{next:e=>i(e&&_r.getOrCreate(e)),error:t,complete:n}}function Sr(e,t){const n=function(e,t){const n=fr();if(!n)return[];const r=X(hr,e,t);switch(n.getItem(r)){case ur.NONE:return[Y];case ur.LOCAL:return[zt,Ct];case ur.SESSION:return[Ct];default:return[]}}(e,t);if("undefined"==typeof self||n.includes(zt)||n.push(zt),"undefined"!=typeof window)for(const e of[kt,Ct])n.includes(e)||n.push(e);return n.includes(Y)||n.push(Y),n}Er.Persistence=ur;class kr{constructor(){this.providerId="phone",this._delegate=new nn(mr(r.A.auth()))}static credential(e,t){return nn.credential(e,t)}verifyPhoneNumber(e,t){return this._delegate.verifyPhoneNumber(e,t)}unwrap(){return this._delegate}}kr.PHONE_SIGN_IN_METHOD=nn.PHONE_SIGN_IN_METHOD,kr.PROVIDER_ID=nn.PROVIDER_ID;const Ar=w;var Cr;(Cr=r.A).INTERNAL.registerComponent(new c.uA("auth-compat",e=>{const t=e.getProvider("app-compat").getImmediate(),n=e.getProvider("auth");return new Er(t,n)},"PUBLIC").setServiceProps({ActionCodeInfo:{Operation:{EMAIL_SIGNIN:"EMAIL_SIGNIN",PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:"REVERT_SECOND_FACTOR_ADDITION",VERIFY_AND_CHANGE_EMAIL:"VERIFY_AND_CHANGE_EMAIL",VERIFY_EMAIL:"VERIFY_EMAIL"}},EmailAuthProvider:Fe,FacebookAuthProvider:Be,GithubAuthProvider:ze,GoogleAuthProvider:qe,OAuthProvider:Ve,SAMLAuthProvider:Ge,PhoneAuthProvider:kr,PhoneMultiFactorGenerator:zn,RecaptchaVerifier:class{constructor(e,t,n=r.A.app()){var i;Ar(null===(i=n.options)||void 0===i?void 0:i.apiKey,"invalid-api-key",{appName:n.name}),this._delegate=new Zt(e,t,n.auth()),this.type=this._delegate.type}clear(){this._delegate.clear()}render(){return this._delegate.render()}verify(){return this._delegate.verify()}},TwitterAuthProvider:Ke,Auth:Er,AuthCredential:Te,Error:i.g}).setInstantiationMode("LAZY").setMultipleInstances(!1)),Cr.registerVersion("@firebase/auth-compat","0.4.2")},4427:function(e,t,n){"use strict";var r=n(48793),i=n(96435),s=n(85929),o=n(5686),a=s("species");e.exports=function(e){var t=r(e),n=i.f;o&&t&&!t[a]&&n(t,a,{configurable:!0,get:function(){return this}})}},4616:function(e,t,n){"use strict";n.d(t,{y:function(){return a}});var r=n(47393),i=n(58725),s=n(82184),o=n(68292),a={test:function(e){return o.B.test(e)||i.u.test(e)||s.V.test(e)},parse:function(e){return o.B.test(e)?o.B.parse(e):s.V.test(e)?s.V.parse(e):i.u.parse(e)},transform:function(e){return(0,r.Kg)(e)?e:e.hasOwnProperty("red")?o.B.transform(e):s.V.transform(e)}}},4754:function(e,t,n){var r=n(99569),i=/#|\.prototype\./,s=function(e,t){var n=a[o(e)];return n==u||n!=c&&("function"==typeof t?r(t):!!t)},o=s.normalize=function(e){return String(e).replace(i,".").toLowerCase()},a=s.data={},c=s.NATIVE="N",u=s.POLYFILL="P";e.exports=s},4794:function(e,t,n){var r=n(16054);e.exports=Array.isArray||function(e){return"Array"==r(e)}},5686:function(e,t,n){var r=n(99569);e.exports=!r(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}}
2)[1]})},6168:function(e,t,n){var r=n(93992),i="["+n(27158)+"]",s=RegExp("^"+i+i+"*"),o=RegExp(i+i+"*$"),a=function(e){return function(t){var n=String(r(t));return 1&e&&(n=n.replace(s,"")),2&e&&(n=n.replace(o,"")),n}};e.exports={start:a(1),end:a(2),trim:a(3)}},6522:function(e,t,n){"use strict";var r=n(51624),i=n(26891),s=n(1266),o=n(94762);function a(e,t){const n={};for(const r in e)e.hasOwnProperty(r)&&(n[r]=t(e[r]));return n}function c(e){if(null==e)return null;if(e instanceof Number&&(e=e.valueOf()),"number"==typeof e&&isFinite(e))return e;if(!0===e||!1===e)return e;if("[object String]"===Object.prototype.toString.call(e))return e;if(e instanceof Date)return e.toISOString();if(Array.isArray(e))return e.map(e=>c(e));if("function"==typeof e||"object"==typeof e)return a(e,e=>c(e));throw new Error("Data cannot be encoded in JSON: "+e)}function u(e){if(null==e)return e;if(e["@type"])switch(e["@type"]){case"type.googleapis.com/google.protobuf.Int64Value":case"type.googleapis.com/google.protobuf.UInt64Value":{const t=Number(e.value);if(isNaN(t))throw new Error("Data cannot be decoded from JSON: "+e);return t}default:throw new Error("Data cannot be decoded from JSON: "+e)}return Array.isArray(e)?e.map(e=>u(e)):"function"==typeof e||"object"==typeof e?a(e,e=>u(e)):e}const l="functions",h={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class d extends s.g{constructor(e,t,n){super(`${l}/${e}`,t||""),this.details=n}}class f{constructor(e,t,n){this.auth=null,this.messaging=null,this.appCheck=null,this.auth=e.getImmediate({optional:!0}),this.messaging=t.getImmediate({optional:!0}),this.auth||e.get().then(e=>this.auth=e,()=>{}),this.messaging||t.get().then(e=>this.messaging=e,()=>{}),this.appCheck||n.get().then(e=>this.appCheck=e,()=>{})}async getAuthToken(){if(this.auth)try{const e=await this.auth.getToken();return null==e?void 0:e.accessToken}catch(e){return}}async getMessagingToken(){if(this.messaging&&"Notification"in self&&"granted"===Notification.permission)try{return await this.messaging.getToken()}catch(e){return}}async getAppCheckToken(e){if(this.appCheck){const t=e?await this.appCheck.getLimitedUseToken():await this.appCheck.getToken();return t.error?null:t.token}return null}async getContext(e){return{authToken:await this.getAuthToken(),messagingToken:await this.getMessagingToken(),appCheckToken:await this.getAppCheckToken(e)}}}const p="us-central1";class g{constructor(e,t,n,r,i=p,s){this.app=e,this.fetchImpl=s,this.emulatorOrigin=null,this.contextProvider=new f(t,n,r),this.cancelAllRequests=new Promise(e=>{this.deleteService=()=>Promise.resolve(e())});try{const e=new URL(i);this.customDomain=e.origin,this.region=p}catch(e){this.customDomain=null,this.region=i}}_delete(){return this.deleteService()}_url(e){const t=this.app.options.projectId;return null!==this.emulatorOrigin?`${this.emulatorOrigin}/${t}/${this.region}/${e}`:null!==this.customDomain?`${this.customDomain}/${e}`:`https://${this.region}-${t}.cloudfunctions.net/${e}`}}async function m(e,t,n,r){let i;n["Content-Type"]="application/json";try{i=await r(e,{method:"POST",body:JSON.stringify(t),headers:n})}catch(e){return{status:0,json:null}}let s=null;try{s=await i.json()}catch(e){}return{status:i.status,json:s}}async function v(e,t,n,r){const i={data:n=c(n)},s={},o=await e.contextProvider.getContext(r.limitedUseAppCheckTokens);o.authToken&&(s.Authorization="Bearer "+o.authToken),o.messagingToken&&(s["Firebase-Instance-ID-Token"]=o.messagingToken),null!==o.appCheckToken&&(s["X-Firebase-AppCheck"]=o.appCheckToken);const a=function(e){let t=null;return{promise:new Promise((n,r)=>{t=setTimeout(()=>{r(new d("deadline-exceeded","deadline-exceeded"))},e)}),cancel:()=>{t&&clearTimeout(t)}}}(r.timeout||7e4),l=await Promise.race([m(t,i,s,e.fetchImpl),a.promise,e.cancelAllRequests]);if(a.cancel(),!l)throw new d("cancelled","Firebase Functions instance was deleted.");const f=function(e,t){let n,r=function(e){if(e>=200&&e<300)return"ok";switch(e){case 0:case 500:return"internal";case 400:return"invalid-argument";case 401:return"unauthenticated";case 403:return"permission-denied";case 404:return"not-found";case 409:return"aborted";case 429:return"resource-exhausted";case 499:return"cancelled";case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline-exceeded"}return"unknown"}(e),i=r;try{const e=t&&t.error;if(e){const t=e.status;if("string"==typeof t){if(!h[t])return new d("internal","internal");r=h[t],i=t}const s=e.message;"string"==typeof s&&(i=s),n=e.details,void 0!==n&&(n=u(n))}}catch(e){}return"ok"===r?null:new d(r,i,n)}(l.status,l.json);if(f)throw f;
2if(!l.json)throw new d("internal","Response is not valid JSON object.");let p=l.json.data;if(void 0===p&&(p=l.json.result),void 0===p)throw new d("internal","Response is missing data field.");return{data:u(p)}}const y="@firebase/functions",w="0.10.0";function b(e,t,n){!function(e,t,n){e.emulatorOrigin=`http://${t}:${n}`}((0,s.Ku)(e),t,n)}var _;_=fetch.bind(self),(0,i._registerComponent)(new o.uA(l,(e,{instanceIdentifier:t})=>{const n=e.getProvider("app").getImmediate(),r=e.getProvider("auth-internal"),i=e.getProvider("messaging-internal"),s=e.getProvider("app-check-internal");return new g(n,r,i,s,t,_)},"PUBLIC").setMultipleInstances(!0)),(0,i.registerVersion)(y,w,undefined),(0,i.registerVersion)(y,w,"esm2017");class I{constructor(e,t){this.app=e,this._delegate=t,this._region=this._delegate.region,this._customDomain=this._delegate.customDomain}httpsCallable(e,t){return function(e,t,n){return function(e,t,n){return r=>function(e,t,n,r){const i=e._url(t);return v(e,i,n,r)}(e,t,r,n||{})}((0,s.Ku)(e),t,n)}(this._delegate,e,t)}httpsCallableFromURL(e,t){return function(e,t,n){return function(e,t,n){return r=>v(e,t,r,n||{})}((0,s.Ku)(e),t,n)}(this._delegate,e,t)}useFunctionsEmulator(e){const t=e.match("[a-zA-Z]+://([a-zA-Z0-9.-]+)(?::([0-9]+))?");if(null==t)throw new s.g("functions","No origin provided to useFunctionsEmulator()");if(null==t[2])throw new s.g("functions","Port missing in origin provided to useFunctionsEmulator()");return b(this._delegate,t[1],Number(t[2]))}useEmulator(e,t){return b(this._delegate,e,t)}}const E=(e,{instanceIdentifier:t})=>{const n=e.getProvider("app-compat").getImmediate(),r=e.getProvider("functions").getImmediate({identifier:null!=t?t:"us-central1"});return new I(n,r)};!function(){const e={Functions:I};r.A.INTERNAL.registerComponent(new o.uA("functions-compat",E,"PUBLIC").setServiceProps(e).setMultipleInstances(!0))}(),r.A.registerVersion("@firebase/functions-compat","0.3.5")},6618:function(e,t,n){var r=n(61581),i=n(11941);e.exports=function(e,t){try{i(r,e,t)}catch(n){r[e]=t}return t}},7099:function(e,t,n){var r=n(12368);e.exports=function(e,t){if(!r(e))return e;var n,i;if(t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;if("function"==typeof(n=e.valueOf)&&!r(i=n.call(e)))return i;if(!t&&"function"==typeof(n=e.toString)&&!r(i=n.call(e)))return i;throw TypeError("Can't convert object to primitive value")}},7257:function(e,t,n){var r=n(63661);e.exports=function(e){var t=e.return;if(void 0!==t)return r(t.call(e)).value}},7967:function(e,t,n){var r=n(5686),i=n(96435),s=n(63661),o=n(33922);e.exports=r?Object.defineProperties:function(e,t){s(e);for(var n,r=o(t),a=r.length,c=0;a>c;)i.f(e,n=r[c++],t[n]);return e}},8216:function(e,t,n){"use strict";var r=n(97004),i=n(50208),s=n(47845),o=n(70489),a=n(42349),c=n(11941),u=n(75748),l=n(85929),h=n(86333),d=n(94063),f=n(61891),p=f.IteratorPrototype,g=f.BUGGY_SAFARI_ITERATORS,m=l("iterator"),v="keys",y="values",w="entries",b=function(){return this};e.exports=function(e,t,n,l,f,_,I){i(n,t,l);var E,T,S,k=function(e){if(e===f&&D)return D;if(!g&&e in x)return x[e];switch(e){case v:case y:case w:return function(){return new n(this,e)}}return function(){return new n(this)}},A=t+" Iterator",C=!1,x=e.prototype,O=x[m]||x["@@iterator"]||f&&x[f],D=!g&&O||k(f),N="Array"==t&&x.entries||O;if(N&&(E=s(N.call(new e)),p!==Object.prototype&&E.next&&(h||s(E)===p||(o?o(E,p):"function"!=typeof E[m]&&c(E,m,b)),a(E,A,!0,!0),h&&(d[A]=b))),f==y&&O&&O.name!==y&&(C=!0,D=function(){return O.call(this)}),h&&!I||x[m]===D||c(x,m,D),d[t]=D,f)if(T={values:k(y),keys:_?D:k(v),entries:k(w)},I)for(S in T)(g||C||!(S in x))&&u(x,S,T[S]);else r({target:t,proto:!0,forced:g||C},T);return T}},8474:function(e,t,n){"use strict";n.d(t,{$b:function(){return i},Ey:function(){return h},He:function(){return l},Vy:function(){return u}});const r=[];var i;!function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(i||(i={}));const s={debug:i.DEBUG,verbose:i.VERBOSE,info:i.INFO,warn:i.WARN,error:i.ERROR,silent:i.SILENT},o=i.INFO,a={[i.DEBUG]:"log",[i.VERBOSE]:"log",[i.INFO]:"info",[i.WARN]:"warn",[i.ERROR]:"error"},c=(e,t,...n)=>{if(t<e.logLevel)return;const r=(new Date).toISOString(),i=a[t];if(!i)throw new Error(`Attempted to log a message with an invali
2d logType (value: ${t})`);console[i](`[${r}] ${e.name}:`,...n)};class u{constructor(e){this.name=e,this._logLevel=o,this._logHandler=c,this._userLogHandler=null,r.push(this)}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in i))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel="string"==typeof e?s[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if("function"!=typeof e)throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,i.DEBUG,...e),this._logHandler(this,i.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,i.VERBOSE,...e),this._logHandler(this,i.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,i.INFO,...e),this._logHandler(this,i.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,i.WARN,...e),this._logHandler(this,i.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,i.ERROR,...e),this._logHandler(this,i.ERROR,...e)}}function l(e){r.forEach(t=>{t.setLogLevel(e)})}function h(e,t){for(const n of r){let r=null;t&&t.level&&(r=s[t.level]),n.userLogHandler=null===e?null:(t,n,...s)=>{const o=s.map(e=>{if(null==e)return null;if("string"==typeof e)return e;if("number"==typeof e||"boolean"==typeof e)return e.toString();if(e instanceof Error)return e.message;try{return JSON.stringify(e)}catch(e){return null}}).filter(e=>e).join(" ");n>=(null!=r?r:t.logLevel)&&e({level:i[n].toLowerCase(),message:o,args:s,type:t.name})}}}},8686:function(e){"use strict";var t=Array.isArray,n=Object.keys,r=Object.prototype.hasOwnProperty;e.exports=function e(i,s){if(i===s)return!0;if(i&&s&&"object"==typeof i&&"object"==typeof s){var o,a,c,u=t(i),l=t(s);if(u&&l){if((a=i.length)!=s.length)return!1;for(o=a;0!==o--;)if(!e(i[o],s[o]))return!1;return!0}if(u!=l)return!1;var h=i instanceof Date,d=s instanceof Date;if(h!=d)return!1;if(h&&d)return i.getTime()==s.getTime();var f=i instanceof RegExp,p=s instanceof RegExp;if(f!=p)return!1;if(f&&p)return i.toString()==s.toString();var g=n(i);if((a=g.length)!==n(s).length)return!1;for(o=a;0!==o--;)if(!r.call(s,g[o]))return!1;for(o=a;0!==o--;)if(!e(i[c=g[o]],s[c]))return!1;return!0}return i!=i&&s!=s}},8732:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.empty=void 0,t.empty={object:{},array:[]}},9351:function(e,t,n){"use strict";n.d(t,{B:function(){return a}});var r=n(35285),i=n(55166),s=n(68043),o=n(34775);function a(e){var t,n=e.from,a=void 0===n?0:n,c=e.velocity,u=void 0===c?0:c,l=e.min,h=e.max,d=e.power,f=void 0===d?.8:d,p=e.timeConstant,g=void 0===p?750:p,m=e.bounceStiffness,v=void 0===m?500:m,y=e.bounceDamping,w=void 0===y?10:y,b=e.restDelta,_=void 0===b?1:b,I=e.modifyTarget,E=e.driver,T=e.onUpdate,S=e.onComplete;function k(e){return void 0!==l&&e<l||void 0!==h&&e>h}function A(e){return void 0===l?h:void 0===h||Math.abs(l-e)<Math.abs(h-e)?l:h}function C(e){null==t||t.stop(),t=(0,i.i)((0,r.__assign)((0,r.__assign)({},e),{driver:E,onUpdate:function(t){var n;null==T||T(t),null===(n=e.onUpdate)||void 0===n||n.call(e,t)},onComplete:S}))}function x(e){C((0,r.__assign)({type:"spring",stiffness:v,damping:w,restDelta:_},e))}if(k(a))x({from:a,velocity:u,to:A(a)});else{var O=f*u+a;void 0!==I&&(O=I(O));var D,N,R=A(O),P=R===l?-1:1;C({type:"decay",from:a,velocity:u,timeConstant:g,power:f,restDelta:_,modifyTarget:I,onUpdate:k(O)?function(e){D=N,N=e,u=(0,s.f)(e-D,(0,o.KK)().delta),(1===P&&e>R||-1===P&&e<R)&&x({from:e,to:R,velocity:u})}:void 0})}return{stop:function(){return null==t?void 0:t.stop()}}}},10475:function(e,t,n){var r=n(97004),i=n(5686);r({target:"Object",stat:!0,forced:!i,sham:!i},{defineProperty:n(96435).f})},10621:function(e,t,n){"use strict";var r=n(74250),i=n(96665);e.exports=r?{}.toString:function(){return"[object "+i(this)+"]"}},10965:function(e,t,n){var r=n(81254).default;function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}
2e.exports=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=i(t);if(n&&n.has(e))return n.get(e);var s={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var c=o?Object.getOwnPropertyDescriptor(e,a):null;c&&(c.get||c.set)?Object.defineProperty(s,a,c):s[a]=e[a]}return s.default=e,n&&n.set(e,s),s},e.exports.default=e.exports,e.exports.__esModule=!0},11566:function(e,t,n){var r=n(10965),i=n(1918);Object.defineProperty(t,"__esModule",{value:!0}),t.Fuego=void 0;var s=i(n(80019)),o=i(n(49145)),a=r(n(69188));t.Fuego=function e(t){(0,s.default)(this,e),(0,o.default)(this,"db",void 0),(0,o.default)(this,"auth",void 0),(0,o.default)(this,"functions",void 0),(0,o.default)(this,"storage",void 0),this.db=a.apps.length?a.app().firestore():a.initializeApp(t).firestore(),this.auth=a.auth,this.functions=a.functions,this.storage=a.storage}},11941:function(e,t,n){var r=n(5686),i=n(96435),s=n(70354);e.exports=r?function(e,t,n){return i.f(e,t,s(1,n))}:function(e,t,n){return e[t]=n,e}},12064:function(e,t,n){"use strict";var r=n(97004),i=n(12368),s=n(4794),o=n(16424),a=n(92636),c=n(84263),u=n(66774),l=n(85929),h=n(73131)("slice"),d=l("species"),f=[].slice,p=Math.max;r({target:"Array",proto:!0,forced:!h},{slice:function(e,t){var n,r,l,h=c(this),g=a(h.length),m=o(e,g),v=o(void 0===t?g:t,g);if(s(h)&&("function"!=typeof(n=h.constructor)||n!==Array&&!s(n.prototype)?i(n)&&null===(n=n[d])&&(n=void 0):n=void 0,n===Array||void 0===n))return f.call(h,m,v);for(r=new(void 0===n?Array:n)(p(v-m,0)),l=0;m<v;m++,l++)m in h&&u(r,l,h[m]);return r.length=l,r}})},12132:function(e,t,n){"use strict";n.d(t,{G:function(){return w}});var r=n(1724),i=n(77157),s=n(54447),o=n(35285),a=n(4616),c=n(49019),u=n(62527),l=n(13191),h=n(25003);function d(e,t){return(0,u.T)(e)?function(n){return(0,i.j)(e,t,n)}:a.y.test(e)?(0,s.i)(e,t):m(e,t)}var f=function(e,t){var n=(0,o.__spreadArray)([],e),r=n.length,i=e.map(function(e,n){return d(e,t[n])});return function(e){for(var t=0;t<r;t++)n[t]=i[t](e);return n}},p=function(e,t){var n=(0,o.__assign)((0,o.__assign)({},e),t),r={};for(var i in n)void 0!==e[i]&&void 0!==t[i]&&(r[i]=d(e[i],t[i]));return function(e){for(var t in r)n[t]=r[t](e);return n}};function g(e){for(var t=c.f.parse(e),n=t.length,r=0,i=0,s=0,o=0;o<n;o++)r||"number"==typeof t[o]?r++:void 0!==t[o].hue?s++:i++;return{parsed:t,numNumbers:r,numRGB:i,numHSL:s}}var m=function(e,t){var n=c.f.createTransformer(t),r=g(e),i=g(t);return(0,h.V)(r.numHSL===i.numHSL&&r.numRGB===i.numRGB&&r.numNumbers>=i.numNumbers,"Complex values '"+e+"' and '"+t+"' too different to mix. Ensure all colors are of the same type."),(0,l.F)(f(r.parsed,i.parsed),n)},v=n(71984),y=function(e,t){return function(n){return(0,i.j)(e,t,n)}};function w(e,t,n){var i=void 0===n?{}:n,o=i.clamp,c=void 0===o||o,u=i.ease,d=i.mixer,g=e.length;(0,h.V)(g===t.length,"Both input and output ranges must be the same length"),(0,h.V)(!u||!Array.isArray(u)||u.length===g-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),e[0]>e[g-1]&&(e=[].concat(e),t=[].concat(t),e.reverse(),t.reverse());var w=function(e,t,n){for(var r,i=[],o=n||("number"==typeof(r=e[0])?y:"string"==typeof r?a.y.test(r)?s.i:m:Array.isArray(r)?f:"object"==typeof r?p:void 0),c=e.length-1,u=0;u<c;u++){var h=o(e[u],e[u+1]);if(t){var d=Array.isArray(t)?t[u]:t;h=(0,l.F)(d,h)}i.push(h)}return i}(t,u,d),b=2===g?function(e,t){var n=e[0],i=e[1],s=t[0];return function(e){return s((0,r.q)(n,i,e))}}(e,w):function(e,t){var n=e.length,i=n-1;return function(s){var o=0,a=!1;if(s<=e[0]?a=!0:s>=e[i]&&(o=i-1,a=!0),!a){for(var c=1;c<n&&!(e[c]>s||c===i);c++);o=c-1}var u=(0,r.q)(e[o],e[o+1],s);return t[o](u)}}(e,w);return c?function(t){return b((0,v.q)(e[0],e[g-1],t))}:b}},12341:function(e,t,n){var r=n(85929);t.f=r},12368:function(e){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},13191:function(e,t,n){"use strict";n.d(t,{F:function(){return i}});var r=function(e,t){return function(n){return t(e(n))}},i=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.reduce(r)}},13341:function(e,t,n){"use strict";n.d(t,{p:function(){return u}});var r=n(35285),i=n(49019),s=n(47393),o=new Set(["brightness","contrast","saturate","opacity"]);function a(e){var t=e.slice(0,-1).split("("),n=t[0],r=t[1];if("drop-shadow"===n)return e;var i=(r.match(s.SY)||[])[0];if(!i)return e;var a=r.replace(i,""),c=o.has(n)?1:0;return i!==r&&(c*=100),n+"("+c+a+")"}var c=/([a-z-]*)\(.*?\)/g,u=(0,r.__assign)((0,r.__assign)({},i.f),{getAnimatableNone:function(e){var t=e.match(c);return t?t.map(a).join(" "):e}})}
2,14943:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.isDev=void 0;var n="undefined"==typeof __DEV__||__DEV__;t.isDev=n},15996:function(e,t,n){"use strict";var r=n(1404),i=n(12368),s=[].slice,o={};e.exports=Function.bind||function(e){var t=r(this),n=s.call(arguments,1),a=function(){var r=n.concat(s.call(arguments));return this instanceof a?function(e,t,n){if(!(t in o)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";o[t]=Function("C,a","return new C("+r.join(",")+")")}return o[t](e,n)}(t,r.length,r):t.apply(e,r)};return i(t.prototype)&&(a.prototype=t.prototype),a}},16054:function(e){var t={}.toString;e.exports=function(e){return t.call(e).slice(8,-1)}},16424:function(e,t,n){var r=n(57956),i=Math.max,s=Math.min;e.exports=function(e,t){var n=r(e);return n<0?i(n+t,0):s(n,t)}},16987:function(e,t,n){var r=n(121);e.exports=function(e,t){if(null==e)return{};var n,i,s=r(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)n=o[i],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s},e.exports.default=e.exports,e.exports.__esModule=!0},18002:function(e){var t=0,n=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++t+n).toString(36)}},19535:function(e,t,n){var r,i="__lodash_hash_undefined__",s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/,a=/^\./,c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,u=/\\(\\)?/g,l=/^\[object .+?Constructor\]$/,h="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,d="object"==typeof self&&self&&self.Object===Object&&self,f=h||d||Function("return this")(),p=Array.prototype,g=Function.prototype,m=Object.prototype,v=f["__core-js_shared__"],y=(r=/[^.]+$/.exec(v&&v.keys&&v.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",w=g.toString,b=m.hasOwnProperty,_=m.toString,I=RegExp("^"+w.call(b).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),E=f.Symbol,T=p.splice,S=P(f,"Map"),k=P(Object,"create"),A=E?E.prototype:void 0,C=A?A.toString:void 0;function x(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function O(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function D(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function N(e,t){for(var n=e.length;n--;)if(j(e[n][0],t))return n;return-1}function R(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function P(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){if(!V(e)||y&&y in e)return!1;var t=function(e){var t=V(e)?_.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?I:l;return t.test(function(e){if(null!=e){try{return w.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(n)?n:void 0}x.prototype.clear=function(){this.__data__=k?k(null):{}},x.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},x.prototype.get=function(e){var t=this.__data__;if(k){var n=t[e];return n===i?void 0:n}return b.call(t,e)?t[e]:void 0},x.prototype.has=function(e){var t=this.__data__;return k?void 0!==t[e]:b.call(t,e)},x.prototype.set=function(e,t){return this.__data__[e]=k&&void 0===t?i:t,this},O.prototype.clear=function(){this.__data__=[]},O.prototype.delete=function(e){var t=this.__data__,n=N(t,e);return!(n<0||(n==t.length-1?t.pop():T.call(t,n,1),0))},O.prototype.get=function(e){var t=this.__data__,n=N(t,e);return n<0?void 0:t[n][1]},O.prototype.has=function(e){return N(this.__data__,e)>-1},O.prototype.set=function(e,t){var n=this.__data__,r=N(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},D.prototype.clear=function(){this.__data__={hash:new x,map:new(S||O),string:new x}},D.prototype.delete=function(e){return R(this,e).delete(e)},D.prototype.get=function(e){return R(this,e).get(e)},D.prototype.has=function(e){return R(this,e).has(e)},D.prototype.set=function(e,t){return R(this,e).set(e,t),this};var L=F(function(e){var t;
2e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if(B(e))return C?C.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return a.test(e)&&n.push(""),e.replace(c,function(e,t,r,i){n.push(r?i.replace(u,"$1"):t||e)}),n});function M(e){if("string"==typeof e||B(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function F(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=e.apply(this,r);return n.cache=s.set(i,o),o};return n.cache=new(F.Cache||D),n}function j(e,t){return e===t||e!=e&&t!=t}F.Cache=D;var U=Array.isArray;function V(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function B(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==_.call(e)}e.exports=function(e,t,n){var r=null==e?void 0:function(e,t){var n;t=function(e,t){if(U(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!B(e))||o.test(e)||!s.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:U(n=t)?n:L(n);for(var r=0,i=t.length;null!=e&&r<i;)e=e[M(t[r++])];return r&&r==i?e:void 0}(e,t);return void 0===r?n:r}},20469:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={NODE_CLIENT:!1,NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"},i=function(e,t){if(!e)throw s(t)},s=function(e){return new Error("Firebase Database ("+r.SDK_VERSION+") INTERNAL ASSERT FAILED: "+e)},o=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=63&i|128):55296==(64512&i)&&r+1<e.length&&56320==(64512&e.charCodeAt(r+1))?(i=65536+((1023&i)<<10)+(1023&e.charCodeAt(++r)),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=63&i|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=63&i|128)}return t},a={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let t=0;t<e.length;
vendor: 4,729 bytes, line 2
2t+=3){const i=e[t],s=t+1<e.length,o=s?e[t+1]:0,a=t+2<e.length,c=a?e[t+2]:0,u=i>>2,l=(3&i)<<4|o>>4;let h=(15&o)<<2|c>>6,d=63&c;a||(d=64,s||(h=64)),r.push(n[u],n[l],n[h],n[d])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(o(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):function(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){const s=e[n++];t[r++]=String.fromCharCode((31&i)<<6|63&s)}else if(i>239&&i<365){const s=((7&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t[r++]=String.fromCharCode(55296+(s>>10)),t[r++]=String.fromCharCode(56320+(1023&s))}else{const s=e[n++],o=e[n++];t[r++]=String.fromCharCode((15&i)<<12|(63&s)<<6|63&o)}}return t.join("")}(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let t=0;t<e.length;){const i=n[e.charAt(t++)],s=t<e.length?n[e.charAt(t)]:0;++t;const o=t<e.length?n[e.charAt(t)]:64;++t;const a=t<e.length?n[e.charAt(t)]:64;if(++t,null==i||null==s||null==o||null==a)throw new c;const u=i<<2|s>>4;if(r.push(u),64!==o){const e=s<<4&240|o>>2;if(r.push(e),64!==a){const e=o<<6&192|a;r.push(e)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class c extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const u=function(e){const t=o(e);return a.encodeByteArray(t,!0)},l=function(e){return u(e).replace(/\./g,"")},h=function(e){try{return a.decodeString(e,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function d(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:void 0===e&&(e={});break;case Array:e=[];break;default:return t}for(const n in t)t.hasOwnProperty(n)&&f(n)&&(e[n]=d(e[n],t[n]));return e}function f(e){return"__proto__"!==e}function p(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n.g)return n.g;throw new Error("Unable to locate global object.")}const g=()=>{try{return p().__FIREBASE_DEFAULTS__||(()=>{if("undefined"==typeof process||void 0===process.env)return;const e=process.env.__FIREBASE_DEFAULTS__;return e?JSON.parse(e):void 0})()||(()=>{if("undefined"==typeof document)return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(e){return}const t=e&&h(e[1]);return t&&JSON.parse(t)})()}catch(e){return void console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`)}},m=e=>{var t,n;return null===(n=null===(t=g())||void 0===t?void 0:t.emulatorHosts)||void 0===n?void 0:n[e]};class v{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,n)=>{t?this.reject(t):this.resolve(n),"function"==typeof e&&(this.promise.catch(()=>{}),1===e.length?e(t):e(t,n))}}}function y(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function w(){var e;const t=null===(e=g())||void 0===e?void 0:e.forceEnvironment;if("node"===t)return!0;if("browser"===t)return!1;try{return"[object process]"===Object.prototype.toString.call(n.g.process)}catch(e){return!1}}class b extends Error{constructor(e,t,n){super(t),this.code=e,this.customData=n,this.name="FirebaseError",Object.setPrototypeOf(this,b.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,_.prototype.create)}}class _{constructor(e,t,n){this.service=e,this.serviceName=t,this.errors=n}create(e,...t){const n=t[0]||{},r=`${this.service}/${e}`,i=this.errors[e],s=i?function(e,t){return e.replace(I,(e,n)=>{const r=t[n];return null!=r?String(r):`<${n}?>`})}(i,n):"Error",o=`${this.serviceName}: ${s} (${r}).`;return new b(r,o,n)}}const I=/\{\$([^}]+)}/g;function E(e){return JSON.parse(e)}const T=function(e){let t={},n={},r={},i="";try{const s=e.split(".");t=E(h(s[0])||""),n=E(h(s[1])||""),i=s[2],r=n.d||{},delete n.d}catch(e){}return{header:t,claims:n,data:r,signature:i}};function S(e){return null!==e&&"object"==typeof e}class k{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Prom
2ise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(e=>{this.error(e)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,n){let r;if(void 0===e&&void 0===t&&void 0===n)throw new Error("Missing Observer.");r=function(e){if("object"!=typeof e||null===e)return!1;for(const t of["next","error","complete"])if(t in e&&"function"==typeof e[t])return!0;return!1}(e)?e:{next:e,error:t,complete:n},void 0===r.next&&(r.next=A),void 0===r.error&&(r.error=A),void 0===r.complete&&(r.complete=A);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch(e){}}),this.observers.push(r),i}unsubscribeOne(e){void 0!==this.observers&&void 0!==this.observers[e]&&(delete this.observers[e],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(void 0!==this.observers&&void 0!==this.observers[e])try{t(this.observers[e])}catch(e){"undefined"!=typeof console&&console.error&&console.error(e)}})}close(e){this.finalized||(this.finalized=!0,void 0!==e&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function A(){}function C(e,t){return`${e} failed: ${t} argument `}const x=144e5;t.CONSTANTS=r,t.DecodeBase64StringError=c,t.Deferred=v,t.ErrorFactory=_,t.FirebaseError=b,t.MAX_VALUE_MILLIS=x,t.RANDOM_FACTOR=.5,t.Sha1=class{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=64,this.pad_[0]=128;for(let e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}reset(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0}compress_(e,t){t||(t=0);const n=this.W_;if("string"==typeof e)for(let r=0;r<16;r++)n[r]=e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3),t+=4;else for(let r=0;r<16;r++)n[r]=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3],t+=4;for(let e=16;e<80;e++){const t=n[e-3]^n[e-8]^n[e-14]^n[e-16];n[e]=4294967295&(t<<1|t>>>31)}let r,i,s=this.chain_[0],o=this.chain_[1],a=this.chain_[2],c=this.chain_[3],u=this.chain_[4];for(let e=0;e<80;e++){e<40?e<20?(r=c^o&(a^c),i=1518500249):(r=o^a^c,i=1859775393):e<60?(r=o&a|c&(o|a),i=2400959708):(r=o^a^c,i=3395469782);const t=(s<<5|s>>>27)+r+u+i+n[e]&4294967295;u=c,c=a,a=4294967295&(o<<30|o>>>2),o=s,s=t}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+o&4294967295,this.chain_[2]=this.chain_[2]+a&4294967295,this.chain_[3]=this.chain_[3]+c&4294967295,this.chain_[4]=this.chain_[4]+u&4294967295}update(e,t){if(null==e)return;void 0===t&&(t=e.length);const n=t-this.blockSize;let r=0;const i=this.buf_;let s=this.inbuf_;for(;r<t;){if(0===s)for(;r<=n;)this.compress_(e,r),r+=this.blockSize;if("string"==typeof e){for(;r<t;)if(i[s]=e.charCodeAt(r),++s,++r,s===this.blockSize){this.compress_(i),s=0;break}}else for(;r<t;)if(i[s]=e[r],++s,++r,s===this.blockSize){this.compress_(i),s=0;break}}this.inbuf_=s,this.total_+=t}digest(){const e=[];let t=8*this.total_;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(let e=this.blockSize-1;e>=56;e--)this.buf_[e]=255&t,t/=256;this.compress_(this.buf_);let n=0;for(let t=0;t<5;t++)for(let r=24;r>=0;r-=8)e[n]=this.chain_[t]>>r&255,++n;return e}},t.areCookiesEnabled=function(){return!("undefined"==typeof navigator||!navigator.cookieEnabled)},t.assert=i,t.assertionError=s,t.async=function(e,t){return(...n)=>{Promise.resolve(!0).then(()=>{e(...n)}).catch(e=>{t&&t(e)})}},t.base64=a,t.base64Decode=h,t.base64Encode=u,t.base64urlEncodeWithoutPadding=l,t.calculateBackoffMillis=function(e,t=1e3,n=2){const r=t*Math.pow(n,e),i=Math.round(.5*r*(Math.random()-.5)*2);return Math.min(x,r+i)},t.contains=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.createMockUserToken=function(e,t){if(e.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=t||"demo-project",r=e.iat||0,i=e.sub||e.user_id;if(!i)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const s=Object.assign({iss:`https://securetoken.google.com/${n}`,aud:n,iat:r,exp:r+3600,auth_time:r,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},e);return[l(JSON.stringify({alg:"none",type:"JWT"})),l(JSON.stringify(s)),""].join(".")},t.createSubscribe=function(e,t){const n=new k(e,t);return n.subscribe.bind(n)},t.decode=T,t.deepCopy=function(e){return d(void 0,e)},t.deepEqual=function e(t,n){if(t===n)return!0;const r=Object.keys(t),i=Object.keys(n);for(const s of r){if(!i.includes(s))return!1;const r=t[s],o=n[s];if(S(r)&&S(o)){if(!e(r,o))return!1}else if(r!==o)return!1}for(const e of i)if(!r.includes(e))return!1;return!0},t.deepExtend=d,t.errorPrefix=C,t.extractQuerystring=function(e){const t=e.indexOf("?");if(!t)return"";const n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)},t.getDefaultAppConfig=()=>{var e;return null===(e=g())||void 0===e?void 0:e.config},t.getDefaultEmulatorHost=m,t.getDefaultEmulatorHostnameAndPort=e=>{const t=m(e);if(!t)return;const n=t.lastIndexOf(":");if(n<=0||n+1===t.length)throw new Error(`Invalid host ${t} with no separate hostname and port!`);const r=parseInt(t.substring(n+1),10);return"["===t[0]?[t.substring(1,n-1),r]:[t.substring(0,n),r]},t.getDefaults=g,t.getExperimentalSetting=e=>{var t;return null===(t=g())||void 0===t?void 0:t[`_${e}`]},t.getGlobal=p,t.getModularInstance=function(e){return e&&e._delegate?e._delegate:e}
2,t.getUA=y,t.isAdmin=function(e){const t=T(e).claims;return"object"==typeof t&&!0===t.admin},t.isBrowser=function(){return"object"==typeof self&&self.self===self},t.isBrowserExtension=function(){const e="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof e&&void 0!==e.id},t.isElectron=function(){return y().indexOf("Electron/")>=0},t.isEmpty=function(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0},t.isIE=function(){const e=y();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0},t.isIndexedDBAvailable=function(){try{return"object"==typeof indexedDB}catch(e){return!1}},t.isMobileCordova=function(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(y())},t.isNode=w,t.isNodeSdk=function(){return!0===r.NODE_CLIENT||!0===r.NODE_ADMIN},t.isReactNative=function(){return"object"==typeof navigator&&"ReactNative"===navigator.product},t.isSafari=function(){return!w()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")},t.isUWP=function(){return y().indexOf("MSAppHost/")>=0},t.isValidFormat=function(e){const t=T(e).claims;return!!t&&"object"==typeof t&&t.hasOwnProperty("iat")},t.isValidTimestamp=function(e){const t=T(e).claims,n=Math.floor((new Date).getTime()/1e3);let r=0,i=0;return"object"==typeof t&&(t.hasOwnProperty("nbf")?r=t.nbf:t.hasOwnProperty("iat")&&(r=t.iat),i=t.hasOwnProperty("exp")?t.exp:r+86400),!!n&&!!r&&!!i&&n>=r&&n<=i},t.issuedAtTime=function(e){const t=T(e).claims;return"object"==typeof t&&t.hasOwnProperty("iat")?t.iat:null},t.jsonEval=E,t.map=function(e,t,n){const r={};for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=t.call(n,e[i],i,e));return r},t.ordinal=function(e){return Number.isFinite(e)?e+function(e){const t=(e=Math.abs(e))%100;if(t>=10&&t<=20)return"th";const n=e%10;return 1===n?"st":2===n?"nd":3===n?"rd":"th"}(e):`${e}`},t.promiseWithTimeout=function(e,t=2e3){const n=new v;return setTimeout(()=>n.reject("timeout!"),t),e.then(n.resolve,n.reject),n.promise},t.querystring=function(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(e=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(e))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""},t.querystringDecode=function(e){const t={};return e.replace(/^\?/,"").split("&").forEach(e=>{if(e){const[n,r]=e.split("=");
2t[decodeURIComponent(n)]=decodeURIComponent(r)}}),t},t.safeGet=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0},t.stringLength=function(e){let t=0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);r<128?t++:r<2048?t+=2:r>=55296&&r<=56319?(t+=4,n++):t+=3}return t},t.stringToByteArray=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);if(s>=55296&&s<=56319){const t=s-55296;r++,i(r<e.length,"Surrogate pair missing trail surrogate."),s=65536+(t<<10)+(e.charCodeAt(r)-56320)}s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=63&s|128):s<65536?(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=63&s|128):(t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=63&s|128)}return t},t.stringify=function(e){return JSON.stringify(e)},t.uuidv4=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},t.validateArgCount=function(e,t,n,r){let i;if(r<t?i="at least "+t:r>n&&(i=0===n?"none":"no more than "+n),i)throw new Error(e+" failed: Was called with "+r+(1===r?" argument.":" arguments.")+" Expects "+i+".")},t.validateCallback=function(e,t,n,r){if((!r||n)&&"function"!=typeof n)throw new Error(C(e,t)+"must be a valid function.")},t.validateContextObject=function(e,t,n,r){if((!r||n)&&("object"!=typeof n||null===n))throw new Error(C(e,t)+"must be a valid context object.")},t.validateIndexedDBOpenable=function(){return new Promise((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var e;t((null===(e=i.error)||void 0===e?void 0:e.message)||"")}}catch(e){t(e)}})},t.validateNamespace=function(e,t,n){if((!n||t)&&"string"!=typeof t)throw new Error(C(e,"namespace")+"must be a valid firebase namespace.")}},21081:function(e,t,n){var r=n(72134);e.exports=/(?:iphone|ipod|ipad).*applewebkit/i.test(r)},22554:function(e,t,n){var r=n(1404);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},22710:function(e,t,n){var r=n(39278);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},23007:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},23311:function(e,t,n){var r=n(5686),i=n(99569),s=n(71233);e.exports=!r&&!i(function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a})},24060:function(e,t,n){var r=n(54595),i={}.hasOwnProperty;e.exports=Object.hasOwn||function(e,t){return i.call(r(e),t)}},24075:function(e,t,n){n(97004)({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}})},24370:function(e,t,n){var r=n(1918);Object.defineProperty(t,"__esModule",{value:!0}),t.collectionCache=void 0;var i=r(n(94400)),s=r(n(80019)),o=r(n(94343)),a=r(n(49145)),c=n(8732);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var l=function(){function e(){(0,s.default)(this,e),(0,a.default)(this,"collections",void 0),this.collections={}}return(0,o.default)(e,[{key:"getSWRKeysFromCollectionPath",value:function(e){var t,n;return e.trim().split("/").filter(Boolean).length%2!=0||console.error("[fuego-swr-keys-from-collection-path] error: Passed a path that was not a collection to useCollection: ".concat(e,".")),null!==(t=null===(n=this.collections[e])||void 0===n?void 0:n.map(function(e){return e.key.filter(function(e){return"string"==typeof e})}).filter(Boolean))&&void 0!==t?t:c.empty.array}},{key:"addCollectionToCache",value:function(e,t){var n,r;return(null===(n=this.collections[e])||void 0===n?void 0:n.some(function(n){var r=n.key;return r[0]===e&&r[1]===t}))||(this.collections=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
2t%2?u(Object(n),!0).forEach(function(t){(0,a.default)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},this.collections,(0,a.default)({},e,[].concat((0,i.default)(null!==(r=this.collections[e])&&void 0!==r?r:c.empty.array),[{key:[e,t]}])))),this.collections}}]),e}(),h=new l;t.collectionCache=h},25003:function(e,t,n){"use strict";n.d(t,{$:function(){return r},V:function(){return i}});var r=function(){},i=function(){}},25403:function(e,t,n){var r=n(22554),i=n(56737),s=n(54595),o=n(92636),a=n(41551),c=[].push,u=function(e){var t=1==e,n=2==e,u=3==e,l=4==e,h=6==e,d=7==e,f=5==e||h;return function(p,g,m,v){for(var y,w,b=s(p),_=i(b),I=r(g,m,3),E=o(_.length),T=0,S=v||a,k=t?S(p,E):n||d?S(p,0):void 0;E>T;T++)if((f||T in _)&&(w=I(y=_[T],T,b),e))if(t)k[T]=w;else if(w)switch(e){case 3:return!0;case 5:return y;case 6:return T;case 2:c.call(k,y)}else switch(e){case 4:return!1;case 7:c.call(k,y)}return h?-1:u||l?l:k}};e.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterOut:u(7)}},26349:function(e){"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n}).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var i={};if(r)for(var s=0;s<this.length;s++){var o=this[s][0];null!=o&&(i[o]=!0)}for(var a=0;a<e.length;a++){var c=[].concat(e[a]);r&&i[c[0]]||(n&&(c[2]?c[2]="".concat(n," and ").concat(c[2]):c[2]=n),t.push(c))}},t}},26891:function(e,t,n){"use strict";n.r(t),n.d(t,{FirebaseError:function(){return s.g},SDK_VERSION:function(){return W},_DEFAULT_ENTRY_NAME:function(){return L},_addComponent:function(){return U},_addOrOverwriteComponent:function(){return V},_apps:function(){return F},_clearComponents:function(){return $},_components:function(){return j},_getProvider:function(){return q},_registerComponent:function(){return B},_removeServiceInstance:function(){return z},deleteApp:function(){return X},getApp:function(){return Q},getApps:function(){return Y},initializeApp:function(){return H},onLog:function(){return Z},registerVersion:function(){return J},setLogLevel:function(){return ee}});var r=n(94762),i=n(8474),s=n(1266),o=n(29656);class a{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(e=>{if(function(e){const t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){const t=e.getImmediate();return`${t.library}/${t.version}`}return null}).filter(e=>e).join(" ")}}const c="@firebase/app",u="0.9.13",l=new i.Vy("@firebase/app"),h="@firebase/app-compat",d="@firebase/analytics-compat",f="@firebase/analytics",p="@firebase/app-check-compat",g="@firebase/app-check",m="@firebase/auth",v="@firebase/auth-compat",y="@firebase/database",w="@firebase/database-compat",b="@firebase/functions",_="@firebase/functions-compat",I="@firebase/installations",E="@firebase/installations-compat",T="@firebase/messaging",S="@firebase/messaging-compat",k="@firebase/performance",A="@firebase/performance-compat",C="@firebase/remote-config",x="@firebase/remote-config-compat",O="@firebase/storage",D="@firebase/storage-compat",N="@firebase/firestore",R="@firebase/firestore-compat",P="firebase",L="[DEFAULT]",M={[c]:"fire-core",[h]:"fire-core-compat",[f]:"fire-analytics",[d]:"fire-analytics-compat",[g]:"fire-app-check",[p]:"fire-app-check-compat",[m]:"fire-auth",[v]:"fire-auth-compat",[y]:"fire-rtdb",[w]:"fire-rtdb-compat",[b]:"fire-fn",[_]:"fire-fn-compat",[I]:"fire-iid",[E]:"fire-iid-compat",[T]:"fire-fcm",[S]:"fire-fcm-compat",[k]:"fire-perf",[A]:"fire-perf-compat",[C]:"fire-rc",[x]:"fire-rc-compat",[O]:"fire-gcs",[D]:"fire-gcs-compat",[N]:"fire-fst",[R]:"fire-fst-compat","fire-js":"fire-js",[P]:"fire-js-all"},F=new Map,j=new Map;function U(e,t){try{e.container.addComponent(t)}catch(n){l.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function V(e,t){e.container.addOrOverwriteComponent(t)}function B(e){const t=e.name;if(j.has(t))return l.debug(`There were multiple attempts to register component ${t}.`),!1;j.set(t,e);for(const t of F.values())U(t,e);return!0}function q(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function z(e,t,n=L){q(e,t).clearInstance(n)}function $(){j.clear()}const G=new s.FA("app","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invali
2d-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}."});class K{constructor(e,t,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new r.uA("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw G.create("app-deleted",{appName:this._name})}}const W="9.23.0";function H(e,t={}){let n=e;"object"!=typeof t&&(t={name:t});const i=Object.assign({name:L,automaticDataCollectionEnabled:!1},t),o=i.name;if("string"!=typeof o||!o)throw G.create("bad-app-name",{appName:String(o)});if(n||(n=(0,s.T9)()),!n)throw G.create("no-options");const a=F.get(o);if(a){if((0,s.bD)(n,a.options)&&(0,s.bD)(i,a.config))return a;throw G.create("duplicate-app",{appName:o})}const c=new r.h1(o);for(const e of j.values())c.addComponent(e);const u=new K(n,i,c);return F.set(o,u),u}function Q(e=L){const t=F.get(e);if(!t&&e===L&&(0,s.T9)())return H();if(!t)throw G.create("no-app",{appName:e});return t}function Y(){return Array.from(F.values())}async function X(e){const t=e.name;F.has(t)&&(F.delete(t),await Promise.all(e.container.getProviders().map(e=>e.delete())),e.isDeleted=!0)}function J(e,t,n){var i;let s=null!==(i=M[e])&&void 0!==i?i:e;n&&(s+=`-${n}`);const o=s.match(/\s|\//),a=t.match(/\s|\//);if(o||a){const e=[`Unable to register library "${s}" with version "${t}":`];return o&&e.push(`library name "${s}" contains illegal characters (whitespace or "/")`),o&&a&&e.push("and"),a&&e.push(`version name "${t}" contains illegal characters (whitespace or "/")`),void l.warn(e.join(" "))}B(new r.uA(`${s}-version`,()=>({library:s,version:t}),"VERSION"))}function Z(e,t){if(null!==e&&"function"!=typeof e)throw G.create("invalid-log-argument");(0,i.Ey)(e,t)}function ee(e){(0,i.He)(e)}const te="firebase-heartbeat-store";let ne=null;function re(){return ne||(ne=(0,o.openDB)("firebase-heartbeat-database",1,{upgrade:(e,t)=>{0===t&&e.createObjectStore(te)}}).catch(e=>{throw G.create("idb-open",{originalErrorMessage:e.message})})),ne}async function ie(e,t){try{const n=(await re()).transaction(te,"readwrite"),r=n.objectStore(te);await r.put(t,se(e)),await n.done}catch(e){if(e instanceof s.g)l.warn(e.message);else{const t=G.create("idb-set",{originalErrorMessage:null==e?void 0:e.message});l.warn(t.message)}}}function se(e){return`${e.name}!${e.options.appId}`}class oe{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new ce(t),this._heartbeatsCachePromise=this._storage.read().then(e=>(this._heartbeatsCache=e,e))}async triggerHeartbeat(){const e=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),t=ae();if(null===this._heartbeatsCache&&(this._heartbeatsCache=await this._heartbeatsCachePromise),this._heartbeatsCache.lastSentHeartbeatDate!==t&&!this._heartbeatsCache.heartbeats.some(e=>e.date===t))return this._heartbeatsCache.heartbeats.push({date:t,agent:e}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(e=>{const t=new Date(e.date).valueOf();return Date.now()-t<=2592e6}),this._storage.overwrite(this._heartbeatsCache)}
2async getHeartbeatsHeader(){if(null===this._heartbeatsCache&&await this._heartbeatsCachePromise,null===this._heartbeatsCache||0===this._heartbeatsCache.heartbeats.length)return"";const e=ae(),{heartbeatsToSend:t,unsentEntries:n}=function(e,t=1024){const n=[];let r=e.slice();for(const i of e){const e=n.find(e=>e.agent===i.agent);if(e){if(e.dates.push(i.date),ue(n)>t){e.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),ue(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}(this._heartbeatsCache.heartbeats),r=(0,s.Uj)(JSON.stringify({version:2,heartbeats:t}));return this._heartbeatsCache.lastSentHeartbeatDate=e,n.length>0?(this._heartbeatsCache.heartbeats=n,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),r}}function ae(){return(new Date).toISOString().substring(0,10)}class ce{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return!!(0,s.zW)()&&(0,s.eX)().then(()=>!0).catch(()=>!1)}async read(){return await this._canUseIndexedDBPromise&&await async function(e){try{const t=await re();return await t.transaction(te).objectStore(te).get(se(e))}catch(e){if(e instanceof s.g)l.warn(e.message);else{const t=G.create("idb-get",{originalErrorMessage:null==e?void 0:e.message});l.warn(t.message)}}}(this.app)||{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return ie(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:e.heartbeats})}}async add(e){var t;if(await this._canUseIndexedDBPromise){const n=await this.read();return ie(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:[...n.heartbeats,...e.heartbeats]})}}}function ue(e){return(0,s.Uj)(JSON.stringify({version:2,heartbeats:e})).length}B(new r.uA("platform-logger",e=>new a(e),"PRIVATE")),B(new r.uA("heartbeat",e=>new oe(e),"PRIVATE")),J(c,u,""),J(c,u,"esm2017"),J("fire-js","")},27158:function(e){e.exports="\t\n\v\f\r  áââââââ
ââââââ¯âã\u2028\u2029\ufeff"},27485:function(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},28853:function(e,t,n){var r=n(61581);e.exports=r},29656:function(e,t,n){"use strict";n.r(t),n.d(t,{deleteDB:function(){return m},openDB:function(){return g},unwrap:function(){return p},wrap:function(){return f}});const r=(e,t)=>t.some(t=>e instanceof t);let i,s;const o=new WeakMap,a=new WeakMap,c=new WeakMap,u=new WeakMap,l=new WeakMap;let h={get(e,t,n){if(e instanceof IDBTransaction){if("done"===t)return a.get(e);if("objectStoreNames"===t)return e.objectStoreNames||c.get(e);if("store"===t)return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return f(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&("done"===t||"store"===t)||t in e}};function d(e){return"function"==typeof e?(t=e)!==IDBDatabase.prototype.transaction||"objectStoreNames"in IDBTransaction.prototype?(s||(s=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])).includes(t)?function(...e){return t.apply(p(this),e),f(o.get(this))}:function(...e){return f(t.apply(p(this),e))}:function(e,...n){const r=t.call(p(this),e,...n);return c.set(r,e.sort?e.sort():[e]),f(r)}:(e instanceof IDBTransaction&&function(e){if(a.has(e))return;const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("complete",i),e.removeEventListener("error",s),e.removeEventListener("abort",s)},i=()=>{t(),r()},s=()=>{n(e.error||new DOMException("AbortError","AbortError")),r()};e.addEventListener("complete",i),e.addEventListener("error",s),e.addEventListener("abort",s)});a.set(e,t)}(e),r(e,i||(i=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(e,h):e);var t}function f(e){if(e instanceof IDBRequest)return function(e){const t=new Promise((t,n)=>{const r=()=>{e.removeEventListener("success",i),e.removeEventListener("error",s)},i=()=>{t(f(e.result)),r()},s=()=>{n(e.error),r()};e.addEventListener("success",i),e.addEventListener("error",s)});return t.then(t=>{t instanceof IDBCursor&&o.set(t,e)}).catch(()=>{}),l.set(t,e),t}(e);if(u.has(e))return u.get(e);const t=d(e);return t!==e&&(u.set(e,t),l.set(t,e)),t}const p=e=>l.get(e);function g(e,t,{blocked:n,upgrade:r,blocking:i,terminated:s}={}){const o=indexedDB.open(e,t),a=f(o);return r&&o.addEventListener("upgradeneeded",e=>{r(f(o.result),e.oldVersion,e.newVersion,f(o.transaction),e)}),n&&o.addEventListener("blocked",e=>n(e.oldVersion,e.newVersion,e)),a.then(e=>{s&&e.addEventListener("close",()=>s()),i&&e.addEventListener("versionchange",e=>i(e.oldVersion,e.newVersion,e))}).catch(()=>{}),a}function m(e,{blocked:t}={}){const n=indexedDB.deleteDatabase(e);return t&&n.addEventListener("blocked",e=>t(e.oldVersion,e)),f(n).then(()=>{})}const v=["get","getKey","getAll","getAllKeys","count"],y=["put","add","delete","clear"],w=new Map;function b(e,t){if(!(e instanceof IDBDatabase)||t in e||"string"!=typeof t)return;if(w.get(t))return w.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=y.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!i&&!v.includes(n))return;const s=async function(e,...t){const s=this.transaction(e,i?"readwrite":"readonly");let o=s.store;
2return r&&(o=o.index(t.shift())),(await Promise.all([o[n](...t),i&&s.done]))[0]};return w.set(t,s),s}var _;_=h,h={..._,get:(e,t,n)=>b(e,t)||_.get(e,t,n),has:(e,t)=>!!b(e,t)||_.has(e,t)}},30932:function(e,t,n){var r=n(63661),i=n(12368),s=n(63293);e.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var n=s.f(e);return(0,n.resolve)(t),n.promise}},31035:function(e,t,n){"use strict";var r=n(35959),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},s={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function c(e){return r.isMemo(e)?o:a[e.$$typeof]||i}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=o;var u=Object.defineProperty,l=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(p){var i=f(n);i&&i!==p&&e(t,i,r)}var o=l(n);h&&(o=o.concat(h(n)));for(var a=c(t),g=c(n),m=0;m<o.length;++m){var v=o[m];if(!(s[v]||r&&r[v]||g&&g[v]||a&&a[v])){var y=d(n,v);try{u(t,v,y)}catch(e){}}}}return t}},31863:function(e,t,n){var r=n(97004),i=n(5686);r({target:"Object",stat:!0,forced:!i,sham:!i},{defineProperties:n(7967)})},32145:function(e,t,n){"use strict";var r=n(97004),i=n(61581),s=n(48793),o=n(86333),a=n(5686),c=n(39278),u=n(22710),l=n(99569),h=n(24060),d=n(4794),f=n(12368),p=n(63661),g=n(54595),m=n(84263),v=n(7099),y=n(70354),w=n(68562),b=n(33922),_=n(83982),I=n(79164),E=n(77347),T=n(78825),S=n(96435),k=n(91635),A=n(11941),C=n(75748),x=n(1391),O=n(84201),D=n(96331),N=n(18002),R=n(85929),P=n(12341),L=n(39425),M=n(42349),F=n(82651),j=n(25403).forEach,U=O("hidden"),V="Symbol",B="prototype",q=R("toPrimitive"),z=F.set,$=F.getterFor(V),G=Object[B],K=i.Symbol,W=s("JSON","stringify"),H=T.f,Q=S.f,Y=I.f,X=k.f,J=x("symbols"),Z=x("op-symbols"),ee=x("string-to-symbol-registry"),te=x("symbol-to-string-registry"),ne=x("wks"),re=i.QObject,ie=!re||!re[B]||!re[B].findChild,se=a&&l(function(){return 7!=w(Q({},"a",{get:function(){return Q(this,"a",{value:7}).a}})).a})?function(e,t,n){var r=H(G,t);r&&delete G[t],Q(e,t,n),r&&e!==G&&Q(G,t,r)}:Q,oe=function(e,t){var n=J[e]=w(K[B]);return z(n,{type:V,tag:e,description:t}),a||(n.description=t),n},ae=u?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof K},ce=function(e,t,n){e===G&&ce(Z,t,n),p(e);var r=v(t,!0);return p(n),h(J,r)?(n.enumerable?(h(e,U)&&e[U][r]&&(e[U][r]=!1),n=w(n,{enumerable:y(0,!1)})):(h(e,U)||Q(e,U,y(1,{})),e[U][r]=!0),se(e,r,n)):Q(e,r,n)},ue=function(e,t){p(e);var n=m(t),r=b(n).concat(fe(n));return j(r,function(t){a&&!le.call(n,t)||ce(e,t,n[t])}),e},le=function(e){var t=v(e,!0),n=X.call(this,t);return!(this===G&&h(J,t)&&!h(Z,t))&&(!(n||!h(this,t)||!h(J,t)||h(this,U)&&this[U][t])||n)},he=function(e,t){var n=m(e),r=v(t,!0);if(n!==G||!h(J,r)||h(Z,r)){var i=H(n,r);return!i||!h(J,r)||h(n,U)&&n[U][r]||(i.enumerable=!0),i}},de=function(e){var t=Y(m(e)),n=[];return j(t,function(e){h(J,e)||h(D,e)||n.push(e)}),n},fe=function(e){var t=e===G,n=Y(t?Z:m(e)),r=[];return j(n,function(e){!h(J,e)||t&&!h(G,e)||r.push(J[e])}),r};c||(K=function(){if(this instanceof K)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=N(e),n=function(e){this===G&&n.call(Z,e),h(this,U)&&h(this[U],t)&&(this[U][t]=!1),se(this,t,y(1,e))};return a&&ie&&se(G,t,{configurable:!0,set:n}),oe(t,e)},C(K[B],"toString",function(){return $(this).tag}),C(K,"withoutSetter",function(e){return oe(N(e),e)}),k.f=le,S.f=ce,T.f=he,_.f=I.f=de,E.f=fe,P.f=function(e){return oe(R(e),e)},a&&(Q(K[B],"description",{configurable:!0,get:function(){return $(this).description}}),o||C(G,"propertyIsEnumerable",le,{unsafe:!0}))),r({global:!0,wrap:!0,forced:!c,sham:!c},{Symbol:K}),j(b(ne),function(e){L(e)}),r({target:V,stat:!0,forced:!c},{for:function(e){var t=String(e);if(h(ee,t))return ee[t];var n=K(t);return ee[t]=n,te[n]=t,n},keyFor:function(e){if(!ae(e))throw TypeError(e+" is not a symbol");if(h(te,e))return te[e]}
2,useSetter:function(){ie=!0},useSimple:function(){ie=!1}}),r({target:"Object",stat:!0,forced:!c,sham:!a},{create:function(e,t){return void 0===t?w(e):ue(w(e),t)},defineProperty:ce,defineProperties:ue,getOwnPropertyDescriptor:he}),r({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:de,getOwnPropertySymbols:fe}),r({target:"Object",stat:!0,forced:l(function(){E.f(1)})},{getOwnPropertySymbols:function(e){return E.f(g(e))}}),W&&r({target:"JSON",stat:!0,forced:!c||l(function(){var e=K();return"[null]"!=W([e])||"{}"!=W({a:e})||"{}"!=W(Object(e))})},{stringify:function(e,t,n){for(var r,i=[e],s=1;arguments.length>s;)i.push(arguments[s++]);if(r=t,(f(t)||void 0!==e)&&!ae(e))return d(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!ae(t))return t}),i[1]=t,W.apply(null,i)}}),K[B][q]||A(K[B],q,K[B].valueOf),M(K,V),D[U]=!0},32242:function(e,t,n){"use strict";var r=n(79177).charAt,i=n(82651),s=n(8216),o="String Iterator",a=i.set,c=i.getterFor(o);s(String,"String",function(e){a(this,{type:o,string:String(e),index:0})},function(){var e,t=c(this),n=t.string,i=t.index;return i>=n.length?{value:void 0,done:!0}:(e=r(n,i),t.index+=e.length,{value:e,done:!1})})},33001:function(e,t,n){var r=n(97004),i=n(61581),s=n(72134),o=[].slice,a=function(e){return function(t,n){var r=arguments.length>2,i=r?o.call(arguments,2):void 0;return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,n)}};r({global:!0,bind:!0,forced:/MSIE .\./.test(s)},{setTimeout:a(i.setTimeout),setInterval:a(i.setInterval)})},33922:function(e,t,n){var r=n(1422),i=n(27485);e.exports=Object.keys||function(e){return r(e,i)}},34068:function(e,t,n){"use strict";var r,i,s,o,a=n(97004),c=n(86333),u=n(61581),l=n(48793),h=n(75080),d=n(75748),f=n(59030),p=n(70489),g=n(42349),m=n(4427),v=n(12368),y=n(1404),w=n(77629),b=n(60220),_=n(762),I=n(39098),E=n(38091),T=n(65927).set,S=n(49281),k=n(30932),A=n(3027),C=n(63293),x=n(52505),O=n(82651),D=n(4754),N=n(85929),R=n(93796),P=n(89750),L=n(1106),M=N("species"),F="Promise",j=O.get,U=O.set,V=O.getterFor(F),B=h&&h.prototype,q=h,z=B,$=u.TypeError,G=u.document,K=u.process,W=C.f,H=W,Q=!!(G&&G.createEvent&&u.dispatchEvent),Y="function"==typeof PromiseRejectionEvent,X="unhandledrejection",J=!1,Z=D(F,function(){var e=b(q)!==String(q);if(!e&&66===L)return!0;if(c&&!z.finally)return!0;if(L>=51&&/native code/.test(q))return!1;var t=new q(function(e){e(1)}),n=function(e){e(function(){},function(){})};return(t.constructor={})[M]=n,!(J=t.then(function(){})instanceof n)||!e&&R&&!Y}),ee=Z||!I(function(e){q.all(e).catch(function(){})}),te=function(e){var t;return!(!v(e)||"function"!=typeof(t=e.then))&&t},ne=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;S(function(){for(var r=e.value,i=1==e.state,s=0;n.length>s;){var o,a,c,u=n[s++],l=i?u.ok:u.fail,h=u.resolve,d=u.reject,f=u.domain;try{l?(i||(2===e.rejection&&oe(e),e.rejection=1),!0===l?o=r:(f&&f.enter(),o=l(r),f&&(f.exit(),c=!0)),o===u.promise?d($("Promise-chain cycle")):(a=te(o))?a.call(o,h,d):h(o)):d(r)}catch(e){f&&!c&&f.exit(),d(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&ie(e)})}},re=function(e,t,n){var r,i;Q?((r=G.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),u.dispatchEvent(r)):r={promise:t,reason:n},!Y&&(i=u["on"+e])?i(r):e===X&&A("Unhandled promise rejection",n)},ie=function(e){T.call(u,function(){var t,n=e.facade,r=e.value;if(se(e)&&(t=x(function(){P?K.emit("unhandledRejection",r,n):re(X,n,r)}),e.rejection=P||se(e)?2:1,t.error))throw t.value})},se=function(e){return 1!==e.rejection&&!e.parent},oe=function(e){T.call(u,function(){var t=e.facade;P?K.emit("rejectionHandled",t):re("rejectionhandled",t,e.value)})},ae=function(e,t,n){return function(r){e(t,r,n)}},ce=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,ne(e,!0))},ue=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw $("Promise can't be resolved itself");var r=te(t);r?S(function(){var n={done:!1};try{r.call(t,ae(ue,n,e),ae(ce,n,e))}catch(t){ce(n,t,e)}}):(e.value=t,e.state=1,ne(e,!1))}catch(t){ce({done:!1},t,e)}}};if(Z&&(z=(q=function(e){w(this,q,F),y(e),r.call(this);var t=j(this);try{e(ae(ue,t),ae(ce,t))}catch(e){ce(t,e)}}).prototype,(r=function(e){U(this,{type:F,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=f(z,{then:function(e,t){var n=V(this),r=W(E(this,q));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=P?K.domain:void 0,n.parent=!0,n.reactions.push(r),
20!=n.state&&ne(n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),i=function(){var e=new r,t=j(e);this.promise=e,this.resolve=ae(ue,t),this.reject=ae(ce,t)},C.f=W=function(e){return e===q||e===s?new i(e):H(e)},!c&&"function"==typeof h&&B!==Object.prototype)){o=B.then,J||(d(B,"then",function(e,t){var n=this;return new q(function(e,t){o.call(n,e,t)}).then(e,t)},{unsafe:!0}),d(B,"catch",z.catch,{unsafe:!0}));try{delete B.constructor}catch(e){}p&&p(B,z)}a({global:!0,wrap:!0,forced:Z},{Promise:q}),g(q,F,!1,!0),m(F),s=l(F),a({target:F,stat:!0,forced:Z},{reject:function(e){var t=W(this);return t.reject.call(void 0,e),t.promise}}),a({target:F,stat:!0,forced:c||Z},{resolve:function(e){return k(c&&this===s?q:this,e)}}),a({target:F,stat:!0,forced:ee},{all:function(e){var t=this,n=W(t),r=n.resolve,i=n.reject,s=x(function(){var n=y(t.resolve),s=[],o=0,a=1;_(e,function(e){var c=o++,u=!1;s.push(void 0),a++,n.call(t,e).then(function(e){u||(u=!0,s[c]=e,--a||r(s))},i)}),--a||r(s)});return s.error&&i(s.value),n.promise},race:function(e){var t=this,n=W(t),r=n.reject,i=x(function(){var i=y(t.resolve);_(e,function(e){i.call(t,e).then(n.resolve,r)})});return i.error&&r(i.value),n.promise}})},34775:function(e,t,n){"use strict";n.d(t,{eO:function(){return f},Ay:function(){return w},qX:function(){return p},KK:function(){return y}});var r=1/60*1e3,i="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},s="undefined"!=typeof window?function(e){return window.requestAnimationFrame(e)}:function(e){return setTimeout(function(){return e(i())},r)},o=!0,a=!1,c=!1,u={delta:0,timestamp:0},l=["read","update","preRender","render","postRender"],h=l.reduce(function(e,t){return e[t]=function(e){var t=[],n=[],r=0,i=!1,s=new WeakSet,o={schedule:function(e,o,a){void 0===o&&(o=!1),void 0===a&&(a=!1);var c=a&&i,u=c?t:n;return o&&s.add(e),-1===u.indexOf(e)&&(u.push(e),c&&i&&(r=t.length)),e},cancel:function(e){var t=n.indexOf(e);-1!==t&&n.splice(t,1),s.delete(e)},process:function(a){var c;if(i=!0,t=(c=[n,t])[0],(n=c[1]).length=0,r=t.length)for(var u=0;u<r;u++){var l=t[u];l(a),s.has(l)&&(o.schedule(l),e())}i=!1}};return o}(function(){return a=!0}),e},{}),d=l.reduce(function(e,t){var n=h[t];return e[t]=function(e,t,r){return void 0===t&&(t=!1),void 0===r&&(r=!1),a||v(),n.schedule(e,t,r)},e},{}),f=l.reduce(function(e,t){return e[t]=h[t].cancel,e},{}),p=l.reduce(function(e,t){return e[t]=function(){return h[t].process(u)},e},{}),g=function(e){return h[e].process(u)},m=function(e){a=!1,u.delta=o?r:Math.max(Math.min(e-u.timestamp,40),1),u.timestamp=e,c=!0,l.forEach(g),c=!1,a&&(o=!1,s(m))},v=function(){a=!0,o=!0,c||s(m)},y=function(){return u},w=d},35285:function(e,t,n){"use strict";n.r(t),n.d(t,{__addDisposableResource:function(){return P},__assign:function(){return s},__asyncDelegator:function(){return S},__asyncGenerator:function(){return T},__asyncValues:function(){return k},__await:function(){return E},__awaiter:function(){return p},__classPrivateFieldGet:function(){return D},__classPrivateFieldIn:function(){return R},__classPrivateFieldSet:function(){return N},__createBinding:function(){return m},__decorate:function(){return a},__disposeResources:function(){return M},__esDecorate:function(){return u},__exportStar:function(){return v},__extends:function(){return i},__generator:function(){return g},__importDefault:function(){return O},__importStar:function(){return x}
vendor: 4,570 bytes, line 2
2,__makeTemplateObject:function(){return A},__metadata:function(){return f},__param:function(){return c},__propKey:function(){return h},__read:function(){return w},__rest:function(){return o},__runInitializers:function(){return l},__setFunctionName:function(){return d},__spread:function(){return b},__spreadArray:function(){return I},__spreadArrays:function(){return _},__values:function(){return y}});var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var s=function(){return s=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},s.apply(this,arguments)};function o(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function a(e,t,n,r){var i,s=arguments.length,o=s<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,n,o):i(t,n))||o);return s>3&&o&&Object.defineProperty(t,n,o),o}function c(e,t){return function(n,r){t(n,r,e)}}function u(e,t,n,r,i,s){function o(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var a,c=r.kind,u="getter"===c?"get":"setter"===c?"set":"value",l=!t&&e?r.static?e:e.prototype:null,h=t||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),d=!1,f=n.length-1;f>=0;f--){var p={};for(var g in r)p[g]="access"===g?{}:r[g];for(var g in r.access)p.access[g]=r.access[g];p.addInitializer=function(e){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(e||null))};var m=(0,n[f])("accessor"===c?{get:h.get,set:h.set}:h[u],p);if("accessor"===c){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=o(m.get))&&(h.get=a),(a=o(m.set))&&(h.set=a),(a=o(m.init))&&i.unshift(a)}else(a=o(m))&&("field"===c?i.unshift(a):h[u]=a)}l&&Object.defineProperty(l,r.name,h),d=!0}function l(e,t,n){for(var r=arguments.length>2,i=0;i<t.length;i++)n=r?t[i].call(e,n):t[i].call(e);return r?n:void 0}function h(e){return"symbol"==typeof e?e:"".concat(e)}function d(e,t,n){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function p(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}c((r=r.apply(e,t||[])).next())})}function g(e,t){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}var m=Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);
vendor: 5,160 bytes, line 2
2i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]};function v(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||m(t,e,n)}function y(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function w(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,s=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return o}function b(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(w(arguments[t]));return e}function _(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,i++)r[i]=s[o];return r}function I(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function E(e){return this instanceof E?(this.v=e,this):new E(e)}function T(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(e,t||[]),s=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(e){i[e]&&(r[e]=function(t){return new Promise(function(n,r){s.push([e,t,n,r])>1||a(e,t)})})}function a(e,t){try{(n=i[e](t)).value instanceof E?Promise.resolve(n.value.v).then(c,u):l(s[0][2],n)}catch(e){l(s[0][3],e)}var n}function c(e){a("next",e)}function u(e){a("throw",e)}function l(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function S(e){var t,n;return t={},r("next"),r("throw",function(e){throw e}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:E(e[r](t)),done:!1}:i?i(t):t}:i}}function k(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e=y(e),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise(function(r,i){!function(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}(r,i,(t=e[n](t)).done,t.value)})}}}function A(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var C=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function x(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&m(t,e,n);return C(t,e),t}function O(e){return e&&e.__esModule?e:{default:e}}function D(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)}function N(e,t,n,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,n):i?i.value=n:t.set(e,n),n}function R(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function P(e,t,n){if(null!=t){if("object"!=typeof t&&"function"!=typeof t)throw new TypeError("Object expected.");var r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=t[Symbol.asyncDispose]}if(void 0===r){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=t[Symbol.dispose]}if("function"!=typeof r)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:r,async:n})}else n&&e.stack.push({async:!0});return t}var L="function"==typeof SuppressedError?SuppressedError:function(e,t,n){var r=new Error(n);return r.name="SuppressedError",r.error=e,r.suppressed=t,r};function M(e){function t(t){e.error=e.hasError?new L(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function n(){for(;e.stack.length;){var r=e.stack.pop();try{var i=r.dispose&&r.dispose.call(r.value);if(r.async)return Promise.resolve(i).then(n,function(e){return t(e),n()})}catch(e){t(e)}}if(e.hasError)throw e.error}()}t.default={__extends:i,__assign:s,__rest:o,__decorate:a,__param:c,__metadata:f,__awaiter:p,__generator:g,__createBinding:m,__exportStar:v,__values:y,__read:w,__spread:b,__spreadArrays:_,__spreadArray:I,__await:E,__asyncGenerator:T,__asyncDelegator:S,__asyncValues:k,__makeTemplateOb
2ject:A,__importStar:x,__importDefault:O,__classPrivateFieldGet:D,__classPrivateFieldSet:N,__classPrivateFieldIn:R,__addDisposableResource:P,__disposeResources:M}},35959:function(e,t,n){"use strict";e.exports=n(95843)},37022:function(e,t,n){var r,i="__lodash_hash_undefined__",s=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,o=/^\w*$/,a=/^\./,c=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,u=/\\(\\)?/g,l=/^\[object .+?Constructor\]$/,h=/^(?:0|[1-9]\d*)$/,d="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,f="object"==typeof self&&self&&self.Object===Object&&self,p=d||f||Function("return this")(),g=Array.prototype,m=Function.prototype,v=Object.prototype,y=p["__core-js_shared__"],w=(r=/[^.]+$/.exec(y&&y.keys&&y.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",b=m.toString,_=v.hasOwnProperty,I=v.toString,E=RegExp("^"+b.call(_).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),T=p.Symbol,S=g.splice,k=M(p,"Map"),A=M(Object,"create"),C=T?T.prototype:void 0,x=C?C.toString:void 0;function O(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function D(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function N(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function R(e,t,n){var r=e[t];_.call(e,t)&&B(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function P(e,t){for(var n=e.length;n--;)if(B(e[n][0],t))return n;return-1}function L(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function M(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){if(!z(e)||w&&w in e)return!1;var t=function(e){var t=z(e)?I.call(e):"";return"[object Function]"==t||"[object GeneratorFunction]"==t}(e)||function(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}(e)?E:l;return t.test(function(e){if(null!=e){try{return b.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e))}(n)?n:void 0}function F(e,t){return!!(t=null==t?9007199254740991:t)&&("number"==typeof e||h.test(e))&&e>-1&&e%1==0&&e<t}O.prototype.clear=function(){this.__data__=A?A(null):{}},O.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},O.prototype.get=function(e){var t=this.__data__;if(A){var n=t[e];return n===i?void 0:n}return _.call(t,e)?t[e]:void 0},O.prototype.has=function(e){var t=this.__data__;return A?void 0!==t[e]:_.call(t,e)},O.prototype.set=function(e,t){return this.__data__[e]=A&&void 0===t?i:t,this},D.prototype.clear=function(){this.__data__=[]},D.prototype.delete=function(e){var t=this.__data__,n=P(t,e);return!(n<0||(n==t.length-1?t.pop():S.call(t,n,1),0))},D.prototype.get=function(e){var t=this.__data__,n=P(t,e);return n<0?void 0:t[n][1]},D.prototype.has=function(e){return P(this.__data__,e)>-1},D.prototype.set=function(e,t){var n=this.__data__,r=P(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},N.prototype.clear=function(){this.__data__={hash:new O,map:new(k||D),string:new O}},N.prototype.delete=function(e){return L(this,e).delete(e)},N.prototype.get=function(e){return L(this,e).get(e)},N.prototype.has=function(e){return L(this,e).has(e)},N.prototype.set=function(e,t){return L(this,e).set(e,t),this};var j=V(function(e){var t;e=null==(t=e)?"":function(e){if("string"==typeof e)return e;if($(e))return x?x.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}(t);var n=[];return a.test(e)&&n.push(""),e.replace(c,function(e,t,r,i){n.push(r?i.replace(u,"$1"):t||e)}),n});function U(e){if("string"==typeof e||$(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function V(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=e.apply(this,r);return n.cache=s.set(i,o),o};return n.cache=new(V.Cache||N),n}function B(e,t){return e===t||e!=e&&t!=t}V.Cache=N;var q=Array.isArray;function z(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function $(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==I.call(e)}e.exports=function(e,t,n){return null==e?e:function(e,t,n,r){if(!z(e))return e;t=function(e,t){if(q(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!$(e))||o.test(e)||!s.test(e)||null!=t&&e in Object(t)}(t,e)?[t]:function(e){return q(e)?e:j(e)}(t);for(var i=-1,a=t.length,c=a-1,u=e;null!=u&&++i<a;){var l=U(t[i]),h=n;if(i!=c){var d=u[l];void 0===(h=r?r(d,l,u):void 0)&&(h=z(d)?d:F(t[i+1])?[]:{})}R(u,l,h),u=u[l]}return e}(e,t,n)}},38091:function(e,t,n){var r=n(63661),i=n(1404),s=n(85929)("species");e.exports=function(e,t){var n,o=r(e).constructor;return void 0===o||null==(n=r(o)[s])?t:i(n)}},38095:function(e,t,n){"use strict";
2n.d(t,{bt:function(){return w},dg:function(){return m},ZZ:function(){return y},Sz:function(){return v},ip:function(){return T},wm:function(){return S},Te:function(){return E},po:function(){return f},tn:function(){return g},yT:function(){return p},a6:function(){return l},am:function(){return d},vT:function(){return h},sn:function(){return u}});var r,i=function(e){return function(t){return 1-e(1-t)}},s=function(e){return function(t){return t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2}},o=function(e){return function(t){return t*t*((e+1)*t-e)}},a=4/11,c=8/11,u=function(e){return e},l=function(e){return Math.pow(e,2)},h=i(l),d=s(l),f=function(e){return 1-Math.sin(Math.acos(e))},p=i(f),g=s(p),m=o(1.525),v=i(m),y=s(m),w=(r=o(1.525),function(e){return(e*=2)<1?.5*r(e):.5*(2-Math.pow(2,-10*(e-1)))}),b=4356/361,_=35442/1805,I=16061/1805,E=function(e){if(1===e||0===e)return e;var t=e*e;return e<a?7.5625*t:e<c?9.075*t-9.9*e+3.4:e<.9?b*t-_*e+I:10.8*e*e-20.52*e+10.72},T=i(E),S=function(e){return e<.5?.5*(1-E(1-2*e)):.5*E(2*e-1)+.5}},39098:function(e,t,n){var r=n(85929)("iterator"),i=!1;try{var s=0,o={next:function(){return{done:!!s++}},return:function(){i=!0}};o[r]=function(){return this},Array.from(o,function(){throw 2})}catch(e){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var s={};s[r]=function(){return{next:function(){return{done:n=!0}}}},e(s)}catch(e){}return n}},39278:function(e,t,n){var r=n(1106),i=n(99569);e.exports=!!Object.getOwnPropertySymbols&&!i(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41})},39425:function(e,t,n){var r=n(28853),i=n(24060),s=n(12341),o=n(96435).f;e.exports=function(e){var t=r.Symbol||(r.Symbol={});i(t,e)||o(t,e,{value:s.f(e)})}},39571:function(e,t,n){var r=n(84263),i=n(92636),s=n(16424),o=function(e){return function(t,n,o){var a,c=r(t),u=i(c.length),l=s(o,u);if(e&&n!=n){for(;u>l;)if((a=c[l++])!=a)return!0}else for(;u>l;l++)if((e||l in c)&&c[l]===n)return e||l||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},39793:function(e,t,n){var r=n(51387);e.exports=function(e){if(Array.isArray(e))return r(e)},e.exports.default=e.exports,e.exports.__esModule=!0},40080:function(e,t,n){"use strict";n.d(t,{Ad:function(){return ue},D5:function(){return Ne},KR:function(){return Fe},Mp:function(){return je},Mx:function(){return V},TZ:function(){return _},UC:function(){return ve},UY:function(){return y},XR:function(){return Me},ZH:function(){return M},_w:function(){return Pe},bp:function(){return Oe},nb:function(){return Ue},nw:function(){return P},p_:function(){return Re},qk:function(){return Le},uj:function(){return m},xc:function(){return ce},yb:function(){return De}});var r=n(26891),i=n(1266),s=n(94762);const o="firebasestorage.googleapis.com",a="storageBucket";class c extends i.g{constructor(e,t,n=0){super(h(e),`Firebase Storage: ${t} (${h(e)})`),this.status_=n,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,c.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return h(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}\n${this.customData.serverResponse}`:this.message=this._baseMessage}}var u,l;function h(e){return"storage/"+e}function d(){return new c(u.UNKNOWN,"An unknown error occurred, please check the error payload for server response.")}function f(){return new c(u.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function p(){return new c(u.CANCELED,"User canceled the upload/download.")}function g(){return new c(u.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function m(e){return new c(u.INVALID_ARGUMENT,e)}function v(){return new c(u.APP_DELETED,"The Firebase app was deleted.")}function y(e){return new c(u.INVALID_ROOT_OPERATION,"The operation '"+e+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function w(e,t){return new c(u.INVALID_FORMAT,"String does not match format '"+e+"': "+t)}function b(e){throw new c(u.INTERNAL_ERROR,"Internal error: "+e)}!function(e){e.UNKNOWN="unknown",e.OBJECT_NOT_FOUND="object-not-found",e.BUCKET_NOT_FOUND="bucket-not-found",e.PROJECT_NOT_FOUND="project-not-found",e.QUOTA_EXCEEDED="quota-exceeded",e.UNAUTHENTICATED="unauthenticated",e.UNAUTHORIZED="unauthorized",e.UNAUTHORIZED_APP="unauthorized-app",e.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",e.INVALID_CHECKSUM="invalid-checksum",e.CANCELED="canceled",e.INVALID_EVENT_NAME="invalid-event-name",e.INVALID_URL="invalid-url",e.INVALID_DEFAULT_BUCKET="invalid-default-bucket",e.NO_DEFAULT_BUCKET="no-default-bucket",e.CA
vendor: 5,080 bytes, line 2
2NNOT_SLICE_BLOB="cannot-slice-blob",e.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",e.NO_DOWNLOAD_URL="no-download-url",e.INVALID_ARGUMENT="invalid-argument",e.INVALID_ARGUMENT_COUNT="invalid-argument-count",e.APP_DELETED="app-deleted",e.INVALID_ROOT_OPERATION="invalid-root-operation",e.INVALID_FORMAT="invalid-format",e.INTERNAL_ERROR="internal-error",e.UNSUPPORTED_ENVIRONMENT="unsupported-environment"}(u||(u={}));class _{constructor(e,t){this.bucket=e,this.path_=t}get path(){return this.path_}get isRoot(){return 0===this.path.length}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,t){let n;try{n=_.makeFromUrl(e,t)}catch(t){return new _(e,"")}if(""===n.path)return n;throw r=e,new c(u.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+r+"'.");var r}static makeFromUrl(e,t){let n=null;const r="([A-Za-z0-9.\\-_]+)",i=new RegExp("^gs://"+r+"(/(.*))?$","i");function s(e){e.path_=decodeURIComponent(e.path)}const a=t.replace(/[.]/g,"\\."),l=[{regex:i,indices:{bucket:1,path:3},postModify:function(e){"/"===e.path.charAt(e.path.length-1)&&(e.path_=e.path_.slice(0,-1))}},{regex:new RegExp(`^https?://${a}/v[A-Za-z0-9_]+/b/${r}/o(/([^?#]*).*)?$`,"i"),indices:{bucket:1,path:3},postModify:s},{regex:new RegExp(`^https?://${t===o?"(?:storage.googleapis.com|storage.cloud.google.com)":t}/${r}/([^?#]*)`,"i"),indices:{bucket:1,path:2},postModify:s}];for(let t=0;t<l.length;t++){const r=l[t],i=r.regex.exec(e);if(i){const e=i[r.indices.bucket];let t=i[r.indices.path];t||(t=""),n=new _(e,t),r.postModify(n);break}}if(null==n)throw function(e){return new c(u.INVALID_URL,"Invalid URL '"+e+"'.")}(e);return n}}class I{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}function E(e){return"string"==typeof e||e instanceof String}function T(e){return S()&&e instanceof Blob}function S(){return"undefined"!=typeof Blob&&!(0,i.Ll)()}function k(e,t,n,r){if(r<t)throw m(`Invalid value for '${e}'. Expected ${t} or greater.`);if(r>n)throw m(`Invalid value for '${e}'. Expected ${n} or less.`)}function A(e,t,n){let r=t;return null==n&&(r=`https://${t}`),`${n}://${r}/v0${e}`}function C(e){const t=encodeURIComponent;let n="?";for(const r in e)e.hasOwnProperty(r)&&(n=n+(t(r)+"=")+t(e[r])+"&");return n=n.slice(0,-1),n}function x(e,t){const n=e>=500&&e<600,r=-1!==[408,429].indexOf(e),i=-1!==t.indexOf(e);return n||r||i}!function(e){e[e.NO_ERROR=0]="NO_ERROR",e[e.NETWORK_ERROR=1]="NETWORK_ERROR",e[e.ABORT=2]="ABORT"}(l||(l={}));class O{constructor(e,t,n,r,i,s,o,a,c,u,l,h=!0){this.url_=e,this.method_=t,this.headers_=n,this.body_=r,this.successCodes_=i,this.additionalRetryCodes_=s,this.callback_=o,this.errorCallback_=a,this.timeout_=c,this.progressCallback_=u,this.connectionFactory_=l,this.retry=h,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((e,t)=>{this.resolve_=e,this.reject_=t,this.start_()})}start_(){const e=(e,t)=>{const n=this.resolve_,r=this.reject_,i=t.connection;if(t.wasSuccessCode)try{const e=this.callback_(i,i.getResponse());void 0!==e?n(e):n()}catch(e){r(e)}else if(null!==i){const e=d();e.serverResponse=i.getErrorText(),this.errorCallback_?r(this.errorCallback_(i,e)):r(e)}else t.canceled?r(this.appDelete_?v():p()):r(f())};this.canceled_?e(0,new D(!1,null,!0)):this.backoffId_=function(e,t,n){let r=1,i=null,s=null,o=!1,a=0;function c(){return 2===a}let u=!1;function l(...e){u||(u=!0,t.apply(null,e))}function h(t){i=setTimeout(()=>{i=null,e(f,c())},t)}function d(){s&&clearTimeout(s)}function f(e,...t){if(u)return void d();if(e)return d(),void l.call(null,e,...t);if(c()||o)return d(),void l.call(null,e,...t);let n;r<64&&(r*=2),1===a?(a=2,n=0):n=1e3*(r+Math.random()),h(n)}let p=!1;function g(e){p||(p=!0,d(),u||(null!==i?(e||(a=2),clearTimeout(i),h(0)):e||(a=1)))}return h(0),s=setTimeout(()=>{o=!0,g(!0)},n),g}((e,t)=>{if(t)return void e(!1,new D(!1,null,!0));const n=this.connectionFactory_();this.pendingConnection_=n;const r=e=>{const t=e.loaded,n=e.lengthComputable?e.total:-1;null!==this.progressCallback_&&this.progressCallback_(t,n)};null!==this.progressCallback_&&n.addUploadProgressListener(r),n.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{null!==this.progressCallback_&&n.removeUploadProgressListener(r),this.pendingConnection_=null;const t=n.getErrorCode()===l.NO_ERROR,i=n.getStatus();if(!t||x(i,this.additionalRetryCodes_)&&this.retry){const t=n.getErrorCode()===l.ABORT;return void e(!1,new D(!1,null,t))}const s=-1!==this.successCodes_.indexOf(i);e(!0,new D(s,n))})},e,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,null!==this.backoffId_&&(0,this.backoffId_)(!1),null!==this.pendingConnection_&&this.pendingConnection_.abort()}}class D{constructor(e,t,n){this.wasSuccessCode=e,this.connection=t,this.canceled=!!n}}function N(){return"undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof WebKitBlobBuilder?Web
2KitBlobBuilder:void 0}function R(...e){const t=N();if(void 0!==t){const n=new t;for(let t=0;t<e.length;t++)n.append(e[t]);return n.getBlob()}if(S())return new Blob(e);throw new c(u.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}const P={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class L{constructor(e,t){this.data=e,this.contentType=t||null}}function M(e,t){switch(e){case P.RAW:return new L(F(t));case P.BASE64:case P.BASE64URL:return new L(j(e,t));case P.DATA_URL:return new L(function(e){const t=new U(e);return t.base64?j(P.BASE64,t.rest):function(e){let t;try{t=decodeURIComponent(e)}catch(e){throw w(P.DATA_URL,"Malformed data URL.")}return F(t)}(t.rest)}(t),new U(t).contentType)}throw d()}function F(e){const t=[];for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r<=127?t.push(r):r<=2047?t.push(192|r>>6,128|63&r):55296==(64512&r)?n<e.length-1&&56320==(64512&e.charCodeAt(n+1))?(r=65536|(1023&r)<<10|1023&e.charCodeAt(++n),t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r)):t.push(239,191,189):56320==(64512&r)?t.push(239,191,189):t.push(224|r>>12,128|r>>6&63,128|63&r)}return new Uint8Array(t)}function j(e,t){switch(e){case P.BASE64:{const n=-1!==t.indexOf("-"),r=-1!==t.indexOf("_");if(n||r)throw w(e,"Invalid character '"+(n?"-":"_")+"' found: is it base64url encoded?");break}case P.BASE64URL:{const n=-1!==t.indexOf("+"),r=-1!==t.indexOf("/");if(n||r)throw w(e,"Invalid character '"+(n?"+":"/")+"' found: is it base64 encoded?");t=t.replace(/-/g,"+").replace(/_/g,"/");break}}let n;try{n=function(e){if("undefined"==typeof atob)throw new c(u.UNSUPPORTED_ENVIRONMENT,"base-64 is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.");return atob(e)}(t)}catch(t){if(t.message.includes("polyfill"))throw t;throw w(e,"Invalid character found")}const r=new Uint8Array(n.length);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);return r}class U{constructor(e){this.base64=!1,this.contentType=null;const t=e.match(/^data:([^,]+)?,/);if(null===t)throw w(P.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");const n=t[1]||null;var r,i;null!=n&&(this.base64=(i=";base64",(r=n).length>=7&&r.substring(r.length-7)===i),this.contentType=this.base64?n.substring(0,n.length-7):n),this.rest=e.substring(e.indexOf(",")+1)}}class V{constructor(e,t){let n=0,r="";T(e)?(this.data_=e,n=e.size,r=e.type):e instanceof ArrayBuffer?(t?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),n=this.data_.length):e instanceof Uint8Array&&(t?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),n=e.length),this.size_=n,this.type_=r}size(){return this.size_}type(){return this.type_}slice(e,t){if(T(this.data_)){const s=(n=this.data_,r=e,i=t,n.webkitSlice?n.webkitSlice(r,i):n.mozSlice?n.mozSlice(r,i):n.slice?n.slice(r,i):null);return null===s?null:new V(s)}var n,r,i;{const n=new Uint8Array(this.data_.buffer,e,t-e);return new V(n,!0)}}static getBlob(...e){if(S()){const t=e.map(e=>e instanceof V?e.data_:e);return new V(R.apply(null,t))}{const t=e.map(e=>E(e)?M(P.RAW,e).data:e.data_);let n=0;t.forEach(e=>{n+=e.byteLength});const r=new Uint8Array(n);let i=0;return t.forEach(e=>{for(let t=0;t<e.length;t++)r[i++]=e[t]}),new V(r,!0)}}uploadData(){return this.data_}}function B(e){let t;try{t=JSON.parse(e)}catch(e){return null}return"object"!=typeof(n=t)||Array.isArray(n)?null:t;var n}function q(e){const t=e.lastIndexOf("/",e.length-2);return-1===t?e:e.slice(t+1)}function z(e,t){return t}class ${constructor(e,t,n,r){this.server=e,this.local=t||e,this.writable=!!n,this.xform=r||z}}let G=null;function K(){if(G)return G;const e=[];e.push(new $("bucket")),e.push(new $("generation")),e.push(new $("metageneration")),e.push(new $("name","fullPath",!0));const t=new $("name");t.xform=function(e,t){return function(e){return!E(e)||e.length<2?e:q(e)}(t)},e.push(t);const n=new $("size");return n.xform=function(e,t){return void 0!==t?Number(t):t},e.push(n),e.push(new $("timeCreated")),e.push(new $("updated")),e.push(new $("md5Hash",null,!0)),e.push(new $("cacheControl",null,!0)),e.push(new $("contentDisposition",null,!0)),e.push(new $("contentEncoding",null,!0)),e.push(new $("contentLanguage",null,!0)),e.push(new $("contentType",null,!0)),e.push(new $("metadata","customMetadata",!0)),G=e,G}function W(e,t,n){const r=B(t);return null===r?null:function(e,t,n){const r={type:"file"},i=n.length;for(let e=0;e<i;e++){const i=n[e];r[i.local]=i.xform(r,t[i.server])}return function(e,t){Object.defineProperty(e,"ref",{get:function(){const n=e.bucket,r=e.fullPath,i=new _(n,r);return t._makeStorageReference(i)}})}(r,e),r}(e,r,n)}function H(e,t){const n={},r=t.length;for(let i=0;i<r;i++){const r=t[i];r.writable&&(n[r.server]=e[r.local])}return JSON.stringify(n)}const Q="prefixes",Y="items";class X{constructor(e,t,n,r){this.url=e,this.method=t,this.handler=n,this.timeout=r,this.urlParam
2s={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}function J(e){if(!e)throw d()}function Z(e,t){return function(n,r){const i=W(e,r,t);return J(null!==i),i}}function ee(e){return function(t,n){let r;var i,s;return 401===t.getStatus()?r=t.getErrorText().includes("Firebase App Check token is invalid")?new c(u.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project."):new c(u.UNAUTHENTICATED,"User is not authenticated, please authenticate using Firebase Authentication and try again."):402===t.getStatus()?(s=e.bucket,r=new c(u.QUOTA_EXCEEDED,"Quota for bucket '"+s+"' exceeded, please view quota on https://firebase.google.com/pricing/.")):403===t.getStatus()?(i=e.path,r=new c(u.UNAUTHORIZED,"User does not have permission to access '"+i+"'.")):r=n,r.status=t.getStatus(),r.serverResponse=n.serverResponse,r}}function te(e){const t=ee(e);return function(n,r){let i=t(n,r);var s;return 404===n.getStatus()&&(s=e.path,i=new c(u.OBJECT_NOT_FOUND,"Object '"+s+"' does not exist.")),i.serverResponse=r.serverResponse,i}}function ne(e,t,n){const r=A(t.fullServerUrl(),e.host,e._protocol),i=e.maxOperationRetryTime,s=new X(r,"GET",Z(e,n),i);return s.errorHandler=te(t),s}function re(e,t,n,r,i){const s={};t.isRoot?s.prefix="":s.prefix=t.path+"/",n&&n.length>0&&(s.delimiter=n),r&&(s.pageToken=r),i&&(s.maxResults=i);const o=A(t.bucketOnlyServerUrl(),e.host,e._protocol),a=e.maxOperationRetryTime,c=new X(o,"GET",function(e,t){return function(n,r){const i=function(e,t,n){const r=B(n);return null===r?null:function(e,t,n){const r={prefixes:[],items:[],nextPageToken:n.nextPageToken};if(n[Q])for(const i of n[Q]){const n=i.replace(/\/$/,""),s=e._makeStorageReference(new _(t,n));r.prefixes.push(s)}if(n[Y])for(const i of n[Y]){const n=e._makeStorageReference(new _(t,i.name));r.items.push(n)}return r}(e,t,r)}(e,t,r);return J(null!==i),i}}(e,t.bucket),a);return c.urlParams=s,c.errorHandler=ee(t),c}function ie(e,t,n){const r=Object.assign({},n);return r.fullPath=e.path,r.size=t.size(),r.contentType||(r.contentType=function(e,t){return t&&t.type()||"application/octet-stream"}(0,t)),r}class se{constructor(e,t,n,r){this.current=e,this.total=t,this.finalized=!!n,this.metadata=r||null}}function oe(e,t){let n=null;try{n=e.getResponseHeader("X-Goog-Upload-Status")}catch(e){J(!1)}return J(!!n&&-1!==(t||["active"]).indexOf(n)),n}const ae=262144;const ce={STATE_CHANGED:"state_changed"},ue={RUNNING:"running",PAUSED:"paused",SUCCESS:"success",CANCELED:"canceled",ERROR:"error"};function le(e){switch(e){case"running":case"pausing":case"canceling":return ue.RUNNING;case"paused":return ue.PAUSED;case"success":return ue.SUCCESS;case"canceled":return ue.CANCELED;default:return ue.ERROR}}class he{constructor(e,t,n){if("function"==typeof e||null!=t||null!=n)this.next=e,this.error=null!=t?t:void 0,this.complete=null!=n?n:void 0;else{const t=e;this.next=t.next,this.error=t.error,this.complete=t.complete}}}function de(e){return(...t)=>{Promise.resolve().then(()=>e(...t))}}let fe=null;class pe{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=l.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=l.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=l.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,t,n,r){if(this.sent_)throw b("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(t,e,!0),void 0!==r)for(const e in r)r.hasOwnProperty(e)&&this.xhr_.setRequestHeader(e,r[e].toString());return void 0!==n?this.xhr_.send(n):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw b("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw b("cannot .getStatus() before sending");try{return this.xhr_.status}catch(e){return-1}}getResponse(){if(!this.sent_)throw b("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw b("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){null!=this.xhr_.upload&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){null!=this.xhr_.upload&&this.xhr_.upload.removeEventListener("progress",e)}}class ge extends pe{initXhr(){this.xhr_.responseType="text"}}function me(){return fe?fe():new ge}class ve{constructor(e,t,n=null){this._transferred=0,this._needToFetchStatus=!1,this._needToFetchMetadata=!1,this._observers=[],this._error=void 0,this._uploadUrl=void 0,this._request=void 0,this._chunkMultiplier=1,this._resolve=void 0,this._reject=void 0,this._ref=e,this._blob=t,this._metadata=n,this._mappings=K(),this._resumable=this._shouldDoResumable(this._blob),this._state="running",this._errorHandler=e=>{if(this._request=void 0,this._chunkMultiplier=1,e._codeEquals(u.CANCELED))this._needToFetchStatus=!0,this.completeTransitions_();else{const t=this.isExponentialBackoffExpired();if(x(e.status,[])){if(!t)return this.sleepTime=Math.max(2*this.sleepTime,1e3),this._needToFetchStatus=!0,void this.completeTransitions_();e=f()}this._error=e,this._transition("error")}},this._metadataErrorHandler=e=>{this._request=void 0,e._codeEquals(u.CANCELED)?this.completeTransitions_():(this._error=e,this._transition("error"))},this.sleepTime=0,this.maxSleepTime=this._ref.storage.maxUploadRetryTime,this._promise=new Promise((e,t)=>
2{this._resolve=e,this._reject=t,this._start()}),this._promise.then(null,()=>{})}isExponentialBackoffExpired(){return this.sleepTime>this.maxSleepTime}_makeProgressCallback(){const e=this._transferred;return t=>this._updateProgress(e+t)}_shouldDoResumable(e){return e.size()>262144}_start(){"running"===this._state&&void 0===this._request&&(this._resumable?void 0===this._uploadUrl?this._createResumable():this._needToFetchStatus?this._fetchStatus():this._needToFetchMetadata?this._fetchMetadata():this.pendingTimeout=setTimeout(()=>{this.pendingTimeout=void 0,this._continueUpload()},this.sleepTime):this._oneShotUpload())}_resolveToken(e){Promise.all([this._ref.storage._getAuthToken(),this._ref.storage._getAppCheckToken()]).then(([t,n])=>{switch(this._state){case"running":e(t,n);break;case"canceling":this._transition("canceled");break;case"pausing":this._transition("paused")}})}_createResumable(){this._resolveToken((e,t)=>{const n=function(e,t,n,r,i){const s=t.bucketOnlyServerUrl(),o=ie(t,r,i),a={name:o.fullPath},c=A(s,e.host,e._protocol),u={"X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${r.size()}`,"X-Goog-Upload-Header-Content-Type":o.contentType,"Content-Type":"application/json; charset=utf-8"},l=H(o,n),h=e.maxUploadRetryTime,d=new X(c,"POST",function(e){let t;oe(e);try{t=e.getResponseHeader("X-Goog-Upload-URL")}catch(e){J(!1)}return J(E(t)),t},h);return d.urlParams=a,d.headers=u,d.body=l,d.errorHandler=ee(t),d}(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),r=this._ref.storage._makeRequest(n,me,e,t);this._request=r,r.getPromise().then(e=>{this._request=void 0,this._uploadUrl=e,this._needToFetchStatus=!1,this.completeTransitions_()},this._errorHandler)})}_fetchStatus(){const e=this._uploadUrl;this._resolveToken((t,n)=>{const r=function(e,t,n,r){const i=e.maxUploadRetryTime,s=new X(n,"POST",function(e){const t=oe(e,["active","final"]);let n=null;try{n=e.getResponseHeader("X-Goog-Upload-Size-Received")}catch(e){J(!1)}n||J(!1);const i=Number(n);return J(!isNaN(i)),new se(i,r.size(),"final"===t)},i);return s.headers={"X-Goog-Upload-Command":"query"},s.errorHandler=ee(t),s}(this._ref.storage,this._ref._location,e,this._blob),i=this._ref.storage._makeRequest(r,me,t,n);this._request=i,i.getPromise().then(e=>{this._request=void 0,this._updateProgress(e.current),this._needToFetchStatus=!1,e.finalized&&(this._needToFetchMetadata=!0),this.completeTransitions_()},this._errorHandler)})}_continueUpload(){const e=ae*this._chunkMultiplier,t=new se(this._transferred,this._blob.size()),n=this._uploadUrl;this._resolveToken((r,i)=>{let s;try{s=function(e,t,n,r,i,s,o,a){const l=new se(0,0);if(o?(l.current=o.current,l.total=o.total):(l.current=0,l.total=r.size()),r.size()!==l.total)throw new c(u.SERVER_FILE_WRONG_SIZE,"Server recorded incorrect upload file size, please retry the upload.");const h=l.total-l.current;let d=h;i>0&&(d=Math.min(d,i));const f=l.current,p=f+d;let m="";m=0===d?"finalize":h===d?"upload, finalize":"upload";const v={"X-Goog-Upload-Command":m,"X-Goog-Upload-Offset":`${l.current}`},y=r.slice(f,p);if(null===y)throw g();const w=t.maxUploadRetryTime,b=new X(n,"POST",function(e,n){const i=oe(e,["active","final"]),o=l.current+d,a=r.size();let c;return c="final"===i?Z(t,s)(e,n):null,new se(o,a,"final"===i,c)},w);return b.headers=v,b.body=y.uploadData(),b.progressCallback=a||null,b.errorHandler=ee(e),b}(this._ref._location,this._ref.storage,n,this._blob,e,this._mappings,t,this._makeProgressCallback())}catch(e){return this._error=e,void this._transition("error")}const o=this._ref.storage._makeRequest(s,me,r,i,!1);this._request=o,o.getPromise().then(e=>{this._increaseMultiplier(),this._request=void 0,this._updateProgress(e.current),e.finalized?(this._metadata=e.metadata,this._transition("success")):this.completeTransitions_()},this._errorHandler)})}_increaseMultiplier(){ae*this._chunkMultiplier*2<33554432&&(this._chunkMultiplier*=2)}_fetchMetadata(){this._resolveToken((e,t)=>{const n=ne(this._ref.storage,this._ref._location,this._mappings),r=this._ref.storage._makeRequest
vendor: 5,123 bytes, line 2
2(n,me,e,t);this._request=r,r.getPromise().then(e=>{this._request=void 0,this._metadata=e,this._transition("success")},this._metadataErrorHandler)})}_oneShotUpload(){this._resolveToken((e,t)=>{const n=function(e,t,n,r,i){const s=t.bucketOnlyServerUrl(),o={"X-Goog-Upload-Protocol":"multipart"},a=function(){let e="";for(let t=0;t<2;t++)e+=Math.random().toString().slice(2);return e}();o["Content-Type"]="multipart/related; boundary="+a;const c=ie(t,r,i),u="--"+a+"\r\nContent-Type: application/json; charset=utf-8\r\n\r\n"+H(c,n)+"\r\n--"+a+"\r\nContent-Type: "+c.contentType+"\r\n\r\n",l="\r\n--"+a+"--",h=V.getBlob(u,r,l);if(null===h)throw g();const d={name:c.fullPath},f=A(s,e.host,e._protocol),p=e.maxUploadRetryTime,m=new X(f,"POST",Z(e,n),p);return m.urlParams=d,m.headers=o,m.body=h.uploadData(),m.errorHandler=ee(t),m}(this._ref.storage,this._ref._location,this._mappings,this._blob,this._metadata),r=this._ref.storage._makeRequest(n,me,e,t);this._request=r,r.getPromise().then(e=>{this._request=void 0,this._metadata=e,this._updateProgress(this._blob.size()),this._transition("success")},this._errorHandler)})}_updateProgress(e){const t=this._transferred;this._transferred=e,this._transferred!==t&&this._notifyObservers()}_transition(e){if(this._state!==e)switch(e){case"canceling":case"pausing":this._state=e,void 0!==this._request?this._request.cancel():this.pendingTimeout&&(clearTimeout(this.pendingTimeout),this.pendingTimeout=void 0,this.completeTransitions_());break;case"running":const t="paused"===this._state;this._state=e,t&&(this._notifyObservers(),this._start());break;case"paused":case"error":case"success":this._state=e,this._notifyObservers();break;case"canceled":this._error=p(),this._state=e,this._notifyObservers()}}completeTransitions_(){switch(this._state){case"pausing":this._transition("paused");break;case"canceling":this._transition("canceled");break;case"running":this._start()}}get snapshot(){const e=le(this._state);return{bytesTransferred:this._transferred,totalBytes:this._blob.size(),state:e,metadata:this._metadata,task:this,ref:this._ref}}on(e,t,n,r){const i=new he(t||void 0,n||void 0,r||void 0);return this._addObserver(i),()=>{this._removeObserver(i)}}then(e,t){return this._promise.then(e,t)}catch(e){return this.then(null,e)}_addObserver(e){this._observers.push(e),this._notifyObserver(e)}_removeObserver(e){const t=this._observers.indexOf(e);-1!==t&&this._observers.splice(t,1)}_notifyObservers(){this._finishPromise(),this._observers.slice().forEach(e=>{this._notifyObserver(e)})}_finishPromise(){if(void 0!==this._resolve){let e=!0;switch(le(this._state)){case ue.SUCCESS:de(this._resolve.bind(null,this.snapshot))();break;case ue.CANCELED:case ue.ERROR:de(this._reject.bind(null,this._error))();break;default:e=!1}e&&(this._resolve=void 0,this._reject=void 0)}}_notifyObserver(e){switch(le(this._state)){case ue.RUNNING:case ue.PAUSED:e.next&&de(e.next.bind(e,this.snapshot))();break;case ue.SUCCESS:e.complete&&de(e.complete.bind(e))();break;case ue.CANCELED:case ue.ERROR:default:e.error&&de(e.error.bind(e,this._error))()}}resume(){const e="paused"===this._state||"pausing"===this._state;return e&&this._transition("running"),e}pause(){const e="running"===this._state;return e&&this._transition("pausing"),e}cancel(){const e="running"===this._state||"pausing"===this._state;return e&&this._transition("canceling"),e}}class ye{constructor(e,t){this._service=e,this._location=t instanceof _?t:_.makeFromUrl(t,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,t){return new ye(e,t)}get root(){const e=new _(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return q(this._location.path)}get storage(){return this._service}get parent(){const e=function(e){if(0===e.length)return null;const t=e.lastIndexOf("/");return-1===t?"":e.slice(0,t)}(this._location.path);if(null===e)return null;const t=new _(this._location.bucket,e);return new ye(this._service,t)}_throwIfRoot(e){if(""===this._location.path)throw y(e)}}function we(e){const t={prefixes:[],items:[]};return be(e,t).then(()=>t)}async function be(e,t,n){const r={pageToken:n},i=await _e(e,r);t.prefixes.push(...i.prefixes),t.items.push(...i.items),null!=i.nextPageToken&&await be(e,t,i.nextPageToken)}function _e(e,t){null!=t&&"number"==typeof t.maxResults&&k("options.maxResults",1,1e3,t.maxResults);const n=t||{},r=re(e.storage,e._location,"/",n.pageToken,n.maxResults);return e.storage.makeRequestWithTokens(r,me)}function Ie(e){e._throwIfRoot("getDownloadURL");const t=function(e,t,n){const r=A(t.fullServerUrl(),e.host,e._protocol),i=e.maxOperationRetryTime,s=new X(r,"GET",function(e,t){return function(n,r){const i=W(e,r,t);return J(null!==i),function(e,t,n,r){const i=B(t);if(null===i)return null;if(!E(i.downloadTokens))return null;const s=i.downloadTokens;if(0===s.length)return null;const o=encodeURIComponent;return s.split(",").map(t=>{const i=e.bucket,s=e.fullPath;return A("/b/"+o(i)+"/o/"+o(s),n,r)+C({alt:"media",token:t})})[0]}(i,r,e.host,e._protocol)}}
2(e,n),i);return s.errorHandler=te(t),s}(e.storage,e._location,K());return e.storage.makeRequestWithTokens(t,me).then(e=>{if(null===e)throw new c(u.NO_DOWNLOAD_URL,"The given file does not have any download URLs.");return e})}function Ee(e,t){const n=function(e,t){const n=t.split("/").filter(e=>e.length>0).join("/");return 0===e.length?n:e+"/"+n}(e._location.path,t),r=new _(e._location.bucket,n);return new ye(e.storage,r)}function Te(e,t){if(e instanceof Ae){const n=e;if(null==n._bucket)throw new c(u.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+a+"' property when initializing the app?");const r=new ye(n,n._bucket);return null!=t?Te(r,t):r}return void 0!==t?Ee(e,t):e}function Se(e,t){if(t&&/^[A-Za-z]+:\/\//.test(t)){if(e instanceof Ae)return new ye(e,t);throw m("To use ref(service, url), the first argument must be a Storage instance.")}return Te(e,t)}function ke(e,t){const n=null==t?void 0:t[a];return null==n?null:_.makeFromBucketSpec(n,e)}class Ae{constructor(e,t,n,r,i){this.app=e,this._authProvider=t,this._appCheckProvider=n,this._url=r,this._firebaseVersion=i,this._bucket=null,this._host=o,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=12e4,this._maxUploadRetryTime=6e5,this._requests=new Set,this._bucket=null!=r?_.makeFromBucketSpec(r,this._host):ke(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,null!=this._url?this._bucket=_.makeFromBucketSpec(this._url,e):this._bucket=ke(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){k("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){k("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const t=await e.getToken();if(null!==t)return t.accessToken}return null}async _getAppCheckToken(){const e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new ye(this,e)}_makeRequest(e,t,n,r,i=!0){if(this._deleted)return new I(v());{const s=function(e,t,n,r,i,s,o=!0){const a=C(e.urlParams),c=e.url+a,u=Object.assign({},e.headers);return function(e,t){t&&(e["X-Firebase-GMPID"]=t)}(u,t),function(e,t){null!==t&&t.length>0&&(e.Authorization="Firebase "+t)}(u,n),function(e,t){e["X-Firebase-Storage-Version"]="webjs/"+(null!=t?t:"AppManager")}(u,s),function(e,t){null!==t&&(e["X-Firebase-AppCheck"]=t)}(u,r),new O(c,e.method,u,e.body,e.successCodes,e.additionalRetryCodes,e.handler,e.errorHandler,e.timeout,e.progressCallback,i,o)}(e,this._appId,n,r,t,this._firebaseVersion,i);return this._requests.add(s),s.getPromise().then(()=>this._requests.delete(s),()=>this._requests.delete(s)),s}}async makeRequestWithTokens(e,t){const[n,r]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,t,n,r).getPromise()}}const Ce="@firebase/storage",xe="0.11.2";function Oe(e,t,n){return function(e,t,n){return e._throwIfRoot("uploadBytesResumable"),new ve(e,new V(t),n)}(e=(0,i.Ku)(e),t,n)}function De(e){return function(e){e._throwIfRoot("getMetadata");const t=ne(e.storage,e._location,K());return e.storage.makeRequestWithTokens(t,me)}(e=(0,i.Ku)(e))}function Ne(e,t){return function(e,t){e._throwIfRoot("updateMetadata");const n=function(e,t,n,r){const i=A(t.fullServerUrl(),e.host,e._protocol),s=H(n,r),o=e.maxOperationRetryTime,a=new X(i,"PATCH",Z(e,r),o);return a.headers={"Content-Type":"application/json; charset=utf-8"},a.body=s,a.errorHandler=te(t),a}(e.storage,e._location,t,K());return e.storage.makeRequestWithTokens(n,me)}(e=(0,i.Ku)(e),t)}function Re(e,t){return _e(e=(0,i.Ku)(e),t)}function Pe(e){return we(e=(0,i.Ku)(e))}function Le(e){return Ie(e=(0,i.Ku)(e))}function Me(e){return function(e){e._throwIfRoot("deleteObject");const t=function(e,t){const n=A(t.fullServerUrl(),e.host,e._protocol),r=e.maxOperationRetryTime,i=new X(n,"DELETE",function(e,t){},r);return i.successCodes=[200,204],i.errorHandler=te(t),i}(e.storage,e._location);return e.storage.makeRequestWithTokens(t,me)}(e=(0,i.Ku)(e))}function Fe(e,t){return Se(e=(0,i.Ku)(e),t)}function je(e,t){return Ee(e,t)}function Ue(e,t,n,r={}){!function(e,t,n,r={}){e.host=`${t}:${n}`,e._protocol="http";const{mockUserToken:s}=r;s&&(e._overrideAuthToken="string"==typeof s?s:(0,i.Fy)(s,e.app.options.projectId))}(e,t,n,r)}(0,r._registerComponent)(new s.uA("storage",function(e,{instanceIdentifier:t}){const n=e.getProvider("app").getImmediate(),i=e.getProvider("auth-internal"),s=e.getProvider("app-check-internal");return new Ae(n,i,s,t,r.SDK_VERSION)},"PUBLIC").setMultipleInstances(!0)),(0,r.registerVersion)(Ce,xe,""),(0,r.registerVersion)(Ce,xe,"esm2017")},41551:function(e,t,n){var r=n(12368),i=n(4794),s=n(85929)("species");e.exports=function(e,t){var n;return i(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!i(n.prototype)?r(n)&&null===(n=n[s])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)}},42349:function(e,t,n){var r=n(96435).f,i=n(24060),s=n(85929)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,s)&&r(e,s,{configurable:!0,value:t})}},43465:function(e,t,n){"use strict";var r=n(97004),i=n(68437),s=n(93992);r({target:"String",proto:!0,forced:!n(52002)("includes")},{includes:function(e){return!!~String(s(this)).indexOf(i(e),arguments.length>1?arguments[1]:void 0)}})},44134:function(e,t,n){"use strict";n.r(t),n.d(t,{SWRConfig:function(){return O},cache:function(){return l},default:function(){return P},mutate:function(){return x},trigger:function(){return A},useSWRPages:function(){return R}});var r=n(37953),i=n(8686),s=n.n(i);function o(){return"undefined"==typeof document||void 0===document.visibilityState||"hidden"
2!==document.visibilityState}function a(){return void 0===navigator.onLine||navigator.onLine}var c=new WeakMap,u=0,l=new(function(){function e(e){void 0===e&&(e={}),this.__cache=new Map(Object.entries(e)),this.__listeners=[]}return e.prototype.get=function(e){var t=this.serializeKey(e)[0];return this.__cache.get(t)},e.prototype.set=function(e,t,n){void 0===n&&(n=!0);var r=this.serializeKey(e)[0];this.__cache.set(r,t),n&&x(e,t,!1),this.notify()},e.prototype.keys=function(){return Array.from(this.__cache.keys())},e.prototype.has=function(e){var t=this.serializeKey(e)[0];return this.__cache.has(t)},e.prototype.clear=function(e){void 0===e&&(e=!0),e&&this.__cache.forEach(function(e){return x(e,null,!1)}),this.__cache.clear(),this.notify()},e.prototype.delete=function(e,t){void 0===t&&(t=!0);var n=this.serializeKey(e)[0];t&&x(e,null,!1),this.__cache.delete(n),this.notify()},e.prototype.serializeKey=function(e){var t=null;if("function"==typeof e)try{e=e()}catch(t){e=""}return Array.isArray(e)?(t=e,e=function(e){if(!e.length)return"";for(var t="arg",n=0;n<e.length;++n){var r=void 0;null===e[n]||"object"!=typeof e[n]?r="string"==typeof e[n]?'"'+e[n]+'"':String(e[n]):c.has(e[n])?r=c.get(e[n]):(r=u,c.set(e[n],u++)),t+="@"+r}return t}(e)):e=String(e||""),[e,t,e?"err@"+e:""]},e.prototype.subscribe=function(e){var t=this;if("function"!=typeof e)throw new Error("Expected the listener to be a function.");var n=!0;return this.__listeners.push(e),function(){if(n){n=!1;var r=t.__listeners.indexOf(e);r>-1&&(t.__listeners[r]=t.__listeners[t.__listeners.length-1],t.__listeners.length--)}}},e.prototype.notify=function(){for(var e=0,t=this.__listeners;e<t.length;e++)(0,t[e])()},e}()),h={},d={},f={},p={},g={},m="undefined"!=typeof window&&navigator.connection&&-1!==["slow-2g","2g"].indexOf(navigator.connection.effectiveType),v={onLoadingSlow:function(){},onSuccess:function(){},onError:function(){},onErrorRetry:function(e,t,n,r,i){if(o()&&!(n.errorRetryCount&&i.retryCount>n.errorRetryCount)){var s=Math.min(i.retryCount||0,8),a=~~((Math.random()+.5)*(1<<s))*n.errorRetryInterval;setTimeout(r,a,i)}},errorRetryInterval:1e3*(m?10:5),focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:1e3*(m?5:3),refreshInterval:0,revalidateOnFocus:!0,revalidateOnReconnect:!0,refreshWhenHidden:!1,refreshWhenOffline:!1,shouldRetryOnError:!0,suspense:!1,compare:s()},y=!1;if("undefined"!=typeof window&&window.addEventListener&&!y){var w=function(){if(o()&&a())for(var e in f)f[e][0]&&f[e][0]()};window.addEventListener("visibilitychange",w,!1),window.addEventListener("focus",w,!1),y=!0}var b=v,_=(0,r.createContext)({});_.displayName="SWRConfigContext";var I=_,E=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function o(e){try{c(r.next(e))}catch(e){s(e)}}function a(e){try{c(r.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,a)}c((r=r.apply(e,t||[])).next())})},T=function(e,t){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,a])}}},S="undefined"==typeof window,k=S?r.useEffect:r.useLayoutEffect,A=function(e,t){void 0===t&&(t=!0);var n=l.serializeKey(e),r=n[0],i=n[2];if(!r)return Promise.resolve();var s=p[r];if(r&&s){for(var o=l.get(r),a=l.get(i),c=[],u=0;u<s.length;++u)c.push(s[u](t,o,a,u>0));return Promise.all(c).then(function(){return l.get(r)})}return Promise.resolve(l.get(r))},C=function(e,t,n){var r=p[e];if(e&&r)for(var i=0;i<r.length;++i)r[i](!1,t,n)},x=function(e,t,n){return void 0===n&&(n=!0),E(void 0,void 0,void 0,function(){var r,i,s,o,a,c,u,h,f,m;return T(this,function(v){switch(v.label){case 0:if(!(r=l.serializeKey(e)[0]))return[2];if(void 0===t)return[2,A(e,n)];if(g[r]=Date.now()-1,o=g[r],a=d[r],!t||"function"!=typeof t)return[3,5];v.label=1;case 1:return v.trys.push([1,3,,4]),[4,t(l.get(r))];case 2:return i=v.sent(),[3,4];case 3:return c=v.sent(),s=c,[3,4];case 4:return[3,11];case 5:if(!t||"function"!=typeof t.then)return[3,10];v.label=6;case 6:return v.trys.push([6,8,,9]),[4,t];case 7:return i=v.sent(),[3,9];case 8:return u=v.sent(),s=u,[3,9];case 9:return[3,11];case 10:i=t,v.label=11;case 11:if(o!==g[r]||a!==d[r]){if(s)throw s;return[2,i]}if(void 0!==i&&l.set(r,i,!1),h=p[r]){for(f=[],m=0;m<h.length;++m)f.push(h[m](!!n,i,s,m>0));return[2,Promise.all(f).then(function(){return l.get(r)})]}if(s)throw s;return[2,i]}})})},O=I.Provider,D=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var s=arguments[t],o=0,a=s.length;o<a;o++,i++)r[i]=s[o];return r},N=new Map;function R(e,t,n,i){void 0===i&&(i=[]);var s="_swr_page_count_"+e,o="_swr_page_offset_"+e,a=(0,r.useState)(l.get(s)||1),c=a[0],u=a[1],h=(0,r.useState)(l.get(o)||[null]),d=h[0],f=h[1],p=(0,r.useState)([]),g=p[0],m=p[1],v=(0,r.useRef)(t),y=(0,r.useRef)(!1),w=(0,r.useCallback)(function(e){var t=v.current(e);return t&&!t.length?y.current=!0:y.current=!1,t},[]),b=null===d[c],_=c===d.length,I=b&&1===c&&y.current,E=(0,r.useCallback)(function(){_||b||u(function(e){return l.set(s,e+1),e+1})},[_||b]),T=(0,r.useCallback)(t,i);return v.current=T,{pages:(0,r.useMemo)(function(){var t=function(e){return function(t){return g[e]&&g[e].data===t.data&&g[e].error===t.error&&g[e].revalidate===t.revalidate||setTimeout(function(){if(m(function(n){var r=D(n);return r[e]={data:t.data,error:t.error,revalidate:t.revalidate,isValidating:t.isValidating,mutate:t.mutate},r}),void 0!==t.data){var r=n(t,e);d[e+1]!==r&&f(function(t){var n=D(t);return n[e+1]=r,l.set(o,n),n})}}),t}},i=[];N.has(e)||N.set(e,[]);for(var s=N.get(e),a=0;a<c;++a)s[a]&&s[a].offset===d[a]&&s[a].pageFn===T||(s[a]={component:r.createElement(w,{key:"page-"+d[a]+"-"+a,offset:d[a],withSWR:t(a)}),pageFn:T,offset:d[a]}),i.push(s[a].component);return i},[T,c,g,d,e]),pageCount:c,pageSWRs:g,isLoadingMore:_,isReachingEnd:b,isEmpty:I,loadM
2ore:E}}var P=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i,s,c={};t.length>=1&&(i=t[0]),t.length>2?(s=t[1],c=t[2]):"function"==typeof t[1]?s=t[1]:"object"==typeof t[1]&&(c=t[1]);var u=l.serializeKey(i),m=u[0],v=u[1],y=u[2];c=Object.assign({},b,(0,r.useContext)(I),c),void 0===s&&(s=c.fetcher);var w=l.get(m)||c.initialData,_=l.get(y),A=(0,r.useRef)({data:!1,error:!1,isValidating:!1}),O=(0,r.useRef)({data:w,error:_,isValidating:!1}),D=(0,r.useState)(null)[1],N=(0,r.useCallback)(function(e){var t=!1;for(var n in e)O.current[n]=e[n],A.current[n]&&(t=!0);(t||c.suspense)&&D({})},[]),R=(0,r.useRef)(!1),P=(0,r.useRef)(m),L=(0,r.useRef)({emit:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];R.current||c[e].apply(c,t)}}),M=(0,r.useCallback)(function(e,t){return x(m,e,t)},[m]),F=(0,r.useCallback)(function(t){return void 0===t&&(t={}),E(e,void 0,void 0,function(){var e,n,r,i,o,a,u;return T(this,function(f){switch(f.label){case 0:if(!m||!s)return[2,!1];if(R.current)return[2,!1];t=Object.assign({dedupe:!1},t),e=!0,n=void 0!==h[m]&&t.dedupe,f.label=1;case 1:return f.trys.push([1,6,,7]),N({isValidating:!0}),r=void 0,i=void 0,n?(i=d[m],[4,h[m]]):[3,3];case 2:return r=f.sent(),[3,5];case 3:return h[m]&&(g[m]=Date.now()-1),c.loadingTimeout&&!l.get(m)&&setTimeout(function(){e&&L.current.emit("onLoadingSlow",m,c)},c.loadingTimeout),h[m]=null!==v?s.apply(void 0,v):s(m),d[m]=i=Date.now(),[4,h[m]];case 4:r=f.sent(),setTimeout(function(){delete h[m],delete d[m]},c.dedupingInterval),L.current.emit("onSuccess",r,m,c),f.label=5;case 5:return g[m]&&i<=g[m]?(N({isValidating:!1}),[2,!1]):(l.set(m,r,!1),l.set(y,void 0,!1),o={isValidating:!1},void 0!==O.current.error&&(o.error=void 0),c.compare(O.current.data,r)||(o.data=r),N(o),n||C(m,r,void 0),[3,7]);case 6:return a=f.sent(),delete h[m],delete d[m],l.set(y,a,!1),O.current.error!==a&&(N({isValidating:!1,error:a}),n||C(m,void 0,a)),L.current.emit("onError",a,m,c),c.shouldRetryOnError&&(u=(t.retryCount||0)+1,L.current.emit("onErrorRetry",a,m,c,F,Object.assign({dedupe:!0},t,{retryCount:u}))),[3,7];case 7:return e=!1,[2,!0]}})})},[m]);if(k(function(){if(m){R.current=!1;var e=O.current.data,t=l.get(m)||c.initialData;P.current===m&&c.compare(e,t)||(N({data:t}),P.current=m);var n,r=function(){return F({dedupe:!0})};(c.revalidateOnMount||!c.initialData&&void 0===c.revalidateOnMount)&&(void 0!==t&&!S&&window.requestIdleCallback?window.requestIdleCallback(r):r()),c.revalidateOnFocus&&(n=function(e,t){var n=!1;return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];n||(n=!0,e.apply(void 0,r),setTimeout(function(){return n=!1},t))}}(r,c.focusThrottleInterval),f[m]?f[m].push(n):f[m]=[n]);var i=function(e,t,n,i){void 0===e&&(e=!0),void 0===i&&(i=!0);var s={},o=!1;return void 0===t||c.compare(O.current.data,t)||(s.data=t,o=!0),O.current.error!==n&&(s.error=n,o=!0),o&&N(s),!!e&&(i?r():F())};p[m]?p[m].push(i):p[m]=[i];var s=null;return!S&&window.addEventListener&&c.revalidateOnReconnect&&window.addEventListener("online",s=r),function(){var e,t;N=function(){return null},R.current=!0,n&&f[m]&&(t=(e=f[m]).indexOf(n))>=0&&(e[t]=e[e.length-1],e.pop()),p[m]&&(t=(e=p[m]).indexOf(i))>=0&&(e[t]=e[e.length-1],e.pop()),!S&&window.removeEventListener&&null!==s&&window.removeEventListener("online",s)}}},[m,F]),k(function(){var t=null,n=function(){return E(e,void 0,void 0,function(){return T(this,function(e){switch(e.label){case 0:return O.current.error||!c.refreshWhenHidden&&!o()||!c.refreshWhenOffline&&!a()?[3,2]:[4,F({dedupe:!0})];case 1:e.sent(),e.label=2;case 2:return c.refreshInterval&&(t=setTimeout(n,c.refreshInterval)),[2]}})})};return c.refreshInterval&&(t=setTimeout(n,c.refreshInterval)),function(){t&&clearTimeout(t)}},[c.refreshInterval,c.refreshWhenHidden,c.refreshWhenOffline,F]),c.suspense){var j=l.get(m)||w,U=l.get(y)||_;if(void 0===j&&void 0===U){if(h[m]||F(),h[m]&&"function"==typeof h[m].then)throw h[m];j=h[m]}if(void 0===j&&U)throw U;return{error:U,data:j,revalidate:F,mutate:M,isValidating:O.current.isValidating}}return(0,r.useMemo)(function(){var e={revalidate:F,mutate:M};return Object.defineProperties(e,{error:{get:function(){return A.current.error=!0,P.current===m?O.current.error:_},enumerable:!0},data:{get:function(){return A.current.data=!0,P.current===m?O.current.data:w},enumerable:!0},isValidating:{get:function(){return A.current.isValidating=!0,O.current.isValidating},enumerable:!0}}),e},[F])}},44465:function(e,t,n){var r=n(97004),i=n(84154),s=n(99569),o=n(12368),a=n(1633).onFreeze,c=Object.freeze;r({target:"Object",stat:!0,forced:s(function(){c(1)}),sham:!i},{freeze:function(e){return c&&o(e)?c(a(e)):e}})},47393:function(e,t,n){"use strict";n.d(t,{Fl:function(){return a},Kg:function(){return c}
2,SY:function(){return s},aj:function(){return i},ne:function(){return o},qE:function(){return r}});var r=function(e,t){return function(n){return Math.max(Math.min(n,t),e)}},i=function(e){return e%1?Number(e.toFixed(5)):e},s=/(-)?([\d]*\.?[\d])+/g,o=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,a=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function c(e){return"string"==typeof e}},47845:function(e,t,n){var r=n(24060),i=n(54595),s=n(84201),o=n(48345),a=s("IE_PROTO"),c=Object.prototype;e.exports=o?Object.getPrototypeOf:function(e){return e=i(e),r(e,a)?e[a]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?c:null}},48345:function(e,t,n){var r=n(99569);e.exports=!r(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},48793:function(e,t,n){var r=n(28853),i=n(61581),s=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?s(r[e])||s(i[e]):r[e]&&r[e][t]||i[e]&&i[e][t]}},49019:function(e,t,n){"use strict";n.d(t,{f:function(){return d}});var r=n(4616),i=n(64065),s=n(47393),o="${c}",a="${n}";function c(e){var t=[],n=0,c=e.match(s.ne);c&&(n=c.length,e=e.replace(s.ne,o),t.push.apply(t,c.map(r.y.parse)));var u=e.match(s.SY);return u&&(e=e.replace(s.SY,a),t.push.apply(t,u.map(i.ai.parse))),{values:t,numColors:n,tokenised:e}}function u(e){return c(e).values}function l(e){var t=c(e),n=t.values,i=t.numColors,u=t.tokenised,l=n.length;return function(e){for(var t=u,n=0;n<l;n++)t=t.replace(n<i?o:a,n<i?r.y.transform(e[n]):(0,s.aj)(e[n]));return t}}var h=function(e){return"number"==typeof e?0:e},d={test:function(e){var t,n,r,i;return isNaN(e)&&(0,s.Kg)(e)&&(null!==(n=null===(t=e.match(s.SY))||void 0===t?void 0:t.length)&&void 0!==n?n:0)+(null!==(i=null===(r=e.match(s.ne))||void 0===r?void 0:r.length)&&void 0!==i?i:0)>0},parse:u,createTransformer:l,getAnimatableNone:function(e){var t=u(e);return l(e)(t.map(h))}}},49145:function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},49263:function(e,t,n){var r=n(23007),i=n(96456),s=n(81670),o=n(82676);e.exports=function(e,t){return r(e)||i(e,t)||s(e,t)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},49281:function(e,t,n){var r,i,s,o,a,c,u,l,h=n(61581),d=n(78825).f,f=n(65927).set,p=n(21081),g=n(53383),m=n(89750),v=h.MutationObserver||h.WebKitMutationObserver,y=h.document,w=h.process,b=h.Promise,_=d(h,"queueMicrotask"),I=_&&_.value;I||(r=function(){var e,t;for(m&&(e=w.domain)&&e.exit();i;){t=i.fn,i=i.next;try{t()}catch(e){throw i?o():s=void 0,e}}s=void 0,e&&e.enter()},p||m||g||!v||!y?b&&b.resolve?((u=b.resolve(void 0)).constructor=b,l=u.then,o=function(){l.call(u,r)}):o=m?function(){w.nextTick(r)}:function(){f.call(h,r)}:(a=!0,c=y.createTextNode(""),new v(r).observe(c,{characterData:!0}),o=function(){c.data=a=!a})),e.exports=I||function(e){var t={fn:e,next:void 0};s&&(s.next=t),i||(i=t,o()),s=t}},50208:function(e,t,n){"use strict";var r=n(61891).IteratorPrototype,i=n(68562),s=n(70354),o=n(42349),a=n(94063),c=function(){return this};e.exports=function(e,t,n){var u=t+" Iterator";return e.prototype=i(r,{next:s(1,n)}),o(e,u,!1,!0),a[u]=c,e}},51387:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},51624:function(e,t,n){"use strict";n.d(t,{A:function(){return h}});var r=n(1266),i=n(94762),s=n(26891),o=n(8474);class a{constructor(e,t){this._delegate=e,this.firebase=t,(0,s._addComponent)(e,new i.uA("app-compat",()=>this,"PUBLIC")),this.container=e.container}get automaticDataCollectionEnabled(){return this._delegate.automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this._delegate.automaticDataCollectionEnabled=e}get name(){return this._delegate.name}get options(){return this._delegate.options}delete(){return new Promise(e=>{this._delegate.checkDestroyed(),e()}).then(()=>(this.firebase.INTERNAL.removeApp(this.name),(0,s.deleteApp)(this._delegate)))}_getService(e,t=s._DEFAULT_ENTRY_NAME){var n;this._delegate.checkDestroyed();const r=this._delegate.container.getProvider(e);return r.isInitialized()||"EXPLICIT"!==(null===(n=r.getComponent())||void 0===n?void 0:n.instantiationMode)||r.initialize(),r.getImmediate({identifier:t})}_removeServiceInstance(e,t=s._DEFAULT_ENTRY_NAME){this._delegate.container.getProvider(e).
2clearInstance(t)}_addComponent(e){(0,s._addComponent)(this._delegate,e)}_addOrOverwriteComponent(e){(0,s._addOrOverwriteComponent)(this._delegate,e)}toJSON(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}}}const c=new r.FA("app-compat","Firebase",{"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance."}),u=function e(){const t=function(e){const t={},n={__esModule:!0,initializeApp:function(i,o={}){const a=s.initializeApp(i,o);if((0,r.gR)(t,a.name))return t[a.name];const c=new e(a,n);return t[a.name]=c,c},app:i,registerVersion:s.registerVersion,setLogLevel:s.setLogLevel,onLog:s.onLog,apps:null,SDK_VERSION:s.SDK_VERSION,INTERNAL:{registerComponent:function(t){const o=t.name,a=o.replace("-compat","");if(s._registerComponent(t)&&"PUBLIC"===t.type){const s=(e=i())=>{if("function"!=typeof e[a])throw c.create("invalid-app-argument",{appName:o});return e[a]()};void 0!==t.serviceProps&&(0,r.zw)(s,t.serviceProps),n[a]=s,e.prototype[a]=function(...e){return this._getService.bind(this,o).apply(this,t.multipleInstances?e:[])}}return"PUBLIC"===t.type?n[a]:null},removeApp:function(e){delete t[e]},useAsService:function(e,t){return"serverAuth"===t?null:t},modularAPIs:s}};function i(e){if(e=e||s._DEFAULT_ENTRY_NAME,!(0,r.gR)(t,e))throw c.create("no-app",{appName:e});return t[e]}return n.default=n,Object.defineProperty(n,"apps",{get:function(){return Object.keys(t).map(e=>t[e])}}),i.App=e,n}(a);return t.INTERNAL=Object.assign(Object.assign({},t.INTERNAL),{createFirebaseNamespace:e,extendNamespace:function(e){(0,r.zw)(t,e)},createSubscribe:r.tD,ErrorFactory:r.FA,deepExtend:r.zw}),t}(),l=new o.Vy("@firebase/app-compat");if((0,r.Bd)()&&void 0!==self.firebase){l.warn("\n Warning: Firebase is already defined in the global scope. Please make sure\n Firebase library is only loaded once.\n ");const e=self.firebase.SDK_VERSION;e&&e.indexOf("LITE")>=0&&l.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 ")}const h=u;(0,s.registerVersion)("@firebase/app-compat","0.2.13",undefined)},51983:function(e,t,n){var r=n(61581),i=n(6618),s="__core-js_shared__",o=r[s]||i(s,{});e.exports=o},52002:function(e,t,n){var r=n(85929)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[r]=!1,"/./"[e](t)}catch(e){}}return!1}},52505:function(e){e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},53383:function(e,t,n){var r=n(72134);e.exports=/web0s(?!.*chrome)/i.test(r)},54447:function(e,t,n){"use strict";n.d(t,{i:function(){return f}});var r=n(35285),i=n(77157),s=n(58725),o=n(68292),a=n(82184),c=n(25003),u=function(e,t,n){var r=e*e,i=t*t;return Math.sqrt(Math.max(0,n*(i-r)+r))},l=[s.u,o.B,a.V],h=function(e){return l.find(function(t){return t.test(e)})},d=function(e){return"'"+e+"' is not an animatable color. Use the equivalent color code instead."},f=function(e,t){var n=h(e),s=h(t);(0,c.V)(!!n,d(e)),(0,c.V)(!!s,d(t)),(0,c.V)(n.transform===s.transform,"Both colors must be hex/RGBA, OR both must be HSLA.");var o=n.parse(e),l=s.parse(t),f=(0,r.__assign)({},o),p=n===a.V?i.j:u;return function(e){for(var t in f)"alpha"!==t&&(f[t]=p(o[t],l[t],e));return f.alpha=(0,i.j)(o.alpha,l.alpha,e),n.transform(f)}}},54595:function(e,t,n){var r=n(93992);e.exports=function(e){return Object(r(e))}},55081:function(e){"use strict";var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var s={},o=[],a=0;a<e.length;a++){var c=e[a],u=r.base?c[0]+r.base:c[0],l=s[u]||0,h="".concat(u," ").concat(l);s[u]=l+1;var d=n(h),f={css:c[1],media:c[2],sourceMap:c[3]};-1!==d?(t[d].references++,t[d].updater(f)):t.push({identifier:h,updater:i(f,r),references:1}),o.push(h)}return o}function i(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;n.update(e=t)}else n.remove()}}e.exports=function(e,i){var s=r(e=e||[],i=i||{});return function(e){e=e||[];for(var o=0;o<s.length;o++){var a=n(s[o]);t[a].references--}for(var c=r(e,i),u=0;u<s.length;u++){var l=n(s[u]);0===t[l].references&&(t[l].updater(),t.splice(l,1))}s=c}}},55119:function(e,t,n){var r=n(85929),i=n(68562),s=n(96435),o=r("unscopables"),a=Array.prototype;null==a[o]&&s.f(a,o,{configurable:!0,value:i(null)}),e.exports=function(e){a[o][e]=!0}},55166:function(e,t,n){"use strict";n.d(t,{i:function(){return k}});var r=n(35285),i=n(25003),s=n(71984),o=.001,a=.01,c=10,u=.05,l=1;var h=12;function d(e,t){return e*Math.sqrt(1-t*t)}var f=["duration","bounce"],p=["stiffness","damping","mass"];function g(e,t){return t.some(function(t){return void 0!==e[t]})}function m(e){var t=e.from,n=void 0===t?0:t,m=e.to,y=void 0===m?1:m,w=e.restSpeed,b=void 0===w?2:w,_=e.restDelta,I=(0,r.__rest)(e,["from","to","restSpeed","restDelta"]),E={done:!1,value:n},T=function(e){var t=(0,r.__assign)({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},e);if(!g(e,p)&&g(e,f)){var n=function(e){var t,n,r=e.duration,f=void 0===r?800:r,p=e.bounce,g=void 0===p?.25:p,m=e.velocity,v=void 0===m?0:m,y=e.mass,w=void 0===y?1:y;(0,i.$)(f<=1e3*c,"Spring duration must be 10 seconds or less");var b=1-g;b=(0,s.q)(u,l,b),f=(0,s.q)(a,c,f/1e3),b<1?(t=function(e){var t=e*b,n=t*f,r=t-v,i=d(e,b),s=Math.exp(-n);return o-r/i*s},n=function(e){var n=e*b*f,r=n*v+v,i=Math.pow(b,2)*Math.pow(e,2)*f,s=Math.exp(-n),a=d(Math.pow(e,2),b);return(-t(e)+o>0?-1:1)*((r-i)*s)/a}):(t=function(e){return Math.exp(-e*f)*((e-v)*f+1)-o},n=function(e){return Math.exp(-e*f)*(f*f*(v-e))});var _=function(e,t,n){for(var r=n,i=1;i<h;i++)r-=e(r)/t(r);return r}(t,n,5/f);if(f*=1e3,isNaN(_))return{stiffness:100,damping:10,duration:f};var I=Math.pow(_,2)*w;return{stiffness:I,damping:2*b*Math.sqrt(w*I),duration:f}}(e);(t=(0,r.__assign)((0,r.__assign)((0,r.__assign)({},t),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return t}(I),S=T.stiffness,k=T.damping,A=T.mass,C=T.velocity,x=T.duration,O=T.isResolvedFromDuration,D=v,N=v;function R(){var e=C?-C/1e3:0,t=y-n,r=k/(2*Math.sqrt(S*A)),i=Math.sqrt(S/A)/1e3;if(null!=_||(_=Math.abs(y-n)<=1?.01:.4),r<1){var s=d(i,r);D=function(n){var o=Math.exp(-r*i*n);return y-o*((e+r*i*t)/s*Math.sin(s*n)+t*Math.cos(s*n))},N=function(n){var o=Math.exp(-r*i*n);return r*i*o*(Math.sin(s*n)*(e+r*i*t)/s+t*Math.cos(s*n))-o*(Math.cos(s*n)*(e+r*i*t)-s*t*Math.sin(s*n))}}else if(1===r)D=function(n){return y-Math.exp(-i*n)*(t+(e+i*t)*n)};else{var o=i*Math.sqrt(r*r-1);D=function(n){var s=Math.exp(-r*i*n),a=Math.min(o*n,300);return y-s*((e+r*i*t)*Math.sinh(a)+o*t*Math.cosh(a))/o}}}return R(),{next:function(e){var t=D(e);if(O)E.done=e>=x;else{var n=1e3*N(e),r=Math.abs(n)<=b,i=Math.abs(y-t)<=_;E.done=r&&i}return E.value=E.done?y:t,E},flipTarget:function(){var e;C=-C,n=(e=[y,n])[0],y=e[1],R()}}}m.needsInterpolation=function(e,t){return"string"==typeof e||"string"==typeof t};var v=function(e){return 0},y=n(12132),w=n(38095);function b(e,t){return e.map(function(){return t||w.am}).splice(0,e.length-1)}function _(e){var t=e.from,n=void 0===t?0:t,r=e.to,i=void 0===r?1:r,s=e.ease,o=e.offset,a=e.duration,c=void 0===a?300:a,u={done:!1,value:n},l=Array.isArray(i)?i:[n,i],h=function(e,t){return e.map(function(e){return e*t})}(o&&o.length===l.length?o:function(e){var t=e.length;
2return e.map(function(e,n){return 0!==n?n/(t-1):0})}(l),c);function d(){return(0,y.G)(h,l,{ease:Array.isArray(s)?s:b(l,s)})}var f=d();return{next:function(e){return u.value=f(e),u.done=e>=c,u},flipTarget:function(){l.reverse(),f=d()}}}var I={keyframes:_,spring:m,decay:function(e){var t=e.velocity,n=void 0===t?0:t,r=e.from,i=void 0===r?0:r,s=e.power,o=void 0===s?.8:s,a=e.timeConstant,c=void 0===a?350:a,u=e.restDelta,l=void 0===u?.5:u,h=e.modifyTarget,d={done:!1,value:i},f=o*n,p=i+f,g=void 0===h?p:h(p);return g!==p&&(f=g-i),{next:function(e){var t=-f*Math.exp(-e/c);return d.done=!(t>l||t<-l),d.value=d.done?g:g+t,d},flipTarget:function(){}}}},E=n(34775);function T(e,t,n){return void 0===n&&(n=0),e-t-n}var S=function(e){var t=function(t){var n=t.delta;return e(n)};return{start:function(){return E.Ay.update(t,!0)},stop:function(){return E.eO.update(t)}}};function k(e){var t,n,i,s,o,a=e.from,c=e.autoplay,u=void 0===c||c,l=e.driver,h=void 0===l?S:l,d=e.elapsed,f=void 0===d?0:d,p=e.repeat,g=void 0===p?0:p,v=e.repeatType,w=void 0===v?"loop":v,b=e.repeatDelay,E=void 0===b?0:b,k=e.onPlay,A=e.onStop,C=e.onComplete,x=e.onRepeat,O=e.onUpdate,D=(0,r.__rest)(e,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),N=D.to,R=0,P=D.duration,L=!1,M=!0,F=function(e){if(Array.isArray(e.to))return _;if(I[e.type])return I[e.type];var t=new Set(Object.keys(e));return t.has("ease")||t.has("duration")&&!t.has("dampingRatio")?_:t.has("dampingRatio")||t.has("stiffness")||t.has("mass")||t.has("damping")||t.has("restSpeed")||t.has("restDelta")?m:_}(D);(null===(n=(t=F).needsInterpolation)||void 0===n?void 0:n.call(t,a,N))&&(o=(0,y.G)([0,100],[a,N],{clamp:!1}),a=0,N=100);var j=F((0,r.__assign)((0,r.__assign)({},D),{from:a,to:N}));return u&&(null==k||k(),(i=h(function(e){if(M||(e=-e),f+=e,!L){var t=j.next(Math.max(0,f));s=t.value,o&&(s=o(s)),L=M?t.done:f<=0}null==O||O(s),L&&(0===R&&(null!=P||(P=f)),R<g?function(e,t,n,r){return r?e>=t+n:e<=-n}(f,P,E,M)&&(R++,"reverse"===w?f=function(e,t,n,r){return void 0===n&&(n=0),void 0===r&&(r=!0),r?T(t+-e,t,n):t-(e-t)+n}(f,P,E,M=R%2==0):(f=T(f,P,E),"mirror"===w&&j.flipTarget()),L=!1,x&&x()):(i.stop(),C&&C()))})).start()),{stop:function(){null==A||A(),i.stop()}}}},55900:function(){},56158:function(e,t,n){var r=n(24060),i=n(77265),s=n(78825),o=n(96435);e.exports=function(e,t){for(var n=i(t),a=o.f,c=s.f,u=0;u<n.length;u++){var l=n[u];r(e,l)||a(e,l,c(t,l))}}},56737:function(e,t,n){var r=n(99569),i=n(16054),s="".split;e.exports=r(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==i(e)?s.call(e,""):Object(e)}:Object},57045:function(e,t,n){n(39425)("iterator")},57956:function(e){var t=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:t)(e)}},58725:function(e,t,n){"use strict";n.d(t,{u:function(){return i}});var r=n(68292),i={test:(0,n(72049).$)("#"),parse:function(e){var t="",n="",r="",i="";return e.length>5?(t=e.substr(1,2),n=e.substr(3,2),r=e.substr(5,2),i=e.substr(7,2)):(t=e.substr(1,1),n=e.substr(2,1),r=e.substr(3,1),i=e.substr(4,1),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:r.B.transform}},59030:function(e,t,n){var r=n(75748);e.exports=function(e,t,n){for(var i in t)r(e,i,t[i],n);return e}},59807:function(e,t,n){"use strict";var r=n(51624),i=n(91752),s=n(1266),o=n(94762);function a(e,t){if(void 0===t)return{merge:!1};if(void 0!==t.mergeFields&&void 0!==t.merge)throw new i.W6("invalid-argument",`Invalid options passed to function ${e}(): You cannot specify both "merge" and "mergeFields".`);return t}function c(){if("undefined"==typeof Uint8Array)throw new i.W6("unimplemented","Uint8Arrays are not available in this environment.")}function u(){if(!(0,i.qG)())throw new i.W6("unimplemented","Blobs are unavailable in Firestore in this environment.")}class l{constructor(e){this._delegate=e}static fromBase64String(e){return u(),new l(i.Ix.fromBase64String(e))}static fromUint8Array(e){return c(),new l(i.Ix.fromUint8Array(e))}toBase64(){return u(),this._delegate.toBase64()}toUint8Array(){return c(),this._delegate.toUint8Array()}isEqual(e){return this._delegate.isEqual(e._delegate)}toString(){return"Blob(base64: "+this.toBase64()+")"}}function h(e){return function(e){if("object"!=typeof e||null===e)return!1;const t=e;for(const e of["next","error","complete"])if(e in t&&"function"==typeof t[e])return!0;return!1}(e)}class d{enableIndexedDbPersistence(e,t){return(0,i.ol)(e._delegate,{forceOwnership:t})}enableMultiTabIndexedDbPersistence(e){return(0,i.Q5)(e._delegate)}clearIndexedDbPersistence(e){return(0,i.me)(e._delegate)}}class f{constructor(e,t,n){this._delegate=t,this._persistenceProvider=n,this.INTERNAL={delete:()=>this.terminate()},e instanceof i.cm||(this._appCompat=e)}get _databaseId(){return this._delegate._databaseId}settings(e){const t=this._delegate._getSettings();e.merge||t.host===e.host||(0,i.qi)("You are overriding the original host. If you did not intend to override your settings, use {merge: true}."),e.merge&&delete(e=Object.assign(Object.assign({},t),e)).merge,this._delegate._setSettings(e)}useEmulator(e,t,n={}){(0,i.vN)(this._delegate,e,t,n)}enableNetwork(){return(0,i.Os)(this._delegate)}disableNetwork(){return(0,i.LA)(this._delegate)}enablePersistence(e){let t=!1,n=!1;return e&&(t=!!e.synchronizeTabs,n=!!e.experimentalForceOwningTab,(0,i.c8)("synchronizeTabs",t,"experimentalForceOwningTab",n)),t?this._persistenceProvider.enableMultiTabIndexedDbPersistence(this):this._persistenceProvider.enableIndexedDbPersistence(this,n)}clearPersistence(){return this._persistenceProvider.clearIndexedDbPersistence(this)}terminate(){return this._appCompat&&(this._appCompat._removeServiceInstance("firestore-compat"),this._appCompat._removeServiceInstance("firestore")),this._delegate._delete()}waitForPendingWrites(){return(0,i.iB)(this._delegate)}onSnapshotsInSync(e){return(0,i.FC)(this._delegate,e)}get app(){if(!this._appCompat)throw new i.W6("failed-precondition","Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._appCompat}collection(e){try{return new A(this,(0,i.rJ)(this._delegate,e))}catch(e){throw w(e,"collection()","Firestore.collection()")}}doc(e){try{return new y(this,(0,i.H9)(this._delegate,e))}catch(e){throw w(e,"doc()","Firestore.doc()")}}collectionGroup(e){try{return new T(this,(0,i.Cs)(this._delegate,e))}catch(e){throw w(e,"collectionGroup()","Firestore.collectionGroup()")}}runTransaction(e){return(0,i.c4)(this._delegate,t=>e(new g(this,t)))}batch(){return(0,i.Ws)(this._delegate),new m(new i.GA(this._delegate,e=>(0,i.z6)(this._delegate,e)))}loadBundle(e){return(0,i.po)(this._delegate,e)}namedQuery(e){return(0,i.St)(this._delegate,e).then(e=>e?new T(this,e):null)}}class p extends i.fS{constructor(e){super(),this.firestore=e}convertBytes(e){return new l(new i.Ix(e))}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);
2return y.forKey(t,this.firestore,null)}}class g{constructor(e,t){this._firestore=e,this._delegate=t,this._userDataWriter=new p(e)}get(e){const t=C(e);return this._delegate.get(t).then(e=>new I(this._firestore,new i.Wq(this._firestore._delegate,this._userDataWriter,e._key,e._document,e.metadata,t.converter)))}set(e,t,n){const r=C(e);return n?(a("Transaction.set",n),this._delegate.set(r,t,n)):this._delegate.set(r,t),this}update(e,t,n,...r){const i=C(e);return 2===arguments.length?this._delegate.update(i,t):this._delegate.update(i,t,n,...r),this}delete(e){const t=C(e);return this._delegate.delete(t),this}}class m{constructor(e){this._delegate=e}set(e,t,n){const r=C(e);return n?(a("WriteBatch.set",n),this._delegate.set(r,t,n)):this._delegate.set(r,t),this}update(e,t,n,...r){const i=C(e);return 2===arguments.length?this._delegate.update(i,t):this._delegate.update(i,t,n,...r),this}delete(e){const t=C(e);return this._delegate.delete(t),this}commit(){return this._delegate.commit()}}class v{constructor(e,t,n){this._firestore=e,this._userDataWriter=t,this._delegate=n}fromFirestore(e,t){const n=new i.YQ(this._firestore._delegate,this._userDataWriter,e._key,e._document,e.metadata,null);return this._delegate.fromFirestore(new E(this._firestore,n),null!=t?t:{})}toFirestore(e,t){return t?this._delegate.toFirestore(e,t):this._delegate.toFirestore(e)}static getInstance(e,t){const n=v.INSTANCES;let r=n.get(e);r||(r=new WeakMap,n.set(e,r));let i=r.get(t);return i||(i=new v(e,new p(e),t),r.set(t,i)),i}}v.INSTANCES=new WeakMap;class y{constructor(e,t){this.firestore=e,this._delegate=t,this._userDataWriter=new p(e)}static forPath(e,t,n){if(e.length%2!=0)throw new i.W6("invalid-argument",`Invalid document reference. Document references must have an even number of segments, but ${e.canonicalString()} has ${e.length}`);return new y(t,new i.T1(t._delegate,n,new i.K$(e)))}static forKey(e,t,n){return new y(t,new i.T1(t._delegate,n,e))}get id(){return this._delegate.id}get parent(){return new A(this.firestore,this._delegate.parent)}get path(){return this._delegate.path}collection(e){try{return new A(this.firestore,(0,i.rJ)(this._delegate,e))}catch(e){throw w(e,"collection()","DocumentReference.collection()")}}isEqual(e){return(e=(0,s.Ku)(e))instanceof i.T1&&(0,i.yx)(this._delegate,e)}set(e,t){t=a("DocumentReference.set",t);try{return t?(0,i.BN)(this._delegate,e,t):(0,i.BN)(this._delegate,e)}catch(e){throw w(e,"setDoc()","DocumentReference.set()")}}update(e,t,...n){try{return 1===arguments.length?(0,i.mZ)(this._delegate,e):(0,i.mZ)(this._delegate,e,t,...n)}catch(e){throw w(e,"updateDoc()","DocumentReference.update()")}}delete(){return(0,i.kd)(this._delegate)}onSnapshot(...e){const t=b(e),n=_(e,e=>new I(this.firestore,new i.Wq(this.firestore._delegate,this._userDataWriter,e._key,e._document,e.metadata,this._delegate.converter)));return(0,i.aQ)(this._delegate,t,n)}get(e){let t;return t="cache"===(null==e?void 0:e.source)?(0,i.nY)(this._delegate):"server"===(null==e?void 0:e.source)?(0,i._e)(this._delegate):(0,i.x7)(this._delegate),t.then(e=>new I(this.firestore,new i.Wq(this.firestore._delegate,this._userDataWriter,e._key,e._document,e.metadata,this._delegate.converter)))}withConverter(e){return new y(this.firestore,e?this._delegate.withConverter(v.getInstance(this.firestore,e)):this._delegate.withConverter(null))}}function w(e,t,n){return e.message=e.message.replace(t,n),e}function b(e){for(const t of e)if("object"==typeof t&&!h(t))return t;return{}}function _(e,t){var n,r;let i;return i=h(e[0])?e[0]:h(e[1])?e[1]:"function"==typeof e[0]?{next:e[0],error:e[1],complete:e[2]}:{next:e[1],error:e[2],complete:e[3]},{next:e=>{i.next&&i.next(t(e))},error:null===(n=i.error)||void 0===n?void 0:n.bind(i),complete:null===(r=i.complete)||void 0===r?void 0:r.bind(i)}}class I{constructor(e,t){this._firestore=e,this._delegate=t}get ref(){return new y(this._firestore,this._delegate.ref)}get id(){return this._delegate.id}get metadata(){return this._delegate.metadata}get exists(){return this._delegate.exists()}data(e){return this._delegate.data(e)}get(e,t){return this._delegate.get(e,t)}isEqual(e){return(0,i.lN)(this._delegate,e._delegate)}}class E extends I{data(e){const t=this._delegate.data(e);return(0,i.bI)(void 0!==t,"Document in a QueryDocumentSnapshot should exist"),t}}class T{constructor(e,t){this.firestore=e,this._delegate=t,this._userDataWriter=new p(e)}where(e,t,n){try{return new T(this.firestore,(0,i.P)(this._delegate,(0,i._M)(e,t,n
2)))}catch(e){throw w(e,/(orderBy|where)\(\)/,"Query.$1()")}}orderBy(e,t){try{return new T(this.firestore,(0,i.P)(this._delegate,(0,i.My)(e,t)))}catch(e){throw w(e,/(orderBy|where)\(\)/,"Query.$1()")}}limit(e){try{return new T(this.firestore,(0,i.P)(this._delegate,(0,i.AB)(e)))}catch(e){throw w(e,"limit()","Query.limit()")}}limitToLast(e){try{return new T(this.firestore,(0,i.P)(this._delegate,(0,i.$1)(e)))}catch(e){throw w(e,"limitToLast()","Query.limitToLast()")}}startAt(...e){try{return new T(this.firestore,(0,i.P)(this._delegate,(0,i.EO)(...e)))}catch(e){throw w(e,"startAt()","Query.startAt()")}}startAfter(...e){try{return new T(this.firestore,(0,i.P)(this._delegate,(0,i.HM)(...e)))}catch(e){throw w(e,"startAfter()","Query.startAfter()")}}endBefore(...e){try{return new T(this.firestore,(0,i.P)(this._delegate,(0,i.rf)(...e)))}catch(e){throw w(e,"endBefore()","Query.endBefore()")}}endAt(...e){try{return new T(this.firestore,(0,i.P)(this._delegate,(0,i.FD)(...e)))}catch(e){throw w(e,"endAt()","Query.endAt()")}}isEqual(e){return(0,i.B)(this._delegate,e._delegate)}get(e){let t;return t="cache"===(null==e?void 0:e.source)?(0,i.kU)(this._delegate):"server"===(null==e?void 0:e.source)?(0,i.Rr)(this._delegate):(0,i.GG)(this._delegate),t.then(e=>new k(this.firestore,new i.NJ(this.firestore._delegate,this._userDataWriter,this._delegate,e._snapshot)))}onSnapshot(...e){const t=b(e),n=_(e,e=>new k(this.firestore,new i.NJ(this.firestore._delegate,this._userDataWriter,this._delegate,e._snapshot)));return(0,i.aQ)(this._delegate,t,n)}withConverter(e){return new T(this.firestore,e?this._delegate.withConverter(v.getInstance(this.firestore,e)):this._delegate.withConverter(null))}}class S{constructor(e,t){this._firestore=e,this._delegate=t}get type(){return this._delegate.type}get doc(){return new E(this._firestore,this._delegate.doc)}get oldIndex(){return this._delegate.oldIndex}get newIndex(){return this._delegate.newIndex}}class k{constructor(e,t){this._firestore=e,this._delegate=t}get query(){return new T(this._firestore,this._delegate.query)}get metadata(){return this._delegate.metadata}get size(){return this._delegate.size}get empty(){return this._delegate.empty}get docs(){return this._delegate.docs.map(e=>new E(this._firestore,e))}docChanges(e){return this._delegate.docChanges(e).map(e=>new S(this._firestore,e))}forEach(e,t){this._delegate.forEach(n=>{e.call(t,new E(this._firestore,n))})}isEqual(e){return(0,i.lN)(this._delegate,e._delegate)}}class A extends T{constructor(e,t){super(e,t),this.firestore=e,this._delegate=t}get id(){return this._delegate.id}get path(){return this._delegate.path}get parent(){const e=this._delegate.parent;return e?new y(this.firestore,e):null}doc(e){try{return new y(this.firestore,void 0===e?(0,i.H9)(this._delegate):(0,i.H9)(this._delegate,e))}catch(e){throw w(e,"doc()","CollectionReference.doc()")}}add(e){return(0,i.gS)(this._delegate,e).then(e=>new y(this.firestore,e))}isEqual(e){return(0,i.yx)(this._delegate,e._delegate)}withConverter(e){return new A(this.firestore,e?this._delegate.withConverter(v.getInstance(this.firestore,e)):this._delegate.withConverter(null))}}function C(e){return(0,i.lo)(e,i.T1)}class x{constructor(...e){this._delegate=new i.uY(...e)}static documentId(){return new x(i.FA.keyField().canonicalString())}isEqual(e){return(e=(0,s.Ku)(e))instanceof i.uY&&this._delegate._internalPath.isEqual(e._internalPath)}}class O{constructor(e){this._delegate=e}static serverTimestamp(){const e=(0,i.O5)();return e._methodName="FieldValue.serverTimestamp",new O(e)}static delete(){const e=(0,i.CL)();return e._methodName="FieldValue.delete",new O(e)}static arrayUnion(...e){const t=(0,i.hq)(...e);return t._methodName="FieldValue.arrayUnion",new O(t)}static arrayRemove(...e){const t=(0,i.C3)(...e);return t._methodName="FieldValue.arrayRemove",new O(t)}static increment(e){const t=(0,i.GV)(e);return t._methodName="FieldValue.increment",new O(t)}isEqual(e){return this._delegate.isEqual(e._delegate)}}const D={Firestore:f,GeoPoint:i.Ci,Timestamp:i.Dc,Blob:l,Transaction:g,WriteBatch:m,DocumentReference:y,DocumentSnapshot:I,Query:T,QueryDocumentSnapshot:E,QuerySnapsh
vendor: 3,573 bytes, line 2
2ot:k,CollectionReference:A,FieldPath:x,FieldValue:O,setLogLevel:function(e){(0,i.He)(e)},CACHE_SIZE_UNLIMITED:i.H6};var N,R;N=r.A,R=(e,t)=>new f(e,t,new d),N.INTERNAL.registerComponent(new o.uA("firestore-compat",e=>{const t=e.getProvider("app-compat").getImmediate(),n=e.getProvider("firestore").getImmediate();return R(t,n)},"PUBLIC").setServiceProps(Object.assign({},D))),N.registerVersion("@firebase/firestore-compat","0.3.12")},59837:function(e,t,n){var r=n(97004),i=n(99569),s=n(54595),o=n(47845),a=n(48345);r({target:"Object",stat:!0,forced:i(function(){o(1)}),sham:!a},{getPrototypeOf:function(e){return o(s(e))}})},60039:function(e,t,n){var r=n(61581),i=n(82290),s=n(65114),o=n(11941),a=n(85929),c=a("iterator"),u=a("toStringTag"),l=s.values;for(var h in i){var d=r[h],f=d&&d.prototype;if(f){if(f[c]!==l)try{o(f,c,l)}catch(e){f[c]=l}if(f[u]||o(f,u,h),i[h])for(var p in s)if(f[p]!==s[p])try{o(f,p,s[p])}catch(e){f[p]=s[p]}}}},60088:function(e,t){"use strict";var n,r,i,s;if("object"==typeof performance&&"function"==typeof performance.now){var o=performance;t.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();t.unstable_now=function(){return a.now()-c}}if("undefined"==typeof window||"function"!=typeof MessageChannel){var u=null,l=null,h=function(){if(null!==u)try{var e=t.unstable_now();u(!0,e),u=null}catch(e){throw setTimeout(h,0),e}};n=function(e){null!==u?setTimeout(n,0,e):(u=e,setTimeout(h,0))},r=function(e,t){l=setTimeout(e,t)},i=function(){clearTimeout(l)},t.unstable_shouldYield=function(){return!1},s=t.unstable_forceFrameRate=function(){}}else{var d=window.setTimeout,f=window.clearTimeout;if("undefined"!=typeof console){var p=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),"function"!=typeof p&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")}var g=!1,m=null,v=-1,y=5,w=0;t.unstable_shouldYield=function(){return t.unstable_now()>=w},s=function(){},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):y=0<e?Math.floor(1e3/e):5};var b=new MessageChannel,_=b.port2;b.port1.onmessage=function(){if(null!==m){var e=t.unstable_now();w=e+y;try{m(!0,e)?_.postMessage(null):(g=!1,m=null)}catch(e){throw _.postMessage(null),e}}else g=!1},n=function(e){m=e,g||(g=!0,_.postMessage(null))},r=function(e,n){v=d(function(){e(t.unstable_now())},n)},i=function(){f(v),v=-1}}function I(e,t){var n=e.length;e.push(t);e:for(;;){var r=n-1>>>1,i=e[r];if(!(void 0!==i&&0<S(i,t)))break e;e[r]=t,e[n]=i,n=r}}function E(e){return void 0===(e=e[0])?null:e}function T(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var r=0,i=e.length;r<i;){var s=2*(r+1)-1,o=e[s],a=s+1,c=e[a];if(void 0!==o&&0>S(o,n))void 0!==c&&0>S(c,o)?(e[r]=c,e[a]=n,r=a):(e[r]=o,e[s]=n,r=s);else{if(!(void 0!==c&&0>S(c,n)))break e;e[r]=c,e[a]=n,r=a}}}return t}return null}function S(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var k=[],A=[],C=1,x=null,O=3,D=!1,N=!1,R=!1;function P(e){for(var t=E(A);null!==t;){if(null===t.callback)T(A);else{if(!(t.startTime<=e))break;T(A),t.sortIndex=t.expirationTime,I(k,t)}t=E(A)}}function L(e){if(R=!1,P(e),!N)if(null!==E(k))N=!0,n(M);else{var t=E(A);null!==t&&r(L,t.startTime-e)}}
2function M(e,n){N=!1,R&&(R=!1,i()),D=!0;var s=O;try{for(P(n),x=E(k);null!==x&&(!(x.expirationTime>n)||e&&!t.unstable_shouldYield());){var o=x.callback;if("function"==typeof o){x.callback=null,O=x.priorityLevel;var a=o(x.expirationTime<=n);n=t.unstable_now(),"function"==typeof a?x.callback=a:x===E(k)&&T(k),P(n)}else T(k);x=E(k)}if(null!==x)var c=!0;else{var u=E(A);null!==u&&r(L,u.startTime-n),c=!1}return c}finally{x=null,O=s,D=!1}}var F=s;t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){N||D||(N=!0,n(M))},t.unstable_getCurrentPriorityLevel=function(){return O},t.unstable_getFirstCallbackNode=function(){return E(k)},t.unstable_next=function(e){switch(O){case 1:case 2:case 3:var t=3;break;default:t=O}var n=O;O=t;try{return e()}finally{O=n}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=F,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=O;O=e;try{return t()}finally{O=n}},t.unstable_scheduleCallback=function(e,s,o){var a=t.unstable_now();switch(o="object"==typeof o&&null!==o&&"number"==typeof(o=o.delay)&&0<o?a+o:a,e){case 1:var c=-1;break;case 2:c=250;break;case 5:c=1073741823;break;case 4:c=1e4;break;default:c=5e3}return e={id:C++,callback:s,priorityLevel:e,startTime:o,expirationTime:c=o+c,sortIndex:-1},o>a?(e.sortIndex=o,I(A,e),null===E(k)&&e===E(A)&&(R?i():R=!0,r(L,o-a))):(e.sortIndex=c,I(k,e),N||D||(N=!0,n(M))),e},t.unstable_wrapCallback=function(e){var t=O;return function(){var n=O;O=t;try{return e.apply(this,arguments)}finally{O=n}}}},60220:function(e,t,n){var r=n(51983),i=Function.toString;"function"!=typeof r.inspectSource&&(r.inspectSource=function(e){return i.call(e)}),e.exports=r.inspectSource},60896:function(e,t,n){e.exports=n(94214)},61387:function(e,t,n){var r=n(85929),i=n(94063),s=r("iterator"),o=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||o[s]===e)}},61445:function(e,t,n){var r=n(74250),i=n(75748),s=n(10621);r||i(Object.prototype,"toString",s,{unsafe:!0})},61581:function(e,t,n){var r=function(e){return e&&e.Math==Math&&e};e.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},61891:function(e,t,n){"use strict";var r,i,s,o=n(99569),a=n(47845),c=n(11941),u=n(24060),l=n(85929),h=n(86333),d=l("iterator"),f=!1;[].keys&&("next"in(s=[].keys())?(i=a(a(s)))!==Object.prototype&&(r=i):f=!0);var p=null==r||o(function(){var e={};return r[d].call(e)!==e});p&&(r={}),h&&!p||u(r,d)||c(r,d,function(){return this}),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:f}},62165:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,i,s=n(75194),o=n(35285),a=n(314),c=n(20469),u=n(29656),l=function(){function e(e){this.container=e}return e.prototype.getPlatformInfoString=function(){return this.container.getProviders().map(function(e){if(function(e){var t=e.getComponent();return"VERSION"===(null==t?void 0:t.type)}(e)){var t=e.getImmediate();return"".concat(t.library,"/").concat(t.version)}return null}).filter(function(e){return e}).join(" ")},e}(),h="@firebase/app",d="0.9.13",f=new a.Logger("@firebase/app"),p="[DEFAULT]",g=((r={})[h]="fire-core",r["@firebase/app-compat"]="fire-core-compat",r["@firebase/analytics"]="fire-analytics",r["@firebase/analytics-compat"]="fire-analytics-compat",r["@firebase/app-check"]="fire-app-check",r["@firebase/app-check-compat"]="fire-app-check-compat",r["@firebase/auth"]="fire-auth",r["@firebase/auth-compat"]="fire-auth-compat",r["@firebase/database"]="fire-rtdb",r["@firebase/database-compat"]="fire-rtdb-compat",r["@firebase/functions"]="fire-fn",r["@firebase/functions-compat"]="fire-fn-compat",r["@firebase/installations"]="fire-iid",r["@firebase/installations-compat"]="fire-iid-compat",r["@firebase/messaging"]="fire-fcm",r["@firebase/messaging-compat"]="fire-fcm-compat",r["@firebase/performance"]="fire-perf",r["@firebase/performance-compat"]="fire-perf-compat",r["@firebase/remote-config"]="fire-rc",r["@firebase/remote-config-compat"]="fire-rc-compat",r["@firebase/storage"]="fire-g
2cs",r["@firebase/storage-compat"]="fire-gcs-compat",r["@firebase/firestore"]="fire-fst",r["@firebase/firestore-compat"]="fire-fst-compat",r["fire-js"]="fire-js",r.firebase="fire-js-all",r),m=new Map,v=new Map;function y(e,t){try{e.container.addComponent(t)}catch(n){f.debug("Component ".concat(t.name," failed to register with FirebaseApp ").concat(e.name),n)}}function w(e){var t,n,r=e.name;if(v.has(r))return f.debug("There were multiple attempts to register component ".concat(r,".")),!1;v.set(r,e);try{for(var i=o.__values(m.values()),s=i.next();!s.done;s=i.next())y(s.value,e)}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return!0}function b(e,t){var n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}var _=((i={})["no-app"]="No Firebase App '{$appName}' has been created - call initializeApp() first",i["bad-app-name"]="Illegal App name: '{$appName}",i["duplicate-app"]="Firebase App named '{$appName}' already exists with different options or config",i["app-deleted"]="Firebase App named '{$appName}' already deleted",i["no-options"]="Need to provide options, when not being deployed to hosting via source.",i["invalid-app-argument"]="firebase.{$appName}() takes either no argument or a Firebase App instance.",i["invalid-log-argument"]="First argument to `onLog` must be null or a function.",i["idb-open"]="Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.",i["idb-get"]="Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.",i["idb-set"]="Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.",i["idb-delete"]="Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.",i),I=new c.ErrorFactory("app","Firebase",_),E=function(){function e(e,t,n){var r=this;this._isDeleted=!1,this._options=o.__assign({},e),this._config=o.__assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new s.Component("app",function(){return r},"PUBLIC"))}return Object.defineProperty(e.prototype,"automaticDataCollectionEnabled",{get:function(){return this.checkDestroyed(),this._automaticDataCollectionEnabled},set:function(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.checkDestroyed(),this._name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this.checkDestroyed(),this._options},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"config",{get:function(){return this.checkDestroyed(),this._config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDeleted",{get:function(){return this._isDeleted},set:function(e){this._isDeleted=e},enumerable:!1,configurable:!0}),e.prototype.checkDestroyed=function(){if(this.isDeleted)throw I.create("app-deleted",{appName:this._name})},e}();function T(e,t){var n,r;void 0===t&&(t={});var i=e;"object"!=typeof t&&(t={name:t});var a=o.__assign({name:p,automaticDataCollectionEnabled:!1},t),u=a.name;if("string"!=typeof u||!u)throw I.create("bad-app-name",{appName:String(u)});if(i||(i=c.getDefaultAppConfig()),!i)throw I.create("no-options");var l=m.get(u);if(l){if(c.deepEqual(i,l.options)&&c.deepEqual(a,l.config))return l;throw I.create("duplicate-app",{appName:u})}var h=new s.ComponentContainer(u);try{for(var d=o.__values(v.values()),f=d.next();!f.done;f=d.next()){var g=f.value;h.addComponent(g)}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}var y=new E(i,a,h);return m.set(u,y),y}function S(e,t,n){var r,i=null!==(r=g[e])&&void 0!==r?r:e;n&&(i+="-".concat(n));var o=i.match(/\s|\//),a=t.match(/\s|\//);if(o||a){var c=['Unable to register library "'.concat(i,'" with version "').concat(t,'":')];return o&&c.push('library name "'.concat(i,'" contains illegal characters (whitespace or "/")')),o&&a&&c.push("and"),a&&c.push('version name "'.concat(t,'" contains illegal characters (whitespace or "/")')),void f.warn(c.join(" "))}w(new s.Component("".concat(i,"-version"),function(){return{library:i,version:t}},"VERSION"))}var k="firebase-heartbeat-store",A=null;function C(){return A||(A=u.openDB("firebase-heartbeat-database",1,{upgrade:function(e,t){0===t&&e.createObjectStore(k)}}).catch(function(e){throw I.create("idb-open",{originalErrorMessage:e.message})})),A}function x(e){return o.__awaiter(this,void 0,void 0,function(){var t,n;return o.__generator(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,C()];case 1:return[4,r.sent().transaction(k).objectStore(k).get(D(e))];case 2:return[2,r.sent()];case 3:return(t=r.sent())instanceof c.FirebaseError?f.warn(t.message):(n=I.create("idb-get",{originalErrorMessage:null==t?void 0:t.message}),f.warn(n.message)),[3,4];case 4:return[2]}})})}function O(e,t){return o.__awaiter(this,void 0,void 0,function(){var n,r,i,s;return o.__generator(this,function(o){switch(o.label){case 0:return o.trys.push([0,4,,5]),[4,C()];case 1:return n=o.sent(),[4,(r=n.transaction(k,"readwrite")).objectStore(k).put(t,D(e))];case 2:return o.sent(),[4,r.done];case 3:return o.sent(),[3,5];case 4:return(i=o.sent())instanceof c.FirebaseError?f.warn(i.message):(s=I.create("idb-set",{originalErrorMessage:null==i?void 0:i.message}),f.warn(s.message)),[3,5];case 5:return[2]}})})}function D(e){return"".concat(e.name,"!").concat(e.options.appId)}var N=function(){function e(e){var t=this;this.container=e,this._heartbeatsCache=null;var n=this.container.getProvider("app").getImmediate();this._storage=new P(n),this._heartbeatsCachePromise=this._storage.read().then(function(e){return t._heartbeatsCache=e,e})}return e.prototype.triggerHeartbeat=function(){return o.__awaiter(this,void 0,void 0,function(){var e,t,n,r;return o.__generator(this,function(i){switch(i.label){case 0:return e=this.container.getProvider("platform-logger").getImmediate(),t=e.getPlatformInfoString(),n=R(),null!==this._heartbeatsCache?[3,2]:(r=this,[4,this._heartbeatsCachePromise]);case 1:r._heartbeatsCache=i.sent(),i.label=2;case 2:return this._heartbeatsCache.lastSentHeartbeatDate===n||this._heartbeatsCache.heartbeats.some(function(e){return e.date===n})?[2]:(this._heartbeatsCache.heartbeats.push({date:n,agent:t}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(function(e){var t=new Date(e.date).valueOf();return Date.now()-t<=2592e6}),[2,this._storage.overwrite(this._heartbeatsCache)])}})})},e.prototype.getHeartbeatsHeader=function(){return o.__awaiter(this,void 0,void 0,function(){var e,t,n,r,i;return o.__generator(this,function(s){switch(s.label){case 0:return null!==this._heartbeatsCache?[3,2]:[4,this._heartbeatsCachePromise];case 1:s.sent(),s.label=2;case 2:return null===this._heartbeatsCache||0===this._heartbeatsCache.heartbeats.length?[2,""]:(e=R(),t=function(e,t){var n,r;void 0===t&&(t=1024);var i=[],s=e.slice(),a=function(e){var n=i.find(function(t){return t.agent===e.agent});if(n){if(n.dates.push(e.date),L(i)>t)return n.dates.pop(),"break"}else if(i.push({agent:e.agent,dates:[e.date]}),L(i)>t)return i.pop(),"break";s=s.slice(1)};try{for(var c=o.__values(e),u=c.next();!u.done&&"break"!==a(u.value);u=c.next());}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return{heartbeatsToSend:i,unsentEntries:s}}(this._heartbeatsCache.heartbeats),n=t.heartbeatsToSend,r=t.unsentEntries,i=c.base64urlEncodeWithoutPadding(JSON.stringify({version:2,heartbeats:n})),this._heartbeatsCache.lastSentHeartbeatDate=e,r.length>0?(this._heartbeatsCache.heartbeats=r,[4,this._storage.overwrite(this._heartbeatsCache)]):[3,4]);case 3:return s.sent(),[3,5];case 4:this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache),s.label=5;case 5:return[2,i]}})})},e}();function R(){return(new Date).toISOString().substring(0,10)}var P=function(){function e(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}return e.prototype.runIndexedDBEnvironmentCheck=function(){return o.__awaiter(this,void 0,void 0,function(){return o.__generator(this,function(e){return c.isIndexedDBAvailable()?[2,c.validateIndexedDBOpenable().then(function(){return!0}).catch(function(){return!1})]:[2,!1]})})},e.prototype.read=function(){return o.__awaiter(this,void 0,void 0,function(){return o.__generator(this,function(e){switch(e.label){case 0:return[4,this._canUseIndexedDBPromise];case 1:return e.sent()?[3,2]:[2,{heartbeats:[]}];case 2:return[4,x(this.app)];case 3:return[2,e.sent()||{heartbeats:[]}]}})})},e.prototype.overwrite=function(e){var t;return o.__awaiter(this,void 0,void 0,function(){var n;return o.__generator(this,function(r){switch(r.label){case 0:return[4,this._canUseIndexedDBPromise];case 1:return r.sent()?[3,2]:[2];case 2:return[4,this.read()];case 3:return n=r.sent(),[2,O(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:e.heartbeats})]}})})},e.prototype.add=function(e){var t;return o.__awaiter(this,void 0,void 0,function(){var n;return o.__generator(this,function(r){switch(r.label){case 0:return[4,this._canUseIndexedDBPromise];case 1:return r.sent()?[3,2]:[2];case 2:return[4,this.read()];case 3:return n=r.sent(),[2,O(this.app,{lastSentHeartbeatDate:null!==(t=e.lastSentHeartbeatDate)&&void 0!==t?t:n.lastSentHeartbeatDate,heartbeats:o.__spreadArray(o.__spreadArray([],o.__read(n.heartbeats),!1),o.__read(e.heartbeats),!1)})]}})})},e}();function L(e){return c.base64urlEncodeWithoutPadding(JSON.stringify({version:2,heartbeats:e})).length}w(new s.Component("platform-logger",function(e){return new l(e)},"PRIVATE")),w(new s.Component("heartbeat",function(e){return new N(e)},"PRIVATE")),S(h,d,"node"),S(h,d,"cjs5"),S("fire-js",""),Object.defineProperty(t,"FirebaseError",{enumerable:!0,get:function(){return c.FirebaseError}}),t.SDK_VERSION="9.23.0",t._DEFAULT_ENTRY_NAME=p,t._addComponent=y,t._addOrOverwriteComponent=function(e,t){e.container.addOrOverwriteComponent(t)},t._apps=m,t._clearComponents=function(){v.clear()},t._components=v,t._getProvider=b,t._registerComponent=w,t._removeServiceInstance=function(e,t,n){void 0===n&&(n=p),b(e,t).clearInstance(n)},t.deleteApp=function(e){return o.__awaiter(this,void 0,void 0,function(){var t;return o.__generator(this,function(n){switch(n.label){case 0:return t=e.name,m.has(t)?(m.delete(t),[4,Promise.all(e.container.getProviders().map(function(e){return e.delete()}))]):[3,2];case 1:n.sent(),e.isDeleted=!0,n.label=2;case 2:return[2]}})})},t.getApp=function(e){void 0===e&&(e=p);var t=m.get(e);if(!t&&e===p&&c.getDefaultAppConfig())return T();if(!t)throw I.create("no-app",{appName:e});return t},t.getApps=function(){return Array.from(m.values())},t.initializeApp=T,t.onLog=function(e,t){if(null!==e&&"function"!=typeof e)throw I.create("invalid-log-argument");a.setUserLogHandler(e,t)},t.registerVersion=S,t.setLogLevel=function(e){a.setLogLevel(e)}},62527:function(e,t,n){"use strict";n.d(t,{T:function(){return r}});var r=function(e){return"number"==typeof e}},62945:function(e){e.exports=function(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;
2if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),c=0;c<s.length;c++){var u=s[c];if(!a(u))return!1;var l=e[u],h=t[u];if(!1===(i=n?n.call(r,l,h,u):void 0)||void 0===i&&l!==h)return!1}return!0}},63095:function(e,t,n){var r=n(97004),i=n(48793),s=n(1404),o=n(63661),a=n(12368),c=n(68562),u=n(15996),l=n(99569),h=i("Reflect","construct"),d=l(function(){function e(){}return!(h(function(){},[],e)instanceof e)}),f=!l(function(){h(function(){})}),p=d||f;r({target:"Reflect",stat:!0,forced:p,sham:p},{construct:function(e,t){s(e),o(t);var n=arguments.length<3?e:s(arguments[2]);if(f&&!d)return h(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}var r=[null];return r.push.apply(r,t),new(u.apply(e,r))}var i=n.prototype,l=c(a(i)?i:Object.prototype),p=Function.apply.call(e,l,t);return a(p)?p:l}})},63293:function(e,t,n){"use strict";var r=n(1404),i=function(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new i(e)}},63661:function(e,t,n){var r=n(12368);e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},64065:function(e,t,n){"use strict";n.d(t,{X4:function(){return o},ai:function(){return s},hs:function(){return a}});var r=n(35285),i=n(47393),s={test:function(e){return"number"==typeof e},parse:parseFloat,transform:function(e){return e}},o=(0,r.__assign)((0,r.__assign)({},s),{transform:(0,i.qE)(0,1)}),a=(0,r.__assign)((0,r.__assign)({},s),{default:1})},65114:function(e,t,n){"use strict";var r=n(84263),i=n(55119),s=n(94063),o=n(82651),a=n(8216),c="Array Iterator",u=o.set,l=o.getterFor(c);e.exports=a(Array,"Array",function(e,t){u(this,{type:c,target:r(e),index:0,kind:t})},function(){var e=l(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}},"values"),s.Arguments=s.Array,i("keys"),i("values"),i("entries")},65813:function(e,t,n){"use strict";n.d(t,{A:function(){return g}});var r=n(38095),i=function(e,t){return 1-3*t+3*e},s=function(e,t){return 3*t-6*e},o=function(e){return 3*e},a=function(e,t,n){return((i(t,n)*e+s(t,n))*e+o(t))*e},c=function(e,t,n){return 3*i(t,n)*e*e+2*s(t,n)*e+o(t)},u=1e-7,l=10,h=8,d=.001,f=11,p=1/(f-1);function g(e,t,n,i){if(e===t&&n===i)return r.sn;for(var s=new Float32Array(f),o=0;o<f;++o)s[o]=a(o*p,e,n);return function(r){return 0===r||1===r?r:a(function(t){for(var r=0,i=1,o=f-1;i!==o&&s[i]<=t;++i)r+=p;--i;var g=r+(t-s[i])/(s[i+1]-s[i])*p,m=c(g,e,n);return m>=d?function(e,t,n,r){for(var i=0;i<h;++i){var s=c(t,n,r);if(0===s)return t;t-=(a(t,n,r)-e)/s}return t}(t,g,e,n):0===m?g:function(e,t,n,r,i){var s,o,c=0;do{(s=a(o=t+(n-t)/2,r,i)-e)>0?n=o:t=o}while(Math.abs(s)>u&&++c<l);return o}(t,r,r+p,e,n)}(r),t,i)}}},65927:function(e,t,n){var r,i,s,o=n(61581),a=n(99569),c=n(22554),u=n(88659),l=n(71233),h=n(21081),d=n(89750),f=o.location,p=o.setImmediate,g=o.clearImmediate,m=o.process,v=o.MessageChannel,y=o.Dispatch,w=0,b={},_="onreadystatechange",I=function(e){if(b.hasOwnProperty(e)){var t=b[e];delete b[e],t()}},E=function(e){return function(){I(e)}},T=function(e){I(e.data)},S=function(e){o.postMessage(e+"",f.protocol+"//"+f.host)};p&&g||(p=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return b[++w]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},r(w),w},g=function(e){delete b[e]},d?r=function(e){m.nextTick(E(e))}:y&&y.now?r=function(e){y.now(E(e))}:v&&!h?(s=(i=new v).port2,i.port1.onmessage=T,r=c(s.postMessage,s,1)):o.addEventListener&&"function"==typeof postMessage&&!o.importScripts&&f&&"file:"!==f.protocol&&!a(S)?(r=S,o.addEventListener("message",T,!1)):r=_ in l("script")?function(e){u.appendChild(l("script"))[_]=function(){u.removeChild(this),I(e)}}:function(e){setTimeout(E(e),0)}),e.exports={set:p,clear:g}},66706:function(e,t,n){var r=n(75748),i=Date.prototype,s="Invalid Date",o="toString",a=i[o],c=i.getTime;new Date(NaN)+""!=s&&r(i,o,function(){var e=c.call(this);return e==e?a.call(this):s})},66774:function(e,t,n){"use strict";var r=n(7099),i=n(96435),s=n(70354);e.exports=function(e,t,n){var o=r(t);o in e?i.f(e,o,s(0,n)):e[o]=n}},68043:function(e,t,n){"use strict";function r(e,t){return t?e*(1e3/t):0}n.d(t,{f:function(){return r}})},68292:function(e,t,n){"use strict";n.d(t,{B:function(){return u}});var r=n(35285),i=n(64065),s=n(47393),o=n(72049),a=(0,s.qE)(0,255),c=(0,r.__assign)((0,r.__assign)({},i.ai),{transform:function(e){return Math.round(a(e))}}),u={test:(0,o.$)("rgb","red"),parse:(0,o.q)("red","green","blue"),transform:function(e){var t=e.red,n=e.green,r=e.blue,o=e.alpha,a=void 0===o?1:o;return"rgba("+c.transform(t)+", "+c.transform(n)+", "+c.transform(r)+", "+(0,s.aj)(i.X4.transform(a))+")"}}},68309:function(e,t,n){"use strict";n.d(t,{A:function(){return s}});var r,i=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInl
2ine|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,s=(r={},function(e){return void 0===r[e]&&(r[e]=(t=e,i.test(t)||111===t.charCodeAt(0)&&110===t.charCodeAt(1)&&t.charCodeAt(2)<91)),r[e];var t})},68437:function(e,t,n){var r=n(474);e.exports=function(e){if(r(e))throw TypeError("The method doesn't accept regular expressions");return e}},68562:function(e,t,n){var r,i=n(63661),s=n(7967),o=n(27485),a=n(96331),c=n(88659),u=n(71233),l=n(84201),h="prototype",d="script",f=l("IE_PROTO"),p=function(){},g=function(e){return"<"+d+">"+e+"</"+d+">"},m=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t,n;m=r?function(e){e.write(g("")),e.close();var t=e.parentWindow.Object;return e=null,t}(r):(t=u("iframe"),n="java"+d+":",t.style.display="none",c.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(g("document.F=Object")),e.close(),e.F);for(var i=o.length;i--;)delete m[h][o[i]];return m()};a[f]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(p[h]=i(e),n=new p,p[h]=null,n[f]=e):n=m(),void 0===t?n:s(n,t)}},68837:function(e,t,n){var r=n(1918);
2Object.defineProperty(t,"__esModule",{value:!0}),t.deleteDocument=t.revalidateCollection=t.revalidateDocument=t.update=t.set=void 0;var i=r(n(49145)),s=n(44134),o=n(85191),a=n(8732),c=n(24370);function u(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?u(Object(n),!0).forEach(function(t){(0,i.default)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}t.revalidateDocument=function(e){return(0,s.mutate)(e)},t.revalidateCollection=function(e){var t=[];return c.collectionCache.getSWRKeysFromCollectionPath(e).forEach(function(e){t.push((0,s.mutate)(e))}),Promise.all(t)},t.set=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(null===e)return null;if(e.trim().split("/").filter(Boolean).length%2!=0)throw new Error("[@nandorojo/swr-firestore] error: called set() function with path: ".concat(e,". This is not a valid document path. \n \ndata: ").concat(JSON.stringify(t)));r||(0,s.mutate)(e,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.empty.object;return(null==n?void 0:n.merge)?l({},e,{},t):t},!1);var i=e.split("/").filter(Boolean),u=i.pop();return i=i.join("/"),c.collectionCache.getSWRKeysFromCollectionPath(i).forEach(function(e){(0,s.mutate)(e,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.empty.array;return e.some(function(e){return e.id===u})?e.map(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.empty.object;return e.id===u&&(null==n?void 0:n.merge)?l({},e,{},t):e}):e},!1)}),o.fuego.db.doc(e).set(t,n)},t.update=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(null===e)return null;if(e.trim().split("/").filter(Boolean).length%2!=0)throw new Error("[@nandorojo/swr-firestore] error: called update function with path: ".concat(e,". This is not a valid document path. \n \ndata: ").concat(JSON.stringify(t)));n||(0,s.mutate)(e,function(){return l({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.empty.object,{},t)},!1);var r=e.split("/").filter(Boolean),i=r.pop();return r=r.join("/"),c.collectionCache.getSWRKeysFromCollectionPath(r).forEach(function(e){(0,s.mutate)(e,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.empty.array;return e.some(function(e){return e.id===i})?e.map(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.empty.object;return e.id===i?l({},e,{},t):e}):e},!1)}),o.fuego.db.doc(e).update(t)},t.deleteDocument=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(null===e)return null;if(e.trim().split("/").filter(Boolean).length%2!=0)throw new Error("[@nandorojo/swr-firestore] error: called delete() function with path: ".concat(e,". This is not a valid document path."));if(!t){(0,s.mutate)(e,null,!1);var n=e.split("/").filter(Boolean),r=n.pop();n=n.join("/"),c.collectionCache.getSWRKeysFromCollectionPath(n).forEac
2h(function(e){(0,s.mutate)(e,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a.empty.array;return e.some(function(e){return e&&e.id===r})?e.filter(function(e){return!!e&&e.id!==r}):e},!1)})}return o.fuego.db.doc(e).delete()}},69188:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(62165);r.registerVersion("firebase","9.23.0","app"),Object.keys(r).forEach(function(e){"default"===e||t.hasOwnProperty(e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})})},69866:function(e,t,n){n(97004)({target:"Object",stat:!0,sham:!n(5686)},{create:n(68562)})},70354:function(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},70484:function(e,t,n){var r=n(12368);e.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},70489:function(e,t,n){var r=n(63661),i=n(70484);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,s){return r(n),i(s),t?e.call(n,s):n.__proto__=s,n}}():void 0)},70710:function(e,t,n){"use strict";n.d(t,{KN:function(){return a},gQ:function(){return h},px:function(){return c},uj:function(){return o},vh:function(){return u},vw:function(){return l}});var r=n(35285),i=n(47393),s=function(e){return{test:function(t){return(0,i.Kg)(t)&&t.endsWith(e)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return""+t+e}}},o=s("deg"),a=s("%"),c=s("px"),u=s("vh"),l=s("vw"),h=(0,r.__assign)((0,r.__assign)({},a),{parse:function(e){return a.parse(e)/100},transform:function(e){return a.transform(100*e)}})},71233:function(e,t,n){var r=n(61581),i=n(12368),s=r.document,o=i(s)&&i(s.createElement);e.exports=function(e){return o?s.createElement(e):{}}},71984:function(e,t,n){"use strict";n.d(t,{q:function(){return r}});var r=function(e,t,n){return Math.min(Math.max(n,e),t)}},72049:function(e,t,n){"use strict";n.d(t,{$:function(){return i},q:function(){return s}});var r=n(47393),i=function(e,t){return function(n){return Boolean((0,r.Kg)(n)&&r.Fl.test(n)&&n.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(n,t))}},s=function(e,t,n){return function(i){var s;if(!(0,r.Kg)(i))return i;var o=i.match(r.SY),a=o[0],c=o[1],u=o[2],l=o[3];return(s={})[e]=parseFloat(a),s[t]=parseFloat(c),s[n]=parseFloat(u),s.alpha=void 0!==l?parseFloat(l):1,s}}},72134:function(e,t,n){var r=n(48793);e.exports=r("navigator","userAgent")||""},72926:function(e){"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r=n.css,i=n.media,s=n.sourceMap;i?e.setAttribute("media",i):e.removeAttribute("media"),s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(r,e)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},73131:function(e,t,n){var r=n(99569),i=n(85929),s=n(1106),o=i("species");e.exports=function(e){return s>=51||!r(function(){var t=[];return(t.constructor={})[o]=function(){return{foo:1}},1!==t[e](Boolean).foo})}},74250:function(e,t,n){var r={};r[n(85929)("toStringTag")]="z",e.exports="[object z]"===String(r)},74277:function(e,t,n){"use strict";var r=n(97004),i=n(5686),s=n(61581),o=n(24060),a=n(12368),c=n(96435).f,u=n(56158),l=s.Symbol;if(i&&"function"==typeof l&&(!("description"in l.prototype)||void 0!==l().description)){var h={},d=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof d?new l(e):void 0===e?l():l(e);return""===e&&(h[t]=!0),t};u(d,l);var f=d.prototype=l.prototype;f.constructor=d;var p=f.toString,g="Symbol(test)"==String(l("test")),m=/^Symbol\((.*)\)[^)]+$/;c(f,"description",{configurable:!0,get:function(){var e=a(this)?this.valueOf():this,t=p.call(e);if(o(h,e))return"";var n=g?t.slice(7,-1):t.replace(m,"$1");return""===n?void 0:n}}),r({global:!0,forced:!0},{Symbol:d})}},75080:function(e,t,n){var r=n(61581);e.exports=r.Promise},75194:function(e,t,n){"use strict";
2Object.defineProperty(t,"__esModule",{value:!0});var r=n(35285),i=n(20469),s=function(){function e(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}return e.prototype.setInstantiationMode=function(e){return this.instantiationMode=e,this},e.prototype.setMultipleInstances=function(e){return this.multipleInstances=e,this},e.prototype.setServiceProps=function(e){return this.serviceProps=e,this},e.prototype.setInstanceCreatedCallback=function(e){return this.onInstanceCreated=e,this},e}(),o="[DEFAULT]",a=function(){function e(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}return e.prototype.get=function(e){var t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){var n=new i.Deferred;if(this.instancesDeferred.set(t,n),this.isInitialized(t)||this.shouldAutoInitialize())try{var r=this.getOrInitializeService({instanceIdentifier:t});r&&n.resolve(r)}catch(e){}}return this.instancesDeferred.get(t).promise},e.prototype.getImmediate=function(e){var t,n=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),r=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(r)return null;throw Error("Service ".concat(this.name," is not available"))}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(e){if(r)return null;throw e}},e.prototype.getComponent=function(){return this.component},e.prototype.setComponent=function(e){var t,n;if(e.name!==this.name)throw Error("Mismatching Component ".concat(e.name," for Provider ").concat(this.name,"."));if(this.component)throw Error("Component for ".concat(this.name," has already been provided"));if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:o})}catch(e){}try{for(var i=r.__values(this.instancesDeferred.entries()),s=i.next();!s.done;s=i.next()){var a=r.__read(s.value,2),c=a[0],u=a[1],l=this.normalizeInstanceIdentifier(c);try{var h=this.getOrInitializeService({instanceIdentifier:l});u.resolve(h)}catch(e){}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}}},e.prototype.clearInstance=function(e){void 0===e&&(e=o),this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)},e.prototype.delete=function(){return r.__awaiter(this,void 0,void 0,function(){var e;return r.__generator(this,function(t){switch(t.label){case 0:return e=Array.from(this.instances.values()),[4,Promise.all(r.__spreadArray(r.__spreadArray([],r.__read(e.filter(function(e){return"INTERNAL"in e}).map(function(e){return e.INTERNAL.delete()})),!1),r.__read(e.filter(function(e){return"_delete"in e}).map(function(e){return e._delete()})),!1))];case 1:return t.sent(),[2]}})})},e.prototype.isComponentSet=function(){return null!=this.component},e.prototype.isInitialized=function(e){return void 0===e&&(e=o),this.instances.has(e)},e.prototype.getOptions=function(e){return void 0===e&&(e=o),this.instancesOptions.get(e)||{}},e.prototype.initialize=function(e){var t,n;void 0===e&&(e={});var i=e.options,s=void 0===i?{}:i,o=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(o))throw Error("".concat(this.name,"(").concat(o,") has already been initialized"));if(!this.isComponentSet())throw Error("Component ".concat(this.name," has not been registered yet"));var a=this.getOrInitializeService({instanceIdentifier:o,options:s});try{for(var c=r.__values(this.instancesDeferred.entries()),u=c.next();!u.done;u=c.next()){var l=r.__read(u.value,2),h=l[0],d=l[1];o===this.normalizeInstanceIdentifier(h)&&d.resolve(a)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return a},e.prototype.onInit=function(e,t){var n,r=this.normalizeInstanceIdentifier(t),i=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;i.add(e),this.onInitCallbacks.set(r,i);var s=this.instances.get(r);return s&&e(s,r),function(){i.delete(e)}},e.prototype.invokeOnInitCallbacks=function(e,t){var n,i,s=this.onInitCallbacks.get(t);if(s)try{for(var o=r.__values(s),a=o.next();!a.done;a=o.next()){var c=a.value;try{c(e,t)}catch(e){}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}},e.prototype.getOrInitializeService=function(e){var t,n=e.instanceIdentifier,r=e.options,i=void 0===r?{}:r,s=this.instances.get(n);if(!s&&this.component&&(s=this.component.instanceFactory(this.container,{instanceIdentifier:(t=n,t===o?void 0:t),options:i}),this.instances.set(n,s),this.instancesOptions.set(n,i),this.invokeOnInitCallbacks(s,n),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,n,s)}catch(e){}return s||null},e.prototype.normalizeInstanceIdentifier=function(e){return void 0===e&&(e=o),this.component?this.component.multipleInstances?e:o:e},e.prototype.shouldAutoInitialize=function(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode},e}(),c=function(){function e(e){this.name=e,this.providers=new Map}return e.prototype.addComponent=function(e){var t=this.getProvider(e.name);if(t.isComponentSet())throw new Error("Component ".concat(e.name," has already been registered with ").concat(this.name));t.setComponent(e)},e.prototype.addOrOverwriteComponent=function(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)},e.prototype.getProvider=function(e){if(this.providers.has(e))return this.providers.get(e);var t=new a(e,this);return this.providers.set(e,t),t},e.prototype.getProviders=function(){return Array.from(this.providers.values())},e}();t.Component=s,t.ComponentContainer=c,t.Provider=a},75748:function(e,t,n){var r=n(61581),i=n(11941),s=n(24060),o=n(6618),a=n(60220),c=n(82651),u=c.get,l=c.enforce,h=String(String).split("String");
2(e.exports=function(e,t,n,a){var c,u=!!a&&!!a.unsafe,d=!!a&&!!a.enumerable,f=!!a&&!!a.noTargetGet;"function"==typeof n&&("string"!=typeof t||s(n,"name")||i(n,"name",t),(c=l(n)).source||(c.source=h.join("string"==typeof t?t:""))),e!==r?(u?!f&&e[t]&&(d=!0):delete e[t],d?e[t]=n:i(e,t,n)):d?e[t]=n:o(t,n)})(Function.prototype,"toString",function(){return"function"==typeof this&&u(this).source||a(this)})},75868:function(e,t,n){var r=n(5686),i=n(96435).f,s=Function.prototype,o=s.toString,a=/^\s*function ([^ (]*)/,c="name";r&&!(c in s)&&i(s,c,{configurable:!0,get:function(){try{return o.call(this).match(a)[1]}catch(e){return""}}})},76591:function(e,t,n){"use strict";e.exports=n(60088)},76993:function(e,t,n){var r=n(1918);Object.defineProperty(t,"__esModule",{value:!0}),t.useCollectionGroup=t.useExperimentalCollectionGroup=void 0;var i=r(n(49145)),s=n(84999);function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(Object(n),!0).forEach(function(t){(0,i.default)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}t.useExperimentalCollectionGroup=function(e,t,n){return console.warn("[swr-firestore] useExperimentalCollectionGroup is deprecated. Switch to useCollectionGroup."),(0,s.useCollection)(e,a({},t,{isCollectionGroup:!0}),n)},t.useCollectionGroup=function(e,t,n){return(0,s.useCollection)(e,a({},t,{isCollectionGroup:!0}),n)}},77157:function(e,t,n){"use strict";n.d(t,{j:function(){return r}});var r=function(e,t,n){return-n*e+n*t+e}},77265:function(e,t,n){var r=n(48793),i=n(83982),s=n(77347),o=n(63661);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(o(e)),n=s.f;return n?t.concat(n(e)):t}},77347:function(e,t){t.f=Object.getOwnPropertySymbols},77629:function(e){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},77654:function(e,t,n){"use strict";var r=n(5686),i=n(61581),s=n(4754),o=n(75748),a=n(24060),c=n(16054),u=n(88165),l=n(7099),h=n(99569),d=n(68562),f=n(83982).f,p=n(78825).f,g=n(96435).f,m=n(6168).trim,v="Number",y=i[v],w=y.prototype,b=c(d(w))==v,_=function(e){var t,n,r,i,s,o,a,c,u=l(e,!1);if("string"==typeof u&&u.length>2)if(43===(t=(u=m(u)).charCodeAt(0))||45===t){if(88===(n=u.charCodeAt(2))||120===n)return NaN}else if(48===t){switch(u.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+u}for(o=(s=u.slice(2)).length,a=0;a<o;a++)if((c=s.charCodeAt(a))<48||c>i)return NaN;return parseInt(s,r)}return+u};if(s(v,!y(" 0o1")||!y("0b1")||y("+0x1"))){for(var I,E=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof E&&(b?h(function(){w.valueOf.call(n)}):c(n)!=v)?u(new y(_(t)),n,E):_(t)},T=r?f(y):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),S=0;T.length>S;S++)a(y,I=T[S])&&!a(E,I)&&g(E,I,p(y,I));E.prototype=w,w.constructor=E,o(i,v,E)}},77994:function(e){"use strict";function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}e.exports=function(e){var n,r,i=(r=4,function(e){if(Array.isArray(e))return e}(n=e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=n){var r,i,s=[],o=!0,a=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(s.push(r.value),!t||s.length!==t);o=!0);}catch(e){a=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(a)throw i}}return s}}(n,r)||function(e,n){if(e){if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}
2(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=i[1],o=i[3];if("function"==typeof btoa){var a=btoa(unescape(encodeURIComponent(JSON.stringify(o)))),c="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(a),u="/*# ".concat(c," */"),l=o.sources.map(function(e){return"/*# sourceURL=".concat(o.sourceRoot||"").concat(e," */")});return[s].concat(l).concat([u]).join("\n")}return[s].join("\n")}},78825:function(e,t,n){var r=n(5686),i=n(91635),s=n(70354),o=n(84263),a=n(7099),c=n(24060),u=n(23311),l=Object.getOwnPropertyDescriptor;t.f=r?l:function(e,t){if(e=o(e),t=a(t,!0),u)try{return l(e,t)}catch(e){}if(c(e,t))return s(!i.f.call(e,t),e[t])}},79164:function(e,t,n){var r=n(84263),i=n(83982).f,s={}.toString,o="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return o&&"[object Window]"==s.call(e)?function(e){try{return i(e)}catch(e){return o.slice()}}(e):i(r(e))}},79177:function(e,t,n){var r=n(57956),i=n(93992),s=function(e){return function(t,n){var s,o,a=String(i(t)),c=r(n),u=a.length;return c<0||c>=u?e?"":void 0:(s=a.charCodeAt(c))<55296||s>56319||c+1===u||(o=a.charCodeAt(c+1))<56320||o>57343?e?a.charAt(c):s:e?a.slice(c,c+2):o-56320+(s-55296<<10)+65536}};e.exports={codeAt:s(!1),charAt:s(!0)}},80019:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},80265:function(e,t,n){var r=n(61581),i=n(60220),s=r.WeakMap;e.exports="function"==typeof s&&/native code/.test(i(s))},80545:function(e,t,n){"use strict";var r=n(97004),i=n(39571).includes,s=n(55119);r({target:"Array",proto:!0},{includes:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}}),s("includes")},81254:function(e){function t(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=t=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=t=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),t(n)}e.exports=t,e.exports.default=e.exports,e.exports.__esModule=!0},81481:function(e,t,n){"use strict";n.d(t,{A:function(){return r.A}});var r=n(51624);r.A.registerVersion("firebase","9.23.0","app-compat")},81670:function(e,t,n){var r=n(51387);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},82184:function(e,t,n){"use strict";n.d(t,{V:function(){return a}});var r=n(64065),i=n(70710),s=n(47393),o=n(72049),a={test:(0,o.$)("hsl","hue"),parse:(0,o.q)("hue","saturation","lightness"),transform:function(e){var t=e.hue,n=e.saturation,o=e.lightness,a=e.alpha,c=void 0===a?1:a;return"hsla("+Math.round(t)+", "+i.KN.transform((0,s.aj)(n))+", "+i.KN.transform((0,s.aj)(o))+", "+(0,s.aj)(r.X4.transform(c))+")"}}},82185:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(e,t,n){e[t]=n.value},s="function"==typeof Symbol?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function l(e,t,n,r){var s=t&&t.prototype instanceof v?t:v,o=Object.create(s.prototype),a=new O(r||[]);return i(o,"_invoke",{value:k(e,n,a)}),o}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var d="suspendedStart",f="suspendedYield",p="executing",g="completed",m={};function v(){}function y(){}function w(){}var b={};u(b,o,function(){return this});var _=Object.getPrototypeOf,I=_&&_(_(D([])));I&&I!==n&&r.call(I,o)&&(b=I);var E=w.prototype=v.prototype=Object.create(b);function T(e){["next","throw","return"].forEach(function(t){u(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){function n(i,s,o,a){var c=h(e[i],e,s);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==typeof l&&r.call(l,"__await")?t.resolve(l.__await).then(function(e){n("next",e,o,a)},function(e){n("throw",e,o,a)}):t.resolve(l).then(function(e){u.value=e,o(u)},function(e){return n("throw",e,o,a)})}a(c.arg)}var s;i(this,"_invoke",{value:function(e,r){function i(){return new t(function(t,i){n(e,r,t,i)})}return s=s?s.then(i,i):i()}})}function k(e,n,r){var i=d;return function(s,o){if(i===p)throw new Error("Generator is already running");if(i===g){if("throw"===s)throw o;return{value:t,done:!0}}for(r.method=s,r.arg=o;;){var a=r.delegate;if(a){var c=A(a,r);if(c){if(c===m)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===d)throw i=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=p;var u=h(e,n,r);if("normal"===u.type){if(i=r.done?g:f,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=g,r.method="throw",r.arg=u.arg)}}}function A(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator.return&&
vendor: 5,031 bytes, line 2
2(n.method="return",n.arg=t,A(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var s=h(i,e.iterator,n.arg);if("throw"===s.type)return n.method="throw",n.arg=s.arg,n.delegate=null,m;var o=s.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function D(e){if(null!=e){var n=e[o];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,s=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return s.next=s}}throw new TypeError(typeof e+" is not iterable")}return y.prototype=w,i(E,"constructor",{value:w,configurable:!0}),i(w,"constructor",{value:y,configurable:!0}),y.displayName=u(w,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,u(e,c,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},T(S.prototype),u(S.prototype,a,function(){return this}),e.AsyncIterator=S,e.async=function(t,n,r,i,s){void 0===s&&(s=Promise);var o=new S(l(t,n,r,i),s);return e.isGeneratorFunction(n)?o:o.next().then(function(e){return e.done?e.value:o.next()})},T(E),u(E,c,"Generator"),u(E,o,function(){return this}),u(E,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=D,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return a.type="throw",a.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var o=this.tryEntries[s],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(c&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=e,o.arg=t,s?(this.method="next",this.next=s.finallyLoc,m):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:D(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},82290:function(e){e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},82651:function(e,t,n){var r,i,s,o=n(80265),a=n(61581),c=n(12368),u=n(11941),l=n(24060),h=n(
251983),d=n(84201),f=n(96331),p="Object already initialized",g=a.WeakMap;if(o||h.state){var m=h.state||(h.state=new g),v=m.get,y=m.has,w=m.set;r=function(e,t){if(y.call(m,e))throw new TypeError(p);return t.facade=e,w.call(m,e,t),t},i=function(e){return v.call(m,e)||{}},s=function(e){return y.call(m,e)}}else{var b=d("state");f[b]=!0,r=function(e,t){if(l(e,b))throw new TypeError(p);return t.facade=e,u(e,b,t),t},i=function(e){return l(e,b)?e[b]:{}},s=function(e){return l(e,b)}}e.exports={set:r,get:i,has:s,enforce:function(e){return s(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=i(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}}},82676:function(e){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},83483:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(97945);Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})});var i=n(276);
vendor: 2,486 bytes, line 2
2Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var s=n(85191);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})});var o=n(11566);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})})},83982:function(e,t,n){var r=n(1422),i=n(27485).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},84059:function(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var s,o,a=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),c=1;c<arguments.length;c++){for(var u in s=Object(arguments[c]))n.call(s,u)&&(a[u]=s[u]);if(t){o=t(s);for(var l=0;l<o.length;l++)r.call(s,o[l])&&(a[o[l]]=s[o[l]])}}return a}},84136:function(e,t,n){"use strict";n.d(t,{DU:function(){return Re},AH:function(){return me},Ay:function(){return Le},i7:function(){return Pe}});var r=n(35959),i=n(37953),s=n(62945),o=n.n(s),a=function(e){function t(e,r,c,u,d){for(var f,p,g,m,b,I=0,E=0,T=0,S=0,k=0,N=0,P=g=f=0,M=0,F=0,j=0,U=0,V=c.length,B=V-1,q="",z="",$="",G="";M<V;){if(p=c.charCodeAt(M),M===B&&0!==E+S+T+I&&(0!==E&&(p=47===E?10:47),S=T=I=0,V++,B++),0===E+S+T+I){if(M===B&&(0<F&&(q=q.replace(h,"")),0<q.trim().length)){switch(p){case 32:case 9:case 59:case 13:case 10:break;default:q+=c.charAt(M)}p=59}switch(p){case 123:for(f=(q=q.trim()).charCodeAt(0),g=1,U=++M;M<V;){switch(p=c.charCodeAt(M)){case 123:g++;break;case 125:g--;break;case 47:switch(p=c.charCodeAt(M+1)){case 42:case 47:e:{for(P=M+1;P<B;++P)switch(c.charCodeAt(P)){case 47:if(42===p&&42===c.charCodeAt(P-1)&&M+2!==P){M=P+1;break e}break;case 10:if(47===p){M=P+1;break e}}M=P}}break;case 91:p++;case 40:p++;case 34:case 39:for(;
vendor: 11,551 bytes, line 2
2M++<B&&c.charCodeAt(M)!==p;);}if(0===g)break;M++}if(g=c.substring(U,M),0===f&&(f=(q=q.replace(l,"").trim()).charCodeAt(0)),64===f){switch(0<F&&(q=q.replace(h,"")),p=q.charCodeAt(1)){case 100:case 109:case 115:case 45:F=r;break;default:F=D}if(U=(g=t(r,F,g,p,d+1)).length,0<R&&(b=a(3,g,F=n(D,q,j),r,C,A,U,p,d,u),q=F.join(""),void 0!==b&&0===(U=(g=b.trim()).length)&&(p=0,g="")),0<U)switch(p){case 115:q=q.replace(_,o);case 100:case 109:case 45:g=q+"{"+g+"}";break;case 107:g=(q=q.replace(v,"$1 $2"))+"{"+g+"}",g=1===O||2===O&&s("@"+g,3)?"@-webkit-"+g+"@"+g:"@"+g;break;default:g=q+g,112===u&&(z+=g,g="")}else g=""}else g=t(r,n(r,q,j),g,u,d+1);$+=g,g=j=F=P=f=0,q="",p=c.charCodeAt(++M);break;case 125:case 59:if(1<(U=(q=(0<F?q.replace(h,""):q).trim()).length))switch(0===P&&(f=q.charCodeAt(0),45===f||96<f&&123>f)&&(U=(q=q.replace(" ",":")).length),0<R&&void 0!==(b=a(1,q,r,e,C,A,z.length,u,d,u))&&0===(U=(q=b.trim()).length)&&(q="\0\0"),f=q.charCodeAt(0),p=q.charCodeAt(1),f){case 0:break;case 64:if(105===p||99===p){G+=q+c.charAt(M);break}default:58!==q.charCodeAt(U-1)&&(z+=i(q,f,p,q.charCodeAt(2)))}j=F=P=f=0,q="",p=c.charCodeAt(++M)}}switch(p){case 13:case 10:47===E?E=0:0===1+f&&107!==u&&0<q.length&&(F=1,q+="\0"),0<R*L&&a(0,q,r,e,C,A,z.length,u,d,u),A=1,C++;break;case 59:case 125:if(0===E+S+T+I){A++;break}default:switch(A++,m=c.charAt(M),p){case 9:case 32:if(0===S+I+E)switch(k){case 44:case 58:case 9:case 32:m="";break;default:32!==p&&(m=" ")}break;case 0:m="\\0";break;case 12:m="\\f";break;case 11:m="\\v";break;case 38:0===S+E+I&&(F=j=1,m="\f"+m);break;case 108:if(0===S+E+I+x&&0<P)switch(M-P){case 2:112===k&&58===c.charCodeAt(M-3)&&(x=k);case 8:111===N&&(x=N)}break;case 58:0===S+E+I&&(P=M);break;case 44:0===E+T+S+I&&(F=1,m+="\r");break;case 34:case 39:0===E&&(S=S===p?0:0===S?p:S);break;case 91:0===S+E+T&&I++;break;case 93:0===S+E+T&&I--;break;case 41:0===S+E+I&&T--;break;case 40:0===S+E+I&&(0===f&&(2*k+3*N==533||(f=1)),T++);break;case 64:0===E+T+S+I+P+g&&(g=1);break;case 42:case 47:if(!(0<S+I+T))switch(E){case 0:switch(2*p+3*c.charCodeAt(M+1)){case 235:E=47;break;case 220:U=M,E=42}break;case 42:47===p&&42===k&&U+2!==M&&(33===c.charCodeAt(U+2)&&(z+=c.substring(U,M+1)),m="",E=0)}}0===E&&(q+=m)}N=k,k=p,M++}if(0<(U=z.length)){if(F=r,0<R&&void 0!==(b=a(2,z,F,e,C,A,U,u,d,u))&&0===(z=b).length)return G+z+$;if(z=F.join(",")+"{"+z+"}",0!==O*x){switch(2!==O||s(z,2)||(x=0),x){case 111:z=z.replace(w,":-moz-$1")+z;break;case 112:z=z.replace(y,"::-webkit-input-$1")+z.replace(y,"::-moz-$1")+z.replace(y,":-ms-input-$1")+z}x=0}}return G+z+$}function n(e,t,n){var i=t.trim().split(g);t=i;var s=i.length,o=e.length;switch(o){case 0:case 1:var a=0;for(e=0===o?"":e[0]+" ";a<s;++a)t[a]=r(e,t[a],n).trim();break;default:var c=a=0;for(t=[];a<s;++a)for(var u=0;u<o;++u)t[c++]=r(e[u]+" ",i[a],n).trim()}return t}function r(e,t,n){var r=t.charCodeAt(0);switch(33>r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0<t.indexOf("\f"))return t.replace(m,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function i(e,t,n,r){var o=e+";",a=2*t+3*n+4*r;if(944===a){e=o.indexOf(":",9)+1;var c=o.substring(e,o.length-1).trim();return c=o.substring(0,e).trim()+c+";",1===O||2===O&&s(c,1)?"-webkit-"+c+c:c}if(0===O||2===O&&!s(o,1))return o;switch(a){case 1015:return 97===o.charCodeAt(10)?"-webkit-"+o+o:o;case 951:return 116===o.charCodeAt(3)?"-webkit-"+o+o:o;case 963:return 110===o.charCodeAt(5)?"-webkit-"+o+o:o;case 1009:if(100!==o.charCodeAt(4))break;case 969:case 942:return"-webkit-"+o+o;case 978:return"-webkit-"+o+"-moz-"+o+o;case 1019:case 983:return"-webkit-"+o+"-moz-"+o+"-ms-"+o+o;case 883:if(45===o.charCodeAt(8))return"-webkit-"+o+o;if(0<o.indexOf("image-set(",11))return o.replace(k,"$1-webkit-$2")+o;break;case 932:if(45===o.charCodeAt(4))switch(o.charCodeAt(5)){case 103:return"-webkit-box-"+o.replace("-grow","")+"-webkit-"+o+"-ms-"+o.replace("grow","positive")+o;case 115:return"-webkit-"+o+"-ms-"+o.replace("shrink","negative")+o;case 98:return"-webkit-"+o+"-ms-"+o.replace("basis","preferred-size")+o}return"-webkit-"+o+"-ms-"+o+o;case 964:return"-webkit-"+o+"-ms-flex-"+o+o;case 1023:if(99!==o.charCodeAt(8))break;return"-webkit-box-pack"+(c=o.substring(o.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+o+"-ms-flex-pack"+c+o;case 1005:return f.test(o)?o.replace(d,":-webkit-")+o.replace(d,":-moz-")+o:o;case 1e3:switch(t=(c=o.substring(13).trim()).indexOf("-")+1,c.charCodeAt(0)+c.charCodeAt(t)){case 226:c=o.replace(b,"tb");break;case 232:c=o.replace(b,"tb-rl");break;case 220:c=o.replace(b,"lr");break;default:return o}return"-webkit-"+o+"-ms-"+c+o;case 1017:if(-1===o.indexOf("sticky",9))break;case 975:switch(t=(o=e).length-10,a=(c=(33===o.charCodeAt(t)?o.substring(0,t):o).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|c.charCodeAt(7))){case 203:if(111>c.charCodeAt(8))break;case 115:o=o.replace(c,"-webkit-"+c)+";"+o;break;case 207:case 102:o=o.replace(c,"-webkit-"+(102<a?"inline-":"")+"box")+";"+o.replace(c,"-webkit-"+c)+";"+o.replace(c,"-ms-"+c+"box")+";"+o}return o+";";case 938:if(45===o.charCodeAt(5))switch(o.charCodeAt(6)){case 105:return c=o.replace("-items",""),"-webkit-"+o+"-webkit-box-"+c+"-ms-flex-"+c+o;case 115:return"-webkit-"+o+"-ms-flex-item-"+o.replace(E,"")+o;default:return"-webkit-"+o+"-ms-flex-line-pack"+o.replace("align-content","").replace(E,"")+o}break;case 973:case 989:if(45!==o.charCodeAt(3)||122===o.charCodeAt(4))break;case 931:case 953:if(!0===S.test(e))return 115===(c=e.substring(e.indexOf(":")+1)).charCodeAt(0)?i(e.replace("stretch","fill-available"),t,n,r).replace(":fill-available",":stretch"):o.replace(c,"-webkit-"+c)+o.replace(c,"-moz-"+c.replace("fill-",""))+o;break;case 962:if(o="-webkit-"+o+(102===o.charCodeAt(5)?"-ms-"+o:"")+o,211===n+r&&105===o.charCodeAt(13)&&0<o.indexOf("transform",10))return o.substring(0,o.indexOf(";",27)+1).replace(p,"$1-webkit-$2")+o}return o}function s(e,t){var n=e.indexOf(1===t?":":"{"),r=e.substring(0,3!==t?n:10);return n=e.substring(n+1,e.length-1),P(2!==t?r:r.replace(T,"$1"),n,t)}function o(e,t){var n=i(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return n!==t+";"?n.replace(I," or ($1)").substring(4):"("+t+")"}function a(e,t,n,r,i,s,o,a,c,l){for(var h,d=0,f=t;d<R;++d)switch(h=N[d].call(u,e,f,n,r,i,s,o,a,c,l)){case void 0:case!1:case!0:case null:break;default:f=h}if(f!==t)return f}function c(e){return void 0!==(e=e.prefix)&&(P=null,e?"function"!=typeof e?O=1:(O=2,P=e):O=0),c}function u(e,n){var r=e;if(33>r.charCodeAt(0)&&(r=r.trim()),r=[r],0<R){var i=a(-1,n,r,r,C,A,0,0,0,0);void 0!==i&&"string"==typeof i&&(n=i)}var s=t(D,r,n,0,0);return 0<R&&void 0!==(i=a(-2,s,r,r,C,A,s.length,0,0,0))&&(s=i),x=0,A=C=1,s}var l=/^\0+/g,h=/[\0\r\f]/g,d=/: */g,f=/zoo|gra/,p=/([,: ])(transform)/g,g=/,\r+?/g,m=/([\t\r\n ])*\f?&/g,v=/@(k\w+)\s*(\S*)\s*/,y=/::(place)/g,w=/:(read-only)/g,b=/[svh]\w+-[tblr]{2}/,_=/\(\s*(.*)\s*\)/g,I=/([\s\S]*?);/g,E=/-self|flex-/g,T=/[^]*?(:[rp][el]a[\w-]+)[^]*/,S=/stretch|:\s*\w+\-(?:conte|avail)/,k=/([^-])(image-set\()/,A=1,C=1,x=0,O=1,D=[],N=[],R=0,P=null,L=0;return u.use=function e(t){switch(t){case void 0:case null:R=N.length=0;break;default:if("function"==typeof t)N[R++]=t;else if("object"==typeof t)for(var n=0,r=t.length;n<r;++n)e(t[n]);else L=0|!!t}return e},u.set=c,void 0!==e&&c(e),u},c={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},u=n(68309),l=n(31035),h=n.n(l);function d(){return(d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var f=function(e,t){for(var n=[e[0]],r=0,i=t.length;r<i;r+=1)n.push(t[r],e[r+1]);return n},p=function(e){return null!==e&&"object"==typeof e&&"[object Object]"===(e.toString?e.toString():Object.prototype.toString.call(e))&&!(0,r.typeOf)(e)},g=Object.freeze([]),m=Object.freeze({});function v(e){return"function"==typeof e}function y(e){return e.displayName||e.name||"Component"}function w(e){return e&&"string"==typeof e.styledComponentId}var b="undefined"!=typeof process&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",_="undefined"!=typeof window&&"HTMLElement"in window,I=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==process.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==process.env.REACT_APP_SC_DISABLE_SPEEDY&&process.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof process&&void 0!==process.env.SC_DISABLE_SPEEDY&&""!==process.env.SC_DISABLE_SPEEDY&&"false"!==process.env.SC_DISABLE_SPEEDY&&process.env.SC_DISABLE_SPEEDY),E={};function T(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(n.length>0?" Args: "+n.join(", "):""))}var S=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n<e;n++)t+=this.groupSizes[n];return t},t.insertRules=function(e,t){if(e>=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)(i<<=1)<0&&T(16,""+e);this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var s=r;s<i;s++)this.groupSizes[s]=0}for(var o=this.indexOfGroup(e+1),a=0,c=t.length;a<c;a++)this.tag.insertRule(o,t[a])&&(this.groupSizes[e]++,o++)},t.clearGroup=function(e){if(e<this.length){var t=this.groupSizes[e],n=this.indexOfGroup(e),r=n+t;this.groupSizes[e]=0;for(var i=n;i<r;i++)this.tag.deleteRule(n)}},t.getGroup=function(e){var t="";if(e>=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,s=r;s<i;s++)t+=this.tag.getRule(s)+"/*!sc*/\n";return t},e}(),k=new Map,A=new Map,C=1,x=function(e){if(k.has(e))return k.get(e);for(;A.has(C);)C++;var t=C++;return k.set(e,t),A.set(t,e),t},O=function(e){return A.get(e)},D=function(e,t){k.set(e,t),A.set(t,e)},N="style["+b+'][data-styled-version="5.3.0"]',R=new RegExp("^"+b+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),P=function(e,t,n){for(var r,i=n.split(","),s=0,o=i.length;s<o;s++)(r=i[s])&&e.registerName(t,r)},L=function(e,t){for(var n=t.innerHTML.split("/*!sc*/\n"),r=[],i=0,s=n.length;i<s;i++){var o=n[i].trim();if(o){var a=o.match(R);if(a){var c=0|parseInt(a[1],10),u=a[2];0!==c&&(D(u,c),P(e,u,a[3]),e.getTag().insertRules(c,r)),r.length=0}else r.push(o)}}},M=function(){return"undefined"!=typeof window&&void 0!==window.__webpack_nonce__?window.__webpack_nonce__:null},F=function(e){var t=document.head,n=e||t,r=document.createElement("style"),i=function(e){for(var t=e.childNodes,n=t.length;n>=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(b))return r}}(n),s=void 0!==i?i.nextSibling:null;r.setAttribute(b,"active"),r.setAttribute("data-styled-version","5.3.0");var o=M();
vendor: 8,927 bytes, line 2
2return o&&r.setAttribute("nonce",o),n.insertBefore(r,s),r},j=function(){function e(e){var t=this.element=F(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n<r;n++){var i=t[n];if(i.ownerNode===e)return i}T(17)}(t),this.length=0}var t=e.prototype;return t.insertRule=function(e,t){try{return this.sheet.insertRule(t,e),this.length++,!0}catch(e){return!1}},t.deleteRule=function(e){this.sheet.deleteRule(e),this.length--},t.getRule=function(e){var t=this.sheet.cssRules[e];return void 0!==t&&"string"==typeof t.cssText?t.cssText:""},e}(),U=function(){function e(e){var t=this.element=F(e);this.nodes=t.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(e,t){if(e<=this.length&&e>=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e<this.length?this.nodes[e].textContent:""},e}(),V=function(){function e(e){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(e,t){return e<=this.length&&(this.rules.splice(e,0,t),this.length++,!0)},t.deleteRule=function(e){this.rules.splice(e,1),this.length--},t.getRule=function(e){return e<this.length?this.rules[e]:""},e}(),B=_,q={isServer:!_,useCSSOMInjection:!I},z=function(){function e(e,t,n){void 0===e&&(e=m),void 0===t&&(t={}),this.options=d({},q,{},e),this.gs=t,this.names=new Map(n),!this.options.isServer&&_&&B&&(B=!1,function(e){for(var t=document.querySelectorAll(N),n=0,r=t.length;n<r;n++){var i=t[n];i&&"active"!==i.getAttribute(b)&&(L(e,i),i.parentNode&&i.parentNode.removeChild(i))}}(this))}e.registerId=function(e){return x(e)};var t=e.prototype;return t.reconstructWithOptions=function(t,n){return void 0===n&&(n=!0),new e(d({},this.options,{},t),this.gs,n&&this.names||void 0)},t.allocateGSInstance=function(e){return this.gs[e]=(this.gs[e]||0)+1},t.getTag=function(){return this.tag||(this.tag=(n=(t=this.options).isServer,r=t.useCSSOMInjection,i=t.target,e=n?new V(i):r?new j(i):new U(i),new S(e)));var e,t,n,r,i},t.hasNameForId=function(e,t){return this.names.has(e)&&this.names.get(e).has(t)},t.registerName=function(e,t){if(x(e),this.names.has(e))this.names.get(e).add(t);else{var n=new Set;n.add(t),this.names.set(e,n)}},t.insertRules=function(e,t,n){this.registerName(e,t),this.getTag().insertRules(x(e),n)},t.clearNames=function(e){this.names.has(e)&&this.names.get(e).clear()},t.clearRules=function(e){this.getTag().clearGroup(x(e)),this.clearNames(e)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(e){for(var t=e.getTag(),n=t.length,r="",i=0;i<n;i++){var s=O(i);if(void 0!==s){var o=e.names.get(s),a=t.getGroup(i);if(void 0!==o&&0!==a.length){var c=b+".g"+i+'[id="'+s+'"]',u="";void 0!==o&&o.forEach(function(e){e.length>0&&(u+=e+",")}),r+=""+a+c+'{content:"'+u+'"}/*!sc*/\n'}}}return r}(this)},e}(),$=/(a)(d)/gi,G=function(e){return String.fromCharCode(e+(e>25?39:97))};function K(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=G(t%52)+n;return(G(t%52)+n).replace($,"$1-$2")}var W=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},H=function(e){return W(5381,e)};function Q(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(v(n)&&!w(n))return!1}return!0}var Y=H("5.3.0"),X=function(){function e(e,t,n){this.rules=e,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&Q(e),this.componentId=t,this.baseHash=W(Y,t),this.baseStyle=n,z.registerId(t)}return e.prototype.generateAndInjectStyles=function(e,t,n){var r=this.componentId,i=[];if(this.baseStyle&&i.push(this.baseStyle.generateAndInjectStyles(e,t,n)),this.isStatic&&!n.hash)if(this.staticRulesId&&t.hasNameForId(r,this.staticRulesId))i.push(this.staticRulesId);else{var s=ge(this.rules,e,t,n).join(""),o=K(W(this.baseHash,s.length)>>>0);if(!t.hasNameForId(r,o)){var a=n(s,"."+o,void 0,r);t.insertRules(r,o,a)}i.push(o),this.staticRulesId=o}else{for(var c=this.rules.length,u=W(this.baseHash,n.hash),l="",h=0;h<c;h++){var d=this.rules[h];if("string"==typeof d)l+=d;else if(d){var f=ge(d,e,t,n),p=Array.isArray(f)?f.join(""):f;u=W(u,p+h),l+=p}}if(l){var g=K(u>>>0);if(!t.hasNameForId(r,g)){var m=n(l,"."+g,void 0,r);t.insertRules(r,g,m)}i.push(g)}}return i.join(" ")},e}(),J=/^\s*\/\/.*$/gm,Z=[":","[",".","#"];function ee(e){var t,n,r,i,s=void 0===e?m:e,o=s.options,c=void 0===o?m:o,u=s.plugins,l=void 0===u?g:u,h=new a(c),d=[],f=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,i,s,o,a,c,u,l,h){switch(n){case 1:if(0===l&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(i[0]+r),"";default:return r+(0===h?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}(function(e){d.push(e)}),p=function(e,r,s){return 0===r&&-1!==Z.indexOf(s[n.length])||s.match(i)?e:"."+t};function v(e,s,o,a){void 0===a&&(a="&");var c=e.replace(J,""),u=s&&o?o+" "+s+" { "+c+" }":c;return t=a,n=s,r=new RegExp("\\"+n+"\\b","g"),i=new RegExp("(\\"+n+"\\b){2,}"),h(o||!s?"":s,u)}return h.use([].concat(l,[function(e,t,i){2===e&&i.length&&i[0].lastIndexOf(n)>0&&(i[0]=i[0].replace(r,p))},f,function(e){if(-2===e){var t=d;return d=[],t}}])),v.hash=l.length?l.reduce(function(e,t){return t.name||T(15),W(e,t.name)},5381).toString():"",v}var te=i.createContext(),ne=(te.Consumer,i.createContext()),re=(ne.Consumer,new z),ie=ee();function se(){return(0,i.useContext)(te)||re}function oe(){return(0,i.useContext)(ne)||ie}function ae(e){var t=(0,i.useState)(e.stylisPlugins),n=t[0],r=t[1],s=se(),a=(0,i.useMemo)(function(){var t=s;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t},[e.disableCSSOMInjection,e.sheet,e.target]),c=(0,i.useMemo)(function(){return ee({options:{prefix:!e.disableVendorPrefixes},plugins:n})},[e.disableVendorPrefixes,n]);return(0,i.useEffect)(function(){o()(n,e.stylisPlugins)||r(e.stylisPlugins)},[e.stylisPlugins]),i.createElement(te.Provider,{value:a},i.createElement(ne.Provider,{value:c},e.children))}var ce=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=ie);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return T(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=ie),this.name+e.hash},e}(),ue=/([A-Z])/,le=/([A-Z])/g,he=/^ms-/,de=function(e){return"-"+e.toLowerCase()};function fe(e){return ue.test(e)?e.replace(le,de).replace(he,"-ms-"):e}var pe=function(e){return null==e||!1===e||""===e};function ge(e,t,n,r){if(Array.isArray(e)){for(var i,s=[],o=0,a=e.length;o<a;o+=1)""!==(i=ge(e[o],t,n,r))&&(Array.isArray(i)?s.push.apply(s,i):s.push(i));return s}return pe(e)?"":w(e)?"."+e.styledComponentId:v(e)?"function"!=typeof(u=e)||u.prototype&&u.prototype.isReactComponent||!t?e:ge(e(t),t,n,r):e instanceof ce?n?(e.inject(n,r),e.getName(r)):e:p(e)?function e(t,n){var r,i,s=[];for(var o in t)t.hasOwnProperty(o)&&!pe(t[o])&&(p(t[o])?s.push.apply(s,e(t[o],o)):v(t[o])?s.push(fe(o)+":",t[o],";"):s.push(fe(o)+": "+(r=o,(null==(i=t[o])||"boolean"==typeof i||""===i?"":"number"!=typeof i||0===i||r in c?String(i).trim():i+"px")+";")));return n?[n+" {"].concat(s,["}"]):s}(e):e.toString();var u}function me(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return v(e)||p(e)?ge(f(g,[e].concat(n))):0===n.length&&1===e.length&&"string"==typeof e[0]?e:ge(f(e,n))}new Set;var ve=function(e,t,n){return void 0===n&&(n=m),e.theme!==n.theme&&e.theme||t||n.theme},ye=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,we=/(^-|-$)/g;function be(e){return e.replace(ye,"-").replace(we,"")}var _e=function(e){return K(H(e)>>>0)};function Ie(e){return"string"==typeof e&&!0}var Ee=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Te=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Se(e,t,n){var r=e[n];Ee(t)&&Ee(r)?ke(r,t):e[n]=t}function ke(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var i=0,s=n;i<s.length;i++){var o=s[i];if(Ee(o))for(var a in o)Te(a)&&Se(e,o[a],a)}return e}var Ae=i.createContext();Ae.Consumer;var Ce={};function xe(e,t,n){var r=w(e),s=!Ie(e),o=t.attrs,a=void 0===o?g:o,c=t.componentId,l=void 0===c?function(e,t){var n="string"!=typeof e?"sc":be(e);Ce[n]=(Ce[n]||0)+1;var r=n+"-"+_e("5.3.0"+n+Ce[n]);return t?t+"-"+r:r}(t.displayName,t.parentComponentId):c,f=t.displayName,p=void 0===f?function(e){return Ie(e)?"styled."+e:"Styled("+y(e)+")"}(e):f,b=t.displayName&&t.componentId?be(t.displayName)+"-"+t.componentId:t.componentId||l,_=r&&e.attrs?Array.prototype.concat(e.attrs,a).filter(
vendor: 4,145 bytes, line 2
2Boolean):a,I=t.shouldForwardProp;r&&e.shouldForwardProp&&(I=t.shouldForwardProp?function(n,r,i){return e.shouldForwardProp(n,r,i)&&t.shouldForwardProp(n,r,i)}:e.shouldForwardProp);var E,T=new X(n,b,r?e.componentStyle:void 0),S=T.isStatic&&0===a.length,k=function(e,t){return function(e,t,n,r){var s=e.attrs,o=e.componentStyle,a=e.defaultProps,c=e.foldedComponentIds,l=e.shouldForwardProp,h=e.styledComponentId,f=e.target,p=function(e,t,n){void 0===e&&(e=m);var r=d({},t,{theme:e}),i={};return n.forEach(function(e){var t,n,s,o=e;for(t in v(o)&&(o=o(r)),o)r[t]=i[t]="className"===t?(n=i[t],s=o[t],n&&s?n+" "+s:n||s):o[t]}),[r,i]}(ve(t,(0,i.useContext)(Ae),a)||m,t,s),g=p[0],y=p[1],w=function(e,t,n){var r=se(),i=oe();return t?e.generateAndInjectStyles(m,r,i):e.generateAndInjectStyles(n,r,i)}(o,r,g),b=n,_=y.$as||t.$as||y.as||t.as||f,I=Ie(_),E=y!==t?d({},t,{},y):t,T={};for(var S in E)"$"!==S[0]&&"as"!==S&&("forwardedAs"===S?T.as=E[S]:(l?l(S,u.A,_):!I||(0,u.A)(S))&&(T[S]=E[S]));return t.style&&y.style!==t.style&&(T.style=d({},t.style,{},y.style)),T.className=Array.prototype.concat(c,h,w!==h?w:null,t.className,y.className).filter(Boolean).join(" "),T.ref=b,(0,i.createElement)(_,T)}(E,e,t,S)};return k.displayName=p,(E=i.forwardRef(k)).attrs=_,E.componentStyle=T,E.displayName=p,E.shouldForwardProp=I,E.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):g,E.styledComponentId=b,E.target=r?e.target:e,E.withComponent=function(e){var r=t.componentId,i=function(e,t){if(null==e)return{};var n,r,i={},s=Object.keys(e);for(r=0;r<s.length;r++)n=s[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(t,["componentId"]),s=r&&r+"-"+(Ie(e)?e:be(y(e)));return xe(e,d({},i,{attrs:_,componentId:s}),n)},Object.defineProperty(E,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?ke({},e.defaultProps,t):t}}),E.toString=function(){return"."+E.styledComponentId},s&&h()(E,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),E}var Oe=function(e){return function e(t,n,i){if(void 0===i&&(i=m),!(0,r.isValidElementType)(n))return T(1,String(n));var s=function(){return t(n,i,me.apply(void 0,arguments))};return s.withConfig=function(r){return e(t,n,d({},i,{},r))},s.attrs=function(r){return e(t,n,d({},i,{attrs:Array.prototype.concat(i.attrs,r).filter(Boolean)}))},s}(xe,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){Oe[e]=Oe(e)});var De,Ne=function(){function e(e,t){this.rules=e,this.componentId=t,this.isStatic=Q(e),z.registerId(this.componentId+1)}var t=e.prototype;return t.createStyles=function(e,t,n,r){var i=r(ge(this.rules,t,n,r).join(""),""),s=this.componentId+e;n.insertRules(s,s,i)},t.removeStyles=function(e,t){t.clearRules(this.componentId+e)},t.renderStyles=function(e,t,n,r){e>2&&z.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},e}();function Re(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var s=me.apply(void 0,[e].concat(n)),o="sc-global-"+_e(JSON.stringify(s)),a=new Ne(s,o);
2function c(e){var t=se(),n=oe(),r=(0,i.useContext)(Ae),s=(0,i.useRef)(t.allocateGSInstance(o)).current;return(0,i.useLayoutEffect)(function(){return u(s,e,t,r,n),function(){return a.removeStyles(s,t)}},[s,e,t,r,n]),null}function u(e,t,n,r,i){if(a.isStatic)a.renderStyles(e,E,n,i);else{var s=d({},t,{theme:ve(t,r,c.defaultProps)});a.renderStyles(e,s,n,i)}}return i.memo(c)}function Pe(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=me.apply(void 0,[e].concat(n)).join(""),s=_e(i);return new ce(s,i)}(De=function(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString(),n=M();return"<style "+[n&&'nonce="'+n+'"',b+'="true"','data-styled-version="5.3.0"'].filter(Boolean).join(" ")+">"+t+"</style>"},this.getStyleTags=function(){return e.sealed?T(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return T(2);var n=((t={})[b]="",t["data-styled-version"]="5.3.0",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=M();return r&&(n.nonce=r),[i.createElement("style",d({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new z({isServer:!0}),this.sealed=!1}.prototype).collectStyles=function(e){return this.sealed?T(2):i.createElement(ae,{sheet:this.instance},e)},De.interleaveWithNodeStream=function(e){return T(3)};var Le=Oe},84154:function(e,t,n){var r=n(99569);e.exports=!r(function(){return Object.isExtensible(Object.preventExtensions({}))})},84201:function(e,t,n){var r=n(1391),i=n(18002),s=r("keys");e.exports=function(e){return s[e]||(s[e]=i(e))}},84263:function(e,t,n){var r=n(56737),i=n(93992);e.exports=function(e){return r(i(e))}},84999:function(e,t,n){var r=n(10965),i=n(1918);Object.defineProperty(t,"__esModule",{value:!0}),t.useCollection=t.getCollection=void 0;var s=i(n(16987)),o=i(n(94400)),a=i(n(49263)),c=i(n(60896)),u=i(n(49145)),l=r(n(44134)),h=n(85191),d=n(37953),f=n(8732),p=n(24370),g=n(14943),m=n(3650);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach(function(t){(0,u.default)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var w=function(e){var t,n,r,i,s,o,a=arguments;return c.default.async(function(u){for(;;)switch(u.prev=u.next){case 0:return t=a.length>1&&void 0!==a[1]?a[1]:{},n=a.length>2&&void 0!==a[2]?a[2]:f.empty.object,r=n.parseDates,i=n.ignoreFirestoreDocumentSnapshotField,s=b(e,t),u.next=5,c.default.awrap(s.get().then(function(e){var t=[];return e.forEach(function(e){var n,s=null!==(n=e.data({serverTimestamps:"estimate"}))&&void 0!==n?n:f.empty.object,o=(0,m.withDocumentDatesParsed)(y({},s,{id:e.id,exists:e.exists,hasPendingWrites:e.metadata.hasPendingWrites,__snapshot:i?void 0:e}),r);(0,l.mutate)(e.ref.path,o,!1),g.isDev&&(s.exists||s.id||s.hasPendingWrites)&&console.warn("[get-collection] warning: Your document, ",e.id," is using one of the following reserved fields: [exists, id, hasPendingWrites]. These fields are reserved. Please remove them from your documents."),t.push(o)}),t}));case 5:return o=u.sent,u.abrupt("return",o);case 7:case"end":return u.stop()}},null,null,null,Promise)};t.getCollection=w;var b=function(e,t){var n,r,i=t.where,s=t.orderBy,o=t.limit,c=t.startAt,u=t.endAt,l=t.startAfter,d=t.endBefore,f=t.isCollectionGroup,p=h.fuego.db.collection(e);if(f&&(p=h.fuego.db.collectionGroup(e)),i&&((n=i)&&Array.isArray(n[0])?i.forEach(function(e){p=p.where(e[0],e[1],e[2])}):"string"==typeof i[0]&&"string"==typeof i[1]&&(p=p.where(i[0],i[1],i[2]))),s)if("string"==typeof s)p=p.orderBy(s);else if(Array.isArray(s))if(r=s,Array.isArray(r[0]))s.forEach(function(e){var t=(0,a.default)(e,2),n=t[0],r=t[1];p=p.orderBy(n,r)});else{var g=(0,a.default)(s,2),m=g[0],v=g[1];p=p.orderBy(m,v)}return c&&(p=p.startAt(c)),u&&(p=p.endAt(u)),l&&(p=p.startAfter(l)),d&&(p=p.endBefore(d)),o&&(p=p.limit(o)),p},_=function(e,t,n){var r,i,s;return c.default.async(function(o){for(;;)switch(o.prev=o.next){case 0:return r=n.parseDates,i=n.ignoreFirestoreDocumentSnapshotField,s=void 0===i||i,o.abrupt("return",new Promise(function(n){var i,o=null!==(i=JSON.parse(t))&&void 0!==i?i:{},a=b(e,o).onSnapshot({includeMetadataChanges:!0},function(i){var o=[];
2i.forEach(function(e){var t,n=null!==(t=e.data({serverTimestamps:"estimate"}))&&void 0!==t?t:f.empty.object,i=(0,m.withDocumentDatesParsed)(y({},n,{id:e.id,exists:e.exists,hasPendingWrites:e.metadata.hasPendingWrites,__snapshot:s?void 0:e}),r);g.isDev&&(n.exists||n.id||n.hasPendingWrites)&&console.warn("[use-collection] warning: Your document, ",e.id," is using one of the following reserved fields: [exists, id, hasPendingWrites]. These fields are reserved. Please remove them from your documents."),(0,l.mutate)(e.ref.path,i,!1),o.push(i)}),n({initialData:o,unsubscribe:a}),(0,l.mutate)([e,t],o,!1)})}));case 2:case"end":return o.stop()}},null,null,null,Promise)};t.useCollection=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:f.empty.object,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:f.empty.object,r=(0,d.useRef)(null),i=t.where,a=t.endAt,u=t.endBefore,g=t.startAfter,m=t.startAt,v=t.orderBy,b=t.limit,I=t.listen,E=void 0!==I&&I,T=t.parseDates,S=t.isCollectionGroup,k=t.ignoreFirestoreDocumentSnapshotField,A=void 0===k||k,C=n.refreshInterval,x=void 0===C?E?0:void 0:C,O=n.refreshWhenHidden,D=void 0===O?!E&&void 0:O,N=n.refreshWhenOffline,R=void 0===N?!E&&void 0:N,P=n.revalidateOnFocus,L=void 0===P?!E&&void 0:P,M=n.revalidateOnReconnect,F=void 0===M?!E&&void 0:M,j=n.dedupingInterval,U=y({},n,{refreshInterval:x,refreshWhenHidden:D,refreshWhenOffline:R,revalidateOnFocus:L,revalidateOnReconnect:F,dedupingInterval:void 0===j?E?0:void 0:j}),V=(0,d.useMemo)(function(){return JSON.stringify({where:i,endAt
2:a,endBefore:u,startAfter:g,startAt:m,orderBy:v,limit:b,isCollectionGroup:S})},[a,u,S,b,v,g,m,i]),B=(0,d.useRef)(T);(0,d.useEffect)(function(){B.current=T},[T]);var q=(0,d.useRef)(E);(0,d.useEffect)(function(){q.current=E});var z=(0,d.useRef)(A);(0,d.useEffect)(function(){z.current=A},[A]);var $=(0,l.default)(null===e?null:[e,V],function(e,t){var n,i,s,o;return c.default.async(function(a){for(;;)switch(a.prev=a.next){case 0:if(!q.current){a.next=9;break}return r.current&&(r.current(),r.current=null),a.next=4,c.default.awrap(_(e,t,{parseDates:B.current,ignoreFirestoreDocumentSnapshotField:z.current}));case 4:return n=a.sent,i=n.unsubscribe,s=n.initialData,r.current=i,a.abrupt("return",s);case 9:return a.next=11,c.default.awrap(w(e,JSON.parse(t),{parseDates:B.current,ignoreFirestoreDocumentSnapshotField:z.current}));case 11:return o=a.sent,a.abrupt("return",o);case 13:case"end":return a.stop()}},null,null,null,Promise)},U),G=(0,d.useRef)(!1);(0,d.useEffect)(function(){G.current?K.current():G.current=!0},[E]);var K=(0,d.useRef)($.revalidate);(0,d.useEffect)(function(){K.current=$.revalidate}),(0,d.useEffect)(function(){return function(){r.current&&(r.current(),r.current=null)}},[e,E,V]),(0,d.useEffect)(function(){e&&p.collectionCache.addCollectionToCache(e,V)},[e,V]);var W=$.data,H=$.isValidating,Q=$.revalidate,Y=$.mutate,X=$.error,J=(0,d.useCallback)(function(t){if(!e)return null;var n=Array.isArray(t)?t:[t],r=h.fuego.db.collection(e),i=n.map(function(e){return y({},e,{id:r.doc().id})});E||Y(function(e){var t=null!=e?e:f.empty.array;return[].concat((0,o.default)(t),(0,o.default)(i))},!1);var a=h.fuego.db.batch();return i.forEach(function(e){var t=e.id,n=(0,s.default)(e,["id"]);a.set(r.doc(t),n)}),a.commit()},[E,Y,e]);return{data:W,isValidating:H,revalidate:Q,mutate:Y,error:X,add:J,loading:!W&&!X,unsubscribe:r.current}}},85191:function(e,t,n){var r=n(10965);Object.defineProperty(t,"__esModule",{value:!0}),t.FuegoProvider=t.useFuegoContext=t.setFuego=t.fuego=t.FuegoContext=void 0;var i,s=r(n(37953)),o=(0,s.createContext)(null);t.FuegoContext=o,t.fuego=i;var a=function(e){return t.fuego=i=e};t.setFuego=a,t.useFuegoContext=function(){return(0,s.useContext)(o)},t.FuegoProvider=function(e){var t=e.children,n=e.fuego;return a(n),s.default.createElement(o.Provider,{value:{fuego:n},__source:{fileName:"/Users/fernandorojo/Developer/quarantine/swr-firestore/src/context/index.tsx",lineNumber:29,columnNumber:5}},t)}},85929:function(e,t,n){var r=n(61581),i=n(1391),s=n(24060),o=n(18002),a=n(39278),c=n(22710),u=i("wks"),l=r.Symbol,h=c?l:l&&l.withoutSetter||o;e.exports=function(e){return s(u,e)&&(a||"string"==typeof u[e])||(a&&s(l,e)?u[e]=l[e]:u[e]=h("Symbol."+e)),u[e]}},86031:function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.default=e.exports,e.exports.__esModule=!0},86333:function(e){e.exports=!1},86608:function(e,t,n){"use strict";var r=n(97004),i=n(25403).map;r({target:"Array",proto:!0,forced:!n(73131)("map")},{map:function(e){return i(this,e,arguments.length>1?arguments[1]:void 0)}})},87893:function(e){"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t),t}},88113:function(e,t,n){var r=n(96665),i=n(94063),s=n(85929)("iterator");e.exports=function(e){if(null!=e)return e[s]||e["@@iterator"]||i[r(e)]}},88165:function(e,t,n){var r=n(12368),i=n(70489);e.exports=function(e,t,n){var s,o;return i&&"function"==typeof(s=t.constructor)&&s!==n&&r(o=s.prototype)&&o!==n.prototype&&i(e,o),e}},88659:function(e,t,n){var r=n(48793);e.exports=r("document","documentElement")},89750:function(e,t,n){var r=n(16054),i=n(61581);e.exports="process"==r(i.process)},91635:function(e,t){"use strict";var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!n.call({1:2},1);t.f=i?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},91752:function(e,t,n){"use strict";n.d(t,{fS:function(){return fg},Ix:function(){return hp},H6:function(){return Hf},T1:function(){return Ff},Wq:function(){return vg},uY:function(){return dp},W6:function(){return qr},Ci:function(){return pp},YQ:function(){return yg},NJ:function(){return wg},Dc:function(){return ri},GA:function(){return Ug},cm:function(){return Ps},K$:function(){return ui},FA:function(){return ci},lo:function(){return Nf},bI:function(){return Ur},qG:function(){return Ts},qi:function(){return Lr},c8:function(){return Cf},gS:function(){return Ng},C3:function(){return Kg},hq:function(){return Gg},me:function(){return np},rJ:function(){return Vf},Cs:function(){return Bf},vN:function(){return Mf},kd:function(){return Dg},CL:function(){return zg},LA:function(){return sp},H9:function(){return qf},ol:function(){return Zf},Q5:function(){return ep},Os:function(){return ip},FD:function(){return ag},rf:function(){return og},Ws:function(){return Xf},z6:function(){return Lg},d_:function(){return Fg},x7:function(){return Ig},nY:function(){return Tg},_e:function(){return Sg},GG:function(){return kg},kU:function(){return Ag},Rr:function(){return Cg},aU:function(){return Yf},GV:function(){return Wg},AB:function(){return eg},$1:function(){return tg},po:function(){return op},St:function(){return ap},aQ:function(){return Rg},FC:function(){return Pg},My:function(){return Jp},P:function(){return Wp},B:function(){return $f},yx:function(){return zf},c4:function(){return qg},O5:function(){return $g},BN:function(){return xg},He:function(){return Nr},lN:function(){return _g},HM:function(){return ig},EO:function(){return rg},mZ:function(){return Og},iB:function(){return rp},_M:function(){return Qp}});var r,i=n(26891),s=n(94762),o=n(8474),a=n(1266),c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},u={},l=l||{},h=c||self;function d(e){var t=typeof e;return"array"==(t="object"!=t?t:e?Array.isArray(e)?"array":t:"null")||"object"==t&&"number"==typeof e.length}function f(e){var t=typeof e;return"object"==t&&null!=e||"function"==t}var p="closure_uid_"+(1e9*Math.random()>>>0),g=0;function m(e,t,n){return e.call.apply(e.bind,arguments)}function v(e,t,n){if(!e)throw Error();if(2<arguments.length){var r=Array.prototype.slice.call(arguments,2);return function(){var n=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(n,r),e.apply(t,n)}}return function(){return e.apply(t,arguments)}}function y(e,t,n){return(y=Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?m:v).apply(null,arguments)}
2function w(e,t){var n=Array.prototype.slice.call(arguments,1);return function(){var t=n.slice();return t.push.apply(t,arguments),e.apply(this,t)}}function b(e,t){function n(){}n.prototype=t.prototype,e.$=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.ac=function(e,n,r){for(var i=Array(arguments.length-2),s=2;s<arguments.length;s++)i[s-2]=arguments[s];return t.prototype[n].apply(e,i)}}function _(){this.s=this.s,this.o=this.o}_.prototype.s=!1,_.prototype.sa=function(){var e;!this.s&&(this.s=!0,this.N(),0)&&(e=this,Object.prototype.hasOwnProperty.call(e,p)&&e[p]||(e[p]=++g))},_.prototype.N=function(){if(this.o)for(;this.o.length;)this.o.shift()()};const I=Array.prototype.indexOf?function(e,t){return Array.prototype.indexOf.call(e,t,void 0)}:function(e,t){if("string"==typeof e)return"string"!=typeof t||1!=t.length?-1:e.indexOf(t,0);for(let n=0;n<e.length;n++)if(n in e&&e[n]===t)return n;return-1};function E(e){const t=e.length;if(0<t){const n=Array(t);for(let r=0;r<t;r++)n[r]=e[r];return n}return[]}function T(e,t){for(let t=1;t<arguments.length;t++){const n=arguments[t];if(d(n)){const t=e.length||0,r=n.length||0;e.length=t+r;for(let i=0;i<r;i++)e[t+i]=n[i]}else e.push(n)}}function S(e,t){this.type=e,this.g=this.target=t,this.defaultPrevented=!1}S.prototype.h=function(){this.defaultPrevented=!0};var k=function(){if(!h.addEventListener||!Object.defineProperty)return!1;var e=!1,t=Object.defineProperty({},"passive",{get:function(){e=!0}});try{h.addEventListener("test",()=>{},t),h.removeEventListener("test",()=>{},t)}catch(e){}return e}();function A(e){return/^[\s\xa0]*$/.test(e)}function C(){var e=h.navigator;return e&&(e=e.userAgent)?e:""}function x(e){return-1!=C().indexOf(e)}function O(e){return O[" "](e),e}O[" "]=function(){};var D,N,R,P=x("Opera"),L=x("Trident")||x("MSIE"),M=x("Edge"),F=M||L,j=x("Gecko")&&!(-1!=C().toLowerCase().indexOf("webkit")&&!x("Edge"))&&!(x("Trident")||x("MSIE"))&&!x("Edge"),U=-1!=C().toLowerCase().indexOf("webkit")&&!x("Edge");function V(){var e=h.document;return e?e.documentMode:void 0}e:{var B="",q=(N=C(),j?/rv:([^\);]+)(\)|;)/.exec(N):M?/Edge\/([\d\.]+)/.exec(N):L?/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(N):U?/WebKit\/(\S+)/.exec(N):P?/(?:Version)[ \/]?(\S+)/.exec(N):void 0);if(q&&(B=q?q[1]:""),L){var z=V();if(null!=z&&z>parseFloat(B)){D=String(z);break e}}D=B}h.document&&L?R=V()||parseInt(D,10)||void 0:R=void 0;var $=R;function G(e,t){if(S.call(this,e?e.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,e){var n=this.type=e.type,r=e.changedTouches&&e.changedTouches.length?e.changedTouches[0]:null;if(this.target=e.target||e.srcElement,this.g=t,t=e.relatedTarget){if(j){e:{try{O(t.nodeName);var i=!0;break e}catch(e){}i=!1}i||(t=null)}}else"mouseover"==n?t=e.fromElement:"mouseout"==n&&(t=e.toElement);this.relatedTarget=t,r?(this.clientX=void 0!==r.clientX?r.clientX:r.pageX,this.clientY=void 0!==r.clientY?r.clientY:r.pageY,this.screenX=r.screenX||0,this.screenY=r.screenY||0):(this.clientX=void 0!==e.clientX?e.clientX:e.pageX,this.clientY=void 0!==e.clientY?e.clientY:e.pageY,this.screenX=e.screenX||0,this.screenY=e.screenY||0),this.button=e.button,this.key=e.key||"",this.ctrlKey=e.ctrlKey,this.altKey=e.altKey,this.shiftKey=e.shiftKey,this.metaKey=e.metaKey,this.pointerId=e.pointerId||0,this.pointerType="string"==typeof e.pointerType?e.pointerType:K[e.pointerType]||"",this.state=e.state,this.i=e,e.defaultPrevented&&G.$.h.call(this)}}b(G,S);var K={2:"touch",3:"pen",4:"mouse"};G.prototype.h=function(){G.$.h.call(this);var e=this.i;e.preventDefault?e.preventDefault():e.returnValue=!1};var W="closure_listenable_"+(1e6*Math.random()|0),H=0;function Q(e,t,n,r,i){this.listener=e,this.proxy=null,this.src=t,this.type=n,this.capture=!!r,this.la=i,this.key=++H,this.fa=this.ia=!1}function Y(e){e.fa=!0,e.listener=null,e.proxy=null,e.src=null,e.la=null}function X(e,t,n){for(const r in e)t.call(n,e[r],r,e)}function J(e){const t={};for(const n in e)t[n]=e[n];return t}const Z="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleStr
2ing toString valueOf".split(" ");function ee(e,t){let n,r;for(let t=1;t<arguments.length;t++){for(n in r=arguments[t],r)e[n]=r[n];for(let t=0;t<Z.length;t++)n=Z[t],Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}}function te(e){this.src=e,this.g={},this.h=0}function ne(e,t){var n=t.type;if(n in e.g){var r,i=e.g[n],s=I(i,t);(r=0<=s)&&Array.prototype.splice.call(i,s,1),r&&(Y(t),0==e.g[n].length&&(delete e.g[n],e.h--))}}function re(e,t,n,r){for(var i=0;i<e.length;++i){var s=e[i];if(!s.fa&&s.listener==t&&s.capture==!!n&&s.la==r)return i}return-1}te.prototype.add=function(e,t,n,r,i){var s=e.toString();(e=this.g[s])||(e=this.g[s]=[],this.h++);var o=re(e,t,r,i);return-1<o?(t=e[o],n||(t.ia=!1)):((t=new Q(t,this.src,s,!!r,i)).ia=n,e.push(t)),t};var ie="closure_lm_"+(1e6*Math.random()|0),se={};function oe(e,t,n,r,i){if(r&&r.once)return ce(e,t,n,r,i);if(Array.isArray(t)){for(var s=0;s<t.length;s++)oe(e,t[s],n,r,i);return null}return n=ge(n),e&&e[W]?e.O(t,n,f(r)?!!r.capture:!!r,i):ae(e,t,n,!1,r,i)}function ae(e,t,n,r,i,s){if(!t)throw Error("Invalid event type");var o=f(i)?!!i.capture:!!i,a=fe(e);if(a||(e[ie]=a=new te(e)),(n=a.add(t,n,r,o,s)).proxy)return n;if(r=function(){const e=de;return function t(n){return e.call(t.src,t.listener,n)}}(),n.proxy=r,r.src=e,r.listener=n,e.addEventListener)k||(i=o),void 0===i&&(i=!1),e.addEventListener(t.toString(),r,i);else if(e.attachEvent)e.attachEvent(he(t.toString()),r);else{if(!e.addListener||!e.removeListener)throw Error("addEventListener and attachEvent are unavailable.");e.addListener(r)}return n}function ce(e,t,n,r,i){if(Array.isArray(t)){for(var s=0;s<t.length;s++)ce(e,t[s],n,r,i);return null}return n=ge(n),e&&e[W]?e.P(t,n,f(r)?!!r.capture:!!r,i):ae(e,t,n,!0,r,i)}function ue(e,t,n,r,i){if(Array.isArray(t))for(var s=0;s<t.length;s++)ue(e,t[s],n,r,i);else r=f(r)?!!r.capture:!!r,n=ge(n),e&&e[W]?(e=e.i,(t=String(t).toString())in e.g&&-1<(n=re(s=e.g[t],n,r,i))&&(Y(s[n]),Array.prototype.splice.call(s,n,1),0==s.length&&(delete e.g[t],e.h--))):e&&(e=fe(e))&&(t=e.g[t.toString()],e=-1,t&&(e=re(t,n,r,i)),(n=-1<e?t[e]:null)&&le(n))}function le(e){if("number"!=typeof e&&e&&!e.fa){var t=e.src;if(t&&t[W])ne(t.i,e);else{var n=e.type,r=e.proxy;t.removeEventListener?t.removeEventListener(n,r,e.capture):t.detachEvent?t.detachEvent(he(n),r):t.addListener&&t.removeListener&&t.removeListener(r),(n=fe(t))?(ne(n,e),0==n.h&&(n.src=null,t[ie]=null)):Y(e)}}}function he(e){return e in se?se[e]:se[e]="on"+e}function de(e,t){if(e.fa)e=!0;else{t=new G(t,this);var n=e.listener,r=e.la||e.src;e.ia&&le(e),e=n.call(r,t)}return e}function fe(e){return(e=e[ie])instanceof te?e:null}var pe="__closure_events_fn_"+(1e9*Math.random()>>>0);function ge(e){return"function"==typeof e?e:(e[pe]||(e[pe]=function(t){return e.handleEvent(t)}),e[pe])}function me(){_.call(this),this.i=new te(this),this.S=this,this.J=null}function ve(e,t){var n,r=e.J;if(r)for(n=[];r;r=r.J)n.push(r);if(e=e.S,r=t.type||t,"string"==typeof t)t=new S(t,e);else if(t instanceof S)t.target=t.target||e;else{var i=t;ee(t=new S(r,e),i)}if(i=!0,n)for(var s=n.length-1;0<=s;s--){var o=t.g=n[s];i=ye(o,r,!0,t)&&i}if(i=ye(o=t.g=e,r,!0,t)&&i,i=ye(o,r,!1,t)&&i,n)for(s=0;s<n.length;s++)i=ye(o=t.g=n[s],r,!1,t)&&i}function ye(e,t,n,r){if(!(t=e.i.g[String(t)]))return!0;t=t.concat();for(var i=!0,s=0;s<t.length;++s){var o=t[s];if(o&&!o.fa&&o.capture==n){var a=o.listener,c=o.la||o.src;o.ia&&ne(e.i,o),i=!1!==a.call(c,r)&&i}}return i&&!r.defaultPrevented}b(me,_),me.prototype[W]=!0,me.prototype.removeEventListener=function(e,t,n,r){ue(this,e,t,n,r)},me.prototype.N=function(){if(me.$.N.call(this),this.i){var e,t=this.i;for(e in t.g){for(var n=t.g[e],r=0;r<n.length;r++)Y(n[r]);delete t.g[e],t.h--}}this.J=null},me.prototype.O=function(e,t,n,r){return this.i.add(String(e),t,!1,n,r)},me.prototype.P=function(e,t,n,r){return this.i.add(String(e),t,!0,n,r)};var we=h.JSON.stringify;function be(){var e=Ae;let t=null;return e.g&&(t=e.g,e.g=e.g.next,e.g||(e.h=null),t.next=null),t}var _e=new class{constructor(e,t){this.i=e,this.j=t,this.h=0,this.g=null}get(){let e;return 0<this.h?(this.h--,e=this.g,this.g=e.next,e.next=null):e=this.i(),e}}(()=>new Ie,e=>e.reset());class Ie{constructor(){this.next=this.g=this.h=null}set(e,t){this.h=e,this.g=t,this.next=null}reset(){this.next=this.g=this.h=null}}function Ee(e){var t=1;e=e.split(":");const n=[];for(;0<t&&e.length;)n.push(e.shift()),t--;return e.length&&n.push(e.join(":")),n}function Te(e){h.setTimeout(()=>{throw e},0)}let Se,ke=!1,Ae=new class{constructor(){this.h=this.g=null}add(e,t){const n=_e.get();n.set(e,t),this.h?this.h.next=n:this.g=n,this.h=n}},Ce=()=>{const e=h.Promise.resolve(void 0);Se=()=>{e.then(xe)}};var xe=()=>{for(var e;
vendor: 19,429 bytes, line 2
2e=be();){try{e.h.call(e.g)}catch(e){Te(e)}var t=_e;t.j(e),100>t.h&&(t.h++,e.next=t.g,t.g=e)}ke=!1};function Oe(e,t){me.call(this),this.h=e||1,this.g=t||h,this.j=y(this.qb,this),this.l=Date.now()}function De(e){e.ga=!1,e.T&&(e.g.clearTimeout(e.T),e.T=null)}function Ne(e,t,n){if("function"==typeof e)n&&(e=y(e,n));else{if(!e||"function"!=typeof e.handleEvent)throw Error("Invalid listener argument");e=y(e.handleEvent,e)}return 2147483647<Number(t)?-1:h.setTimeout(e,t||0)}function Re(e){e.g=Ne(()=>{e.g=null,e.i&&(e.i=!1,Re(e))},e.j);const t=e.h;e.h=null,e.m.apply(null,t)}b(Oe,me),(r=Oe.prototype).ga=!1,r.T=null,r.qb=function(){if(this.ga){var e=Date.now()-this.l;0<e&&e<.8*this.h?this.T=this.g.setTimeout(this.j,this.h-e):(this.T&&(this.g.clearTimeout(this.T),this.T=null),ve(this,"tick"),this.ga&&(De(this),this.start()))}},r.start=function(){this.ga=!0,this.T||(this.T=this.g.setTimeout(this.j,this.h),this.l=Date.now())},r.N=function(){Oe.$.N.call(this),De(this),delete this.g};class Pe extends _{constructor(e,t){super(),this.m=e,this.j=t,this.h=null,this.i=!1,this.g=null}l(e){this.h=arguments,this.g?this.i=!0:Re(this)}N(){super.N(),this.g&&(h.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Le(e){_.call(this),this.h=e,this.g={}}b(Le,_);var Me=[];function Fe(e,t,n,r){Array.isArray(n)||(n&&(Me[0]=n.toString()),n=Me);for(var i=0;i<n.length;i++){var s=oe(t,n[i],r||e.handleEvent,!1,e.h||e);if(!s)break;e.g[s.key]=s}}function je(e){X(e.g,function(e,t){this.g.hasOwnProperty(t)&&le(e)},e),e.g={}}function Ue(){this.g=!0}function Ve(e,t,n,r){e.info(function(){return"XMLHTTP TEXT ("+t+"): "+function(e,t){if(!e.g)return t;if(!t)return null;try{var n=JSON.parse(t);if(n)for(e=0;e<n.length;e++)if(Array.isArray(n[e])){var r=n[e];if(!(2>r.length)){var i=r[1];if(Array.isArray(i)&&!(1>i.length)){var s=i[0];if("noop"!=s&&"stop"!=s&&"close"!=s)for(var o=1;o<i.length;o++)i[o]=""}}}return we(n)}catch(e){return t}}(e,n)+(r?" "+r:"")})}Le.prototype.N=function(){Le.$.N.call(this),je(this)},Le.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")},Ue.prototype.Ea=function(){this.g=!1},Ue.prototype.info=function(){};var Be={},qe=null;function ze(){return qe=qe||new me}function $e(e){S.call(this,Be.Ta,e)}function Ge(e){const t=ze();ve(t,new $e(t))}function Ke(e,t){S.call(this,Be.STAT_EVENT,e),this.stat=t}function We(e){const t=ze();ve(t,new Ke(t,e))}function He(e,t){S.call(this,Be.Ua,e),this.size=t}function Qe(e,t){if("function"!=typeof e)throw Error("Fn must not be null and must be a function");return h.setTimeout(function(){e()},t)}Be.Ta="serverreachability",b($e,S),Be.STAT_EVENT="statevent",b(Ke,S),Be.Ua="timingevent",b(He,S);var Ye={NO_ERROR:0,rb:1,Eb:2,Db:3,yb:4,Cb:5,Fb:6,Qa:7,TIMEOUT:8,Ib:9},Xe={wb:"complete",Sb:"success",Ra:"error",Qa:"abort",Kb:"ready",Lb:"readystatechange",TIMEOUT:"timeout",Gb:"incrementaldata",Jb:"progress",zb:"downloadprogress",$b:"uploadprogress"};function Je(){}function Ze(e){return e.h||(e.h=e.i())}function et(){}Je.prototype.h=null;var tt,nt={OPEN:"a",vb:"b",Ra:"c",Hb:"d"};function rt(){S.call(this,"d")}function it(){S.call(this,"c")}function st(){}function ot(e,t,n,r){this.l=e,this.j=t,this.m=n,this.W=r||1,this.U=new Le(this),this.P=ct,e=F?125:void 0,this.V=new Oe(e),this.I=null,this.i=!1,this.s=this.A=this.v=this.L=this.G=this.Y=this.B=null,this.F=[],this.g=null,this.C=0,this.o=this.u=null,this.ca=-1,this.J=!1,this.O=0,this.M=null,this.ba=this.K=this.aa=this.S=!1,this.h=new at}function at(){this.i=null,this.g="",this.h=!1}b(rt,S),b(it,S),b(st,Je),st.prototype.g=function(){return new XMLHttpRequest},st.prototype.i=function(){return{}},tt=new st;var ct=45e3,ut={},lt={};function ht(e,t,n){e.L=1,e.v=Ot(St(t)),e.s=n,e.S=!0,dt(e,null)}function dt(e,t){e.G=Date.now(),mt(e),e.A=St(e.v);var n=e.A,r=e.W;Array.isArray(r)||(r=[String(r)]),zt(n.i,"t",r),e.C=0,n=e.l.J,e.h=new at,e.g=$n(e.l,n?t:null,!e.s),0<e.O&&(e.M=new Pe(y(e.Pa,e,e.g),e.O)),Fe(e.U,e.g,"readystatechange",e.nb),t=e.I?J(e.I):{},e.s?(e.u||(e.u="POST"),t["Content-Type"]="application/x-www-form-urlencoded",e.g.ha(e.A,e.u,e.s,t)):(e.u="GET",e.g.ha(e.A,e.u,null,t)),Ge(),function(e,t,n,r,i,s){e.info(function(){if(e.g)if(s)for(var o="",a=s.split("&"),c=0;c<a.length;c++){var u=a[c].split("=");if(1<u.length){var l=u[0];u=u[1];var h=l.split("_");o=2<=h.length&&"type"==h[1]?o+(l+"=")+u+"&":o+(l+"=redacted&")}}else o=null;else o=s;return"XMLHTTP REQ ("+r+") [attempt "+i+"]: "+t+"\n"+n+"\n"+o})}(e.j,e.u,e.A,e.m,e.W,e.s)}function ft(e){return!!e.g&&"GET"==e.u&&2!=e.L&&e.l.Ha}function pt(e,t,n){let r,i=!0;for(;!e.J&&e.C<n.length;){if(r=gt(e,n),r==lt){4==t&&(e.o=4,We(14),i=!1),Ve(e.j,e.m,null,"[Incomplete Response]");break}if(r==ut){e.o=4,We(15),Ve(e.j,e.m,n,"[Invalid Chunk]"),i=!1;break}Ve(e.j,e.m,r,null),_t(e,r)}ft(e)&&r!=lt&&r!=ut&&(e.h.g="",e.C=0),4!=t||0!=n.length||e.h.h||(e.o=1,We(16),i=!1),e.i=e.i&&i,i?0<n.length&&!e.ba&&(e.ba=!0,(t=e.l).g==e&&t.ca&&!t.M&&(t.l.info("Great, no buffering proxy detected. Bytes received: "+n.length),Mn(t),t.M=!0,We(11))):(Ve(e.j,e.m,n,"[Invalid Chunked Response]"),bt(e),wt(e))}function gt(e,t){var n=e.C,r=t.indexOf("\n",n);return-1==r?lt:(n=Number(t.substring(n,r)),isNaN(n)?ut:(r+=1)+n>t.length?lt:(t=t.slice(r,r+n),e.C=r+n,t))}function mt(e){e.Y=Date.now()+e.P,vt(e,e.P)}function vt(e,t){if(null!=e.B)throw Error("WatchDog timer not null");e.B=Qe(y(e.lb,e),t)}function yt(e){e.B&&(h.clearTimeout(e.B),e.B=null)}function wt(e){0==e.l.H||e.J||Un(e.l,e)}function bt(e){yt(e);var t=e.M;t&&"function"==typeof t.sa&&t.sa(),e.M=null,De(e.V),je(e.U),e.g&&(t=e.g,e.g=null,t.abort(),t.sa())}function _t(e,t){try{var n=e.l;if(0!=n.H&&(n.g==e||Yt(n.i,e)))if(!e.K&&Yt(n.i,e)&&3==n.H){try{var r=n.Ja.g.parse(t)}catch(e){r=null}if(Array.isArray(r)&&3==r.length){var i=r;if(0==i[0]){e:if(!n.u){if(n.g){if(!(n.g.G+3e3<e.G))break e;jn(n),Cn(n)}Ln(n),We(18)}}else n.Fa=i[1],0<n.Fa-n.V&&37500>i[2]&&n.G&&0==n.A&&!n.v&&(n.v=Qe(y(n.ib,n),6e3));if(1>=Qt(n.i)&&n.oa){try{n.oa()}catch(e){}n.oa=void 0}}else Bn(n,11)}else if((e.K||n.g==e)&&jn(n),!A(t))for(i=n.Ja.g.parse(t),t=0;t<i.length;t++){let u=i[t];if(n.V=u[0],u=u[1],2==n.H)if("c"==u[0]){n.K=u[1],n.pa=u[2];const t=u[3];null!=t&&(n.ra=t,n.l.info("VER="+n.ra));const i=u[4];null!=i&&(n.Ga=i,n.l.info("SVER="+n.Ga));const l=u[5];null!=l&&"number"==typeof l&&0<l&&(r=1.5*l,n.L=r,n.l.info("backChannelRequestTimeoutMs_="+r)),r=n;const h=e.g;if(h){const e=h.g?h.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(e){var s=r.i;s.g||-1==e.indexOf("spdy")&&-1==e.indexOf("quic")&&-1==e.indexOf("h2")||(s.j=s.l,s.g=new Set,s.h&&(Xt(s,s.h),s.h=null))}if(r.F){const e=h.g?h.g.getResponseHeader("X-HTTP-Session-Id"):null;e&&(r.Da=e,xt(r.I,r.F,e))}}n.H=3,n.h&&n.h.Ba(),n.ca&&(n.S=Date.now()-e.G,n.l.info("Handshake RTT: "+n.S+"ms"));var o=e;if((r=n).wa=zn(r,r.J?r.pa:null,r.Y),o.K){Jt(r.i,o);var a=o,c=r.L;c&&a.setTimeout(c),a.B&&(yt(a),mt(a)),r.g=o}else Pn(r);0<n.j.length&&On(n)}else"stop"!=u[0]&&"close"!=u[0]||Bn(n,7);else 3==n.H&&("stop"==u[0]||"close"==u[0]?"stop"==u[0]?Bn(n,7):An(n):"noop"!=u[0]&&n.h&&n.h.Aa(u),n.A=0)}Ge()}catch(e){}}function It(e,t){if(e.forEach&&"function"==typeof e.forEach)e.forEach(t,void 0);else if(d(e)||"string"==typeof e)Array.prototype.forEach.call(e,t,void 0);else for(var n=function(e){if(e.ta&&"function"==typeof e.ta)return e.ta();if(!e.Z||"function"!=typeof e.Z){if("undefined"!=typeof Map&&e instanceof Map)return Array.from(e.keys());if(!("undefined"!=typeof Set&&e instanceof Set)){if(d(e)||"string"==typeof e){var t=[];e=e.length;for(var n=0;n<e;n++)t.push(n);return t}t=[],n=0;for(const r in e)t[n++]=r;return t}}}(e),r=function(e){if(e.Z&&"function"==typeof e.Z)return e.Z();if("undefined"!=typeof Map&&e instanceof Map||"undefined"!=typeof Set&&e instanceof Set)return Array.from(e.values());if("string"==typeof e)return e.split("");if(d(e)){for(var t=[],n=e.length,r=0;r<n;r++)t.push(e[r]);return t}for(r in t=[],n=0,e)t[n++]=e[r];return t}(e),i=r.length,s=0;s<i;s++)t.call(void 0,r[s],n&&n[s],e)}(r=ot.prototype).setTimeout=function(e){this.P=e},r.nb=function(e){e=e.target;const t=this.M;t&&3==_n(e)?t.l():this.Pa(e)},r.Pa=function(e){try{if(e==this.g)e:{const l=_n(this.g);var t=this.g.Ia();if(this.g.da(),!(3>l)&&(3!=l||F||this.g&&(this.h.h||this.g.ja()||In(this.g)))){this.J||4!=l||7==t||Ge(),yt(this);var n=this.g.da();this.ca=n;t:if(ft(this)){var r=In(this.g);e="";var i=r.length,s=4==_n(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){bt(this),wt(this);var o="";break t}this.h.i=new h.TextDecoder}for(t=0;t<i;t++)this.h.h=!0,e+=this.h.i.decode(r[t],{stream:s&&t==i-1});r.splice(0,i),this.h.g+=e,this.C=0,o=this.h.g}else o=this.g.ja();if(this.i=200==n,function(e,t,n,r,i,s,o){e.info(function(){return"XMLHTTP RESP ("+r+") [ attempt "+i+"]: "+t+"\n"+n+"\n"+s+" "+o})}(this.j,this.u,this.A,this.m,this.W,l,n),this.i){if(this.aa&&!this.K){t:{if(this.g){var a,c=this.g;if((a=c.g?c.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!A(a)){var u=a;break t}}u=null}if(!(n=u)){this.i=!1,this.o=3,We(12),bt(this),wt(this);break e}Ve(this.j,this.m,n,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,_t(this,n)}this.S?(pt(this,l,o),F&&this.i&&3==l&&(Fe(this.U,this.V,"tick",this.mb),this.V.start())):(Ve(this.j,this.m,o,null),_t(this,o)),4==l&&bt(this),this.i&&!this.J&&(4==l?Un(this.l,this):(this.i=!1,mt(this)))}else(function(e){const t={};e=(e.g&&2<=_n(e)&&e.g.getAllResponseHeaders()||"").split("\r\n");for(let r=0;r<e.length;r++){if(A(e[r]))continue;var n=Ee(e[r]);const i=n[0];if("string"!=typeof(n=n[1]))continue;n=n.trim();const s=t[i]||[];t[i]=s,s.push(n)}!function(e,t){for(const n in e)t.call(void 0,e[n],n,e)}(t,function(e){return e.join(", ")})})(this.g),400==n&&0<o.indexOf("Unknown SID")?(this.o=3,We(12)):(this.o=0,We(13)),bt(this),wt(this)}}}catch(e){}},r.mb=function(){if(this.g){var e=_n(this.g),t=this.g.ja();this.C<t.length&&(yt(this),pt(this,e,t),this.i&&4!=e&&mt(this))}},r.cancel=function(){this.J=!0,bt(this)},r.lb=function(){this.B=null;const e=Date.now();0<=e-this.Y?(function(e,t){e.info(function(){return"TIMEOUT: "+t})}(this.j,this.A),2!=this.L&&(Ge(),We(17)),bt(this),this.o=2,wt(this)):vt(this,this.Y-e)};var Et=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function Tt(e){if(this.g=this.s=this.j="",this.m=null,this.o=this.l="",this.h=!1,e instanceof Tt){this.h=e.h,kt(this,e.j),this.s=e.s,this.g=e.g,At(this,e.m),this.l=e.l;var t=e.i,n=new Ut;n.i=t.i,t.g&&(n.g=new Map(t.g),n.h=t.h),Ct(this,n),this.o=e.o}else e&&(t=String(e).match(Et))?(this.h=!1,kt(this,t[1]||"",!0),this.s=Dt(t[2]||""),this.g=Dt(t[3]||"",!0),At(this,t[4]),this.l=Dt(t[5]||"",!0),Ct(this,t[6]||"",!0),this.o=Dt(t[7]||"")):(this.h=!1,this.i=new Ut(null,this.h))}function St(e){return new Tt(e)}function kt(e,t,n){e.j=n?Dt(t,!0):t,e.j&&(e.j=e.j.replace(/:$/,""))}function At(e,t){if(t){if(t=Number(t),isNaN(t)||0>t)throw Error("Bad port number "+t);e.m=t}else e.m=null}function Ct(e,t,n){t instanceof Ut?(e.i=t,function(e,t){t&&!e.j&&(Vt(e),e.i=null,e.g.forEach(function(e,t){var n=t.toLowerCase();t!=n&&(Bt(this,t),zt(this,n,e))},e)),e.j=t}(e.i,e.h)):(n||(t=Nt(t,Ft)),e.i=new Ut(t,e.h))}function xt(e,t,n){e.i.set(t,n)}function Ot(e){return xt(e,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),e}function Dt(e,t){return e?t?decodeURI(e.replace(/%25/g,"%2525")):decodeURIComponent(e):""}function Nt(e,t,n){return"string"==typeof e?(e=encodeURI(e).replace(t,Rt),n&&(e=e.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),e):null}function Rt(e){return"%"+((e=e.charCodeAt(0))>>4&15).toString(16)+(15&e).toString(16)}Tt.prototype.toString=function(){var e=[],t=this.j;t&&e.push(Nt(t,Pt,!0),":");var n=this.g;return(n||"file"==t)&&(e.push("//"),(t=this.s)&&e.push(Nt(t,Pt,!0),"@"),e.push(encodeURIComponent(String(n)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(n=this.m)&&e.push(":",String(n))),(n=this.l)&&(this.g&&"/"!=n.charAt(0)&&e.push("/"),e.push(Nt(n,"/"==n.charAt(0)?Mt:Lt,!0))),(n=this.i.toString())&&e.push("?",n),(n=this.o)&&e.push("#",Nt(n,jt)),e.join("")};var Pt=/[#\/\?@]/g,Lt=/[#\?:]/g,Mt=/[#\?]/g,Ft=/[#\?@]/g,jt=/#/g;function Ut(e,t){this.h=this.g=null,this.i=e||null,this.j=!!t}function Vt(e){e.g||(e.g=new Map,e.h=0,e.i&&function(e,t){if(e){e=e.split("&");for(var n=0;n<e.length;n++){var r=e[n].indexOf("="),i=null;if(0<=r){var s=e[n].substring(0,r);i=e[n].substring(r+1)}else s=e[n];t(s,i?decodeURIComponent(i.replace(/\+/g," ")):"")}}}(e.i,function(t,n){e.add(decodeURIComponent(t.replace(/\+/g," ")),n)}))}function Bt(e,t){Vt(e),t=$t(e,t),e.g.has(t)&&(e.i=null,e.h-=e.g.get(t).length,e.g.delete(t))}function qt(e,t){return Vt(e),t=$t(e,t),e.g.has(t)}function zt(e,t,n){Bt(e,t),0<n.length&&(e.i=null,e.g.set($t(e,t),E(n)),e.h+=n.length)}function $t(e,t){return t=String(t),e.j&&(t=t.toLowerCase()),t}(r=Ut.prototype).add=function(e,t){Vt(this),this.i=null,e=$t(this,e);var n=this.g.get(e);return n||this.g.set(e,n=[]),n.push(t),this.h+=1,this},r.forEach=function(e,t){Vt(this),this.g.forEach(function(n,r){n.forEach(function(n){e.call(t,n,r,this)},this)},this)},r.ta=function(){Vt(this);const e=Array.from(this.g.values()),t=Array.from(this.g.keys()),n=[];for(let r=0;r<t.length;r++){const i=e[r];for(let e=0;e<i.length;e++)n.push(t[r])}return n},r.Z=function(e){Vt(this);let t=[];if("string"==typeof e)qt(this,e)&&(t=t.concat(this.g.get($t(this,e))));else{e=Array.from(this.g.values());for(let n=0;n<e.length;n++)t=t.concat(e[n])}return t},r.set=function(e,t){return Vt(this),this.i=null,qt(this,e=$t(this,e))&&(this.h-=this.g.get(e).length),this.g.set(e,[t]),this.h+=1,this},r.get=function(e,t){return e&&0<(e=this.Z(e)).length?String(e[0]):t},r.toString=function(){if(this.i)return this.i;if(!this.g)return"";const e=[],t=Array.from(this.g.keys());for(var n=0;n<t.length;n++){var r=t[n];const s=encodeURIComponent(String(r)),o=this.Z(r);for(r=0;r<o.length;r++){var i=s;""!==o[r]&&(i+="="+encodeURIComponent(String(o[r]))),e.push(i)}}return this.i=e.join("&")};var Gt=class{constructor(e,t){this.g=e,this.map=t}};function Kt(e){this.l=e||Wt,e=h.PerformanceNavigationTiming?0<(e=h.performance.getEntriesByType("navigation")).length&&("hq"==e[0].nextHopProtocol||"h2"==e[0].nextHopProtocol):!!(h.g&&h.g.Ka&&h.g.Ka()&&h.g.Ka().ec),this.j=e?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}var Wt=10;function Ht(e){return!!e.h||!!e.g&&e.g.size>=e.j}function Qt(e){return e.h?1:e.g?e.g.size:0}function Yt(e,t){return e.h?e.h==t:!!e.g&&e.g.has(t)}function Xt(e,t){e.g?e.g.add(t):e.h=t}function Jt(e,t){e.h&&e.h==t?e.h=null:e.g&&e.g.has(t)&&e.g.delete(t)}function Zt(e){if(null!=e.h)return e.i.concat(e.h.F);if(null!=e.g&&0!==e.g.size){let t=e.i;for(const n of e.g.values())t=t.concat(n.F);return t}return E(e.i)}Kt.prototype.cancel=function(){if(this.i=Zt(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const e of this.g.values())e.cancel();this.g.clear()}};var en=class{stringify(e){return h.JSON.stringify(e,void 0)}parse(e){return h.JSON.parse(e,void 0)}};function tn(){this.g=new en}function nn(e,t,n){const r=n||"";try{It(e,function(e,n){let i=e;f(e)&&(i=we(e)),t.push(r+n+"="+encodeURIComponent(i))})}catch(e){throw t.push(r+"type="+encodeURIComponent("_badmap")),e}}function rn(e,t,n,r,i){try{t.onload=null,t.onerror=null,t.onabort=null,t.ontimeout=null,i(r)}catch(e){}}function sn(e){this.l=e.fc||null,this.j=e.ob||!1}function on(e,t){me.call(this),this.F=e,this.u=t,this.m=void 0,this.readyState=an,this.status=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.v=new Headers,this.h=null,this.C="GET",this.B="",this.g=!1,this.A=this.j=this.l=null}b(sn,Je),sn.prototype.g=function(){return new on(this.l,this.j)},sn.prototype.i=function(e){return function(){return e}}({}),b(on,me);var an=0;function cn(e){e.j.read().then(e.Xa.bind(e)).catch(e.ka.bind(e))}function un(e){e.readyState=4,e.l=null,e.j=null,e.A=null,ln(e)}function ln(e){e.onreadystatechange&&e.onreadystatechange.call(e)}(r=on.prototype).open=function(e,t){if(this.readyState!=an)throw this.abort(),Error("Error reopening a connection");this.C=e,this.B=t,this.readyState=1,ln(this)},r.send=function(e){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;const t={headers:this.v,method:this.C,credentials:this.m,cache:void 0};e&&(t.body=e),(this.F||h).fetch(new Request(this.B,t)).then(this.$a.bind(this),this.ka.bind(this))},r.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,un(this)),this.readyState=an},r.$a=function(e){if(this.g&&(this.l=e,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=e.headers,this.readyState=2,ln(this)),this.g&&(this.readyState=3,ln(this),this.g)))if("arraybuffer"===this.responseType)e.arrayBuffer().then(this.Ya.bind(this),this.ka.bind(this));else if(void 0!==h.ReadableStream&&"body"in e){if(this.j=e.body.getReader(),this.u){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.A=new TextDecoder;cn(this)}else e.text().then(this.Za.bind(this),this.ka.bind(this))},r.Xa=function(e){if(this.g){if(this.u&&e.value)this.response.push(e.value);else if(!this.u){var t=e.value?e.value:new Uint8Array(0);(t=this.A.decode(t,{stream:!e.done}))&&(this.response=this.responseText+=t)}e.done?un(this):ln(this),3==this.readyState&&cn(this)}},r.Za=function(e){this.g&&(this.response=this.responseText=e,un(this))},r.Ya=function(e){this.g&&(this.response=e,un(this))},r.ka=function(){this.g&&un(this)},r.setRequestHeader=function(e,t){this.v.append(e,t)},r.getResponseHeader=function(e){return this.h&&this.h.get(e.toLowerCase())||""},r.getAllResponseHeaders=function(){if(!this.h)return"";const e=[],t=this.h.entries();for(var n=t.next();!n.done;)n=n.value,e.push(n[0]+": "+n[1]),n=t.next();return e.join("\r\n")},Object.defineProperty(on.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(e){this.m=e?"include":"same-origin"}});var hn=h.JSON.parse;function dn(e){me.call(this),this.headers=new Map,this.u=e||null,this.h=!1,this.C=this.g=null,this.I="",this.m=0,this.j="",this.l=this.G=this.v=this.F=!1,this.B=0,this.A=null,this.K=fn,this.L=this.M=!1}b(dn,me);var fn="",pn=/^https?$/i,gn=["POST","PUT"];function mn(e,t){e.h=!1,e.g&&(e.l=!0,e.g.abort(),e.l=!1),e.j=t,e.m=5,vn(e),wn(e)}function vn(e){e.F||(e.F=!0,ve(e,"complete"),ve(e,"error"))}function yn(e){if(e.h&&void 0!==l&&(!e.C[1]||4!=_n(e)||2!=e.da()))if(e.v&&4==_n(e))Ne(e.La,0,e);else if(ve(e,"readystatechange"),4==_n(e)){e.h=!1;try{const o=e.da();e:switch(o){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var t=!0;break e;default:t=!1}var n;if(!(n=t)){var r;if(r=0===o){var i=String(e.I).match(Et)[1]||null;!i&&h.self&&h.self.location&&(i=h.self.location.protocol.slice(0,-1)),r=!pn.test(i?i.toLowerCase():"")}n=r}if(n)ve(e,"complete"),ve(e,"success");else{e.m=6;try{var s=2<_n(e)?e.g.statusText:""}catch(e){s=""}e.j=s+" ["+e.da()+"]",vn(e)}}finally{wn(e)}}}function wn(e,t){if(e.g){bn(e);const n=e.g,r=e.C[0]?()=>{}:null;e.g=null,e.C=null,t||ve(e,"ready");try{n.onreadystatechange=r}catch(e){}}}
vendor: 6,953 bytes, line 2
2function bn(e){e.g&&e.L&&(e.g.ontimeout=null),e.A&&(h.clearTimeout(e.A),e.A=null)}function _n(e){return e.g?e.g.readyState:0}function In(e){try{if(!e.g)return null;if("response"in e.g)return e.g.response;switch(e.K){case fn:case"text":return e.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in e.g)return e.g.mozResponseArrayBuffer}return null}catch(e){return null}}function En(e){let t="";return X(e,function(e,n){t+=n,t+=":",t+=e,t+="\r\n"}),t}function Tn(e,t,n){e:{for(r in n){var r=!1;break e}r=!0}r||(n=En(n),"string"==typeof e?null!=n&&encodeURIComponent(String(n)):xt(e,t,n))}function Sn(e,t,n){return n&&n.internalChannelParams&&n.internalChannelParams[e]||t}function kn(e){this.Ga=0,this.j=[],this.l=new Ue,this.pa=this.wa=this.I=this.Y=this.g=this.Da=this.F=this.na=this.o=this.U=this.s=null,this.fb=this.W=0,this.cb=Sn("failFast",!1,e),this.G=this.v=this.u=this.m=this.h=null,this.aa=!0,this.Fa=this.V=-1,this.ba=this.A=this.C=0,this.ab=Sn("baseRetryDelayMs",5e3,e),this.hb=Sn("retryDelaySeedMs",1e4,e),this.eb=Sn("forwardChannelMaxRetries",2,e),this.xa=Sn("forwardChannelRequestTimeoutMs",2e4,e),this.va=e&&e.xmlHttpFactory||void 0,this.Ha=e&&e.dc||!1,this.L=void 0,this.J=e&&e.supportsCrossDomainXhr||!1,this.K="",this.i=new Kt(e&&e.concurrentRequestLimit),this.Ja=new tn,this.P=e&&e.fastHandshake||!1,this.O=e&&e.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.bb=e&&e.bc||!1,e&&e.Ea&&this.l.Ea(),e&&e.forceLongPolling&&(this.aa=!1),this.ca=!this.P&&this.aa&&e&&e.detectBufferingProxy||!1,this.qa=void 0,e&&e.longPollingTimeout&&0<e.longPollingTimeout&&(this.qa=e.longPollingTimeout),this.oa=void 0,this.S=0,this.M=!1,this.ma=this.B=null}function An(e){if(xn(e),3==e.H){var t=e.W++,n=St(e.I);if(xt(n,"SID",e.K),xt(n,"RID",t),xt(n,"TYPE","terminate"),Nn(e,n),(t=new ot(e,e.l,t)).L=2,t.v=Ot(St(n)),n=!1,h.navigator&&h.navigator.sendBeacon)try{n=h.navigator.sendBeacon(t.v.toString(),"")}catch(e){}!n&&h.Image&&((new Image).src=t.v,n=!0),n||(t.g=$n(t.l,null),t.g.ha(t.v)),t.G=Date.now(),mt(t)}qn(e)}function Cn(e){e.g&&(Mn(e),e.g.cancel(),e.g=null)}function xn(e){Cn(e),e.u&&(h.clearTimeout(e.u),e.u=null),jn(e),e.i.cancel(),e.m&&("number"==typeof e.m&&h.clearTimeout(e.m),e.m=null)}function On(e){if(!Ht(e.i)&&!e.m){e.m=!0;var t=e.Na;Se||Ce(),ke||(Se(),ke=!0),Ae.add(t,e),e.C=0}}function Dn(e,t){var n;n=t?t.m:e.W++;const r=St(e.I);xt(r,"SID",e.K),xt(r,"RID",n),xt(r,"AID",e.V),Nn(e,r),e.o&&e.s&&Tn(r,e.o,e.s),n=new ot(e,e.l,n,e.C+1),null===e.o&&(n.I=e.s),t&&(e.j=t.F.concat(e.j)),t=Rn(e,n,1e3),n.setTimeout(Math.round(.5*e.xa)+Math.round(.5*e.xa*Math.random())),Xt(e.i,n),ht(n,r,t)}function Nn(e,t){e.na&&X(e.na,function(e,n){xt(t,n,e)}),e.h&&It({},function(e,n){xt(t,n,e)})}function Rn(e,t,n){n=Math.min(e.j.length,n);var r=e.h?y(e.h.Va,e.h,e):null;e:{var i=e.j;let t=-1;for(;;){const e=["count="+n];-1==t?0<n?(t=i[0].g,e.push("ofs="+t)):t=0:e.push("ofs="+t);let s=!0;for(let o=0;o<n;o++){let n=i[o].g;const a=i[o].map;if(n-=t,0>n)t=Math.max(0,i[o].g-100),s=!1;else try{nn(a,e,"req"+n+"_")}catch(e){r&&r(a)}}if(s){r=e.join("&");break e}}}return e=e.j.splice(0,n),t.F=e,r}function Pn(e){if(!e.g&&!e.u){e.ba=1;var t=e.Ma;Se||Ce(),ke||(Se(),ke=!0),Ae.add(t,e),e.A=0}}function Ln(e){return!(e.g||e.u||3<=e.A||(e.ba++,e.u=Qe(y(e.Ma,e),Vn(e,e.A)),e.A++,0))}function Mn(e){null!=e.B&&(h.clearTimeout(e.B),e.B=null)}function Fn(e){e.g=new ot(e,e.l,"rpc",e.ba),null===e.o&&(e.g.I=e.s),e.g.O=0;var t=St(e.wa);xt(t,"RID","rpc"),xt(t,"SID",e.K),xt(t,"AID",e.V),xt(t,"CI",e.G?"0":"1"),!e.G&&e.qa&&xt(t,"TO",e.qa),xt(t,"TYPE","xmlhttp"),Nn(e,t),e.o&&e.s&&Tn(t,e.o,e.s),e.L&&e.g.setTimeout(e.L);var n=e.g;e=e.pa,n.L=1,n.v=Ot(St(t)),n.s=null,n.S=!0,dt(n,e)}function jn(e){null!=e.v&&(h.clearTimeout(e.v),e.v=null)}function Un(e,t){var n=null;if(e.g==t){jn(e),Mn(e),e.g=null;var r=2}else{if(!Yt(e.i,t))return;n=t.F,Jt(e.i,t),r=1}if(0!=e.H)if(t.i)if(1==r){n=t.s?t.s.length:0,t=Date.now()-t.G;var i=e.C;ve(r=ze(),new He(r,n)),On(e)}else Pn(e);else if(3==(i=t.o)||0==i&&0<t.ca||!(1==r&&function(e,t){return!(Qt(e.i)>=e.i.j-(e.m?1:0)||(e.m?(e.j=t.F.concat(e.j),0):1==e.H||2==e.H||e.C>=(e.cb?0:e.eb)||(e.m=Qe(y(e.Na,e,t),Vn(e,e.C)),e.C++,0)))}(e,t)||2==r&&Ln(e)))switch(n&&0<n.length&&(t=e.i,t.i=t.i.concat(n)),i){case 1:Bn(e,5);break;case 4:Bn(e,10);break;case 3:Bn(e,6);break;default:Bn(e,2)}}function Vn(e,t){let n=e.ab+Math.floor(Math.random()*e.hb);return e.isActive()||(n*=2),n*t}function Bn(e,t){if(e.l.info("Error code "+t),2==t){var n=null;e.h&&(n=null);var r=y(e.pb,e);n||(n=new Tt("//www.google.com/images/cleardot.gif"),h.location&&"http"==h.location.protocol||kt(n,"https"),Ot(n)),function(e,t){const n=new Ue;if(h.Image){const r=new Image;r.onload=w(rn,n,r,"TestLoadImage: loaded",!0,t),r.onerror=w(rn,n,r,"TestLoadImage: error",!1,t),r.onabort=w(rn,n,r,"TestLoadImage: abort",!1,t),r.ontimeout=w(rn,n,r,"TestLoadImage: timeout",!1,t),h.setTimeout(function(){r.ontimeout&&r.ontimeout()},1e4),r.src=e}else t(!1)}(n.toString(),r)}else We(2);e.H=0,e.h&&e.h.za(t),qn(e),xn(e)}function qn(e){if(e.H=0,e.ma=[],e.h){const t=Zt(e.i);0==t.length&&0==e.j.length||(T(e.ma,t),T(e.ma,e.j),e.i.i.length=0,E(e.j),e.j.length=0),e.h.ya()}}function zn(e,t,n){var r=n instanceof Tt?St(n):new Tt(n);if(""!=r.g)t&&(r.g=t+"."+r.g),At(r,r.m);else{var i=h.location;r=i.protocol,t=t?t+"."+i.hostname:i.hostname,i=+i.port;var s=new Tt(null);r&&kt(s,r),t&&(s.g=t),i&&At(s,i),n&&(s.l=n),r=s}return n=e.F,t=e.Da,n&&t&&xt(r,n,t),xt(r,"VER",e.ra),Nn(e,r),r}function $n(e,t,n){if(t&&!e.J)throw Error("Can't create secondary domain capable XhrIo object.");return(t=n&&e.Ha&&!e.va?new dn(new sn({ob:!0})):new dn(e.va)).Oa(e.J),t}function Gn(){}function Kn(){if(L&&!(10<=Number($)))throw Error("Environmental error: no available transport.")}function Wn(e,t){me.call(this),this.g=new kn(t),this.l=e,this.h=t&&t.messageUrlParams||null,e=t&&t.messageHeaders||null,t&&t.clientProtocolHeaderRequired&&(e?e["X-Client-Protocol"]="webchannel":e={"X-Client-Protocol":"webchannel"}),this.g.s=e,e=t&&t.initMessageHeaders||null,t&&t.messageContentType&&(e?e["X-WebChannel-Content-Type"]=t.messageContentType:e={"X-WebChannel-Content-Type":t.messageContentType}),t&&t.Ca&&(e?e["X-WebChannel-Client-Profile"]=t.Ca:e={"X-WebChannel-Client-Profile":t.Ca}),this.g.U=e,(e=t&&t.cc)&&!A(e)&&(this.g.o=e),this.A=t&&t.supportsCrossDomainXhr||!1,this.v=t&&t.sendRawJson||!1,(t=t&&t.httpSessionIdParam)&&!A(t)&&(this.g.F=t,null!==(e=this.h)&&t in e&&t in(e=this.h)&&delete e[t]),this.j=new Yn(this)}function Hn(e){rt.call(this),e.__headers__&&(this.headers=e.__headers__,this.statusCode=e.__status__,delete e.__headers__,delete e.__status__);var t=e.__sm__;if(t){e:{for(const n in t){e=n;break e}e=void 0}(this.i=e)&&(e=this.i,t=null!==t&&e in t?t[e]:void 0),this.data=t}else this.data=e}function Qn(){it.call(this),this.status=1}function Yn(e){this.g=e}function Xn(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.m=Array(this.blockSize),this.i=this.h=0,this.reset()}
vendor: 4,652 bytes, line 2
2function Jn(e,t,n){n||(n=0);var r=Array(16);if("string"==typeof t)for(var i=0;16>i;++i)r[i]=t.charCodeAt(n++)|t.charCodeAt(n++)<<8|t.charCodeAt(n++)<<16|t.charCodeAt(n++)<<24;else for(i=0;16>i;++i)r[i]=t[n++]|t[n++]<<8|t[n++]<<16|t[n++]<<24;t=e.g[0],n=e.g[1],i=e.g[2];var s=e.g[3],o=t+(s^n&(i^s))+r[0]+3614090360&4294967295;o=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=(n=(i=(s=(t=n+(o<<7&4294967295|o>>>25))+((o=s+(i^t&(n^i))+r[1]+3905402710&4294967295)<<12&4294967295|o>>>20))+((o=i+(n^s&(t^n))+r[2]+606105819&4294967295)<<17&4294967295|o>>>15))+((o=n+(t^i&(s^t))+r[3]+3250441966&4294967295)<<22&4294967295|o>>>10))+((o=t+(s^n&(i^s))+r[4]+4118548399&4294967295)<<7&4294967295|o>>>25))+((o=s+(i^t&(n^i))+r[5]+1200080426&4294967295)<<12&4294967295|o>>>20))+((o=i+(n^s&(t^n))+r[6]+2821735955&4294967295)<<17&4294967295|o>>>15))+((o=n+(t^i&(s^t))+r[7]+4249261313&4294967295)<<22&4294967295|o>>>10))+((o=t+(s^n&(i^s))+r[8]+1770035416&4294967295)<<7&4294967295|o>>>25))+((o=s+(i^t&(n^i))+r[9]+2336552879&4294967295)<<12&4294967295|o>>>20))+((o=i+(n^s&(t^n))+r[10]+4294925233&4294967295)<<17&4294967295|o>>>15))+((o=n+(t^i&(s^t))+r[11]+2304563134&4294967295)<<22&4294967295|o>>>10))+((o=t+(s^n&(i^s))+r[12]+1804603682&4294967295)<<7&4294967295|o>>>25))+((o=s+(i^t&(n^i))+r[13]+4254626195&4294967295)<<12&4294967295|o>>>20))+((o=i+(n^s&(t^n))+r[14]+2792965006&4294967295)<<17&4294967295|o>>>15))+((o=n+(t^i&(s^t))+r[15]+1236535329&4294967295)<<22&4294967295|o>>>10))+((o=t+(i^s&(n^i))+r[1]+4129170786&4294967295)<<5&4294967295|o>>>27))+((o=s+(n^i&(t^n))+r[6]+3225465664&4294967295)<<9&4294967295|o>>>23))+((o=i+(t^n&(s^t))+r[11]+643717713&4294967295)<<14&4294967295|o>>>18))+((o=n+(s^t&(i^s))+r[0]+3921069994&4294967295)<<20&4294967295|o>>>12))+((o=t+(i^s&(n^i))+r[5]+3593408605&4294967295)<<5&4294967295|o>>>27))+((o=s+(n^i&(t^n))+r[10]+38016083&4294967295)<<9&4294967295|o>>>23))+((o=i+(t^n&(s^t))+r[15]+3634488961&4294967295)<<14&4294967295|o>>>18))+((o=n+(s^t&(i^s))+r[4]+3889429448&4294967295)<<20&4294967295|o>>>12))+((o=t+(i^s&(n^i))+r[9]+568446438&4294967295)<<5&4294967295|o>>>27))+((o=s+(n^i&(t^n))+r[14]+3275163606&4294967295)<<9&4294967295|o>>>23))+((o=i+(t^n&(s^t))+r[3]+4107603335&4294967295)<<14&4294967295|o>>>18))+((o=n+(s^t&(i^s))+r[8]+1163531501&4294967295)<<20&4294967295|o>>>12))+((o=t+(i^s&(n^i))+r[13]+2850285829&4294967295)<<5&4294967295|o>>>27))+((o=s+(n^i&(t^n))+r[2]+4243563512&4294967295)<<9&4294967295|o>>>23))+((o=i+(t^n&(s^t))+r[7]+1735328473&4294967295)<<14&4294967295|o>>>18))+((o=n+(s^t&(i^s))+r[12]+2368359562&4294967295)<<20&4294967295|o>>>12))+((o=t+(n^i^s)+r[5]+4294588738&4294967295)<<4&4294967295|o>>>28))+((o=s+(t^n^i)+r[8]+2272392833&4294967295)<<11&4294967295|o>>>21))+((o=i+(s^t^n)+r[11]+1839030562&4294967295)<<16&4294967295|o>>>16))+((o=n+(i^s^t)+r[14]+4259657740&4294967295)<<23&4294967295|o>>>9))+((o=t+(n^i^s)+r[1]+2763975236&4294967295)<<4&4294967295|o>>>28))+((o=s+(t^n^i)+r[4]+1272893353&4294967295)<<11&4294967295|o>>>21))+((o=i+(s^t^n)+r[7]+4139469664&4294967295)<<16&4294967295|o>>>16))+((o=n+(i^s^t)+r[10]+3200236656&4294967295)<<23&4294967295|o>>>9))+((o=t+(n^i^s)+r[13]+681279174&4294967295)<<4&4294967295|o>>>28))+((o=s+(t^n^i)+r[0]+3936430074&4294967295)<<11&4294967295|o>>>21))+((o=i+(s^t^n)+r[3]+3572445317&4294967295)<<16&4294967295|o>>>16))+((o=n+(i^s^t)+r[6]+76029189&4294967295)<<23&4294967295|o>>>9))+((o=t+(n^i^s)+r[9]+3654602809&4294967295)<<4&4294967295|o>>>28))+((o=s+(t^n^i)+r[12]+3873151461&4294967295)<<11&4294967295|o>>>21))+((o=i+(s^t^n)+r[15]+530742520&4294967295)<<16&4294967295|o>>>16))+((o=n+(i^s^t)+r[2]+3299628645&4294967295)<<23&4294967295|o>>>9))+((o=t+(i^(n|~s))+r[0]+4096336452&4294967295)<<6&4294967295|o>>>26))+((o=s+(n^(t|~i))+r[7]+1126891415&4294967295)<<10&4294967295|o>>>22))+((o=i+(t^(s|~n))+r[14]+2878612391&4294967295)<<15&4294967295|o>>>17))+((o=n+(s^(i|~t))+r[5]+4237533241&4294967295)<<21&4294967295|o>>>11))+((o=t+(i^(n|~s))+r[12]+1700485571&4294967295)<<6&4294967295|o>>>26))+((o=s+(n^(t|~i))+r[3]+2399980690&4294967295)<<10&4294967295|o>>>22))+((o=i+(t^(s|~n))+r[10]+4293915773&4294967295)<<15&4294967295|o>>>17))+((o=n+(s^(i|~t))+r[1]+2240044497&4294967295)<<21&4294967295|o>>>11))+((o=t+(i^(n|~s))+r[8]+1873313359&4294967295)<<6&4294967295|o>>>26))+((o=s+(n^(t|~i))+r[15]+4264355552&4294967295)<<10&4294967295|o>>>22))+((o=i+(t^(s|~n))+r[6]+2734768916&4294967295)<<15&4294967295|o>>>17))+((o=n+(s^(i|~t))+r[13]+1309151649&4294967295)<<21&4294967295|o>>>11))+((s=(t=n+((o=t+(i^(n|~s))+r[4]+4149444226&4294967295)<<6&4294967295|o>>>
226))+((o=s+(n^(t|~i))+r[11]+3174756917&4294967295)<<10&4294967295|o>>>22))^((i=s+((o=i+(t^(s|~n))+r[2]+718787259&4294967295)<<15&4294967295|o>>>17))|~t))+r[9]+3951481745&4294967295,e.g[0]=e.g[0]+t&4294967295,e.g[1]=e.g[1]+(i+(o<<21&4294967295|o>>>11))&4294967295,e.g[2]=e.g[2]+i&4294967295,e.g[3]=e.g[3]+s&4294967295}function Zn(e,t){this.h=t;for(var n=[],r=!0,i=e.length-1;0<=i;i--){var s=0|e[i];r&&s==t||(n[i]=s,r=!1)}this.g=n}(r=dn.prototype).Oa=function(e){this.M=e},r.ha=function(e,t,n,r){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.I+"; newUri="+e);t=t?t.toUpperCase():"GET",this.I=e,this.j="",this.m=0,this.F=!1,this.h=!0,this.g=this.u?this.u.g():tt.g(),this.C=this.u?Ze(this.u):Ze(tt),this.g.onreadystatechange=y(this.La,this);try{this.G=!0,this.g.open(t,String(e),!0),this.G=!1}catch(e){return void mn(this,e)}if(e=n||"",n=new Map(this.headers),r)if(Object.getPrototypeOf(r)===Object.prototype)for(var i in r)n.set(i,r[i]);else{if("function"!=typeof r.keys||"function"!=typeof r.get)throw Error("Unknown input type for opt_headers: "+String(r));for(const e of r.keys())n.set(e,r.get(e))}r=Array.from(n.keys()).find(e=>"content-type"==e.toLowerCase()),i=h.FormData&&e instanceof h.FormData,!(0<=I(gn,t))||r||i||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[e,t]of n)this.g.setRequestHeader(e,t);this.K&&(this.g.responseType=this.K),"withCredentials"in this.g&&this.g.withCredentials!==this.M&&(this.g.withCredentials=this.M);try{bn(this),0<this.B&&((this.L=function(e){return L&&"number"==typeof e.timeout&&void 0!==e.ontimeout}(this.g))?(this.g.timeout=this.B,this.g.ontimeout=y(this.ua,this)):this.A=Ne(this.ua,this.B,this)),this.v=!0,this.g.send(e),this.v=!1}catch(e){mn(this,e)}},r.ua=function(){void 0!==l&&this.g&&(this.j="Timed out after "+this.B+"ms, aborting",this.m=8,ve(this,"timeout"),this.abort(8))},r.abort=function(e){this.g&&this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1,this.m=e||7,ve(this,"complete"),ve(this,"abort"),wn(this))},r.N=function(){this.g&&(this.h&&(this.h=!1,this.l=!0,this.g.abort(),this.l=!1),wn(this,!0)),dn.$.N.call(this)},r.La=function(){this.s||(this.G||this.v||this.l?yn(this):this.kb())},r.kb=function(){yn(this)},r.isActive=function(){return!!this.g},r.da=function(){try{return 2<_n(this)?this.g.status:-1}catch(e){return-1}},r.ja=function(){try{return this.g?this.g.responseText:""}catch(e){return""}},r.Wa=function(e){if(this.g){var t=this.g.responseText;return e&&0==t.indexOf(e)&&(t=t.substring(e.length)),hn(t)}},r.Ia=function(){return this.m},r.Sa=function(){return"string"==typeof this.j?this.j:String(this.j)},(r=kn.prototype).ra=8,r.H=1,r.Na=function(e){if(this.m)if(this.m=null,1==this.H){if(!e){this.W=Math.floor(1e5*Math.random()),e=this.W++;const i=new ot(this,this.l,e);let s=this.s;if(this.U&&(s?(s=J(s),ee(s,this.U)):s=this.U),null!==this.o||this.O||(i.I=s,s=null),this.P)e:{for(var t=0,n=0;n<this.j.length;n++){var r=this.j[n];if(void 0===(r="__data__"in r.map&&"string"==typeof(r=r.map.__data__)?r.length:void 0))break;if(4096<(t+=r)){t=n;break e}if(4096===t||n===this.j.length-1){t=n+1;break e}}t=1e3}else t=1e3;t=Rn(this,i,t),xt(n=St(this.I),"RID",e),xt(n,"CVER",22),this.F&&xt(n,"X-HTTP-Session-Id",this.F),Nn(this,n),s&&(this.O?t="headers="+encodeURIComponent(String(En(s)))+"&"+t:this.o&&Tn(n,this.o,s)),Xt(this.i,i),this.bb&&xt(n,"TYPE","init"),this.P?(xt(n,"$req",t),xt(n,"SID","null"),i.aa=!0,ht(i,n,null)):ht(i,n,t),this.H=2}}else 3==this.H&&(e?Dn(this,e):0==this.j.length||Ht(this.i)||Dn(this))},r.Ma=function(){if(this.u=null,Fn(this),this.ca&&!(this.M||null==this.g||0>=this.S)){var e=2*this.S;this.l.info("BP detection timer enabled: "+e),this.B=Qe(y(this.jb,this),e)}},r.jb=function(){this.B&&(this.B=null,this.l.info("BP detection timeout reached."),this.l.info("Buffering proxy detected and switch to long-polling!"),this.G=!1,this.M=!0,We(10),Cn(this),Fn(this))},r.ib=function(){null!=this.v&&(this.v=null,Cn(this),Ln(this),We(19))},r.pb=function(e){e?(this.l.info("Successfully pinged google.com"),We(2)):(this.l.info("Failed to ping google.com"),We(1))},r.isActive=function(){return!!this.h&&this.h.isActive(this)},(r=Gn.prototype).Ba=function(){},r.Aa=function(){},r.za=function(){},r.ya=function(){},r.isActive=function(){return!0},r.Va=function(){},Kn.prototype.g=function(e,t){return new Wn(e,t)},b(Wn,me),Wn.prototype.m=function(){this.g.h=this.j,this.A&&(this.g.J=!0);var e=this.g,t=this.l,n=this.h||void 0;We(0),e.Y=t,e.na=n||{},e.G=e.aa,e.I=zn(e,null,e.Y),On(e)},Wn.prototype.close=function(){An(this.g)},Wn.prototype.u=function(e){var t=this.g;if("string"==typeof e){var n={};n.__data__=e,e=n}else this.v&&((n={}).__data__=we(e),e=n);t.j.push(new Gt(t.fb++,e)),3==t.H&&On(t)},Wn.prototype.N=function(){this.g.h=null,delete this.j,An(this.g),delete this.g,Wn.$.N.call(this)},b(Hn,rt),b(Qn,it),b(Yn,Gn),Yn.prototype.Ba=function(){ve(this.g,"a")},Yn.prototype.Aa=function(e){ve(this.g,new Hn(e))},Yn.prototype.za=function(e){ve(this.g,new Qn)},Yn.prototype.ya=function(){ve(this.g,"b")},b(Xn,function(){this.blockSize=-1}),Xn.prototype.reset=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.i=this.h=0},Xn.prototype.j=function(e,t){void 0===t&&(t=e.length);for(var n=t-this.blockSize,r=this.m,i=this.h,s=0;s<t;){if(0==i)for(;s<=n;)Jn(this,e,s),s+=this.blockSize;if("string"==typeof e){for(;s<t;)if(r[i++]=e.charCodeAt(s++),i==this.blockSize){Jn(this,r),i=0;break}}else for(;s<t;)if(r[i++]=e[s++],i==this.blockSize){Jn(this,r),i=0;break}}this.h=i,this.i+=t},Xn.prototype.l=function(){var e=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);e[0]=128;for(var t=1;t<e.length-8;++t)e[t]=0;var n=8*this.i;for(t=e.length-8;t<e.length;++t)e[t]=255&n,n/=256;for(this.j(e),e=Array(16),t=n=0;4>t;++t)for(var r=0;32>r;r+=8)e[n++]=this.g[t]>>>r&255;return e};var er={};function tr(e){return-128<=e&&128>e?function(e){var t=er;return Object.prototype.hasOwnProperty.call(t,e)?t[e]:t[e]=function(e){return new Zn([0|e],0>e?-1:0)}(e)}(e):new Zn([0|e],0>e?-1:0)}function nr(e){if(isNaN(e)||!isFinite(e))return ir;if(0>e)return ur(nr(-e));for(var t=[],n=1,r=0;e>=n;r++)t[r]=e/n|0,n*=rr;return new Zn(t,0)}var rr=4294967296,ir=tr(0),sr=tr(1),or=tr(16777216);function ar(e){if(0!=e.h)return!1;for(var t=0;t<e.g.length;t++)if(0!=e.g[t])return!1;return!0}function cr(e){return-1==e.h}function ur(e){for(var t=e.g.length,n=[],r=0;r<t;r++)n[r]=~e.g[r];return new Zn(n,~e.h).add(sr)}function lr(e,t){return e.add(ur(t))}function hr(e,t){for(;(65535&e[t])!=e[t];)e[t+1]+=e[t]>>>16,e[t]&=65535,t++}function dr(e,t){this.g=e,this.h=t}function fr(e,t){if(ar(t))throw Error("division by zero");if(ar(e))return new dr(ir,ir);
2if(cr(e))return t=fr(ur(e),t),new dr(ur(t.g),ur(t.h));if(cr(t))return t=fr(e,ur(t)),new dr(ur(t.g),t.h);if(30<e.g.length){if(cr(e)||cr(t))throw Error("slowDivide_ only works with positive integers.");for(var n=sr,r=t;0>=r.X(e);)n=pr(n),r=pr(r);var i=gr(n,1),s=gr(r,1);for(r=gr(r,2),n=gr(n,2);!ar(r);){var o=s.add(r);0>=o.X(e)&&(i=i.add(n),s=o),r=gr(r,1),n=gr(n,1)}return t=lr(e,i.R(t)),new dr(i,t)}for(i=ir;0<=e.X(t);){for(n=Math.max(1,Math.floor(e.ea()/t.ea())),r=48>=(r=Math.ceil(Math.log(n)/Math.LN2))?1:Math.pow(2,r-48),o=(s=nr(n)).R(t);cr(o)||0<o.X(e);)o=(s=nr(n-=r)).R(t);ar(s)&&(s=sr),i=i.add(s),e=lr(e,o)}return new dr(i,e)}function pr(e){for(var t=e.g.length+1,n=[],r=0;r<t;r++)n[r]=e.D(r)<<1|e.D(r-1)>>>31;return new Zn(n,e.h)}function gr(e,t){var n=t>>5;t%=32;for(var r=e.g.length-n,i=[],s=0;s<r;s++)i[s]=0<t?e.D(s+n)>>>t|e.D(s+n+1)<<32-t:e.D(s+n);return new Zn(i,e.h)}(r=Zn.prototype).ea=function(){if(cr(this))return-ur(this).ea();for(var e=0,t=1,n=0;n<this.g.length;n++){var r=this.D(n);e+=(0<=r?r:rr+r)*t,t*=rr}return e},r.toString=function(e){if(2>(e=e||10)||36<e)throw Error("radix out of range: "+e);if(ar(this))return"0";if(cr(this))return"-"+ur(this).toString(e);for(var t=nr(Math.pow(e,6)),n=this,r="";;){var i=fr(n,t).g,s=((0<(n=lr(n,i.R(t))).g.length?n.g[0]:n.h)>>>0).toString(e);if(ar(n=i))return s+r;for(;6>s.length;)s="0"+s;r=s+r}},r.D=function(e){return 0>e?0:e<this.g.length?this.g[e]:this.h},r.X=function(e){return cr(e=lr(this,e))?-1:ar(e)?0:1},r.abs=function(){return cr(this)?ur(this):this},r.add=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0,i=0;i<=t;i++){var s=r+(65535&this.D(i))+(65535&e.D(i)),o=(s>>>16)+(this.D(i)>>>16)+(e.D(i)>>>16);r=o>>>16,s&=65535,o&=65535,n[i]=o<<16|s}return new Zn(n,-2147483648&n[n.length-1]?-1:0)},r.R=function(e){if(ar(this)||ar(e))return ir;if(cr(this))return cr(e)?ur(this).R(ur(e)):ur(ur(this).R(e));if(cr(e))return ur(this.R(ur(e)));if(0>this.X(or)&&0>e.X(or))return nr(this.ea()*e.ea());for(var t=this.g.length+e.g.length,n=[],r=0;r<2*t;r++)n[r]=0;for(r=0;r<this.g.length;r++)for(var i=0;i<e.g.length;i++){var s=this.D(r)>>>16,o=65535&this.D(r),a=e.D(i)>>>16,c=65535&e.D(i);n[2*r+2*i]+=o*c,hr(n,2*r+2*i),n[2*r+2*i+1]+=s*c,hr(n,2*r+2*i+1),n[2*r+2*i+1]+=o*a,hr(n,2*r+2*i+1),n[2*r+2*i+2]+=s*a,hr(n,2*r+2*i+2)}for(r=0;r<t;r++)n[r]=n[2*r+1]<<16|n[2*r];for(r=t;r<2*t;r++)n[r]=0;return new Zn(n,0)},r.gb=function(e){return fr(this,e).h},r.and=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0;r<t;r++)n[r]=this.D(r)&e.D(r);return new Zn(n,this.h&e.h)},r.or=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0;r<t;r++)n[r]=this.D(r)|e.D(r);return new Zn(n,this.h|e.h)},r.xor=function(e){for(var t=Math.max(this.g.length,e.g.length),n=[],r=0;r<t;r++)n[r]=this.D(r)^e.D(r);return new Zn(n,this.h^e.h)},Kn.prototype.createWebChannel=Kn.prototype.g,Wn.prototype.send=Wn.prototype.u,Wn.prototype.open=Wn.prototype.m,Wn.prototype.close=Wn.prototype.close,Ye.NO_ERROR=0,Ye.TIMEOUT=8,Ye.HTTP_ERROR=6,Xe.COMPLETE="complete",et.EventType=nt,nt.OPEN="a",nt.CLOSE="b",nt.ERROR="c",nt.MESSAGE="d",me.prototype.listen=me.prototype.O,dn.prototype.listenOnce=dn.prototype.P,dn.prototype.getLastError=dn.prototype.Sa,dn.prototype.getLastErrorCode=dn.prototype.Ia,dn.prototype.getStatus=dn.prototype.da,dn.prototype.getResponseJson=dn.prototype.Wa,dn.prototype.getResponseText=dn.prototype.ja,dn.prototype.send=dn.prototype.ha,dn.prototype.setWithCredentials=dn.prototype.Oa,Xn.prototype.digest=Xn.prototype.l,Xn.prototype.reset=Xn.prototype.reset,Xn.prototype.update=Xn.prototype.j,Zn.prototype.add=Zn.prototype.add,Zn.prototype.multiply=Zn.prototype.R,Zn.prototype.modulo=Zn.prototype.gb,Zn.prototype.compare=Zn.prototype.X,Zn.prototype.toNumber=Zn.prototype.ea,Zn.prototype.toString=Zn.prototype.toString,Zn.prototype.getBits=Zn.prototype.D,Zn.fromNumber=nr,Zn.fromString=function e(t,n){if(0==t.length)throw Error("number format error: empty string");if(2>(n=n||10)||36<n)throw Error("radix out of range: "+n);if("-"==t.charAt(0))return ur(e(t.substring(1),n));if(0<=t.indexOf("-"))throw Error('number format error: interior "-" character');for(var r=nr(Math.pow(n,8)),i=ir,s=0;s<t.length;s+=8){var o=Math.min(8,t.length-s),a=parseInt(t.substring(s,s+o),n);8>o?(o=nr(Math.pow(n,o)),i=i.R(o).add(nr(a))):i=(i=i.R(r)).add(nr(a))}return i};var mr=u.createWebChannelTransport=function(){return new Kn},vr=u.getStatEventTarget=function(){return ze()},yr=u.ErrorCode=Ye,wr=u.EventType=Xe,br=u.Event=Be,_r=u.Stat={xb:0,Ab:1,Bb:2,Ub:3,Zb:4,Wb:5,Xb:6,Vb:7,Tb:8,Yb:9,PROXY:10,NOPROXY:11,Rb:12,Nb:13,Ob:14,Mb:15,Pb:16,Qb:17,tb:18,sb:19,ub:20},Ir=u.FetchXmlHttpFactory=sn,Er=u.WebChannel=et,Tr=u.XhrIo=dn,Sr=u.Md5=Xn,kr=u.Integer=Zn;const Ar="@firebase/firestore";class Cr{constructor(e){this.uid=e}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}Cr.UNAUTHENTICATED=new Cr(null),Cr.GOOGLE_CREDENTIALS=new Cr("google-credentials-uid"),Cr.FIRST_PARTY=new Cr("first-party-uid"),Cr.MOCK_USER=new Cr("mock-user");let xr="9.23.0";const Or=new o.Vy("@firebase/firestore");function Dr(){return Or.logLevel}function Nr(e){Or.setLogLevel(e)}function Rr(e,...t){if(Or.logLevel<=o.$b.DEBUG){const n=t.map(Mr);Or.debug(`Firestore (${xr}): ${e}`,...n)}}function Pr(e,...t){if(Or.logLevel<=o.$b.ERROR){const n=t.map(Mr);Or.error(`Firestore (${xr}): ${e}`,...n)}}function Lr(e,...t){if(Or.logLevel<=o.$b.WARN){const n=t.map(Mr);Or.warn(`Firestore (${xr}): ${e}`,...n)}}function Mr(e){if("string"==typeof e)return e;try{return t=e,JSON.stringify(t)}catch(t){return e}var t}function Fr(e="Unexpected state"){const t=`FIRESTORE (${xr}) INTERNAL ASSERTION FAILED: `+e;throw Pr(t),new Error(t)}
2function jr(e,t){e||Fr()}function Ur(e,t){e||Fr()}function Vr(e,t){return e}const Br={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class qr extends a.g{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}class zr{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}class $r{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class Gr{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(Cr.UNAUTHENTICATED))}shutdown(){}}class Kr{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class Wr{constructor(e){this.t=e,this.currentUser=Cr.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){let n=this.i;const r=e=>this.i!==n?(n=this.i,t(e)):Promise.resolve();let i=new zr;this.o=()=>{this.i++,this.currentUser=this.u(),i.resolve(),i=new zr,e.enqueueRetryable(()=>r(this.currentUser))};const s=()=>{const t=i;e.enqueueRetryable(async()=>{await t.promise,await r(this.currentUser)})},o=e=>{Rr("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=e,this.auth.addAuthTokenListener(this.o),s()};this.t.onInit(e=>o(e)),setTimeout(()=>{if(!this.auth){const e=this.t.getImmediate({optional:!0});e?o(e):(Rr("FirebaseAuthCredentialsProvider","Auth not yet detected"),i.resolve(),i=new zr)}},0),s()}getToken(){const e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(t=>this.i!==e?(Rr("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):t?(jr("string"==typeof t.accessToken),new $r(t.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const e=this.auth&&this.auth.getUid();return jr(null===e||"string"==typeof e),new Cr(e)}}class Hr{constructor(e,t,n){this.h=e,this.l=t,this.m=n,this.type="FirstParty",this.user=Cr.FIRST_PARTY,this.g=new Map}p(){return this.m?this.m():null}get headers(){this.g.set("X-Goog-AuthUser",this.h);const e=this.p();return e&&this.g.set("Authorization",e),this.l&&this.g.set("X-Goog-Iam-Authorization-Token",this.l),this.g}}class Qr{constructor(e,t,n){this.h=e,this.l=t,this.m=n}getToken(){return Promise.resolve(new Hr(this.h,this.l,this.m))}start(e,t){e.enqueueRetryable(()=>t(Cr.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class Yr{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class Xr{constructor(e){this.I=e,this.forceRefresh=!1,this.appCheck=null,this.T=null}start(e,t){const n=e=>{null!=e.error&&Rr("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${e.error.message}`);const n=e.token!==this.T;return this.T=e.token,Rr("FirebaseAppCheckTokenProvider",`Received ${n?"new":"existing"} token.`),n?t(e.token):Promise.resolve()};this.o=t=>{e.enqueueRetryable(()=>n(t))};const r=e=>{Rr("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=e,this.appCheck.addTokenListener(this.o)};this.I.onInit(e=>r(e)),setTimeout(()=>{if(!this.appCheck){const e=this.I.getImmediate({optional:!0});e?r(e):Rr("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(e=>e?(jr("string"==typeof e.token),this.T=e.token,new Yr(e.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}}function Jr(e){const t="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(e);if(t&&"function"==typeof t.getRandomValues)t.getRandomValues(n);else for(let t=0;t<e;
2t++)n[t]=Math.floor(256*Math.random());return n}class Zr{static A(){const e=62*Math.floor(256/62);let t="";for(;t.length<20;){const n=Jr(40);for(let r=0;r<n.length;++r)t.length<20&&n[r]<e&&(t+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".charAt(n[r]%62))}return t}}function ei(e,t){return e<t?-1:e>t?1:0}function ti(e,t,n){return e.length===t.length&&e.every((e,r)=>n(e,t[r]))}function ni(e){return e+"\0"}class ri{constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new qr(Br.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new qr(Br.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<-62135596800)throw new qr(Br.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new qr(Br.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}static now(){return ri.fromMillis(Date.now())}static fromDate(e){return ri.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),n=Math.floor(1e6*(e-1e3*t));return new ri(t,n)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?ei(this.nanoseconds,e.nanoseconds):ei(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const e=this.seconds- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}class ii{constructor(e){this.timestamp=e}static fromTimestamp(e){return new ii(e)}static min(){return new ii(new ri(0,0))}static max(){return new ii(new ri(253402300799,999999999))}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}class si{constructor(e,t,n){void 0===t?t=0:t>e.length&&Fr(),void 0===n?n=e.length-t:n>e.length-t&&Fr(),this.segments=e,this.offset=t,this.len=n}get length(){return this.len}isEqual(e){return 0===si.comparator(this,e)}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof si?e.forEach(e=>{t.push(e)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=void 0===e?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return 0===this.length}isPrefixOf(e){if(e.length<this.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,n=this.limit();t<n;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){const n=Math.min(e.length,t.length);for(let r=0;r<n;r++){const n=e.get(r),i=t.get(r);if(n<i)return-1;if(n>i)return 1}return e.length<t.length?-1:e.length>t.length?1:0}}class oi extends si{construct(e,t,n){return new oi(e,t,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}static fromString(...e){const t=[];for(const n of e){if(n.indexOf("//")>=0)throw new qr(Br.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);t.push(...n.split("/").filter(e=>e.length>0))}return new oi(t)}static emptyPath(){return new oi([])}}const ai=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class ci extends si{construct(e,t,n){return new ci(e,t,n)}static isValidIdentifier(e){return ai.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),ci.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&"__name__"===this.get(0)}static keyField(){return new ci(["__name__"])}static fromServerFormat(e){const t=[];let n="",r=0;const i=()=>
2{if(0===n.length)throw new qr(Br.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(n),n=""};let s=!1;for(;r<e.length;){const t=e[r];if("\\"===t){if(r+1===e.length)throw new qr(Br.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const t=e[r+1];if("\\"!==t&&"."!==t&&"`"!==t)throw new qr(Br.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);n+=t,r+=2}else"`"===t?(s=!s,r++):"."!==t||s?(n+=t,r++):(i(),r++)}if(i(),s)throw new qr(Br.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new ci(t)}static emptyPath(){return new ci([])}}class ui{constructor(e){this.path=e}static fromPath(e){return new ui(oi.fromString(e))}static fromName(e){return new ui(oi.fromString(e).popFirst(5))}static empty(){return new ui(oi.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return null!==e&&0===oi.comparator(this.path,e.path)}toString(){return this.path.toString()}static comparator(e,t){return oi.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new ui(new oi(e.slice()))}}class li{constructor(e,t,n,r){this.indexId=e,this.collectionGroup=t,this.fields=n,this.indexState=r}}function hi(e){return e.fields.find(e=>2===e.kind)}function di(e){return e.fields.filter(e=>2!==e.kind)}li.UNKNOWN_ID=-1;class fi{constructor(e,t){this.fieldPath=e,this.kind=t}}class pi{constructor(e,t){this.sequenceNumber=e,this.offset=t}static empty(){return new pi(0,vi.min())}}function gi(e,t){const n=e.toTimestamp().seconds,r=e.toTimestamp().nanoseconds+1,i=ii.fromTimestamp(1e9===r?new ri(n+1,0):new ri(n,r));return new vi(i,ui.empty(),t)}function mi(e){return new vi(e.readTime,e.key,-1)}class vi{constructor(e,t,n){this.readTime=e,this.documentKey=t,this.largestBatchId=n}static min(){return new vi(ii.min(),ui.empty(),-1)}static max(){return new vi(ii.max(),ui.empty(),-1)}}function yi(e,t){let n=e.readTime.compareTo(t.readTime);return 0!==n?n:(n=ui.comparator(e.documentKey,t.documentKey),0!==n?n:ei(e.largestBatchId,t.largestBatchId))}const wi="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class bi{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}async function _i(e){if(e.code!==Br.FAILED_PRECONDITION||e.message!==wi)throw e;Rr("LocalStore","Unexpectedly lost primary lease")}class Ii{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(e=>{this.isDone=!0,this.result=e,this.nextCallback&&this.nextCallback(e)},e=>{this.isDone=!0,this.error=e,this.catchCallback&&this.catchCallback(e)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&Fr(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new Ii((n,r)=>{this.nextCallback=t=>{this.wrapSuccess(e,t).next(n,r)},this.catchCallback=e=>{this.wrapFailure(t,e).next(n,r)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{const t=e();return t instanceof Ii?t:Ii.resolve(t)}catch(e){return Ii.reject(e)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):Ii.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):Ii.reject(t)}static resolve(e){return new Ii((t,n)=>{t(e)})}static reject(e){return new Ii((t,n)=>{n(e)})}static waitFor(e){return new Ii((t,n)=>{let r=0,i=0,s=!1;e.forEach(e=>{++r,e.next(()=>{++i,s&&i===r&&t()},e=>n(e))}),s=!0,i===r&&t()})}static or(e){let t=Ii.resolve(!1);for(const n of e)t=t.next(e=>e?Ii.resolve(e):n());return t}static forEach(e,t){const n=[];return e.forEach((e,r)=>{n.push(t.call(this,e,r))}),this.waitFor(n)}static mapArray(e,t){return new Ii((n,r)=>{const i=e.length,s=new Array(i);let o=0;for(let a=0;a<i;a++){const c=a;t(e[c]).next(e=>{s[c]=e,++o,o===i&&n(s)},e=>r(e))}})}static doWhile(e,t){return new Ii((n,r)=>{const i=()=>{!0===e()?t().next(()=>{i()},r):n()};i()})}}class Ei{constructor(e,t){this.action=e,this.transaction=t,this.aborted=!1,this.v=new zr,this.transaction.oncomplete=()=>{this.v.resolve()},this.transaction.onabort=()=>{t.error?this.v.reject(new ki(e,t.error)):this.v.resolve()},this.transaction.onerror=t=>{const n=Di(t.target.error);this.v.reject(new ki(e,n))}}static open(e,t,n,r){try{return new Ei(t,e.transaction(r,n))}catch(e){throw new ki(t,e)}}get R(){return this.v.promise}abort(e){e&&this.v.reject(e),this.aborted||(Rr("SimpleDb","Aborting transaction:",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}P(){const e=this.transaction;this.aborted||"function"!=typeof e.commit||e.commit()}store(e){const t=this.transaction.objectStore(e);return new Ci(t)}}class Ti{constructor(e,t,n){this.name=e,this.version=t,this.V=n,12.2===Ti.S((0,a.ZQ)())&&Pr("Firestore persistence suffers from a bug in
2iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}static delete(e){return Rr("SimpleDb","Removing database:",e),xi(window.indexedDB.deleteDatabase(e)).toPromise()}static D(){if(!(0,a.zW)())return!1;if(Ti.C())return!0;const e=(0,a.ZQ)(),t=Ti.S(e),n=0<t&&t<10,r=Ti.N(e),i=0<r&&r<4.5;return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||n||i)}static C(){var e;return"undefined"!=typeof process&&"YES"===(null===(e=process.env)||void 0===e?void 0:e.k)}static M(e,t){return e.store(t)}static S(e){const t=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),n=t?t[1].split("_").slice(0,2).join("."):"-1";return Number(n)}static N(e){const t=e.match(/Android ([\d.]+)/i),n=t?t[1].split(".").slice(0,2).join("."):"-1";return Number(n)}async $(e){return this.db||(Rr("SimpleDb","Opening database:",this.name),this.db=await new Promise((t,n)=>{const r=indexedDB.open(this.name,this.version);r.onsuccess=e=>{const n=e.target.result;t(n)},r.onblocked=()=>{n(new ki(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},r.onerror=t=>{const r=t.target.error;"VersionError"===r.name?n(new qr(Br.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.")):"InvalidStateError"===r.name?n(new qr(Br.FAILED_PRECONDITION,"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: "+r)):n(new ki(e,r))},r.onupgradeneeded=e=>{Rr("SimpleDb",'Database "'+this.name+'" requires upgrade from version:',e.oldVersion);const t=e.target.result;this.V.O(t,r.transaction,e.oldVersion,this.version).next(()=>{Rr("SimpleDb","Database upgrade to version "+this.version+" complete")})}})),this.F&&(this.db.onversionchange=e=>this.F(e)),this.db}B(e){this.F=e,this.db&&(this.db.onversionchange=t=>e(t))}async runTransaction(e,t,n,r){const i="readonly"===t;let s=0;for(;;){++s;try{this.db=await this.$(e);const t=Ei.open(this.db,e,i?"readonly":"readwrite",n),s=r(t).next(e=>(t.P(),e)).catch(e=>(t.abort(e),Ii.reject(e))).toPromise();return s.catch(()=>{}),await t.R,s}catch(e){const t=e,n="FirebaseError"!==t.name&&s<3;if(Rr("SimpleDb","Transaction failed with error:",t.message,"Retrying:",n),this.close(),!n)return Promise.reject(t)}}}close(){this.db&&this.db.close(),this.db=void 0}}class Si{constructor(e){this.L=e,this.q=!1,this.U=null}get isDone(){return this.q}get K(){return this.U}set cursor(e){this.L=e}done(){this.q=!0}G(e){this.U=e}delete(){return xi(this.L.delete())}}class ki extends qr{constructor(e,t){super(Br.UNAVAILABLE,`IndexedDB transaction '${e}' failed: ${t}`),this.name="IndexedDbTransactionError"}}function Ai(e){return"IndexedDbTransactionError"===e.name}class Ci{constructor(e){this.store=e}put(e,t){let n;return void 0!==t?(Rr("SimpleDb","PUT",this.store.name,e,t),n=this.store.put(t,e)):(Rr("SimpleDb","PUT",this.store.name,"<auto-key>",e),n=this.store.put(e)),xi(n)}add(e){return Rr("SimpleDb","ADD",this.store.name,e,e),xi(this.store.add(e))}get(e){return xi(this.store.get(e)).next(t=>(void 0===t&&(t=null),Rr("SimpleDb","GET",this.store.name,e,t),t))}delete(e){return Rr("SimpleDb","DELETE",this.store.name,e),xi(this.store.delete(e))}count(){return Rr("SimpleDb","COUNT",this.store.name),xi(this.store.count())}j(e,t){const n=this.options(e,t);if(n.index||"function"!=typeof this.store.getAll){const e=this.cursor(n),t=[];return this.W(e,(e,n)=>{t.push(n)}).next(()=>t)}{const e=this.store.getAll(n.range);return new Ii((t,n)=>{e.onerror=e=>{n(e.target.error)},e.onsuccess=e=>{t(e.target.result)}})}}H(e,t){const n=this.store.getAll(e,null===t?void 0:t);return new Ii((e,t)=>{n.onerror=e=>{t(e.target.error)},n.onsuccess=t=>{e(t.target.result)}})}J(e,t){Rr("SimpleDb","DELETE ALL",this.store.name);const n=this.options(e,t);n.Y=!1;const r=this.cursor(n);return this.W(r,(e,t,n)=>n.delete())}X(e,t){let n;t?n=e:(n={},t=e);const r=this.cursor(n);return this.W(r,t)}Z(e){const t=this.cursor({});return new Ii((n,r)=>{t.onerror=e=>{const t=Di(e.target.error);r(t)},t.onsuccess=t=>{const r=t.target.result;r?e(r.primaryKey,r.value).next(e=>{e?r.continue():n()}):n()}})}W(e,t){const n=[];return new Ii((r,i)=>{e.onerror=e=>{i(e.target.error)},e.onsuccess=e=>{const i=e.target.result;if(!i)return void r();const s=new Si(i),o=t(i.primaryKey,i.value,s);if(o instanceof Ii){const e=o.catch(e=>(s.done(),Ii.reject(e)));n.push(e)}s.isDone?r():null===s.K?i.continue():i.continue(s.K)}}).next(()=>Ii.waitFor(n))}options(e,t){let n;return void 0!==e&&("string"==typeof e?n=e:t=e),{index:n,range:t}}cursor(e){let t="next";if(e.reverse&&(t="prev"),e.index){const n=this.store.index(e.index);return e.Y?n.openKeyCursor(e.range,t):n.openCursor(e.range,t)}return this.store.openCursor(e.range,t)}}function xi(e){return new Ii((t,n)=>{e.onsuccess=e=>{const n=e.target.result;t(n)},e.onerror=e=>{const t=Di(e.target.error);n(t)}})}let Oi=!1;function Di(e){const t=Ti.S((0,a.ZQ)());if(t>=12.2&&t<13){const t="An internal error was encountered in the Indexed Database server";if(e.message.indexOf(t)>=0){const e=new qr("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.`);return Oi||(Oi=!0,setTimeout(()=>{throw e},0)),e}}return e}class Ni{constructor(e,t){this.asyncQueue=e,this.tt=t,this.task=null}start(){this.et(15e3)}stop(){this.task&&(this.task.cancel(),this.task=null)}get started(){return null!==this.task}et(e){Rr("IndexBackiller",`Scheduled in ${e}ms`),this.task=this.asyncQueue.enqueueAfterDelay("index_backfill",e,async()=>{this.task=null;try{Rr("IndexBackiller",`Documents written: ${await this.tt.nt()}`)}catch(e){Ai(e)?Rr("IndexBackiller","Ignoring IndexedDB error during index backfill: ",e):await _i(e)}await this.et(6e4)})}}class Ri{constructor(e,t){this.localStore=e,this.persistence=t}async nt(e=50){return this.persistence.runTransaction("Backfill Indexes","readwrite-primary",t=>this.st(t,e))}st(e,t){const n=new Set;let r=t,i=!0;
2return Ii.doWhile(()=>!0===i&&r>0,()=>this.localStore.indexManager.getNextCollectionGroupToUpdate(e).next(t=>{if(null!==t&&!n.has(t))return Rr("IndexBackiller",`Processing collection: ${t}`),this.it(e,t,r).next(e=>{r-=e,n.add(t)});i=!1})).next(()=>t-r)}it(e,t,n){return this.localStore.indexManager.getMinOffsetFromCollectionGroup(e,t).next(r=>this.localStore.localDocuments.getNextDocuments(e,t,r,n).next(n=>{const i=n.changes;return this.localStore.indexManager.updateIndexEntries(e,i).next(()=>this.rt(r,n)).next(n=>(Rr("IndexBackiller",`Updating offset: ${n}`),this.localStore.indexManager.updateCollectionGroup(e,t,n))).next(()=>i.size)}))}rt(e,t){let n=e;return t.changes.forEach((e,t)=>{const r=mi(t);yi(r,n)>0&&(n=r)}),new vi(n.readTime,n.documentKey,Math.max(t.batchId,e.largestBatchId))}}class Pi{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=e=>this.ot(e),this.ut=e=>t.writeSequenceNumber(e))}ot(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ut&&this.ut(e),e}}function Li(e){return null==e}function Mi(e){return 0===e&&1/e==-1/0}function Fi(e){return"number"==typeof e&&Number.isInteger(e)&&!Mi(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER}function ji(e){let t="";for(let n=0;n<e.length;n++)t.length>0&&(t=Vi(t)),t=Ui(e.get(n),t);return Vi(t)}function Ui(e,t){let n=t;const r=e.length;for(let t=0;t<r;t++){const r=e.charAt(t);switch(r){case"\0":n+="��";break;case"�":n+="��";break;default:n+=r}}return n}function Vi(e){return e+"��"}function Bi(e){const t=e.length;if(jr(t>=2),2===t)return jr("�"===e.charAt(0)&&"�"===e.charAt(1)),oi.emptyPath();const n=t-2,r=[];let i="";for(let s=0;s<t;){const t=e.indexOf("�",s);switch((t<0||t>n)&&Fr(),e.charAt(t+1)){case"�":const n=e.substring(s,t);let o;0===i.length?o=n:(i+=n,o=i,i=""),r.push(o);break;case"�":i+=e.substring(s,t),i+="\0";break;case"�":i+=e.substring(s,t+1);break;default:Fr()}s=t+2}return new oi(r)}Pi.ct=-1;const qi=["userId","batchId"];function zi(e,t){return[e,ji(t)]}function $i(e,t,n){return[e,ji(t),n]}const Gi={},Ki=["prefixPath","collectionGroup","readTime","documentId"],Wi=["prefixPath","collectionGroup","documentId"],Hi=["collectionGroup","readTime","prefixPath","documentId"],Qi=["canonicalId","targetId"],Yi=["targetId","path"],Xi=["path","targetId"],Ji=["collectionId","parent"],Zi=["indexId","uid"],es=["uid","sequenceNumber"],ts=["indexId","uid","arrayValue","directionalValue","orderedDocumentKey","documentKey"],ns=["indexId","uid","orderedDocumentKey"],rs=["userId","collectionPath","documentId"],is=["userId","collectionPath","largestBatchId"],ss=["userId","collectionGroup","largestBatchId"],os=["mutationQueues","mutations","documentMutations","remoteDocuments","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries"],as=[...os,"documentOverlays"],cs=["mutationQueues","mutations","documentMutations","remoteDocumentsV14","targets","owner","targetGlobal","targetDocuments","clientMetadata","remoteDocumentGlobal","collectionParents","bundles","namedQueries","documentOverlays"],us=cs,ls=[...us,"indexConfiguration","indexState","indexEntries"];class hs extends bi{constructor(e,t){super(),this.ht=e,this.currentSequenceNumber=t}}function ds(e,t){const n=Vr(e);return Ti.M(n.ht,t)}function fs(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function ps(e,t){for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t(n,e[n])}function gs(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}class ms{constructor(e,t){this.comparator=e,this.root=t||ys.EMPTY}insert(e,t){return new ms(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,ys.BLACK,null,null))}remove(e){return new ms(this.comparator,this.root.remove(e,this.comparator).copy(null,null,ys.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const n=this.comparator(e,t.key);if(0===n)return t.value;n<0?t=t.left:n>0&&(t=t.right)}return null}indexOf(e){let t=0,n=this.root;for(;!n.isEmpty();){const r=this.comparator(e,n.key);if(0===r)return t+n.left.size;r<0?n=n.left:(t+=n.left.size+1,n=n.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,n)=>(e(t,n),!1))}toString(){const e=[];return this.inorderTraversal((t,n)=>(e.push(`${t}:${n}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new vs(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new vs(this.root,e,this.comparator,!1)}getReverseIterator(){return new vs(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new vs(this.root,e,this.comparator,!0)}}class vs{constructor(e,t,n,r){this.isReverse=r,this.nodeStack=[];let i=1;for(;!e.isEmpty();)if(i=t?n(e.key,t):1,t&&r&&(i*=-1),i<0)e=this.isReverse?e.left:e.right;else{if(0===i){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class ys{constructor(e,t,n,r,i){this.key=e,this.value=t,this.color=null!=n?n:ys.RED,this.left=null!=r?r:ys.EMPTY,this.right=null!=i?i:ys.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,n,r,i){return new ys(null!=e?e:this.key,null!=t?t:this.value,
vendor: 4,421 bytes, line 2
2null!=n?n:this.color,null!=r?r:this.left,null!=i?i:this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,n){let r=this;const i=n(e,r.key);return r=i<0?r.copy(null,null,null,r.left.insert(e,t,n),null):0===i?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,n)),r.fixUp()}removeMin(){if(this.left.isEmpty())return ys.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let n,r=this;if(t(e,r.key)<0)r.left.isEmpty()||r.left.isRed()||r.left.left.isRed()||(r=r.moveRedLeft()),r=r.copy(null,null,null,r.left.remove(e,t),null);else{if(r.left.isRed()&&(r=r.rotateRight()),r.right.isEmpty()||r.right.isRed()||r.right.left.isRed()||(r=r.moveRedRight()),0===t(e,r.key)){if(r.right.isEmpty())return ys.EMPTY;n=r.right.min(),r=r.copy(n.key,n.value,null,null,r.right.removeMin())}r=r.copy(null,null,null,null,r.right.remove(e,t))}return r.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,ys.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,ys.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw Fr();if(this.right.isRed())throw Fr();const e=this.left.check();if(e!==this.right.check())throw Fr();return e+(this.isRed()?0:1)}}ys.EMPTY=null,ys.RED=!0,ys.BLACK=!1,ys.EMPTY=new class{constructor(){this.size=0}get key(){throw Fr()}get value(){throw Fr()}get color(){throw Fr()}get left(){throw Fr()}get right(){throw Fr()}copy(e,t,n,r,i){return this}insert(e,t,n){return new ys(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class ws{constructor(e){this.comparator=e,this.data=new ms(this.comparator)}has(e){return null!==this.data.get(e)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,n)=>(e(t),!1))}forEachInRange(e,t){const n=this.data.getIteratorFrom(e[0]);for(;n.hasNext();){const r=n.getNext();if(this.comparator(r.key,e[1])>=0)return;t(r.key)}}forEachWhile(e,t){let n;for(n=void 0!==t?this.data.getIteratorFrom(t):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new bs(this.data.getIterator())}getIteratorFrom(e){return new bs(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size<e.size&&(t=e,e=this),e.forEach(e=>{t=t.add(e)}),t}isEqual(e){if(!(e instanceof ws))return!1;if(this.size!==e.size)return!1;const t=this.data.getIterator(),n=e.data.getIterator();for(;t.hasNext();){const e=t.getNext().key,r=n.getNext().key;if(0!==this.comparator(e,r))return!1}return!0}toArray(){const e=[];return this.forEach(t=>{e.push(t)}),e}toString(){const e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){const t=new ws(this.comparator);return t.data=e,t}}
2class bs{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}function _s(e){return e.hasNext()?e.getNext():void 0}class Is{constructor(e){this.fields=e,e.sort(ci.comparator)}static empty(){return new Is([])}unionWith(e){let t=new ws(ci.comparator);for(const e of this.fields)t=t.add(e);for(const n of e)t=t.add(n);return new Is(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return ti(this.fields,e.fields,(e,t)=>e.isEqual(t))}}class Es extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}function Ts(){return"undefined"!=typeof atob}class Ss{constructor(e){this.binaryString=e}static fromBase64String(e){const t=function(e){try{return atob(e)}catch(e){throw"undefined"!=typeof DOMException&&e instanceof DOMException?new Es("Invalid base64 string: "+e):e}}(e);return new Ss(t)}static fromUint8Array(e){const t=function(e){let t="";for(let n=0;n<e.length;++n)t+=String.fromCharCode(e[n]);return t}(e);return new Ss(t)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return e=this.binaryString,btoa(e);var e}toUint8Array(){return function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return ei(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}Ss.EMPTY_BYTE_STRING=new Ss("");const ks=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function As(e){if(jr(!!e),"string"==typeof e){let t=0;const n=ks.exec(e);if(jr(!!n),n[1]){let e=n[1];e=(e+"000000000").substr(0,9),t=Number(e)}const r=new Date(e);return{seconds:Math.floor(r.getTime()/1e3),nanos:t}}return{seconds:Cs(e.seconds),nanos:Cs(e.nanos)}}function Cs(e){return"number"==typeof e?e:"string"==typeof e?Number(e):0}function xs(e){return"string"==typeof e?Ss.fromBase64String(e):Ss.fromUint8Array(e)}function Os(e){var t,n;return"server_timestamp"===(null===(n=((null===(t=null==e?void 0:e.mapValue)||void 0===t?void 0:t.fields)||{}).__type__)||void 0===n?void 0:n.stringValue)}function Ds(e){const t=e.mapValue.fields.__previous_value__;return Os(t)?Ds(t):t}function Ns(e){const t=As(e.mapValue.fields.__local_write_time__.timestampValue);return new ri(t.seconds,t.nanos)}class Rs{constructor(e,t,n,r,i,s,o,a,c){this.databaseId=e,this.appId=t,this.persistenceKey=n,this.host=r,this.ssl=i,this.forceLongPolling=s,this.autoDetectLongPolling=o,this.longPollingOptions=a,this.useFetchStreams=c}}class Ps{constructor(e,t){this.projectId=e,this.database=t||"(default)"}static empty(){return new Ps("","")}get isDefaultDatabase(){return"(default)"===this.database}isEqual(e){return e instanceof Ps&&e.projectId===this.projectId&&e.database===this.database}}const Ls={mapValue:{fields:{__type__:{stringValue:"__max__"}}}},Ms={nullValue:"NULL_VALUE"};function Fs(e){return"nullValue"in e?0:"booleanValue"in e?1:"integerValue"in e||"doubleValue"in e?2:"timestampValue"in e?3:"stringValue"in e?5:"bytesValue"in e?6:"referenceValue"in e?7:"geoPointValue"in e?8:"arrayValue"in e?9:"mapValue"in e?Os(e)?4:Xs(e)?9007199254740991:10:Fr()}function js(e,t){if(e===t)return!0;const n=Fs(e);if(n!==Fs(t))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return e.booleanValue===t.booleanValue;case 4:return Ns(e).isEqual(Ns(t));case 3:return function(e,t){if("string"==typeof e.timestampValue&&"string"==typeof t.timestampValue&&e.timestampValue.length===t.timestampValue.length)return e.timestampValue===t.timestampValue;const n=As(e.timestampValue),r=As(t.timestampValue);return n.seconds===r.seconds&&n.nanos===r.nanos}(e,t);case 5:return e.stringValue===t.stringValue;case 6:return function(e,t){return xs(e.bytesValue).isEqual(xs(t.bytesValue))}(e,t);case 7:return e.referenceValue===t.referenceValue;case 8:return function(e,t){return Cs(e.geoPointValue.latitude)===Cs(t.geoPointValue.latitude)&&Cs(e.geoPointValue.longitude)===Cs(t.geoPointValue.longitude)}(e,t);case 2:return function(e,t){if("integerValue"in e&&"integerValue"in t)return Cs(e.integerValue)===Cs(t.integerValue);if("doubleValue"in e&&"doubleValue"in t){const n=Cs(e.doubleValue),r=Cs(t.doubleValue);return n===r?Mi(n)===Mi(r):isNaN(n)&&isNaN(r)}return!1}(e,t);case 9:return ti(e.arrayValue.values||[],t.arrayValue.values||[],js);case 10:return function(e,t){const n=e.mapValue.fields||{},r=t.mapValue.fields||{};if(fs(n)!==fs(r))return!1;for(const e in n)if(n.hasOwnProperty(e)&&(void 0===r[e]||!js(n[e],r[e])))return!1;return!0}(e,t);default:return Fr()}}function Us(e,t){return void 0!==(e.values||[]).find(e=>js(e,t))}function Vs(e,t){if(e===t)return 0;const n=Fs(e),r=Fs(t);if(n!==r)return ei(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return ei(e.booleanValue,t.booleanValue);case 2:return function(e,t){const n=Cs(e.integerValue||e.doubleValue),r=Cs(t.integerValue||t.doubleValue);return n<r?-1:n>r?1:n===r?0:isNaN(n)?isNaN(r)?0:-1:1}(e,t);case 3:return Bs(e.timestampValue,t.timestampValue);case 4:return Bs(Ns(e),Ns(t));case 5:return ei(e.stringValue,t.stringValue);case 6:return function(e,t){const n=xs(e),r=xs(t);return n.compareTo(r)}(e.bytesValue,t.bytesValue);case 7:return function(e,t){const n=e.split("/"),r=t.split("/");for(let e=0;e<n.length&&e<r.length;e++){const t=ei(n[e],r[e]);if(0!==t)return t}return ei(n.length,r.length)}(e.referenceValue,t.referenceValue);case 8:return function(e,t){const n=ei(Cs(e.latitude),Cs(t.latitude));return 0!==n?n:ei(Cs(e.longitude),Cs(t.longitude))}(e.geoPointValue,t.geoPointValue);case 9:return function(e,t){const n=e.values||[],r=t.values||[];for(let e=0;e<n.length&&e<r.length;++e){const t=Vs(n[e],r[e]);if(t)return t}return ei(n.length,r.length)}(e.arrayValue,t.arrayValue);case 10:return function(e,t){if(e===Ls.mapValue&&t===Ls.mapValue)return 0;if(e===Ls.mapValue)return 1;if(t===Ls.mapValue)return-1;const n=e.fields||{},r=Object.keys(n),i=t.fields||{},s=Object.keys(i);r.sort(),s.sort();for(let e=0;e<r.length&&e<s.length;++e){const t=ei(r[e],s[e]);if(0!==t)return t;const o=Vs(n[r[e]],i[s[e]]);if(0!==o)return o}return ei(r.length,s.length)}(e.mapValue,t.mapValue);default:throw Fr()}}function Bs(e,t){if("string"==typeof e&&"string"==typeof t&&e.length===t.length)return ei(e,t);const n=As(e),r=As(t),i=ei(n.seconds,r.seconds);return 0!==i?i:ei(n.nanos,r.nanos)}function qs(e){return zs(e)}function zs(e){return"nullValue"in e?"null":"booleanValue"in e?""+e.booleanValue:"integerValue"in e?""+e.integerValue:"doubleValue"in e?""+e.doubleValue:"timestampValue"in e?function(e){const t=As(e);return`time(${t.seconds},${t.nanos})`}(e.timestampValue):"stringValue"in e?e.stringValue:"bytesValue"in e?xs(e.bytesValue).toBase64():"referenceValue"in e?(n=e.referenceValue,ui.fromName(n).toString()):"geoPointValue"in e?`geo(${(t=e.geoPointValue).latitude},${t.longitude})`:"arrayValue"in e?function(e){let t="[",n=!0;for(const r of e.values||[])n?n=!1:t+=",",t+=zs(r);return t+"]"}(e.arrayValue):"mapValue"in e?function(e){const t=Object.keys(e.fields||{}).sort();let n="{",r=!0;for(const i of t)r?r=!1:n+=",",n+=`${i}:${zs(e.fields[i])}`;return n+"}"}(e.mapValue):Fr();var t,n}function $s(e,t){return{referenceValue:`projects/${e.projectId}/databases/${e.database}/documents/${t.path.canonicalString()}`}}function Gs(e){return!!e&&"integerValue"in e}function Ks(e){return!!e&&"arrayValue"in e}function Ws(e){return!!e&&"nullValue"in e}function Hs(e){return!!e&&"doubleValue"in e&&isNaN(Number(e.doubleValue))}function Qs(e){return!!e&&"mapValue"in e}function Ys(e){if(e.geoPointValue)return{geoPointValue:Object.assign({},e.geoPointValue)};if(e.timestampValue&&"object"==typeof e.timestampValue)return{timestampValue:Object.assign({},e.timestampValue)};if(e.mapValue){const t={mapValue:{fields:{}}};return ps(e.mapValue.fields,(e,n)=>t.mapValue.fields[e]=Ys(n)),t}if(e.arrayValue){const t={arrayValue:{values:[]}};for(let n=0;n<(e.arrayValue.values||[]).length;++n)t.arrayValue.values[n]=Ys(e.arrayValue.values[n]);return t}return Object.assign({},e)}function Xs(e){return"__max__"===(((e.mapValue||{}).fields||{}).__type__||{}).stringValue}function Js(e){return"nullValue"in e?Ms:"booleanValue"in e?{booleanValue:!1}:"integerValue"in e||"doubleValue"in e?{doubleValue:NaN}:"timestampValue"in e?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"stringValue"in e?{stringValue:""}
vendor: 4,250 bytes, line 2
2:"bytesValue"in e?{bytesValue:""}:"referenceValue"in e?$s(Ps.empty(),ui.empty()):"geoPointValue"in e?{geoPointValue:{latitude:-90,longitude:-180}}:"arrayValue"in e?{arrayValue:{}}:"mapValue"in e?{mapValue:{}}:Fr()}function Zs(e){return"nullValue"in e?{booleanValue:!1}:"booleanValue"in e?{doubleValue:NaN}:"integerValue"in e||"doubleValue"in e?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"timestampValue"in e?{stringValue:""}:"stringValue"in e?{bytesValue:""}:"bytesValue"in e?$s(Ps.empty(),ui.empty()):"referenceValue"in e?{geoPointValue:{latitude:-90,longitude:-180}}:"geoPointValue"in e?{arrayValue:{}}:"arrayValue"in e?{mapValue:{}}:"mapValue"in e?Ls:Fr()}function eo(e,t){const n=Vs(e.value,t.value);return 0!==n?n:e.inclusive&&!t.inclusive?-1:!e.inclusive&&t.inclusive?1:0}function to(e,t){const n=Vs(e.value,t.value);return 0!==n?n:e.inclusive&&!t.inclusive?1:!e.inclusive&&t.inclusive?-1:0}class no{constructor(e){this.value=e}static empty(){return new no({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let n=0;n<e.length-1;++n)if(t=(t.mapValue.fields||{})[e.get(n)],!Qs(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=Ys(t)}setAll(e){let t=ci.emptyPath(),n={},r=[];e.forEach((e,i)=>{if(!t.isImmediateParentOf(i)){const e=this.getFieldsMap(t);this.applyChanges(e,n,r),n={},r=[],t=i.popLast()}e?n[i.lastSegment()]=Ys(e):r.push(i.lastSegment())});const i=this.getFieldsMap(t);this.applyChanges(i,n,r)}delete(e){const t=this.field(e.popLast());Qs(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return js(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let n=0;n<e.length;++n){let r=t.mapValue.fields[e.get(n)];Qs(r)&&r.mapValue.fields||(r={mapValue:{fields:{}}},t.mapValue.fields[e.get(n)]=r),t=r}return t.mapValue.fields}applyChanges(e,t,n){ps(t,(t,n)=>e[t]=n);for(const t of n)delete e[t]}clone(){return new no(Ys(this.value))}}function ro(e){const t=[];return ps(e.fields,(e,n)=>{const r=new ci([e]);if(Qs(n)){const e=ro(n.mapValue).fields;if(0===e.length)t.push(r);else for(const n of e)t.push(r.child(n))}else t.push(r)}),new Is(t)}class io{constructor(e,t,n,r,i,s,o){this.key=e,this.documentType=t,this.version=n,this.readTime=r,this.createTime=i,this.data=s,this.documentState=o}static newInvalidDocument(e){return new io(e,0,ii.min(),ii.min(),ii.min(),no.empty(),0)}static newFoundDocument(e,t,n,r){return new io(e,1,t,ii.min(),n,r,0)}static newNoDocument(e,t){return new io(e,2,t,ii.min(),ii.min(),no.empty(),0)}static newUnknownDocument(e,t){return new io(e,3,t,ii.min(),ii.min(),no.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(ii.min())||2!==this.documentType&&0!==this.documentType||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=no.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=no.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=ii.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return 1===this.documentState}get hasCommittedMutations(){return 2===this.documentState}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return 0!==this.documentType}isFoundDocument(){return 1===this.documentType}isNoDocument(){return 2===this.documentType}isUnknownDocument(){return 3===this.documentType}isEqual(e){return e instanceof io&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new io(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}
2class so{constructor(e,t){this.position=e,this.inclusive=t}}function oo(e,t,n){let r=0;for(let i=0;i<e.position.length;i++){const s=t[i],o=e.position[i];if(r=s.field.isKeyField()?ui.comparator(ui.fromName(o.referenceValue),n.key):Vs(o,n.data.field(s.field)),"desc"===s.dir&&(r*=-1),0!==r)break}return r}function ao(e,t){if(null===e)return null===t;if(null===t)return!1;if(e.inclusive!==t.inclusive||e.position.length!==t.position.length)return!1;for(let n=0;n<e.position.length;n++)if(!js(e.position[n],t.position[n]))return!1;return!0}class co{constructor(e,t="asc"){this.field=e,this.dir=t}}function uo(e,t){return e.dir===t.dir&&e.field.isEqual(t.field)}class lo{}class ho extends lo{constructor(e,t,n){super(),this.field=e,this.op=t,this.value=n}static create(e,t,n){return e.isKeyField()?"in"===t||"not-in"===t?this.createKeyFieldInFilter(e,t,n):new Io(e,t,n):"array-contains"===t?new ko(e,n):"in"===t?new Ao(e,n):"not-in"===t?new Co(e,n):"array-contains-any"===t?new xo(e,n):new ho(e,t,n)}static createKeyFieldInFilter(e,t,n){return"in"===t?new Eo(e,n):new To(e,n)}matches(e){const t=e.data.field(this.field);return"!="===this.op?null!==t&&this.matchesComparison(Vs(t,this.value)):null!==t&&Fs(this.value)===Fs(t)&&this.matchesComparison(Vs(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return 0===e;case"!=":return 0!==e;case">":return e>0;case">=":return e>=0;default:return Fr()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}getFirstInequalityField(){return this.isInequality()?this.field:null}}class fo extends lo{constructor(e,t){super(),this.filters=e,this.op=t,this.lt=null}static create(e,t){return new fo(e,t)}matches(e){return po(this)?void 0===this.filters.find(t=>!t.matches(e)):void 0!==this.filters.find(t=>t.matches(e))}getFlattenedFilters(){return null!==this.lt||(this.lt=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.lt}getFilters(){return Object.assign([],this.filters)}getFirstInequalityField(){const e=this.ft(e=>e.isInequality());return null!==e?e.field:null}ft(e){for(const t of this.getFlattenedFilters())if(e(t))return t;return null}}function po(e){return"and"===e.op}function go(e){return"or"===e.op}function mo(e){return vo(e)&&po(e)}function vo(e){for(const t of e.filters)if(t instanceof fo)return!1;return!0}function yo(e){if(e instanceof ho)return e.field.canonicalString()+e.op.toString()+qs(e.value);if(mo(e))return e.filters.map(e=>yo(e)).join(",");{const t=e.filters.map(e=>yo(e)).join(",");return`${e.op}(${t})`}}function wo(e,t){return e instanceof ho?function(e,t){return t instanceof ho&&e.op===t.op&&e.field.isEqual(t.field)&&js(e.value,t.value)}(e,t):e instanceof fo?function(e,t){return t instanceof fo&&e.op===t.op&&e.filters.length===t.filters.length&&e.filters.reduce((e,n,r)=>e&&wo(n,t.filters[r]),!0)}(e,t):void Fr()}function bo(e,t){const n=e.filters.concat(t);return fo.create(n,e.op)}function _o(e){return e instanceof ho?function(e){return`${e.field.canonicalString()} ${e.op} ${qs(e.value)}`}(e):e instanceof fo?function(e){return e.op.toString()+" {"+e.getFilters().map(_o).join(" ,")+"}"}(e):"Filter"}class Io extends ho{constructor(e,t,n){super(e,t,n),this.key=ui.fromName(n.referenceValue)}matches(e){const t=ui.comparator(e.key,this.key);return this.matchesComparison(t)}}class Eo extends ho{constructor(e,t){super(e,"in",t),this.keys=So(0,t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class To extends ho{constructor(e,t){super(e,"not-in",t),this.keys=So(0,t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function So(e,t){var n;return((null===(n=t.arrayValue)||void 0===n?void 0:n.values)||[]).map(e=>ui.fromName(e.referenceValue))}class ko extends ho{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return Ks(t)&&Us(t.arrayValue,this.value)}}class Ao extends ho{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return null!==t&&Us(this.value.arrayValue,t)}}class Co extends ho{constructor(e,t){super(e,"not-in",t)}matches(e){if(Us(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return null!==t&&!Us(this.value.arrayValue,t)}}class xo extends ho{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!Ks(t)||!t.arrayValue.values)&&t.arrayValue.values.some(e=>Us(this.value.arrayValue,e))}}class Oo{constructor(e,t=null,n=[],r=[],i=null,s=null,o=null){this.path=e,this.collectionGroup=t,this.orderBy=n,this.filters=r,this.limit=i,this.startAt=s,this.endAt=o,this.dt=null}}function Do(e,t=null,n=[],r=[],i=null,s=null,o=null){return new Oo(e,t,n,r,i,s,o)}function No(e){const t=Vr(e);
vendor: 2,897 bytes, line 2
2if(null===t.dt){let e=t.path.canonicalString();null!==t.collectionGroup&&(e+="|cg:"+t.collectionGroup),e+="|f:",e+=t.filters.map(e=>yo(e)).join(","),e+="|ob:",e+=t.orderBy.map(e=>function(e){return e.field.canonicalString()+e.dir}(e)).join(","),Li(t.limit)||(e+="|l:",e+=t.limit),t.startAt&&(e+="|lb:",e+=t.startAt.inclusive?"b:":"a:",e+=t.startAt.position.map(e=>qs(e)).join(",")),t.endAt&&(e+="|ub:",e+=t.endAt.inclusive?"a:":"b:",e+=t.endAt.position.map(e=>qs(e)).join(",")),t.dt=e}return t.dt}function Ro(e,t){if(e.limit!==t.limit)return!1;if(e.orderBy.length!==t.orderBy.length)return!1;for(let n=0;n<e.orderBy.length;n++)if(!uo(e.orderBy[n],t.orderBy[n]))return!1;if(e.filters.length!==t.filters.length)return!1;for(let n=0;n<e.filters.length;n++)if(!wo(e.filters[n],t.filters[n]))return!1;return e.collectionGroup===t.collectionGroup&&!!e.path.isEqual(t.path)&&!!ao(e.startAt,t.startAt)&&ao(e.endAt,t.endAt)}function Po(e){return ui.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}function Lo(e,t){return e.filters.filter(e=>e instanceof ho&&e.field.isEqual(t))}function Mo(e,t,n){let r=Ms,i=!0;for(const n of Lo(e,t)){let e=Ms,t=!0;switch(n.op){case"<":case"<=":e=Js(n.value);break;case"==":case"in":case">=":e=n.value;break;case">":e=n.value,t=!1;break;case"!=":case"not-in":e=Ms}eo({value:r,inclusive:i},{value:e,inclusive:t})<0&&(r=e,i=t)}if(null!==n)for(let s=0;s<e.orderBy.length;++s)if(e.orderBy[s].field.isEqual(t)){const e=n.position[s];eo({value:r,inclusive:i},{value:e,inclusive:n.inclusive})<0&&(r=e,i=n.inclusive);break}return{value:r,inclusive:i}}function Fo(e,t,n){let r=Ls,i=!0;for(const n of Lo(e,t)){let e=Ls,t=!0;switch(n.op){case">=":case">":e=Zs(n.value),t=!1;break;case"==":case"in":case"<=":e=n.value;break;case"<":e=n.value,t=!1;break;case"!=":case"not-in":e=Ls}to({value:r,inclusive:i},{value:e,inclusive:t})>0&&(r=e,i=t)}if(null!==n)for(let s=0;s<e.orderBy.length;++s)if(e.orderBy[s].field.isEqual(t)){const e=n.position[s];to({value:r,inclusive:i},{value:e,inclusive:n.inclusive})>0&&(r=e,i=n.inclusive);break}return{value:r,inclusive:i}}class jo{constructor(e,t=null,n=[],r=[],i=null,s="F",o=null,a=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=n,this.filters=r,this.limit=i,this.limitType=s,this.startAt=o,this.endAt=a,this.wt=null,this._t=null,this.startAt,this.endAt}}function Uo(e,t,n,r,i,s,o,a){return new jo(e,t,n,r,i,s,o,a)}function Vo(e){return new jo(e)}function Bo(e){return 0===e.filters.length&&null===e.limit&&null==e.startAt&&null==e.endAt&&(0===e.explicitOrderBy.length||1===e.explicitOrderBy.length&&e.explicitOrderBy[0].field.isKeyField())}function qo(e){return e.explicitOrderBy.length>0?e.explicitOrderBy[0].field:null}function zo(e){for(const t of e.filters){const e=t.getFirstInequalityField();if(null!==e)return e}return null}function $o(e){return null!==e.collectionGroup}function Go(e){const t=Vr(e);
2if(null===t.wt){t.wt=[];const e=zo(t),n=qo(t);if(null!==e&&null===n)e.isKeyField()||t.wt.push(new co(e)),t.wt.push(new co(ci.keyField(),"asc"));else{let e=!1;for(const n of t.explicitOrderBy)t.wt.push(n),n.field.isKeyField()&&(e=!0);if(!e){const e=t.explicitOrderBy.length>0?t.explicitOrderBy[t.explicitOrderBy.length-1].dir:"asc";t.wt.push(new co(ci.keyField(),e))}}}return t.wt}function Ko(e){const t=Vr(e);if(!t._t)if("F"===t.limitType)t._t=Do(t.path,t.collectionGroup,Go(t),t.filters,t.limit,t.startAt,t.endAt);else{const e=[];for(const n of Go(t)){const t="desc"===n.dir?"asc":"desc";e.push(new co(n.field,t))}const n=t.endAt?new so(t.endAt.position,t.endAt.inclusive):null,r=t.startAt?new so(t.startAt.position,t.startAt.inclusive):null;t._t=Do(t.path,t.collectionGroup,e,t.filters,t.limit,n,r)}return t._t}function Wo(e,t){t.getFirstInequalityField(),zo(e);const n=e.filters.concat([t]);return new jo(e.path,e.collectionGroup,e.explicitOrderBy.slice(),n,e.limit,e.limitType,e.startAt,e.endAt)}function Ho(e,t,n){return new jo(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),t,n,e.startAt,e.endAt)}function Qo(e,t){return Ro(Ko(e),Ko(t))&&e.limitType===t.limitType}function Yo(e){return`${No(Ko(e))}|lt:${e.limitType}`}function Xo(e){return`Query(target=${function(e){let t=e.path.canonicalString();return null!==e.collectionGroup&&(t+=" collectionGroup="+e.collectionGroup),e.filters.length>0&&(t+=`, filters: [${e.filters.map(e=>_o(e)).join(", ")}]`),Li(e.limit)||(t+=", limit: "+e.limit),e.orderBy.length>0&&(t+=`, orderBy: [${e.orderBy.map(e=>function(e){return`${e.field.canonicalString()} (${e.dir})`}(e)).join(", ")}]`),e.startAt&&(t+=", startAt: ",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(e=>qs(e)).join(",")),e.endAt&&(t+=", endAt: ",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(e=>qs(e)).join(",")),`Target(${t})`}(Ko(e))}; limitType=${e.limitType})`}function Jo(e,t){return t.isFoundDocument()&&function(e,t){const n=t.key.path;return null!==e.collectionGroup?t.key.hasCollectionId(e.collectionGroup)&&e.path.isPrefixOf(n):ui.isDocumentKey(e.path)?e.path.isEqual(n):e.path.isImmediateParentOf(n)}(e,t)&&function(e,t){for(const n of Go(e))if(!n.field.isKeyField()&&null===t.data.field(n.field))return!1;return!0}(e,t)&&function(e,t){for(const n of e.filters)if(!n.matches(t))return!1;return!0}(e,t)&&function(e,t){return!(e.startAt&&!function(e,t,n){const r=oo(e,t,n);return e.inclusive?r<=0:r<0}(e.startAt,Go(e),t)||e.endAt&&!function(e,t,n){const r=oo(e,t,n);return e.inclusive?r>=0:r>0}(e.endAt,Go(e),t))}(e,t)}function Zo(e){return e.collectionGroup||(e.path.length%2==1?e.path.lastSegment():e.path.get(e.path.length-2))}function ea(e){return(t,n)=>{let r=!1;for(const i of Go(e)){const e=ta(i,t,n);if(0!==e)return e;r=r||i.field.isKeyField()}return 0}}function ta(e,t,n){const r=e.field.isKeyField()?ui.comparator(t.key,n.key):function(e,t,n){const r=t.data.field(e),i=n.data.field(e);return null!==r&&null!==i?Vs(r,i):Fr()}(e.field,t,n);switch(e.dir){case"asc":return r;case"desc":return-1*r;default:return Fr()}}class na{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0!==n)for(const[t,r]of n)if(this.equalsFn(t,e))return r}has(e){return void 0!==this.get(e)}set(e,t){const n=this.mapKeyFn(e),r=this.inner[n];if(void 0===r)return this.inner[n]=[[e,t]],void this.innerSize++;for(let n=0;n<r.length;n++)if(this.equalsFn(r[n][0],e))return void(r[n]=[e,t]);r.push([e,t]),this.innerSize++}delete(e){const t=this.mapKeyFn(e),n=this.inner[t];if(void 0===n)return!1;for(let r=0;r<n.length;r++)if(this.equalsFn(n[r][0],e))return 1===n.length?delete this.inner[t]:n.splice(r,1),this.innerSize--,!0;return!1}forEach(e){ps(this.inner,(t,n)=>{for(const[t,r]of n)e(t,r)})}isEmpty(){return gs(this.inner)}size(){return this.innerSize}}const ra=new ms(ui.comparator);function ia(){return ra}const sa=new ms(ui.comparator);function oa(...e){let t=sa;for(const n of e)t=t.insert(n.key,n);return t}function aa(e){let t=sa;return e.forEach((e,n)=>t=t.insert(e,n.overlayedDocument)),t}function ca(){return la()}function ua(){return la()}
2function la(){return new na(e=>e.toString(),(e,t)=>e.isEqual(t))}const ha=new ms(ui.comparator),da=new ws(ui.comparator);function fa(...e){let t=da;for(const n of e)t=t.add(n);return t}const pa=new ws(ei);function ga(){return pa}function ma(e,t){if(e.useProto3Json){if(isNaN(t))return{doubleValue:"NaN"};if(t===1/0)return{doubleValue:"Infinity"};if(t===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Mi(t)?"-0":t}}function va(e){return{integerValue:""+e}}function ya(e,t){return Fi(t)?va(t):ma(e,t)}class wa{constructor(){this._=void 0}}function ba(e,t,n){return e instanceof Ea?function(e,t){const n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:e.seconds,nanos:e.nanoseconds}}}};return t&&Os(t)&&(t=Ds(t)),t&&(n.fields.__previous_value__=t),{mapValue:n}}(n,t):e instanceof Ta?Sa(e,t):e instanceof ka?Aa(e,t):function(e,t){const n=Ia(e,t),r=xa(n)+xa(e.gt);return Gs(n)&&Gs(e.gt)?va(r):ma(e.serializer,r)}(e,t)}function _a(e,t,n){return e instanceof Ta?Sa(e,t):e instanceof ka?Aa(e,t):n}function Ia(e,t){return e instanceof Ca?Gs(n=t)||function(e){return!!e&&"doubleValue"in e}(n)?t:{integerValue:0}:null;var n}class Ea extends wa{}class Ta extends wa{constructor(e){super(),this.elements=e}}function Sa(e,t){const n=Oa(t);for(const t of e.elements)n.some(e=>js(e,t))||n.push(t);return{arrayValue:{values:n}}}class ka extends wa{constructor(e){super(),this.elements=e}}function Aa(e,t){let n=Oa(t);for(const t of e.elements)n=n.filter(e=>!js(e,t));return{arrayValue:{values:n}}}class Ca extends wa{constructor(e,t){super(),this.serializer=e,this.gt=t}}function xa(e){return Cs(e.integerValue||e.doubleValue)}function Oa(e){return Ks(e)&&e.arrayValue.values?e.arrayValue.values.slice():[]}class Da{constructor(e,t){this.field=e,this.transform=t}}class Na{constructor(e,t){this.version=e,this.transformResults=t}}class Ra{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new Ra}static exists(e){return new Ra(void 0,e)}static updateTime(e){return new Ra(e)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function Pa(e,t){return void 0!==e.updateTime?t.isFoundDocument()&&t.version.isEqual(e.updateTime):void 0===e.exists||e.exists===t.isFoundDocument()}class La{}function Ma(e,t){if(!e.hasLocalMutations||t&&0===t.fields.length)return null;if(null===t)return e.isNoDocument()?new Ka(e.key,Ra.none()):new Ba(e.key,e.data,Ra.none());{const n=e.data,r=no.empty();let i=new ws(ci.comparator);for(let e of t.fields)if(!i.has(e)){let t=n.field(e);null===t&&e.length>1&&(e=e.popLast(),t=n.field(e)),null===t?r.delete(e):r.set(e,t),i=i.add(e)}return new qa(e.key,r,new Is(i.toArray()),Ra.none())}}function Fa(e,t,n){e instanceof Ba?function(e,t,n){const r=e.value.clone(),i=$a(e.fieldTransforms,t,n.transformResults);r.setAll(i),t.convertToFoundDocument(n.version,r).setHasCommittedMutations()}(e,t,n):e instanceof qa?function(e,t,n){if(!Pa(e.precondition,t))return void t.convertToUnknownDocument(n.version);const r=$a(e.fieldTransforms,t,n.transformResults),i=t.data;i.setAll(za(e)),i.setAll(r),t.convertToFoundDocument(n.version,i).setHasCommittedMutations()}(e,t,n):function(e,t,n){t.convertToNoDocument(n.version).setHasCommittedMutations()}(0,t,n)}function ja(e,t,n,r){return e instanceof Ba?function(e,t,n,r){if(!Pa(e.precondition,t))return n;const i=e.value.clone(),s=Ga(e.fieldTransforms,r,t);return i.setAll(s),t.convertToFoundDocument(t.version,i).setHasLocalMutations(),null}(e,t,n,r):e instanceof qa?function(e,t,n,r){if(!Pa(e.precondition,t))return n;const i=Ga(e.fieldTransforms,r,t),s=t.data;return s.setAll(za(e)),s.setAll(i),t.convertToFoundDocument(t.version,s).setHasLocalMutations(),null===n?null:n.unionWith(e.fieldMask.fields).unionWith(e.fieldTransforms.map(e=>e.field))}(e,t,n,r):function(e,t,n){return Pa(e.precondition,t)?(t.convertToNoDocument(t.version).setHasLocalMutations(),null):n}(e,t,n)}function Ua(e,t){let n=null;for(const r of e.fieldTransforms){const e=t.data.field(r.field),i=Ia(r.transform,e||null);null!=i&&(null===n&&(n=no.empty()),n.set(r.field,i))}return n||null}function Va(e,t){return e.type===t.type&&!!e.key.isEqual(t.key)&&!!e.precondition.isEqual(t.precondition)&&!!function(e,t){return void 0===e&&void 0===t||!(!e||!t)&&ti(e,t,(e,t)=>function(e,t){return e.field.isEqual(t.field)&&function(e,t){return e instanceof Ta&&t instanceof Ta||e instanceof ka&&t instanceof ka?ti(e.elements,t.elements,js):e instanceof Ca&&t instanceof Ca?js(e.gt,t.gt):e instanceof Ea&&t instanceof Ea}(e.transform,t.transform)}(e,t))}(e.fieldTransforms,t.fieldTransforms)&&(0===e.type?e.value.isEqual(t.value):1!==e.type||e.data.isEqual(t.data)&&e.fieldMask.isEqual(t.fieldMask))}class Ba extends La{constructor(e,t,n,r=[]){super(),this.key=e,this.value=t,this.prec
2ondition=n,this.fieldTransforms=r,this.type=0}getFieldMask(){return null}}class qa extends La{constructor(e,t,n,r,i=[]){super(),this.key=e,this.data=t,this.fieldMask=n,this.precondition=r,this.fieldTransforms=i,this.type=1}getFieldMask(){return this.fieldMask}}function za(e){const t=new Map;return e.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const r=e.data.field(n);t.set(n,r)}}),t}function $a(e,t,n){const r=new Map;jr(e.length===n.length);for(let i=0;i<n.length;i++){const s=e[i],o=s.transform,a=t.data.field(s.field);r.set(s.field,_a(o,a,n[i]))}return r}function Ga(e,t,n){const r=new Map;for(const i of e){const e=i.transform,s=n.data.field(i.field);r.set(i.field,ba(e,s,t))}return r}class Ka extends La{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class Wa extends La{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}class Ha{constructor(e,t,n,r){this.batchId=e,this.localWriteTime=t,this.baseMutations=n,this.mutations=r}applyToRemoteDocument(e,t){const n=t.mutationResults;for(let t=0;t<this.mutations.length;t++){const r=this.mutations[t];r.key.isEqual(e.key)&&Fa(r,e,n[t])}}applyToLocalView(e,t){for(const n of this.baseMutations)n.key.isEqual(e.key)&&(t=ja(n,e,t,this.localWriteTime));for(const n of this.mutations)n.key.isEqual(e.key)&&(t=ja(n,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){const n=ua();return this.mutations.forEach(r=>{const i=e.get(r.key),s=i.overlayedDocument;let o=this.applyToLocalView(s,i.mutatedFields);o=t.has(r.key)?null:o;const a=Ma(s,o);null!==a&&n.set(r.key,a),s.isValidDocument()||s.convertToNoDocument(ii.min())}),n}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),fa())}isEqual(e){return this.batchId===e.batchId&&ti(this.mutations,e.mutations,(e,t)=>Va(e,t))&&ti(this.baseMutations,e.baseMutations,(e,t)=>Va(e,t))}}class Qa{constructor(e,t,n,r){this.batch=e,this.commitVersion=t,this.mutationResults=n,this.docVersions=r}static from(e,t,n){jr(e.mutations.length===n.length);let r=ha;const i=e.mutations;for(let e=0;e<i.length;e++)r=r.insert(i[e].key,n[e].version);return new Qa(e,t,n,r)}}class Ya{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return null!==e&&this.mutation===e.mutation}toString(){return`Overlay{\n largestBatchId: ${this.largestBatchId},\n mutation: ${this.mutation.toString()}\n }`}}class Xa{constructor(e,t,n){this.alias=e,this.yt=t,this.fieldPath=n}}class Ja{constructor(e,t){this.count=e,this.unchangedNames=t}}var Za,ec;function tc(e){switch(e){default:return Fr();case Br.CANCELLED:case Br.UNKNOWN:case Br.DEADLINE_EXCEEDED:case Br.RESOURCE_EXHAUSTED:case Br.INTERNAL:case Br.UNAVAILABLE:case Br.UNAUTHENTICATED:return!1;case Br.INVALID_ARGUMENT:case Br.NOT_FOUND:case Br.ALREADY_EXISTS:case Br.PERMISSION_DENIED:case Br.FAILED_PRECONDITION:case Br.ABORTED:case Br.OUT_OF_RANGE:case Br.UNIMPLEMENTED:case Br.DATA_LOSS:return!0}}function nc(e){if(void 0===e)return Pr("GRPC error has no .code"),Br.UNKNOWN;switch(e){case Za.OK:return Br.OK;case Za.CANCELLED:return Br.CANCELLED;case Za.UNKNOWN:return Br.UNKNOWN;case Za.DEADLINE_EXCEEDED:return Br.DEADLINE_EXCEEDED;case Za.RESOURCE_EXHAUSTED:return Br.RESOURCE_EXHAUSTED;case Za.INTERNAL:return Br.INTERNAL;case Za.UNAVAILABLE:return Br.UNAVAILABLE;case Za.UNAUTHENTICATED:return Br.UNAUTHENTICATED;case Za.INVALID_ARGUMENT:return Br.INVALID_ARGUMENT;case Za.NOT_FOUND:return Br.NOT_FOUND;case Za.ALREADY_EXISTS:return Br.ALREADY_EXISTS;case Za.PERMISSION_DENIED:return Br.PERMISSION_DENIED;case Za.FAILED_PRECONDITION:return Br.FAILED_PRECONDITION;case Za.ABORTED:return Br.ABORTED;case Za.OUT_OF_RANGE:return Br.OUT_OF_RANGE;case Za.UNIMPLEMENTED:return Br.UNIMPLEMENTED;case Za.DATA_LOSS:return Br.DATA_LOSS;default:return Fr()}}(ec=Za||(Za={}))[ec.OK=0]="OK",ec[ec.CANCELLED=1]="CANCELLED",ec[ec.UNKNOWN=2]="UNKNOWN",ec[ec.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",ec[ec.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",ec[ec.NOT_FOUND=5]="NOT_FOUND",ec[ec.ALREADY_EXISTS=6]="ALREADY_EXISTS",ec[ec.PERMISSION_DENIED=7]="PERMISSION_DENIED",ec[ec.UNAUTHENTICATED=16]="UNAUTHENTICATED",ec[ec.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",ec[ec.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",ec[ec.ABORTED=10]="ABORTED",ec[ec.OUT_OF_RANGE=11]="OUT_OF_RANGE",ec[ec.UNIMPLEMENT
2ED=12]="UNIMPLEMENTED",ec[ec.INTERNAL=13]="INTERNAL",ec[ec.UNAVAILABLE=14]="UNAVAILABLE",ec[ec.DATA_LOSS=15]="DATA_LOSS";class rc{constructor(){this.onExistenceFilterMismatchCallbacks=new Map}static get instance(){return ic}static getOrCreateInstance(){return null===ic&&(ic=new rc),ic}onExistenceFilterMismatch(e){const t=Symbol();return this.onExistenceFilterMismatchCallbacks.set(t,e),()=>this.onExistenceFilterMismatchCallbacks.delete(t)}notifyOnExistenceFilterMismatch(e){this.onExistenceFilterMismatchCallbacks.forEach(t=>t(e))}}let ic=null;function sc(){return new TextEncoder}const oc=new kr([4294967295,4294967295],0);function ac(e){const t=sc().encode(e),n=new Sr;return n.update(t),new Uint8Array(n.digest())}function cc(e){const t=new DataView(e.buffer),n=t.getUint32(0,!0),r=t.getUint32(4,!0),i=t.getUint32(8,!0),s=t.getUint32(12,!0);return[new kr([n,r],0),new kr([i,s],0)]}class uc{constructor(e,t,n){if(this.bitmap=e,this.padding=t,this.hashCount=n,t<0||t>=8)throw new lc(`Invalid padding: ${t}`);if(n<0)throw new lc(`Invalid hash count: ${n}`);if(e.length>0&&0===this.hashCount)throw new lc(`Invalid hash count: ${n}`);if(0===e.length&&0!==t)throw new lc(`Invalid padding when bitmap length is 0: ${t}`);this.It=8*e.length-t,this.Tt=kr.fromNumber(this.It)}Et(e,t,n){let r=e.add(t.multiply(kr.fromNumber(n)));return 1===r.compare(oc)&&(r=new kr([r.getBits(0),r.getBits(1)],0)),r.modulo(this.Tt).toNumber()}At(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}vt(e){if(0===this.It)return!1;const t=ac(e),[n,r]=cc(t);for(let e=0;e<this.hashCount;e++){const t=this.Et(n,r,e);if(!this.At(t))return!1}return!0}static create(e,t,n){const r=e%8==0?0:8-e%8,i=new Uint8Array(Math.ceil(e/8)),s=new uc(i,r,t);return n.forEach(e=>s.insert(e)),s}insert(e){if(0===this.It)return;const t=ac(e),[n,r]=cc(t);for(let e=0;e<this.hashCount;e++){const t=this.Et(n,r,e);this.Rt(t)}}Rt(e){const t=Math.floor(e/8),n=e%8;this.bitmap[t]|=1<<n}}class lc extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}class hc{constructor(e,t,n,r,i){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=n,this.documentUpdates=r,this.resolvedLimboDocuments=i}static createSynthesizedRemoteEventForCurrentChange(e,t,n){const r=new Map;return r.set(e,dc.createSynthesizedTargetChangeForCurrentChange(e,t,n)),new hc(ii.min(),r,new ms(ei),ia(),fa())}}class dc{constructor(e,t,n,r,i){this.resumeToken=e,this.current=t,this.addedDocuments=n,this.modifiedDocuments=r,this.removedDocuments=i}static createSynthesizedTargetChangeForCurrentChange(e,t,n){return new dc(n,t,fa(),fa(),fa())}}class fc{constructor(e,t,n,r){this.Pt=e,this.removedTargetIds=t,this.key=n,this.bt=r}}class pc{constructor(e,t){this.targetId=e,this.Vt=t}}class gc{constructor(e,t,n=Ss.EMPTY_BYTE_STRING,r=null){this.state=e,this.targetIds=t,this.resumeToken=n,this.cause=r}}class mc{constructor(){this.St=0,this.Dt=wc(),this.Ct=Ss.EMPTY_BYTE_STRING,this.xt=!1,this.Nt=!0}get current(){return this.xt}get resumeToken(){return this.Ct}get kt(){return 0!==this.St}get Mt(){return this.Nt}$t(e){e.approximateByteSize()>0&&(this.Nt=!0,this.Ct=e)}Ot(){let e=fa(),t=fa(),n=fa();return this.Dt.forEach((r,i)=>{switch(i){case 0:e=e.add(r);break;case 2:t=t.add(r);break;case 1:n=n.add(r);break;default:Fr()}}),new dc(this.Ct,this.xt,e,t,n)}Ft(){this.Nt=!1,this.Dt=wc()}Bt(e,t){this.Nt=!0,this.Dt=this.Dt.insert(e,t)}Lt(e){this.Nt=!0,this.Dt=this.Dt.remove(e)}qt(){this.St+=1}Ut(){this.St-=1}Kt(){this.Nt=!0,this.xt=!0}}class vc{constructor(e){this.Gt=e,this.Qt=new Map,this.jt=ia(),this.zt=yc(),this.Wt=new ms(ei)}Ht(e){for(const t of e.Pt)e.bt&&e.bt.isFoundDocument()?this.Jt(t,e.bt):this.Yt(t,e.key,e.bt);for(const t of e.removedTargetIds)this.Yt(t,e.key,e.bt)}Xt(e){this.forEachTarget(e,t=>{const n=this.Zt(t);switch(e.state){case 0:this.te(t)&&n.$t(e.resumeToken);break;case 1:n.Ut(),n.kt||n.Ft(),n.$t(e.resumeToken);break;case 2:n.Ut(),n.kt||this.removeTarget(t);break;case 3:this.te(t)&&(n.Kt(),n.$t(e.resumeToken));break;case 4:this.te(t)&&(this.ee(t),n.$t(e.resumeToken));break;default:Fr()}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.Qt.forEach((e,n)=>{this.te(n)&&t(n)})}ne(e){var t;const n=e.targetId,r=e.Vt.count,i=this.se(n);if(i){const s=i.target;if(Po(s))if(0===r){const e=new ui(s.path);this.Yt(n,e,io.newNoDocument(e,ii.min()))}else jr(1===r);else{const i=this.ie(n);if(i!==r){const r=this.re(e,i);if(0!==r){this.ee(n);const e=2===r?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Wt=this.Wt.insert(n,e)}null===(t=rc.instance)||void 0===t||t.notifyOnExistenceFilterMismatch(function(e,t,n){var r,i,s,o,a,c;const u={localCacheCount:t,existenceFilterCount:n.count},l=n.unchangedNames;return l&&(u.bloomFilter={applied:0===e,hashCount:null!==(r=null==l?void 0:l.hashCount)&&void 0!==r?r:0,bitmapLength:null!==(o=null===(s=null===(i=null==l?void 0:l.bits)||void 0===i?void 0:i.bitmap)||void 0===s?void 0:s.length)&&void 0!==o?o:0,padding:null!==(c=null===(a=null==l?void 0:l.bits)||void 0===a?void 0:a.padding)&&void 0!==c?c:0}),u}(r,i,e.Vt))}}}}re(e,t){const{unchangedNames:n,count:r}=e.Vt;if(!n||!n.bits)return 1;const{bits:{bitmap:i="",padding:s=0},hashCount:o=0}=n;let a,c;try{a=xs(i).toUint8Array()}catch(e){if(e instanceof Es)return Lr("Decoding the base64 bloom filter in existence filter failed ("+e.message+"); ignoring the bloom filter and falling back to full re-query."),1;throw e}try{c=new uc(a,s,o)}catch(e){return Lr(e instanceof lc?"BloomFilter error: ":"Applying bloom filter failed: ",e),1}return 0===c.It?1:r!==t-this.oe(e.targetId,c)?2:0}oe(e,t){const n=this.Gt.getRemoteKeysForTarget(e);let r=0;
2return n.forEach(n=>{const i=this.Gt.ue(),s=`projects/${i.projectId}/databases/${i.database}/documents/${n.path.canonicalString()}`;t.vt(s)||(this.Yt(e,n,null),r++)}),r}ce(e){const t=new Map;this.Qt.forEach((n,r)=>{const i=this.se(r);if(i){if(n.current&&Po(i.target)){const t=new ui(i.target.path);null!==this.jt.get(t)||this.ae(r,t)||this.Yt(r,t,io.newNoDocument(t,e))}n.Mt&&(t.set(r,n.Ot()),n.Ft())}});let n=fa();this.zt.forEach((e,t)=>{let r=!0;t.forEachWhile(e=>{const t=this.se(e);return!t||"TargetPurposeLimboResolution"===t.purpose||(r=!1,!1)}),r&&(n=n.add(e))}),this.jt.forEach((t,n)=>n.setReadTime(e));const r=new hc(e,t,this.Wt,this.jt,n);return this.jt=ia(),this.zt=yc(),this.Wt=new ms(ei),r}Jt(e,t){if(!this.te(e))return;const n=this.ae(e,t.key)?2:0;this.Zt(e).Bt(t.key,n),this.jt=this.jt.insert(t.key,t),this.zt=this.zt.insert(t.key,this.he(t.key).add(e))}Yt(e,t,n){if(!this.te(e))return;const r=this.Zt(e);this.ae(e,t)?r.Bt(t,1):r.Lt(t),this.zt=this.zt.insert(t,this.he(t).delete(e)),n&&(this.jt=this.jt.insert(t,n))}removeTarget(e){this.Qt.delete(e)}ie(e){const t=this.Zt(e).Ot();return this.Gt.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}qt(e){this.Zt(e).qt()}Zt(e){let t=this.Qt.get(e);return t||(t=new mc,this.Qt.set(e,t)),t}he(e){let t=this.zt.get(e);return t||(t=new ws(ei),this.zt=this.zt.insert(e,t)),t}te(e){const t=null!==this.se(e);return t||Rr("WatchChangeAggregator","Detected inactive target",e),t}se(e){const t=this.Qt.get(e);return t&&t.kt?null:this.Gt.le(e)}ee(e){this.Qt.set(e,new mc),this.Gt.getRemoteKeysForTarget(e).forEach(t=>{this.Yt(e,t,null)})}ae(e,t){return this.Gt.getRemoteKeysForTarget(e).has(t)}}function yc(){return new ms(ui.comparator)}function wc(){return new ms(ui.comparator)}const bc={asc:"ASCENDING",desc:"DESCENDING"},_c={"<":"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"},Ic={and:"AND",or:"OR"};class Ec{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function Tc(e,t){return e.useProto3Json||Li(t)?t:{value:t}}function Sc(e,t){return e.useProto3Json?`${new Date(1e3*t.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+t.nanoseconds).slice(-9)}Z`:{seconds:""+t.seconds,nanos:t.nanoseconds}}function kc(e,t){return e.useProto3Json?t.toBase64():t.toUint8Array()}function Ac(e,t){return Sc(e,t.toTimestamp())}function Cc(e){return jr(!!e),ii.fromTimestamp(function(e){const t=As(e);return new ri(t.seconds,t.nanos)}(e))}function xc(e,t){return function(e){return new oi(["projects",e.projectId,"databases",e.database])}(e).child("documents").child(t).canonicalString()}function Oc(e){const t=oi.fromString(e);return jr(Jc(t)),t}function Dc(e,t){return xc(e.databaseId,t.path)}function Nc(e,t){const n=Oc(t);if(n.get(1)!==e.databaseId.projectId)throw new qr(Br.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+e.databaseId.projectId);if(n.get(3)!==e.databaseId.database)throw new qr(Br.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+e.databaseId.database);return new ui(Mc(n))}function Rc(e,t){return xc(e.databaseId,t)}function Pc(e){const t=Oc(e);return 4===t.length?oi.emptyPath():Mc(t)}function Lc(e){return new oi(["projects",e.databaseId.projectId,"databases",e.databaseId.database]).canonicalString()}function Mc(e){return jr(e.length>4&&"documents"===e.get(4)),e.popFirst(5)}function Fc(e,t,n){return{name:Dc(e,t),fields:n.value.mapValue.fields}}function jc(e,t,n){const r=Nc(e,t.name),i=Cc(t.updateTime),s=t.createTime?Cc(t.createTime):ii.min(),o=new no({mapValue:{fields:t.fields}}),a=io.newFoundDocument(r,i,s,o);return n&&a.setHasCommittedMutations(),n?a.setHasCommittedMutations():a}function Uc(e,t){let n;if(t instanceof Ba)n={update:Fc(e,t.key,t.value)};else if(t instanceof Ka)n={delete:Dc(e,t.key)};else if(t instanceof qa)n={update:Fc(e,t.key,t.data),updateMask:Xc(t.fieldMask)};else{if(!(t instanceof Wa))return Fr();n={verify:Dc(e,t.key)}}return t.fieldTransforms.length>0&&(n.updateTransforms=t.fieldTransforms.map(e=>function(e,t){const n=t.transform;if(n instanceof Ea)return{fieldPath:t.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof Ta)return{fieldPath:t.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof ka)return{fieldPath:t.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof Ca)return{fieldPath:t.field.canonicalString(),increment:n.gt};throw Fr()}(0,e))),t.precondition.isNone||(n.currentDocument=function(e,t){return void 0!==t.updateTime?{updateTime:Ac(e,t.updateTime)}:void 0!==t.exists?{exists:t.exists}:Fr()}(e,t.precondition)),n}function Vc(e,t){const n=t.currentDocument?function(e){return void 0!==e.updateTime?Ra.updateTime(Cc(e.updateTime)):void 0!==e.exists?Ra.exists(e.exists):Ra.none()}(t.currentDocument):Ra.none(),r=t.updateTransforms?t.updateTransforms.map(t=>function(e,t){let n=null;if("setToServerValue"in t)jr("REQUEST_TIME"===t.setToServerValue),n=new Ea;else if("appendMissingElements"in t){const e=t.appendMissingElements.values||[];n=new Ta(e)}else if("removeAllFromArray"in t){const e=t.removeAllFromArray.values||[];n=new ka(e)}else"increment"in t?n=new Ca(e,t.increment):Fr();const r=ci.fromServerFormat(t.fieldPath);return new Da(r,n)}(e,t)):[];if(t.update){t.update.name;const i=Nc(e,t.update.name),s=new no({mapValue:{fields:t.update.fields}});if(t.updateMask){const e=function(e){const t=e.fieldPaths||[];return new Is(t.map(e=>ci.fromServerFormat(e)))}(t.updateMask);return new qa(i,s,e,n,r)}return new Ba(i,s,n,r)}if(t.delete){const r=Nc(e,t.delete);return new Ka(r,n)}if(t.verify){const r=Nc(e,t.verify);return new Wa(r,n)}return Fr()}function Bc(e,t){return{documents:[Rc(e,t.path)]}}function qc(e,t){const n={structuredQuery:{}},r=t.path;null!==t.collectionGroup?(n.parent=Rc(e,r),n.structuredQuery.from=[{collectionId:t.collectionGroup,allDescendants:!0}]):(n.parent=Rc(e,r.popLast()),n.structuredQuery.from=[{collectionId:r.lastSegment()}]);const i=function(e){if(0!==e.length)return Yc(fo.create(e,"and"))}(t.filters);i&&(n.structuredQuery.where=i);const s=function(e){if(0!==e.length)return e.map(e=>function(e){return{field:Hc(e.field),direction:Gc(e.dir)}}(e))}(t.orderBy);s&&(n.structuredQuery.orderBy=s);const o=Tc(e,t.limit);var a;return null!==o&&(n.structuredQuery.limit=o),t.startAt&&(n.structuredQuery.startAt={before:(a=t.startAt).inclusive,values:a.position}),t.endAt&&(n.structuredQuery.endAt=function(e){return{before:!e.inclusive,values:e.position}}(t.endAt)),n}function zc(e){let t=Pc(e.parent);
2const n=e.structuredQuery,r=n.from?n.from.length:0;let i=null;if(r>0){jr(1===r);const e=n.from[0];e.allDescendants?i=e.collectionId:t=t.child(e.collectionId)}let s=[];n.where&&(s=function(e){const t=$c(e);return t instanceof fo&&mo(t)?t.getFilters():[t]}(n.where));let o=[];n.orderBy&&(o=n.orderBy.map(e=>function(e){return new co(Qc(e.field),function(e){switch(e){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(e.direction))}(e)));let a=null;n.limit&&(a=function(e){let t;return t="object"==typeof e?e.value:e,Li(t)?null:t}(n.limit));let c=null;n.startAt&&(c=function(e){const t=!!e.before,n=e.values||[];return new so(n,t)}(n.startAt));let u=null;return n.endAt&&(u=function(e){const t=!e.before,n=e.values||[];return new so(n,t)}(n.endAt)),Uo(t,i,o,s,a,"F",c,u)}function $c(e){return void 0!==e.unaryFilter?function(e){switch(e.unaryFilter.op){case"IS_NAN":const t=Qc(e.unaryFilter.field);return ho.create(t,"==",{doubleValue:NaN});case"IS_NULL":const n=Qc(e.unaryFilter.field);return ho.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const r=Qc(e.unaryFilter.field);return ho.create(r,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const i=Qc(e.unaryFilter.field);return ho.create(i,"!=",{nullValue:"NULL_VALUE"});default:return Fr()}}(e):void 0!==e.fieldFilter?function(e){return ho.create(Qc(e.fieldFilter.field),function(e){switch(e){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return Fr()}}(e.fieldFilter.op),e.fieldFilter.value)}(e):void 0!==e.compositeFilter?function(e){return fo.create(e.compositeFilter.filters.map(e=>$c(e)),function(e){switch(e){case"AND":return"and";case"OR":return"or";default:return Fr()}}(e.compositeFilter.op))}(e):Fr()}function Gc(e){return bc[e]}function Kc(e){return _c[e]}function Wc(e){return Ic[e]}function Hc(e){return{fieldPath:e.canonicalString()}}function Qc(e){return ci.fromServerFormat(e.fieldPath)}function Yc(e){return e instanceof ho?function(e){if("=="===e.op){if(Hs(e.value))return{unaryFilter:{field:Hc(e.field),op:"IS_NAN"}};if(Ws(e.value))return{unaryFilter:{field:Hc(e.field),op:"IS_NULL"}}}else if("!="===e.op){if(Hs(e.value))return{unaryFilter:{field:Hc(e.field),op:"IS_NOT_NAN"}};if(Ws(e.value))return{unaryFilter:{field:Hc(e.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Hc(e.field),op:Kc(e.op),value:e.value}}}(e):e instanceof fo?function(e){const t=e.getFilters().map(e=>Yc(e));return 1===t.length?t[0]:{compositeFilter:{op:Wc(e.op),filters:t}}}(e):Fr()}function Xc(e){const t=[];return e.fields.forEach(e=>t.push(e.canonicalString())),{fieldPaths:t}}function Jc(e){return e.length>=4&&"projects"===e.get(0)&&"databases"===e.get(2)}class Zc{constructor(e,t,n,r,i=ii.min(),s=ii.min(),o=Ss.EMPTY_BYTE_STRING,a=null){this.target=e,this.targetId=t,this.purpose=n,this.sequenceNumber=r,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=s,this.resumeToken=o,this.expectedCount=a}withSequenceNumber(e){return new Zc(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new Zc(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new Zc(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new Zc(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}class eu{constructor(e){this.fe=e}}function tu(e,t){const n=t.key,r={prefixPath:n.getCollectionPath().popLast().toArray(),collectionGroup:n.collectionGroup,documentId:n.path.lastSegment(),readTime:nu(t.readTime),hasCommittedMutations:t.hasCommittedMutations};if(t.isFoundDocument())r.document=function(e,t){return{name:Dc(e,t.key),fields:t.data.value.mapValue.fields,updateTime:Sc(e,t.version.toTimestamp()),createTime:Sc(e,t.createTime.toTimestamp())}}(e.fe,t);else if(t.isNoDocument())r.noDocument={path:n.path.toArray(),readTime:ru(t.version)};else{if(!t.isUnknownDocument())return Fr();r.unknownDocument={path:n.path.toArray(),version:ru(t.version)}}return r}function nu(e){const t=e.toTimestamp();return[t.seconds,t.nanoseconds]}function ru(e){const t=e.toTimestamp();return{seconds:t.seconds,nanoseconds:t.nanoseconds}}function iu(e){const t=new ri(e.seconds,e.nanoseconds);return ii.fromTimestamp(t)}function su(e,t){const n=(t.baseMutations||[]).map(t=>Vc(e.fe,t));for(let e=0;e<t.mutations.length-1;++e){const n=t.mutations[e];if(e+1<t.mutations.length&&void 0!==t.mutations[e+1].transform){const r=t.mutations[e+1];n.updateTransforms=r.transform.fieldTransforms,t.mutations.splice(e+1,1),++e}}const r=t.mutations.map(t=>Vc(e.fe,t)),i=ri.fromMillis(t.localWriteTimeMs);return new Ha(t.batchId,i,n,r)}function ou(e){const t=iu(e.readTime),n=void 0!==e.lastLimboFreeSnapshotVersion?iu(e.lastLimboFreeSnapshotVersion):ii.min();let r;var i;return void 0!==e.query.documents?(jr(1===(i=e.query).documents.length),r=Ko(Vo(Pc(i.documents[0])))):r=function(e){return Ko(zc(e))}(e.query),new Zc(r,e.targetId,"TargetPurposeListen",e.lastListenSequenceNumber,t,n,Ss.fromBase64String(e.resumeToken))}function au(e,t){const n=ru(t.snapshotVersion),r=ru(t.lastLimboFreeSnapshotVersion);let i;i=Po(t.target)?Bc(e.fe,t.target):qc(e.fe,t.target);const s=t.resumeToken.toBase64();return{targetId:t.targetId,canonicalId:No(t.target),readTime:n,resumeToken:s,lastListenSequenceNumber:t.sequenceNumber,lastLimboFreeSnapshotVersion:r,query:i}}function cu(e){const t=zc({parent:e.parent,structuredQuery:e.structuredQuery});return"LAST"===e.limitType?Ho(t,t.limit,"L"):t}function uu(e,t){return new Ya(t.largestBatchId,Vc(e.fe,t.overlayMutation))}function lu(e,t){const n=t.path.lastSegment();return[e,ji(t.path.popLast()),n]}function hu(e,t,n,r){return{indexId:e,uid:t.uid||"",sequenceNumber:n,readTime:ru(r.readTime),documentKey:ji(r.documentKey.path),largestBatchId:r.largestBatchId}}class du{getBundleMetadata(e,t){return fu(e).get(t).next(e=>{if(e)return{id:(t=e).bundleId,createTime:iu(t.createTime),version:t.version};var t})}saveBundleMetadata(e,t){return fu(e).put({bundleId:(n=t).id,createTime:ru(Cc(n.createTime)),version:n.version});var n}getNamedQuery(e,t){return pu(e).get(t).next(e=>{if(e)return{name:(t=e).name,query:cu(t.bundledQuery),readTime:iu(t.readTime)};var t})}saveNamedQuery(e,t){return pu(e).put(function(e){return{name:e.name,readTime:ru(Cc(e.readTime)),bundledQuery:e.bundledQuery}}(t))}}function fu(e){return ds(e,"bundles")}
2function pu(e){return ds(e,"namedQueries")}class gu{constructor(e,t){this.serializer=e,this.userId=t}static de(e,t){const n=t.uid||"";return new gu(e,n)}getOverlay(e,t){return mu(e).get(lu(this.userId,t)).next(e=>e?uu(this.serializer,e):null)}getOverlays(e,t){const n=ca();return Ii.forEach(t,t=>this.getOverlay(e,t).next(e=>{null!==e&&n.set(t,e)})).next(()=>n)}saveOverlays(e,t,n){const r=[];return n.forEach((n,i)=>{const s=new Ya(t,i);r.push(this.we(e,s))}),Ii.waitFor(r)}removeOverlaysForBatchId(e,t,n){const r=new Set;t.forEach(e=>r.add(ji(e.getCollectionPath())));const i=[];return r.forEach(t=>{const r=IDBKeyRange.bound([this.userId,t,n],[this.userId,t,n+1],!1,!0);i.push(mu(e).J("collectionPathOverlayIndex",r))}),Ii.waitFor(i)}getOverlaysForCollection(e,t,n){const r=ca(),i=ji(t),s=IDBKeyRange.bound([this.userId,i,n],[this.userId,i,Number.POSITIVE_INFINITY],!0);return mu(e).j("collectionPathOverlayIndex",s).next(e=>{for(const t of e){const e=uu(this.serializer,t);r.set(e.getKey(),e)}return r})}getOverlaysForCollectionGroup(e,t,n,r){const i=ca();let s;const o=IDBKeyRange.bound([this.userId,t,n],[this.userId,t,Number.POSITIVE_INFINITY],!0);return mu(e).X({index:"collectionGroupOverlayIndex",range:o},(e,t,n)=>{const o=uu(this.serializer,t);i.size()<r||o.largestBatchId===s?(i.set(o.getKey(),o),s=o.largestBatchId):n.done()}).next(()=>i)}we(e,t){return mu(e).put(function(e,t,n){const[r,i,s]=lu(t,n.mutation.key);return{userId:t,collectionPath:i,documentId:s,collectionGroup:n.mutation.key.getCollectionGroup(),largestBatchId:n.largestBatchId,overlayMutation:Uc(e.fe,n.mutation)}}(this.serializer,this.userId,t))}}function mu(e){return ds(e,"documentOverlays")}class vu{constructor(){}_e(e,t){this.me(e,t),t.ge()}me(e,t){if("nullValue"in e)this.ye(t,5);else if("booleanValue"in e)this.ye(t,10),t.pe(e.booleanValue?1:0);else if("integerValue"in e)this.ye(t,15),t.pe(Cs(e.integerValue));else if("doubleValue"in e){const n=Cs(e.doubleValue);isNaN(n)?this.ye(t,13):(this.ye(t,15),Mi(n)?t.pe(0):t.pe(n))}else if("timestampValue"in e){const n=e.timestampValue;this.ye(t,20),"string"==typeof n?t.Ie(n):(t.Ie(`${n.seconds||""}`),t.pe(n.nanos||0))}else if("stringValue"in e)this.Te(e.stringValue,t),this.Ee(t);else if("bytesValue"in e)this.ye(t,30),t.Ae(xs(e.bytesValue)),this.Ee(t);else if("referenceValue"in e)this.ve(e.referenceValue,t);else if("geoPointValue"in e){const n=e.geoPointValue;this.ye(t,45),t.pe(n.latitude||0),t.pe(n.longitude||0)}else"mapValue"in e?Xs(e)?this.ye(t,Number.MAX_SAFE_INTEGER):(this.Re(e.mapValue,t),this.Ee(t)):"arrayValue"in e?(this.Pe(e.arrayValue,t),this.Ee(t)):Fr()}Te(e,t){this.ye(t,25),this.be(e,t)}be(e,t){t.Ie(e)}Re(e,t){const n=e.fields||{};this.ye(t,55);for(const e of Object.keys(n))this.Te(e,t),this.me(n[e],t)}Pe(e,t){const n=e.values||[];this.ye(t,50);for(const e of n)this.me(e,t)}ve(e,t){this.ye(t,37),ui.fromName(e).path.forEach(e=>{this.ye(t,60),this.be(e,t)})}ye(e,t){e.pe(t)}Ee(e){e.pe(2)}}function yu(e){if(0===e)return 8;let t=0;return!(e>>4)&&(t+=4,e<<=4),!(e>>6)&&(t+=2,e<<=2),!(e>>7)&&(t+=1),t}function wu(e){const t=64-function(e){let t=0;for(let n=0;n<8;++n){const r=yu(255&e[n]);if(t+=r,8!==r)break}return t}(e);return Math.ceil(t/8)}vu.Ve=new vu;class bu{constructor(){this.buffer=new Uint8Array(1024),this.position=0}Se(e){const t=e[Symbol.iterator]();let n=t.next();for(;!n.done;)this.De(n.value),n=t.next();this.Ce()}xe(e){const t=e[Symbol.iterator]();let n=t.next();for(;!n.done;)this.Ne(n.value),n=t.next();this.ke()}Me(e){for(const t of e){const e=t.charCodeAt(0);if(e<128)this.De(e);else if(e<2048)this.De(960|e>>>6),this.De(128|63&e);else if(t<"\ud800"||"\udbff"<t)this.De(480|e>>>12),this.De(128|63&e>>>6),this.De(128|63&e);else{const e=t.codePointAt(0);this.De(240|e>>>18),this.De(128|63&e>>>12),this.De(128|63&e>>>6),this.De(128|63&e)}}this.Ce()}$e(e){for(const t of e){const e=t.charCodeAt(0);if(e<128)this.Ne(e);else if(e<2048)this.Ne(960|e>>>6),this.Ne(128|63&e);else if(t<"\ud800"||"\udbff"<t)this.Ne(480|e>>>12),this.Ne(128|63&e>>>6),this.Ne(128|63&e);else{const e=t.codePointAt(0);this.Ne(240|e>>>18),this.Ne(128|63&e>>>12),this.Ne(128|63&e>>>6),this.Ne(128|63&e)}}this.ke()}Oe(e){const t=this.Fe(e),n=wu(t);this.Be(1+n),this.buffer[this.position++]=255&n;for(let e=t.length-n;e<t.length;++e)this.buffer[this.position++]=255&t[e]}Le(e){const t=this.Fe(e),n=wu(t);this.Be(1+n),this.buffer[this.position++]=~(255&n);for(let e=t.length-n;e<t.length;++e)this.buffer[this.position++]=~(255&t[e])}qe(){this.Ue(255),this.Ue(255)}Ke(){this.Ge(255),this.Ge(255)}reset(){this.position=0}seed(e){this.Be(e.length),this.buffer.set(e,this.position),this.position+=e.length}Qe(){return this.buffer.slice(0,this.position)}Fe(e){const t=function(e){const t=new DataView(new ArrayBuffer(8));return t.setFloat64(0,e,!1),new Uint8Array(t.buffer)}(e),n=!!(128&t[0]);t[0]^=n?255:128;for(let e=1;e<t.length;++e)t[e]^=n?255:0;return t}De(e){const t=255&e;0===t?(this.Ue(0),this.Ue(255)):255===t?(this.Ue(255),this.Ue(0)):this.Ue(t)}Ne(e){const t=255&e;0===t?(this.Ge(0),this.Ge(255)):255===t?(this.Ge(255),this.Ge(0)):this.Ge(e)}Ce(){this.Ue(0),this.Ue(1)}ke(){this.Ge(0),this.Ge(1)}Ue(e){this.Be(1),this.buffer[this.position++]=e}Ge(e){this.Be(1),this.buffer[this.position++]=~e}Be(e){const t=e+this.position;if(t<=this.buffer.length)return;let n=2*this.buffer.length;n<t&&(n=t);
2const r=new Uint8Array(n);r.set(this.buffer),this.buffer=r}}class _u{constructor(e){this.je=e}Ae(e){this.je.Se(e)}Ie(e){this.je.Me(e)}pe(e){this.je.Oe(e)}ge(){this.je.qe()}}class Iu{constructor(e){this.je=e}Ae(e){this.je.xe(e)}Ie(e){this.je.$e(e)}pe(e){this.je.Le(e)}ge(){this.je.Ke()}}class Eu{constructor(){this.je=new bu,this.ze=new _u(this.je),this.We=new Iu(this.je)}seed(e){this.je.seed(e)}He(e){return 0===e?this.ze:this.We}Qe(){return this.je.Qe()}reset(){this.je.reset()}}class Tu{constructor(e,t,n,r){this.indexId=e,this.documentKey=t,this.arrayValue=n,this.directionalValue=r}Je(){const e=this.directionalValue.length,t=0===e||255===this.directionalValue[e-1]?e+1:e,n=new Uint8Array(t);return n.set(this.directionalValue,0),t!==e?n.set([0],this.directionalValue.length):++n[n.length-1],new Tu(this.indexId,this.documentKey,this.arrayValue,n)}}function Su(e,t){let n=e.indexId-t.indexId;return 0!==n?n:(n=ku(e.arrayValue,t.arrayValue),0!==n?n:(n=ku(e.directionalValue,t.directionalValue),0!==n?n:ui.comparator(e.documentKey,t.documentKey)))}function ku(e,t){for(let n=0;n<e.length&&n<t.length;++n){const r=e[n]-t[n];if(0!==r)return r}return e.length-t.length}class Au{constructor(e){this.collectionId=null!=e.collectionGroup?e.collectionGroup:e.path.lastSegment(),this.Ye=e.orderBy,this.Xe=[];for(const t of e.filters){const e=t;e.isInequality()?this.Ze=e:this.Xe.push(e)}}tn(e){jr(e.collectionGroup===this.collectionId);const t=hi(e);if(void 0!==t&&!this.en(t))return!1;const n=di(e);let r=new Set,i=0,s=0;for(;i<n.length&&this.en(n[i]);++i)r=r.add(n[i].fieldPath.canonicalString());if(i===n.length)return!0;if(void 0!==this.Ze){if(!r.has(this.Ze.field.canonicalString())){const e=n[i];if(!this.nn(this.Ze,e)||!this.sn(this.Ye[s++],e))return!1}++i}for(;i<n.length;++i){const e=n[i];if(s>=this.Ye.length||!this.sn(this.Ye[s++],e))return!1}return!0}en(e){for(const t of this.Xe)if(this.nn(t,e))return!0;return!1}nn(e,t){if(void 0===e||!e.field.isEqual(t.fieldPath))return!1;const n="array-contains"===e.op||"array-contains-any"===e.op;return 2===t.kind===n}sn(e,t){return!!e.field.isEqual(t.fieldPath)&&(0===t.kind&&"asc"===e.dir||1===t.kind&&"desc"===e.dir)}}function Cu(e){var t,n;if(jr(e instanceof ho||e instanceof fo),e instanceof ho){if(e instanceof Ao){const r=(null===(n=null===(t=e.value.arrayValue)||void 0===t?void 0:t.values)||void 0===n?void 0:n.map(t=>ho.create(e.field,"==",t)))||[];return fo.create(r,"or")}return e}const r=e.filters.map(e=>Cu(e));return fo.create(r,e.op)}function xu(e){if(0===e.getFilters().length)return[];const t=Ru(Cu(e));return jr(Nu(t)),Ou(t)||Du(t)?[t]:t.getFilters()}function Ou(e){return e instanceof ho}function Du(e){return e instanceof fo&&mo(e)}function Nu(e){return Ou(e)||Du(e)||function(e){if(e instanceof fo&&go(e)){for(const t of e.getFilters())if(!Ou(t)&&!Du(t))return!1;return!0}return!1}(e)}function Ru(e){if(jr(e instanceof ho||e instanceof fo),e instanceof ho)return e;if(1===e.filters.length)return Ru(e.filters[0]);const t=e.filters.map(e=>Ru(e));let n=fo.create(t,e.op);return n=Mu(n),Nu(n)?n:(jr(n instanceof fo),jr(po(n)),jr(n.filters.length>1),n.filters.reduce((e,t)=>Pu(e,t)))}function Pu(e,t){let n;return jr(e instanceof ho||e instanceof fo),jr(t instanceof ho||t instanceof fo),n=e instanceof ho?t instanceof ho?function(e,t){return fo.create([e,t],"and")}(e,t):Lu(e,t):t instanceof ho?Lu(t,e):function(e,t){if(jr(e.filters.length>0&&t.filters.length>0),po(e)&&po(t))return bo(e,t.getFilters());const n=go(e)?e:t,r=go(e)?t:e,i=n.filters.map(e=>Pu(e,r));return fo.create(i,"or")}(e,t),Mu(n)}function Lu(e,t){if(po(t))return bo(t,e.getFilters());{const n=t.filters.map(t=>Pu(e,t));return fo.create(n,"or")}}function Mu(e){if(jr(e instanceof ho||e instanceof fo),e instanceof ho)return e;const t=e.getFilters();if(1===t.length)return Mu(t[0]);if(vo(e))return e;const n=t.map(e=>Mu(e)),r=[];return n.forEach(t=>{t instanceof ho?r.push(t):t instanceof fo&&(t.op===e.op?r.push(...t.filters):r.push(t))}),1===r.length?r[0]:fo.create(r,e.op)}class Fu{constructor(){this.rn=new ju}addToCollectionParentIndex(e,t){return this.rn.add(t),Ii.resolve()}getCollectionParents(e,t){return Ii.resolve(this.rn.getEntries(t))}addFieldIndex(e,t){return Ii.resolve()}deleteFieldIndex(e,t){return Ii.resolve()}getDocumentsMatchingTarget(e,t){return Ii.resolve(null)}getIndexType(e,t){return Ii.resolve(0)}getFieldIndexes(e,t){return Ii.resolve([])}getNextCollectionGroupToUpdate(e){return Ii.resolve(null)}getMinOffset(e,t){return Ii.resolve(vi.min())}getMinOffsetFromCollectionGroup(e,t){return Ii.resolve(vi.min())}updateCollectionGroup(e,t,n){return Ii.resolve()}updateIndexEntries(e,t){return Ii.resolve()}}class ju{constructor(){this.index={}}add(e){const t=e.lastSegment(),n=e.popLast(),r=this.index[t]||new ws(oi.comparator),i=!r.has(n);return this.index[t]=r.add(n),i}has(e){const t=e.lastSegment(),n=e.popLast(),r=this.index[t];return r&&r.has(n)}getEntries(e){return(this.index[e]||new ws(oi.comparator)).toArray()}}const Uu=new Uint8Array(0);class Vu{constructor(e,t){this.user=e,this.databaseId=t,this.on=new ju,this.un=new na(e=>No(e),(e,t)=>Ro(e,t)),this.uid=e.uid||""}addToCollectionParentIndex(e,t){if(!this.on.has(t)){const n=t.lastSegment(),r=t.popLast();e.addOnCommittedListener(()=>{this.on.add(t)});const i={collectionId:n,parent:ji(r)};return Bu(e).put(i)}return Ii.resolve()}getCollectionParents(e,t){const n=[],r=IDBKeyRange.bound([t,""],[ni(t),""],!1,!0);return Bu(e).j(r).next(e=>{for(const r of e){if(r.collectionId!==t)break;n.push(Bi(r.parent))}return n})}addFieldIndex(e,t){const n=zu(e),r=function(e){return{indexId:e.indexId,collectionGroup:e.collectionGroup,fields:e.fields.map(e=>[e.fieldPath.canonicalString(),e.kind])}}(t);delete r.indexId;const i=n.add(r);if(t.indexState){const n=$u(e);return i.next(e=>{n.put(hu(e,this.user,t.indexState.sequenceNumber,t.indexState.offset))})}return i.next()}deleteFieldIndex(e,t){const n=zu(e),r=$u(e),i=qu(e);return n.delete(t.indexId).next(()=>r.delete(IDBKeyRange.bound([t.indexId],[t.indexId+1],!1,!0))).next(()=>i.delete(IDBKeyRange.bound([t.indexId],[t.indexId+1],!1,!0)))}getDocumentsMatchingTarget(e,t){const n=qu(e);let r=!0;const i=new Map;return Ii.forEach(this.cn(t),t=>this.an(e,t).next(e=>{r&&(r=!!e),i.set(t,e)})).next(()=>{if(r){let e=fa();const r=[];return Ii.forEach(i,(i,s)=>{var o;Rr("IndexedDbIndexManager",`Using index ${o=i,`id=${o.indexId}|cg=${o.collectionGroup}|f=${o.fields.map(e=>`${e.fieldPath}:${e.kind}`).join(",")}`} to execute ${No(t)}`);const a=function(e,t){const n=hi(t);if(void 0===n)return null;for(const t of Lo(e,n.fieldPath))switch(t.op){case"array-contains-any":return t.value.arrayValue.values||[];case"array-contains":return[t.value]}return null}(s,i),c=function(e,t){const n=new Map;for(const r of di(t))for(const t of Lo(e,r.fieldPath))switch(t.op){case"==":case"in":n.set(r.fieldPath.canonicalString(),t.value);break;case"not-in":case"!=":return n.set(r.fieldPath.canonicalString(),t.value),Array.from(n.values())}return null}(s,i),u=function(e,t){const n=[];let r=!0;for(const i of di(t)){const t=0===i.kind?Mo(e,i.fieldPath,e.startAt):Fo(e,i.fieldPath,e.startAt);n.push(t.value),r&&(r=t.inclusive)}return new so(n,r)}(s,i),l=function(e,t){const n=[];let r=!0;for(const i of di(t)){const t=0===i.kind?Fo(e,i.fieldPath,e.endAt):Mo(e,i.fieldPath,e.endAt);n.push(t.value),r&&(r=t.inclusive)}return new so(n,r)}(s,i),h=this.hn(i,s,u),d=this.hn(i,s,l),f=this.ln(i,s,c),p=this.fn(i.indexId,a,h,u.inclusive,d,l.inclusive,f);return Ii.forEach(p,i=>n.H(i,t.limit).next(t=>{t.forEach(t=>{const n=ui.fromSegments(t.documentKey);e.has(n)||(e=e.add(n),r.push(n))})}))}).next(()=>r)}return Ii.resolve(null)})}cn(e){let t=this.un.get(e);return t||(t=0===e.filters.length?[e]:xu(fo.create(e.filters,"and")).map(t=>Do(e.path,e.collectionGroup,e.orderBy,t.getFilters(),e.limit,e.startAt,e.endAt)),this.un.set(e,t),t)}fn(e,t,n,r,i,s,o){const a=(null!=t?t.length:1)*Math.max(n.length,i.length),c=a/(null!=t?t.length:1),u=[];for(let l=0;l<a;++l){const a=t?this.dn(t[l/c]):Uu,h=this.wn(e,a,n[l%c],r),d=this._n(e,a,i[l%c],s),f=o.map(t=>this.wn(e,a,t,!0));u.push(...this.createRange(h,d,f))}return u}wn(e,t,n,r){const i=new Tu(e,ui.empty(),t,n);return r?i:i.Je()}_n(e,t,n,r){const i=new Tu(e,ui.empty(),t,n);return r?i.Je():i}an(e,t){const n=new Au(t),r=null!=t.collectionGroup?t.collectionGroup:t.path.lastSegment();return this.getFieldIndexes(e,r).next(e=>{let t=null;for(const r of e)n.tn(r)&&(!t||r.fields.length>t.fields.length)&&(t=r);return t})}getIndexType(e,t){let n=2;const r=this.cn(t);return Ii.forEach(r,t=>this.an(e,t).next(e=>{e?0!==n&&e.fields.length<function(e){let t=new ws(ci.comparator),n=!1;for(const r of e.filters)for(const e of r.getFlattenedFilters())e.field.isKeyField()||("array-contains"===e.op||"array-contains-any"===e.op?n=!0:t=t.add(e.field));for(const n of e.orderBy)n.field.isKeyField()||(t=t.add(n.field));return t.size+(n?1:0)}(t)&&(n=1):n=0})).next(()=>function(e){return null!==e.limit}(t)&&r.length>1&&2===n?1:n)}mn(e,t){const n=new Eu;for(const r of di(e)){const e=t.data.field(r.fieldPath);if(null==e)return null;const i=n.He(r.kind);vu.Ve._e(e,i)}return n.Qe()}dn(e){const t=new Eu;return vu.Ve._e(e,t.He(0)),t.Qe()}gn(e,t){const n=new Eu;return vu.Ve._e($s(this.databaseId,t),n.He(function(e){const t=di(e);return 0===t.length?0:t[t.length-1].kind}(e))),n.Qe()}ln(e,t,n){if(null===n)return[];let r=[];r.push(new Eu);let i=0;for(const s of di(e)){const e=n[i++];for(const n of r)if(this.yn(t,s.fieldPath)&&Ks(e))r=this.pn(r,s,e);else{const t=n.He(s.kind);vu.Ve._e(e,t)}}return this.In(r)}hn(e,t,n){return this.ln(e,t,n.position)}In(e){const t=[];for(let n=0;n<e.length;++n)t[n]=e[n].Qe();return t}pn(e,t,n){const r=[...e],i=[];for(const e of n.arrayValue.values||[])for(const n of r){const r=new Eu;r.seed(n.Qe()),vu.Ve._e(e,r.He(t.kind)),i.push(r)}return i}yn(e,t){return!!e.filters.find(e=>e instanceof ho&&e.field.isEqual(t)&&("in"===e.op||"not-in"===e.op))}getFieldIndexes(e,t){const n=zu(e),r=$u(e);return(t?n.j("collectionGroupIndex",IDBKeyRange.bound(t,t)):n.j()).next(e=>{const t=[];return Ii.forEach(e,e=>r.get([e.indexId,this.uid]).next(n=>{t.push(function(e,t){const n=t?new pi(t.sequenceNumber,new vi(iu(t.readTime),new ui(Bi(t.documentKey)),t.largestBatchId)):pi.empty(),r=e.fields.map(([e,t])=>new fi(ci.fromServerFormat(e),t));return new li(e.indexId,e.collectionGroup,r,n)}(e,n))})).next(()=>t)})}getNextCollectionGroupToUpdate(e){return this.getFieldIndexes(e).next(e=>0===e.length?null:(e.sort((e,t)=>
2{const n=e.indexState.sequenceNumber-t.indexState.sequenceNumber;return 0!==n?n:ei(e.collectionGroup,t.collectionGroup)}),e[0].collectionGroup))}updateCollectionGroup(e,t,n){const r=zu(e),i=$u(e);return this.Tn(e).next(e=>r.j("collectionGroupIndex",IDBKeyRange.bound(t,t)).next(t=>Ii.forEach(t,t=>i.put(hu(t.indexId,this.user,e,n)))))}updateIndexEntries(e,t){const n=new Map;return Ii.forEach(t,(t,r)=>{const i=n.get(t.collectionGroup);return(i?Ii.resolve(i):this.getFieldIndexes(e,t.collectionGroup)).next(i=>(n.set(t.collectionGroup,i),Ii.forEach(i,n=>this.En(e,t,n).next(t=>{const i=this.An(r,n);return t.isEqual(i)?Ii.resolve():this.vn(e,r,n,t,i)}))))})}Rn(e,t,n,r){return qu(e).put({indexId:r.indexId,uid:this.uid,arrayValue:r.arrayValue,directionalValue:r.directionalValue,orderedDocumentKey:this.gn(n,t.key),documentKey:t.key.path.toArray()})}Pn(e,t,n,r){return qu(e).delete([r.indexId,this.uid,r.arrayValue,r.directionalValue,this.gn(n,t.key),t.key.path.toArray()])}En(e,t,n){const r=qu(e);let i=new ws(Su);return r.X({index:"documentKeyIndex",range:IDBKeyRange.only([n.indexId,this.uid,this.gn(n,t)])},(e,r)=>{i=i.add(new Tu(n.indexId,t,r.arrayValue,r.directionalValue))}).next(()=>i)}An(e,t){let n=new ws(Su);const r=this.mn(t,e);if(null==r)return n;const i=hi(t);if(null!=i){const s=e.data.field(i.fieldPath);if(Ks(s))for(const i of s.arrayValue.values||[])n=n.add(new Tu(t.indexId,e.key,this.dn(i),r))}else n=n.add(new Tu(t.indexId,e.key,Uu,r));return n}vn(e,t,n,r,i){Rr("IndexedDbIndexManager","Updating index entries for document '%s'",t.key);const s=[];return function(e,t,n,r,i){const s=e.getIterator(),o=t.getIterator();let a=_s(s),c=_s(o);for(;a||c;){let e=!1,t=!1;if(a&&c){const r=n(a,c);r<0?t=!0:r>0&&(e=!0)}else null!=a?t=!0:e=!0;e?(r(c),c=_s(o)):t?(i(a),a=_s(s)):(a=_s(s),c=_s(o))}}(r,i,Su,r=>{s.push(this.Rn(e,t,n,r))},r=>{s.push(this.Pn(e,t,n,r))}),Ii.waitFor(s)}Tn(e){let t=1;return $u(e).X({index:"sequenceNumberIndex",reverse:!0,range:IDBKeyRange.upperBound([this.uid,Number.MAX_SAFE_INTEGER])},(e,n,r)=>{r.done(),t=n.sequenceNumber+1}).next(()=>t)}createRange(e,t,n){n=n.sort((e,t)=>Su(e,t)).filter((e,t,n)=>!t||0!==Su(e,n[t-1]));const r=[];r.push(e);for(const i of n){const n=Su(i,e),s=Su(i,t);if(0===n)r[0]=e.Je();else if(n>0&&s<0)r.push(i),r.push(i.Je());else if(s>0)break}r.push(t);const i=[];for(let e=0;e<r.length;e+=2){if(this.bn(r[e],r[e+1]))return[];const t=[r[e].indexId,this.uid,r[e].arrayValue,r[e].directionalValue,Uu,[]],n=[r[e+1].indexId,this.uid,r[e+1].arrayValue,r[e+1].directionalValue,Uu,[]];i.push(IDBKeyRange.bound(t,n))}return i}bn(e,t){return Su(e,t)>0}getMinOffsetFromCollectionGroup(e,t){return this.getFieldIndexes(e,t).next(Gu)}getMinOffset(e,t){return Ii.mapArray(this.cn(t),t=>this.an(e,t).next(e=>e||Fr())).next(Gu)}}function Bu(e){return ds(e,"collectionParents")}function qu(e){return ds(e,"indexEntries")}function zu(e){return ds(e,"indexConfiguration")}function $u(e){return ds(e,"indexState")}function Gu(e){jr(0!==e.length);let t=e[0].indexState.offset,n=t.largestBatchId;for(let r=1;r<e.length;r++){const i=e[r].indexState.offset;yi(i,t)<0&&(t=i),n<i.largestBatchId&&(n=i.largestBatchId)}return new vi(t.readTime,t.documentKey,n)}const Ku={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0};class Wu{constructor(e,t,n){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=n}static withCacheSize(e){return new Wu(e,Wu.DEFAULT_COLLECTION_PERCENTILE,Wu.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}}function Hu(e,t,n){const r=e.store("mutations"),i=e.store("documentMutations"),s=[],o=IDBKeyRange.only(n.batchId);let a=0;const c=r.X({range:o},(e,t,n)=>(a++,n.delete()));s.push(c.next(()=>{jr(1===a)}));const u=[];for(const e of n.mutations){const r=$i(t,e.key.path,n.batchId);s.push(i.delete(r)),u.push(e.key)}return Ii.waitFor(s).next(()=>u)}function Qu(e){if(!e)return 0;let t;if(e.document)t=e.document;else if(e.unknownDocument)t=e.unknownDocument;else{if(!e.noDocument)throw Fr();t=e.noDocument}return JSON.stringify(t).length}Wu.DEFAULT_COLLECTION_PERCENTILE=10,Wu.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Wu.DEFAULT=new Wu(41943040,Wu.DEFAULT_COLLECTION_PE
2RCENTILE,Wu.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Wu.DISABLED=new Wu(-1,0,0);class Yu{constructor(e,t,n,r){this.userId=e,this.serializer=t,this.indexManager=n,this.referenceDelegate=r,this.Vn={}}static de(e,t,n,r){jr(""!==e.uid);const i=e.isAuthenticated()?e.uid:"";return new Yu(i,t,n,r)}checkEmpty(e){let t=!0;const n=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return Ju(e).X({index:"userMutationsIndex",range:n},(e,n,r)=>{t=!1,r.done()}).next(()=>t)}addMutationBatch(e,t,n,r){const i=Zu(e),s=Ju(e);return s.add({}).next(o=>{jr("number"==typeof o);const a=new Ha(o,t,n,r),c=function(e,t,n){const r=n.baseMutations.map(t=>Uc(e.fe,t)),i=n.mutations.map(t=>Uc(e.fe,t));return{userId:t,batchId:n.batchId,localWriteTimeMs:n.localWriteTime.toMillis(),baseMutations:r,mutations:i}}(this.serializer,this.userId,a),u=[];let l=new ws((e,t)=>ei(e.canonicalString(),t.canonicalString()));for(const e of r){const t=$i(this.userId,e.key.path,o);l=l.add(e.key.path.popLast()),u.push(s.put(c)),u.push(i.put(t,Gi))}return l.forEach(t=>{u.push(this.indexManager.addToCollectionParentIndex(e,t))}),e.addOnCommittedListener(()=>{this.Vn[o]=a.keys()}),Ii.waitFor(u).next(()=>a)})}lookupMutationBatch(e,t){return Ju(e).get(t).next(e=>e?(jr(e.userId===this.userId),su(this.serializer,e)):null)}Sn(e,t){return this.Vn[t]?Ii.resolve(this.Vn[t]):this.lookupMutationBatch(e,t).next(e=>{if(e){const n=e.keys();return this.Vn[t]=n,n}return null})}getNextMutationBatchAfterBatchId(e,t){const n=t+1,r=IDBKeyRange.lowerBound([this.userId,n]);let i=null;return Ju(e).X({index:"userMutationsIndex",range:r},(e,t,r)=>{t.userId===this.userId&&(jr(t.batchId>=n),i=su(this.serializer,t)),r.done()}).next(()=>i)}getHighestUnacknowledgedBatchId(e){const t=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]);let n=-1;return Ju(e).X({index:"userMutationsIndex",range:t,reverse:!0},(e,t,r)=>{n=t.batchId,r.done()}).next(()=>n)}getAllMutationBatches(e){const t=IDBKeyRange.bound([this.userId,-1],[this.userId,Number.POSITIVE_INFINITY]);return Ju(e).j("userMutationsIndex",t).next(e=>e.map(e=>su(this.serializer,e)))}getAllMutationBatchesAffectingDocumentKey(e,t){const n=zi(this.userId,t.path),r=IDBKeyRange.lowerBound(n),i=[];return Zu(e).X({range:r},(n,r,s)=>{const[o,a,c]=n,u=Bi(a);if(o===this.userId&&t.path.isEqual(u))return Ju(e).get(c).next(e=>{if(!e)throw Fr();jr(e.userId===this.userId),i.push(su(this.serializer,e))});s.done()}).next(()=>i)}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new ws(ei);const r=[];return t.forEach(t=>{const i=zi(this.userId,t.path),s=IDBKeyRange.lowerBound(i),o=Zu(e).X({range:s},(e,r,i)=>{const[s,o,a]=e,c=Bi(o);s===this.userId&&t.path.isEqual(c)?n=n.add(a):i.done()});r.push(o)}),Ii.waitFor(r).next(()=>this.Dn(e,n))}getAllMutationBatchesAffectingQuery(e,t){const n=t.path,r=n.length+1,i=zi(this.userId,n),s=IDBKeyRange.lowerBound(i);let o=new ws(ei);return Zu(e).X({range:s},(e,t,i)=>{const[s,a,c]=e,u=Bi(a);s===this.userId&&n.isPrefixOf(u)?u.length===r&&(o=o.add(c)):i.done()}).next(()=>this.Dn(e,o))}Dn(e,t){const n=[],r=[];return t.forEach(t=>{r.push(Ju(e).get(t).next(e=>{if(null===e)throw Fr();jr(e.userId===this.userId),n.push(su(this.serializer,e))}))}),Ii.waitFor(r).next(()=>n)}removeMutationBatch(e,t){return Hu(e.ht,this.userId,t).next(n=>(e.addOnCommittedListener(()=>{this.Cn(t.batchId)}),Ii.forEach(n,t=>this.referenceDelegate.markPotentiallyOrphaned(e,t))))}Cn(e){delete this.Vn[e]}performConsistencyCheck(e){return this.checkEmpty(e).next(t=>{if(!t)return Ii.resolve();const n=IDBKeyRange.lowerBound([this.userId]),r=[];return Zu(e).X({range:n},(e,t,n)=>{if(e[0]===this.userId){const t=Bi(e[1]);r.push(t)}else n.done()}).next(()=>{jr(0===r.length)})})}containsKey(e,t){return Xu(e,this.userId,t)}xn(e){return el(e).get(this.userId).next(e=>e||{userId:this.userId,lastAcknowledgedBatchId:-1,lastStreamToken:""})}}function Xu(e,t,n){const r=zi(t,n.path),i=r[1],s=IDBKeyRange.lowerBound(r);let o=!1;return Zu(e).X({range:s,Y:!0},(e,n,r)=>{const[s,a,c]=e;s===t&&a===i&&(o=!0),r.done()}).next(()=>o)}function Ju(e){return ds(e,"mutations")}function Zu(e){return ds(e,"documentMutations")}
vendor: 5,217 bytes, line 2
2function el(e){return ds(e,"mutationQueues")}class tl{constructor(e){this.Nn=e}next(){return this.Nn+=2,this.Nn}static kn(){return new tl(0)}static Mn(){return new tl(-1)}}class nl{constructor(e,t){this.referenceDelegate=e,this.serializer=t}allocateTargetId(e){return this.$n(e).next(t=>{const n=new tl(t.highestTargetId);return t.highestTargetId=n.next(),this.On(e,t).next(()=>t.highestTargetId)})}getLastRemoteSnapshotVersion(e){return this.$n(e).next(e=>ii.fromTimestamp(new ri(e.lastRemoteSnapshotVersion.seconds,e.lastRemoteSnapshotVersion.nanoseconds)))}getHighestSequenceNumber(e){return this.$n(e).next(e=>e.highestListenSequenceNumber)}setTargetsMetadata(e,t,n){return this.$n(e).next(r=>(r.highestListenSequenceNumber=t,n&&(r.lastRemoteSnapshotVersion=n.toTimestamp()),t>r.highestListenSequenceNumber&&(r.highestListenSequenceNumber=t),this.On(e,r)))}addTargetData(e,t){return this.Fn(e,t).next(()=>this.$n(e).next(n=>(n.targetCount+=1,this.Bn(t,n),this.On(e,n))))}updateTargetData(e,t){return this.Fn(e,t)}removeTargetData(e,t){return this.removeMatchingKeysForTargetId(e,t.targetId).next(()=>rl(e).delete(t.targetId)).next(()=>this.$n(e)).next(t=>(jr(t.targetCount>0),t.targetCount-=1,this.On(e,t)))}removeTargets(e,t,n){let r=0;const i=[];return rl(e).X((s,o)=>{const a=ou(o);a.sequenceNumber<=t&&null===n.get(a.targetId)&&(r++,i.push(this.removeTargetData(e,a)))}).next(()=>Ii.waitFor(i)).next(()=>r)}forEachTarget(e,t){return rl(e).X((e,n)=>{const r=ou(n);t(r)})}$n(e){return il(e).get("targetGlobalKey").next(e=>(jr(null!==e),e))}On(e,t){return il(e).put("targetGlobalKey",t)}Fn(e,t){return rl(e).put(au(this.serializer,t))}Bn(e,t){let n=!1;return e.targetId>t.highestTargetId&&(t.highestTargetId=e.targetId,n=!0),e.sequenceNumber>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=e.sequenceNumber,n=!0),n}getTargetCount(e){return this.$n(e).next(e=>e.targetCount)}getTargetData(e,t){const n=No(t),r=IDBKeyRange.bound([n,Number.NEGATIVE_INFINITY],[n,Number.POSITIVE_INFINITY]);let i=null;return rl(e).X({range:r,index:"queryTargetsIndex"},(e,n,r)=>{const s=ou(n);Ro(t,s.target)&&(i=s,r.done())}).next(()=>i)}addMatchingKeys(e,t,n){const r=[],i=sl(e);return t.forEach(t=>{const s=ji(t.path);r.push(i.put({targetId:n,path:s})),r.push(this.referenceDelegate.addReference(e,n,t))}),Ii.waitFor(r)}removeMatchingKeys(e,t,n){const r=sl(e);return Ii.forEach(t,t=>{const i=ji(t.path);return Ii.waitFor([r.delete([n,i]),this.referenceDelegate.removeReference(e,n,t)])})}removeMatchingKeysForTargetId(e,t){const n=sl(e),r=IDBKeyRange.bound([t],[t+1],!1,!0);return n.delete(r)}getMatchingKeysForTargetId(e,t){const n=IDBKeyRange.bound([t],[t+1],!1,!0),r=sl(e);let i=fa();return r.X({range:n,Y:!0},(e,t,n)=>{const r=Bi(e[1]),s=new ui(r);i=i.add(s)}).next(()=>i)}containsKey(e,t){const n=ji(t.path),r=IDBKeyRange.bound([n],[ni(n)],!1,!0);let i=0;return sl(e).X({index:"documentTargetsIndex",Y:!0,range:r},([e,t],n,r)=>{0!==e&&(i++,r.done())}).next(()=>i>0)}le(e,t){return rl(e).get(t).next(e=>e?ou(e):null)}}function rl(e){return ds(e,"targets")}function il(e){return ds(e,"targetGlobal")}function sl(e){return ds(e,"targetDocuments")}function ol([e,t],[n,r]){const i=ei(e,n);return 0===i?ei(t,r):i}class al{constructor(e){this.Ln=e,this.buffer=new ws(ol),this.qn=0}Un(){return++this.qn}Kn(e){const t=[e,this.Un()];if(this.buffer.size<this.Ln)this.buffer=this.buffer.add(t);else{const e=this.buffer.last();ol(t,e)<0&&(this.buffer=this.buffer.delete(e).add(t))}}get maxValue(){return this.buffer.last()[0]}}class cl{constructor(e,t,n){this.garbageCollector=e,this.asyncQueue=t,this.localStore=n,this.Gn=null}start(){-1!==this.garbageCollector.params.cacheSizeCollectionThreshold&&this.Qn(6e4)}stop(){this.Gn&&(this.Gn.cancel(),this.Gn=null)}get started(){return null!==this.Gn}Qn(e){Rr("LruGarbageCollector",`Garbage collection scheduled in ${e}ms`),this.Gn=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,async()=>{this.Gn=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(e){Ai(e)?Rr("LruGarbageCollector","Ignoring IndexedDB error during garbage collection: ",e):await _i(e)}await this.Qn(3e5)})}}class ul{constructor(e,t){this.jn=e,this.params=t}calculateTargetCount(e,t){return this.jn.zn(e).next(e=>Math.floor(t/100*e))}nthSequenceNumber(e,t){if(0===t)return Ii.resolve(Pi.ct);const n=new al(t);return this.jn.forEachTarget(e,e=>n.Kn(e.sequenceNumber)).next(()=>this.jn.Wn(e,e=>n.Kn(e))).next(()=>n.maxValue)}removeTargets(e,t,n){return this.jn.removeTargets(e,t,n)}removeOrphanedDocuments(e,t){return this.jn.removeOrphanedDocuments(e,t)}collect(e,t){return-1===this.params.cacheSizeCollectionThreshold?(Rr("LruGarbageCollector","Garbage collection skipped; disabled"),Ii.resolve(Ku)):this.getCacheSize(e).next(n=>n<this.params.cacheSizeCollectionThreshold?(Rr("LruGarbageCollector",`Garbage collection skipped; Cache size ${n} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),Ku):this.Hn(e,t))}getCacheSize(e){return this.jn.getCacheSize(e)}Hn(e,t){let n,r,i,s,a,c,u;const l=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next(t=>(t>this.params.maximumSequenceNumbersToCollect?(Rr("LruGarbageCollector",`C
2apping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${t}`),r=this.params.maximumSequenceNumbersToCollect):r=t,s=Date.now(),this.nthSequenceNumber(e,r))).next(r=>(n=r,a=Date.now(),this.removeTargets(e,n,t))).next(t=>(i=t,c=Date.now(),this.removeOrphanedDocuments(e,n))).next(e=>(u=Date.now(),Dr()<=o.$b.DEBUG&&Rr("LruGarbageCollector",`LRU Garbage Collection\n\tCounted targets in ${s-l}ms\n\tDetermined least recently used ${r} in `+(a-s)+"ms\n"+`\tRemoved ${i} targets in `+(c-a)+"ms\n"+`\tRemoved ${e} documents in `+(u-c)+"ms\n"+`Total Duration: ${u-l}ms`),Ii.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:i,documentsRemoved:e})))}}class ll{constructor(e,t){this.db=e,this.garbageCollector=function(e,t){return new ul(e,t)}(this,t)}zn(e){const t=this.Jn(e);return this.db.getTargetCache().getTargetCount(e).next(e=>t.next(t=>e+t))}Jn(e){let t=0;return this.Wn(e,e=>{t++}).next(()=>t)}forEachTarget(e,t){return this.db.getTargetCache().forEachTarget(e,t)}Wn(e,t){return this.Yn(e,(e,n)=>t(n))}addReference(e,t,n){return hl(e,n)}removeReference(e,t,n){return hl(e,n)}removeTargets(e,t,n){return this.db.getTargetCache().removeTargets(e,t,n)}markPotentiallyOrphaned(e,t){return hl(e,t)}Xn(e,t){return function(e,t){let n=!1;return el(e).Z(r=>Xu(e,r,t).next(e=>(e&&(n=!0),Ii.resolve(!e)))).next(()=>n)}(e,t)}removeOrphanedDocuments(e,t){const n=this.db.getRemoteDocumentCache().newChangeBuffer(),r=[];let i=0;return this.Yn(e,(s,o)=>{if(o<=t){const t=this.Xn(e,s).next(t=>{if(!t)return i++,n.getEntry(e,s).next(()=>(n.removeEntry(s,ii.min()),sl(e).delete([0,ji(s.path)])))});r.push(t)}}).next(()=>Ii.waitFor(r)).next(()=>n.apply(e)).next(()=>i)}removeTarget(e,t){const n=t.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,n)}updateLimboDocument(e,t){return hl(e,t)}Yn(e,t){const n=sl(e);let r,i=Pi.ct;return n.X({index:"documentTargetsIndex"},([e,n],{path:s,sequenceNumber:o})=>{0===e?(i!==Pi.ct&&t(new ui(Bi(r)),i),i=o,r=s):i=Pi.ct}).next(()=>{i!==Pi.ct&&t(new ui(Bi(r)),i)})}getCacheSize(e){return this.db.getRemoteDocumentCache().getSize(e)}}function hl(e,t){return sl(e).put(function(e,t){return{targetId:0,path:ji(e.path),sequenceNumber:t}}(t,e.currentSequenceNumber))}class dl{constructor(){this.changes=new na(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,io.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const n=this.changes.get(t);return void 0!==n?Ii.resolve(n):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}class fl{constructor(e){this.serializer=e}setIndexManager(e){this.indexManager=e}addEntry(e,t,n){return vl(e).put(n)}removeEntry(e,t,n){return vl(e).delete(function(e,t){const n=e.path.toArray();return[n.slice(0,n.length-2),n[n.length-2],nu(t),n[n.length-1]]}(t,n))}updateMetadata(e,t){return this.getMetadata(e).next(n=>(n.byteSize+=t,this.Zn(e,n)))}getEntry(e,t){let n=io.newInvalidDocument(t);return vl(e).X({index:"documentKeyIndex",range:IDBKeyRange.only(yl(t))},(e,r)=>{n=this.ts(t,r)}).next(()=>n)}es(e,t){let n={size:0,document:io.newInvalidDocument(t)};return vl(e).X({index:"documentKeyIndex",range:IDBKeyRange.only(yl(t))},(e,r)=>{n={document:this.ts(t,r),size:Qu(r)}}).next(()=>n)}getEntries(e,t){let n=ia();return this.ns(e,t,(e,t)=>{const r=this.ts(e,t);n=n.insert(e,r)}).next(()=>n)}ss(e,t){let n=ia(),r=new ms(ui.comparator);return this.ns(e,t,(e,t)=>{const i=this.ts(e,t);n=n.insert(e,i),r=r.insert(e,Qu(t))}).next(()=>({documents:n,rs:r}))}ns(e,t,n){if(t.isEmpty())return Ii.resolve();let r=new ws(bl);t.forEach(e=>r=r.add(e));const i=IDBKeyRange.bound(yl(r.first()),yl(r.last())),s=r.getIterator();let o=s.getNext();return vl(e).X({index:"documentKeyIndex",range:i},(e,t,r)=>{const i=ui.fromSegments([...t.prefixPath,t.collectionGroup,t.documentId]);for(;o&&bl(o,i)<0;)n(o,null),o=s.getNext();o&&o.isEqual(i)&&(n(o,t),o=s.hasNext()?s.getNext():null),o?r.G(yl(o)):r.done()}).next(()=>{for(;o;)n(o,null),o=s.hasNext()?s.getNext():null})}getDocumentsMatchingQuery(e,t,n,r){const i=t.path,s=[i.popLast().toArray(),i.lastSegment(),nu(n.readTime),n.documentKey.path.isEmpty()?"":n.documentKey.path.lastSegment()],o=[i.popLast().toArray(),i.lastSegment(),[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],""];return vl(e).j(IDBKeyRange.bound(s,o,!0)).next(e=>{let n=ia();for(const i of e){const e=this.ts(ui.fromSegments(i.prefixPath.concat(i.collectionGroup,i.documentId)),i);
2e.isFoundDocument()&&(Jo(t,e)||r.has(e.key))&&(n=n.insert(e.key,e))}return n})}getAllFromCollectionGroup(e,t,n,r){let i=ia();const s=wl(t,n),o=wl(t,vi.max());return vl(e).X({index:"collectionGroupIndex",range:IDBKeyRange.bound(s,o,!0)},(e,t,n)=>{const s=this.ts(ui.fromSegments(t.prefixPath.concat(t.collectionGroup,t.documentId)),t);i=i.insert(s.key,s),i.size===r&&n.done()}).next(()=>i)}newChangeBuffer(e){return new gl(this,!!e&&e.trackRemovals)}getSize(e){return this.getMetadata(e).next(e=>e.byteSize)}getMetadata(e){return ml(e).get("remoteDocumentGlobalKey").next(e=>(jr(!!e),e))}Zn(e,t){return ml(e).put("remoteDocumentGlobalKey",t)}ts(e,t){if(t){const e=function(e,t){let n;if(t.document)n=jc(e.fe,t.document,!!t.hasCommittedMutations);else if(t.noDocument){const e=ui.fromSegments(t.noDocument.path),r=iu(t.noDocument.readTime);n=io.newNoDocument(e,r),t.hasCommittedMutations&&n.setHasCommittedMutations()}else{if(!t.unknownDocument)return Fr();{const e=ui.fromSegments(t.unknownDocument.path),r=iu(t.unknownDocument.version);n=io.newUnknownDocument(e,r)}}return t.readTime&&n.setReadTime(function(e){const t=new ri(e[0],e[1]);return ii.fromTimestamp(t)}(t.readTime)),n}(this.serializer,t);if(!e.isNoDocument()||!e.version.isEqual(ii.min()))return e}return io.newInvalidDocument(e)}}function pl(e){return new fl(e)}class gl extends dl{constructor(e,t){super(),this.os=e,this.trackRemovals=t,this.us=new na(e=>e.toString(),(e,t)=>e.isEqual(t))}applyChanges(e){const t=[];let n=0,r=new ws((e,t)=>ei(e.canonicalString(),t.canonicalString()));
2return this.changes.forEach((i,s)=>{const o=this.us.get(i);if(t.push(this.os.removeEntry(e,i,o.readTime)),s.isValidDocument()){const a=tu(this.os.serializer,s);r=r.add(i.path.popLast());const c=Qu(a);n+=c-o.size,t.push(this.os.addEntry(e,i,a))}else if(n-=o.size,this.trackRemovals){const n=tu(this.os.serializer,s.convertToNoDocument(ii.min()));t.push(this.os.addEntry(e,i,n))}}),r.forEach(n=>{t.push(this.os.indexManager.addToCollectionParentIndex(e,n))}),t.push(this.os.updateMetadata(e,n)),Ii.waitFor(t)}getFromCache(e,t){return this.os.es(e,t).next(e=>(this.us.set(t,{size:e.size,readTime:e.document.readTime}),e.document))}getAllFromCache(e,t){return this.os.ss(e,t).next(({documents:e,rs:t})=>(t.forEach((t,n)=>{this.us.set(t,{size:n,readTime:e.get(t).readTime})}),e))}}function ml(e){return ds(e,"remoteDocumentGlobal")}function vl(e){return ds(e,"remoteDocumentsV14")}function yl(e){const t=e.path.toArray();return[t.slice(0,t.length-2),t[t.length-2],t[t.length-1]]}function wl(e,t){const n=t.documentKey.path.toArray();return[e,nu(t.readTime),n.slice(0,n.length-2),n.length>0?n[n.length-1]:""]}function bl(e,t){const n=e.path.toArray(),r=t.path.toArray();let i=0;for(let e=0;e<n.length-2&&e<r.length-2;++e)if(i=ei(n[e],r[e]),i)return i;return i=ei(n.length,r.length),i||(i=ei(n[n.length-2],r[r.length-2]),i||ei(n[n.length-1],r[r.length-1]))}class _l{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}class Il{constructor(e,t,n,r){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=n,this.indexManager=r}getDocument(e,t){let n=null;return this.documentOverlayCache.getOverlay(e,t).next(r=>(n=r,this.remoteDocumentCache.getEntry(e,t))).next(e=>(null!==n&&ja(n.mutation,e,Is.empty(),ri.now()),e))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.getLocalViewOfDocuments(e,t,fa()).next(()=>t))}getLocalViewOfDocuments(e,t,n=fa()){const r=ca();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,n).next(e=>{let t=oa();return e.forEach((e,n)=>{t=t.insert(e,n.overlayedDocument)}),t}))}getOverlayedDocuments(e,t){const n=ca();return this.populateOverlays(e,n,t).next(()=>this.computeViews(e,t,n,fa()))}populateOverlays(e,t,n){const r=[];return n.forEach(e=>{t.has(e)||r.push(e)}),this.documentOverlayCache.getOverlays(e,r).next(e=>{e.forEach((e,n)=>{t.set(e,n)})})}computeViews(e,t,n,r){let i=ia();const s=la(),o=la();return t.forEach((e,t)=>{const o=n.get(t.key);r.has(t.key)&&(void 0===o||o.mutation instanceof qa)?i=i.insert(t.key,t):void 0!==o?(s.set(t.key,o.mutation.getFieldMask()),ja(o.mutation,t,o.mutation.getFieldMask(),ri.now())):s.set(t.key,Is.empty())}),this.recalculateAndSaveOverlays(e,i).next(e=>(e.forEach((e,t)=>s.set(e,t)),t.forEach((e,t)=>{var n;return o.set(e,new _l(t,null!==(n=s.get(e))&&void 0!==n?n:null))}),o))}recalculateAndSaveOverlays(e,t){const n=la();let r=new ms((e,t)=>e-t),i=fa();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(e=>{for(const i of e)i.keys().forEach(e=>{const s=t.get(e);if(null===s)return;let o=n.get(e)||Is.empty();o=i.applyToLocalView(s,o),n.set(e,o);const a=(r.get(i.batchId)||fa()).add(e);r=r.insert(i.batchId,a)})}).next(()=>{const s=[],o=r.getReverseIterator();for(;o.hasNext();){const r=o.getNext(),a=r.key,c=r.value,u=ua();c.forEach(e=>{if(!i.has(e)){const r=Ma(t.get(e),n.get(e));null!==r&&u.set(e,r),i=i.add(e)}}),s.push(this.documentOverlayCache.saveOverlays(e,a,u))}return Ii.waitFor(s)}).next(()=>n)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(t=>this.recalculateAndSaveOverlays(e,t))}getDocumentsMatchingQuery(e,t,n){return function(e){return ui.isDocumentKey(e.path)&&null===e.collectionGroup&&0===e.filters.length}(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):$o(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,n):this.getDocumentsMatchingCollectionQuery(e,t,n)}getNextDocuments(e,t,n,r){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,n,r).next(i=>{const s=r-i.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,n.largestBatchId,r-i.size):Ii.resolve(ca());let o=-1,a=i;return s.next(t=>Ii.forEach(t,(t,n)=>(o<n.largestBatchId&&(o=n.largestBatchId),i.get(t)?Ii.resolve():this.remoteDocumentCache.getEntry(e,t).next(e=>{a=a.insert(t,e)}))).next(()=>this.populateOverlays(e,t,i)).next(()=>this.computeViews(e,a,t,fa())).next(e=>({batchId:o,changes:aa(e)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new ui(t)).next(e=>
vendor: 4,076 bytes, line 2
2{let t=oa();return e.isFoundDocument()&&(t=t.insert(e.key,e)),t})}getDocumentsMatchingCollectionGroupQuery(e,t,n){const r=t.collectionGroup;let i=oa();return this.indexManager.getCollectionParents(e,r).next(s=>Ii.forEach(s,s=>{const o=function(e,t){return new jo(t,null,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(t,s.child(r));return this.getDocumentsMatchingCollectionQuery(e,o,n).next(e=>{e.forEach((e,t)=>{i=i.insert(e,t)})})}).next(()=>i))}getDocumentsMatchingCollectionQuery(e,t,n){let r;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,n.largestBatchId).next(i=>(r=i,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,n,r))).next(e=>{r.forEach((t,n)=>{const r=n.getKey();null===e.get(r)&&(e=e.insert(r,io.newInvalidDocument(r)))});let n=oa();return e.forEach((e,i)=>{const s=r.get(e);void 0!==s&&ja(s.mutation,i,Is.empty(),ri.now()),Jo(t,i)&&(n=n.insert(e,i))}),n})}}class El{constructor(e){this.serializer=e,this.cs=new Map,this.hs=new Map}getBundleMetadata(e,t){return Ii.resolve(this.cs.get(t))}saveBundleMetadata(e,t){var n;return this.cs.set(t.id,{id:(n=t).id,version:n.version,createTime:Cc(n.createTime)}),Ii.resolve()}getNamedQuery(e,t){return Ii.resolve(this.hs.get(t))}saveNamedQuery(e,t){return this.hs.set(t.name,function(e){return{name:e.name,query:cu(e.bundledQuery),readTime:Cc(e.readTime)}}(t)),Ii.resolve()}}class Tl{constructor(){this.overlays=new ms(ui.comparator),this.ls=new Map}getOverlay(e,t){return Ii.resolve(this.overlays.get(t))}getOverlays(e,t){const n=ca();return Ii.forEach(t,t=>this.getOverlay(e,t).next(e=>{null!==e&&n.set(t,e)})).next(()=>n)}saveOverlays(e,t,n){return n.forEach((n,r)=>{this.we(e,t,r)}),Ii.resolve()}removeOverlaysForBatchId(e,t,n){const r=this.ls.get(n);return void 0!==r&&(r.forEach(e=>this.overlays=this.overlays.remove(e)),this.ls.delete(n)),Ii.resolve()}getOverlaysForCollection(e,t,n){const r=ca(),i=t.length+1,s=new ui(t.child("")),o=this.overlays.getIteratorFrom(s);for(;o.hasNext();){const e=o.getNext().value,s=e.getKey();if(!t.isPrefixOf(s.path))break;s.path.length===i&&e.largestBatchId>n&&r.set(e.getKey(),e)}return Ii.resolve(r)}getOverlaysForCollectionGroup(e,t,n,r){let i=new ms((e,t)=>e-t);const s=this.overlays.getIterator();for(;s.hasNext();){const e=s.getNext().value;if(e.getKey().getCollectionGroup()===t&&e.largestBatchId>n){let t=i.get(e.largestBatchId);null===t&&(t=ca(),i=i.insert(e.largestBatchId,t)),t.set(e.getKey(),e)}}const o=ca(),a=i.getIterator();for(;a.hasNext()&&(a.getNext().value.forEach((e,t)=>o.set(e,t)),!(o.size()>=r)););return Ii.resolve(o)}we(e,t,n){const r=this.overlays.get(n.key);if(null!==r){const e=this.ls.get(r.largestBatchId).delete(n.key);this.ls.set(r.largestBatchId,e)}this.overlays=this.overlays.insert(n.key,new Ya(t,n));let i=this.ls.get(t);void 0===i&&(i=fa(),this.ls.set(t,i)),this.ls.set(t,i.add(n.key))}}class Sl{constructor(){this.fs=new ws(kl.ds),this.ws=new ws(kl._s)}isEmpty(){return this.fs.isEmpty()}addReference(e,t){const n=new kl(e,t);this.fs=this.fs.add(n),this.ws=this.ws.add(n)}gs(e,t){e.forEach(e=>this.addReference(e,t))}removeReference(e,t){this.ys(new kl(e,t))}ps(e,t){e.forEach(e=>this.removeReference(e,t))}Is(e){const t=new ui(new oi([])),n=new kl(t,e),r=new kl(t,e+1),i=[];return this.ws.forEachInRange([n,r],e=>{this.ys(e),i.push(e.key)}),i}Ts(){this.fs.forEach(e=>this.ys(e))}ys(e){this.fs=this.fs.delete(e),this.ws=this.ws.delete(e)}Es(e){const t=new ui(new oi([])),n=new kl(t,e),r=new kl(t,e+1);let i=fa();return this.ws.forEachInRange([n,r],e=>{i=i.add(e.key)}),i}containsKey(e){const t=new kl(e,0),n=this.fs.firstAfterOrEqual(t);return null!==n&&e.isEqual(n.key)}}class kl{constructor(e,t){this.key=e,this.As=t}static ds(e,t){return ui.comparator(e.key,t.key)||ei(e.As,t.As)}static _s(e,t){return ei(e.As,t.As)||ui.comparator(e.key,t.key)}}class Al{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.vs=1,this.Rs=new ws(kl.ds)}checkEmpty(e){return Ii.resolve(0===this.mutationQueue.length)}addMutationBatch(e,t,n,r){const i=this.vs;
2this.vs++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const s=new Ha(i,t,n,r);this.mutationQueue.push(s);for(const t of r)this.Rs=this.Rs.add(new kl(t.key,i)),this.indexManager.addToCollectionParentIndex(e,t.key.path.popLast());return Ii.resolve(s)}lookupMutationBatch(e,t){return Ii.resolve(this.Ps(t))}getNextMutationBatchAfterBatchId(e,t){const n=t+1,r=this.bs(n),i=r<0?0:r;return Ii.resolve(this.mutationQueue.length>i?this.mutationQueue[i]:null)}getHighestUnacknowledgedBatchId(){return Ii.resolve(0===this.mutationQueue.length?-1:this.vs-1)}getAllMutationBatches(e){return Ii.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const n=new kl(t,0),r=new kl(t,Number.POSITIVE_INFINITY),i=[];return this.Rs.forEachInRange([n,r],e=>{const t=this.Ps(e.As);i.push(t)}),Ii.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(e,t){let n=new ws(ei);return t.forEach(e=>{const t=new kl(e,0),r=new kl(e,Number.POSITIVE_INFINITY);this.Rs.forEachInRange([t,r],e=>{n=n.add(e.As)})}),Ii.resolve(this.Vs(n))}getAllMutationBatchesAffectingQuery(e,t){const n=t.path,r=n.length+1;let i=n;ui.isDocumentKey(i)||(i=i.child(""));const s=new kl(new ui(i),0);let o=new ws(ei);return this.Rs.forEachWhile(e=>{const t=e.key.path;return!!n.isPrefixOf(t)&&(t.length===r&&(o=o.add(e.As)),!0)},s),Ii.resolve(this.Vs(o))}Vs(e){const t=[];return e.forEach(e=>{const n=this.Ps(e);null!==n&&t.push(n)}),t}removeMutationBatch(e,t){jr(0===this.Ss(t.batchId,"removed")),this.mutationQueue.shift();let n=this.Rs;return Ii.forEach(t.mutations,r=>{const i=new kl(r.key,t.batchId);return n=n.delete(i),this.referenceDelegate.markPotentiallyOrphaned(e,r.key)}).next(()=>{this.Rs=n})}Cn(e){}containsKey(e,t){const n=new kl(t,0),r=this.Rs.firstAfterOrEqual(n);return Ii.resolve(t.isEqual(r&&r.key))}performConsistencyCheck(e){return this.mutationQueue.length,Ii.resolve()}Ss(e,t){return this.bs(e)}bs(e){return 0===this.mutationQueue.length?0:e-this.mutationQueue[0].batchId}Ps(e){const t=this.bs(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}class Cl{constructor(e){this.Ds=e,this.docs=new ms(ui.comparator),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const n=t.key,r=this.docs.get(n),i=r?r.size:0,s=this.Ds(t);return this.docs=this.docs.insert(n,{document:t.mutableCopy(),size:s}),this.size+=s-i,this.indexManager.addToCollectionParentIndex(e,n.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const n=this.docs.get(t);return Ii.resolve(n?n.document.mutableCopy():io.newInvalidDocument(t))}getEntries(e,t){let n=ia();return t.forEach(e=>{const t=this.docs.get(e);n=n.insert(e,t?t.document.mutableCopy():io.newInvalidDocument(e))}),Ii.resolve(n)}getDocumentsMatchingQuery(e,t,n,r){let i=ia();const s=t.path,o=new ui(s.child("")),a=this.docs.getIteratorFrom(o);for(;a.hasNext();){const{key:e,value:{document:o}}=a.getNext();if(!s.isPrefixOf(e.path))break;e.path.length>s.length+1||yi(mi(o),n)<=0||(r.has(o.key)||Jo(t,o))&&(i=i.insert(o.key,o.mutableCopy()))}return Ii.resolve(i)}getAllFromCollectionGroup(e,t,n,r){Fr()}Cs(e,t){return Ii.forEach(this.docs,e=>t(e))}newChangeBuffer(e){return new xl(this)}getSize(e){return Ii.resolve(this.size)}}class xl extends dl{constructor(e){super(),this.os=e}applyChanges(e){const t=[];
vendor: 4,465 bytes, line 2
2return this.changes.forEach((n,r)=>{r.isValidDocument()?t.push(this.os.addEntry(e,r)):this.os.removeEntry(n)}),Ii.waitFor(t)}getFromCache(e,t){return this.os.getEntry(e,t)}getAllFromCache(e,t){return this.os.getEntries(e,t)}}class Ol{constructor(e){this.persistence=e,this.xs=new na(e=>No(e),Ro),this.lastRemoteSnapshotVersion=ii.min(),this.highestTargetId=0,this.Ns=0,this.ks=new Sl,this.targetCount=0,this.Ms=tl.kn()}forEachTarget(e,t){return this.xs.forEach((e,n)=>t(n)),Ii.resolve()}getLastRemoteSnapshotVersion(e){return Ii.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return Ii.resolve(this.Ns)}allocateTargetId(e){return this.highestTargetId=this.Ms.next(),Ii.resolve(this.highestTargetId)}setTargetsMetadata(e,t,n){return n&&(this.lastRemoteSnapshotVersion=n),t>this.Ns&&(this.Ns=t),Ii.resolve()}Fn(e){this.xs.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.Ms=new tl(t),this.highestTargetId=t),e.sequenceNumber>this.Ns&&(this.Ns=e.sequenceNumber)}addTargetData(e,t){return this.Fn(t),this.targetCount+=1,Ii.resolve()}updateTargetData(e,t){return this.Fn(t),Ii.resolve()}removeTargetData(e,t){return this.xs.delete(t.target),this.ks.Is(t.targetId),this.targetCount-=1,Ii.resolve()}removeTargets(e,t,n){let r=0;const i=[];return this.xs.forEach((s,o)=>{o.sequenceNumber<=t&&null===n.get(o.targetId)&&(this.xs.delete(s),i.push(this.removeMatchingKeysForTargetId(e,o.targetId)),r++)}),Ii.waitFor(i).next(()=>r)}getTargetCount(e){return Ii.resolve(this.targetCount)}getTargetData(e,t){const n=this.xs.get(t)||null;return Ii.resolve(n)}addMatchingKeys(e,t,n){return this.ks.gs(t,n),Ii.resolve()}removeMatchingKeys(e,t,n){this.ks.ps(t,n);const r=this.persistence.referenceDelegate,i=[];return r&&t.forEach(t=>{i.push(r.markPotentiallyOrphaned(e,t))}),Ii.waitFor(i)}removeMatchingKeysForTargetId(e,t){return this.ks.Is(t),Ii.resolve()}getMatchingKeysForTargetId(e,t){const n=this.ks.Es(t);return Ii.resolve(n)}containsKey(e,t){return Ii.resolve(this.ks.containsKey(t))}}class Dl{constructor(e,t){this.$s={},this.overlays={},this.Os=new Pi(0),this.Fs=!1,this.Fs=!0,this.referenceDelegate=e(this),this.Bs=new Ol(this),this.indexManager=new Fu,this.remoteDocumentCache=function(e){return new Cl(e)}(e=>this.referenceDelegate.Ls(e)),this.serializer=new eu(t),this.qs=new El(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.Fs=!1,Promise.resolve()}get started(){return this.Fs}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new Tl,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let n=this.$s[e.toKey()];return n||(n=new Al(t,this.referenceDelegate),this.$s[e.toKey()]=n),n}getTargetCache(){return this.Bs}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.qs}runTransaction(e,t,n){Rr("MemoryPersistence","Starting transaction:",e);const r=new Nl(this.Os.next());return this.referenceDelegate.Us(),n(r).next(e=>this.referenceDelegate.Ks(r).next(()=>e)).toPromise().then(e=>(r.raiseOnCommittedEvent(),e))}Gs(e,t){return Ii.or(Object.values(this.$s).map(n=>()=>n.containsKey(e,t)))}}class Nl extends bi{constructor(e){super(),this.currentSequenceNumber=e}}class Rl{constructor(e){this.persistence=e,this.Qs=new Sl,this.js=null}static zs(e){return new Rl(e)}get Ws(){if(this.js)return this.js;throw Fr()}addReference(e,t,n){return this.Qs.addReference(n,t),this.Ws.delete(n.toString()),Ii.resolve()}removeReference(e,t,n){return this.Qs.removeReference(n,t),this.Ws.add(n.toString()),Ii.resolve()}markPotentiallyOrphaned(e,t){return this.Ws.add(t.toString()),Ii.resolve()}removeTarget(e,t){this.Qs.Is(t.targetId).forEach(e=>this.Ws.add(e.toString()));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(e,t.targetId).next(e=>{e.forEach(e=>this.Ws.add(e.toString()))}).next(()=>n.removeTargetData(e,t))}Us(){this.js=new Set}Ks(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return Ii.forEach(this.Ws,n=>{const r=ui.fromPath(n);return this.Hs(e,r).next(e=>{e||t.removeEntry(r,ii.min())})}).next(()=>(this.js=null,t.apply(e)))}updateLimboDocument(e,t){return this.Hs(e,t).next(e=>{e?this.Ws.delete(t.toString()):this.Ws.add(t.toString())})}Ls(e){return 0}Hs(e,t){return Ii.or([()=>Ii.resolve(this.Qs.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.Gs(e,t)])}}
2class Pl{constructor(e){this.serializer=e}O(e,t,n,r){const i=new Ei("createOrUpgrade",t);n<1&&r>=1&&(function(e){e.createObjectStore("owner")}(e),function(e){e.createObjectStore("mutationQueues",{keyPath:"userId"}),e.createObjectStore("mutations",{keyPath:"batchId",autoIncrement:!0}).createIndex("userMutationsIndex",qi,{unique:!0}),e.createObjectStore("documentMutations")}(e),Ll(e),function(e){e.createObjectStore("remoteDocuments")}(e));let s=Ii.resolve();return n<3&&r>=3&&(0!==n&&(function(e){e.deleteObjectStore("targetDocuments"),e.deleteObjectStore("targets"),e.deleteObjectStore("targetGlobal")}(e),Ll(e)),s=s.next(()=>function(e){const t=e.store("targetGlobal"),n={highestTargetId:0,highestListenSequenceNumber:0,lastRemoteSnapshotVersion:ii.min().toTimestamp(),targetCount:0};return t.put("targetGlobalKey",n)}(i))),n<4&&r>=4&&(0!==n&&(s=s.next(()=>function(e,t){return t.store("mutations").j().next(n=>{e.deleteObjectStore("mutations"),e.createObjectStore("mutations",{keyPath:"batchId",autoIncrement:!0}).createIndex("userMutationsIndex",qi,{unique:!0});const r=t.store("mutations"),i=n.map(e=>r.put(e));return Ii.waitFor(i)})}(e,i))),s=s.next(()=>{!function(e){e.createObjectStore("clientMetadata",{keyPath:"clientId"})}(e)})),n<5&&r>=5&&(s=s.next(()=>this.Ys(i))),n<6&&r>=6&&(s=s.next(()=>(function(e){e.createObjectStore("remoteDocumentGlobal")}(e),this.Xs(i)))),n<7&&r>=7&&(s=s.next(()=>this.Zs(i))),n<8&&r>=8&&(s=s.next(()=>this.ti(e,i))),n<9&&r>=9&&(s=s.next(()=>{!function(e){e.objectStoreNames.contains("remoteDocumentChanges")&&e.deleteObjectStore("remoteDocumentChanges")}(e)})),n<10&&r>=10&&(s=s.next(()=>this.ei(i))),n<11&&r>=11&&(s=s.next(()=>{!function(e){e.createObjectStore("bundles",{keyPath:"bundleId"})}(e),function(e){e.createObjectStore("namedQueries",{keyPath:"name"})}(e)})),n<12&&r>=12&&(s=s.next(()=>{!function(e){const t=e.createObjectStore("documentOverlays",{keyPath:rs});t.createIndex("collectionPathOverlayIndex",is,{unique:!1}),t.createIndex("collectionGroupOverlayIndex",ss,{unique:!1})}(e)})),n<13&&r>=13&&(s=s.next(()=>function(e){const t=e.createObjectStore("remoteDocumentsV14",{keyPath:Ki});t.createIndex("documentKeyIndex",Wi),t.createIndex("collectionGroupIndex",Hi)}(e)).next(()=>this.ni(e,i)).next(()=>e.deleteObjectStore("remoteDocuments"))),n<14&&r>=14&&(s=s.next(()=>this.si(e,i))),n<15&&r>=15&&(s=s.next(()=>function(e){e.createObjectStore("indexConfiguration",{keyPath:"indexId",autoIncrement:!0}).createIndex("collectionGroupIndex","collectionGroup",{unique:!1}),e.createObjectStore("indexState",{keyPath:Zi}).createIndex("sequenceNumberIndex",es,{unique:!1}),e.createObjectStore("indexEntries",{keyPath:ts}).createIndex("documentKeyIndex",ns,{unique:!1})}(e))),s}Xs(e){let t=0;return e.store("remoteDocuments").X((e,n)=>{t+=Qu(n)}).next(()=>{const n={byteSize:t};return e.store("remoteDocumentGlobal").put("remoteDocumentGlobalKey",n)})}Ys(e){const t=e.store("mutationQueues"),n=e.store("mutations");return t.j().next(t=>Ii.forEach(t,t=>{const r=IDBKeyRange.bound([t.userId,-1],[t.userId,t.lastAcknowledgedBatchId]);return n.j("userMutationsIndex",r).next(n=>Ii.forEach(n,n=>{jr(n.userId===t.userId);const r=su(this.serializer,n);return Hu(e,t.userId,r).next(()=>{})}))}))}Zs(e){const t=e.store("targetDocuments"),n=e.store("remoteDocuments");return e.store("targetGlobal").get("targetGlobalKey").next(e=>{const r=[];return n.X((n,i)=>{const s=new oi(n),o=function(e){return[0,ji(e)]}(s);r.push(t.get(o).next(n=>n?Ii.resolve():(n=>t.put({targetId:0,path:ji(n),sequenceNumber:e.highestListenSequenceNumber}))(s)))}).next(()=>Ii.waitFor(r))})}ti(e,t){e.createObjectStore("collectionParents",{keyPath:Ji});const n=t.store("collectionParents"),r=new ju,i=e=>{if(r.add(e)){const t=e.lastSegment(),r=e.popLast();return n.put({collectionId:t,parent:ji(r)})}};return t.store("remoteDocuments").X({Y:!0},(e,t)=>{const n=new oi(e);return i(n.popLast())}).next(()=>t.store("documentMutations").X({Y:!0},([e,t,n],r)=>{const s=Bi(t);return i(s.popLast())}))}ei(e){const t=e.store("targets");return t.X((e,n)=>{const r=ou(n),i=au(this.serializer,r);return t.put(i)})}ni(e,t){const n=t.store("remoteDocuments"),r=[];return n.X((e,n)=>{const i=t.store("remoteDocumentsV14"),s=(o=n,o.document?new ui(oi.fromString(o.document.name).popFirst(5)):o.noDocument?ui.fromSegments(o.noDocument.path):o.unknownDocument?ui.fromSegments(o.unknownDocument.path):Fr()).path.toArray();var o;const a={prefixPath:s.slice(0,s.length-2),collectionGroup:s[s.length-2],documentId:s[s.length-1],readTime:n.readTime||[0,0],unknownDocument:n.unknownDocument,noDocument:n.noDocument,document:n.document,hasCommittedMutations:!!n.hasCommittedMutations};r.push(i.put(a))}).next(()=>Ii.waitFor(r))}si(e,t){const n=t.store("mutations"),r=pl(this.serializer),i=new Dl(Rl.zs,this.serializer.fe);return n.j().next(e=>{const n=new Map;
2return e.forEach(e=>{var t;let r=null!==(t=n.get(e.userId))&&void 0!==t?t:fa();su(this.serializer,e).keys().forEach(e=>r=r.add(e)),n.set(e.userId,r)}),Ii.forEach(n,(e,n)=>{const s=new Cr(n),o=gu.de(this.serializer,s),a=i.getIndexManager(s),c=Yu.de(s,this.serializer,a,i.referenceDelegate);return new Il(r,c,o,a).recalculateAndSaveOverlaysForDocumentKeys(new hs(t,Pi.ct),e).next()})})}}function Ll(e){e.createObjectStore("targetDocuments",{keyPath:Yi}).createIndex("documentTargetsIndex",Xi,{unique:!0}),e.createObjectStore("targets",{keyPath:"targetId"}).createIndex("queryTargetsIndex",Qi,{unique:!0}),e.createObjectStore("targetGlobal")}const Ml="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.";class Fl{constructor(e,t,n,r,i,s,o,a,c,u,l=15){if(this.allowTabSynchronization=e,this.persistenceKey=t,this.clientId=n,this.ii=i,this.window=s,this.document=o,this.ri=c,this.oi=u,this.ui=l,this.Os=null,this.Fs=!1,this.isPrimary=!1,this.networkEnabled=!0,this.ci=null,this.inForeground=!1,this.ai=null,this.hi=null,this.li=Number.NEGATIVE_INFINITY,this.fi=e=>Promise.resolve(),!Fl.D())throw new qr(Br.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new ll(this,r),this.di=t+"main",this.serializer=new eu(a),this.wi=new Ti(this.di,this.ui,new Pl(this.serializer)),this.Bs=new nl(this.referenceDelegate,this.serializer),this.remoteDocumentCache=pl(this.serializer),this.qs=new du,this.window&&this.window.localStorage?this._i=this.window.localStorage:(this._i=null,!1===u&&Pr("IndexedDbPersistence","LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}start(){return this.mi().then(()=>{if(!this.isPrimary&&!this.allowTabSynchronization)throw new qr(Br.FAILED_PRECONDITION,Ml);return this.gi(),this.yi(),this.pi(),this.runTransaction("getHighestListenSequenceNumber","readonly",e=>this.Bs.getHighestSequenceNumber(e))}).then(e=>{this.Os=new Pi(e,this.ri)}).then(()=>{this.Fs=!0}).catch(e=>(this.wi&&this.wi.close(),Promise.reject(e)))}Ii(e){return this.fi=async t=>{if(this.started)return e(t)},e(this.isPrimary)}setDatabaseDeletedListener(e){this.wi.B(async t=>{null===t.newVersion&&await e()})}setNetworkEnabled(e){this.networkEnabled!==e&&(this.networkEnabled=e,this.ii.enqueueAndForget(async()=>{this.started&&await this.mi()}))}mi(){return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",e=>Ul(e).put({clientId:this.clientId,updateTimeMs:Date.now(),networkEnabled:this.networkEnabled,inForeground:this.inForeground}).next(()=>{if(this.isPrimary)return this.Ti(e).next(e=>{e||(this.isPrimary=!1,this.ii.enqueueRetryable(()=>this.fi(!1)))})}).next(()=>this.Ei(e)).next(t=>this.isPrimary&&!t?this.Ai(e).next(()=>!1):!!t&&this.vi(e).next(()=>!0))).catch(e=>{if(Ai(e))return Rr("IndexedDbPersistence","Failed to extend owner lease: ",e),this.isPrimary;if(!this.allowTabSynchronization)throw e;return Rr("IndexedDbPersistence","Releasing owner lease after error during lease refresh",e),!1}).then(e=>{this.isPrimary!==e&&this.ii.enqueueRetryable(()=>this.fi(e)),this.isPrimary=e})}Ti(e){return jl(e).get("owner").next(e=>Ii.resolve(this.Ri(e)))}Pi(e){return Ul(e).delete(this.clientId)}async bi(){if(this.isPrimary&&!this.Vi(this.li,18e5)){this.li=Date.now();const e=await this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",e=>{const t=ds(e,"clientMetadata");return t.j().next(e=>{const n=this.Si(e,18e5),r=e.filter(e=>-1===n.indexOf(e));return Ii.forEach(r,e=>t.delete(e.clientId)).next(()=>r)})}).catch(()=>[]);if(this._i)for(const t of e)this._i.removeItem(this.Di(t.clientId))}}pi(){this.hi=this.ii.enqueueAfterDelay("client_metadata_refresh",4e3,()=>this.mi().then(()=>this.bi()).then(()=>this.pi()))}Ri(e){return!!e&&e.ownerId===this.clientId}Ei(e){return this.oi?Ii.resolve(!0):jl(e).get("owner").next(t=>
2{if(null!==t&&this.Vi(t.leaseTimestampMs,5e3)&&!this.Ci(t.ownerId)){if(this.Ri(t)&&this.networkEnabled)return!0;if(!this.Ri(t)){if(!t.allowTabSynchronization)throw new qr(Br.FAILED_PRECONDITION,Ml);return!1}}return!(!this.networkEnabled||!this.inForeground)||Ul(e).j().next(e=>void 0===this.Si(e,5e3).find(e=>{if(this.clientId!==e.clientId){const t=!this.networkEnabled&&e.networkEnabled,n=!this.inForeground&&e.inForeground,r=this.networkEnabled===e.networkEnabled;if(t||n&&r)return!0}return!1}))}).next(e=>(this.isPrimary!==e&&Rr("IndexedDbPersistence",`Client ${e?"is":"is not"} eligible for a primary lease.`),e))}async shutdown(){this.Fs=!1,this.xi(),this.hi&&(this.hi.cancel(),this.hi=null),this.Ni(),this.ki(),await this.wi.runTransaction("shutdown","readwrite",["owner","clientMetadata"],e=>{const t=new hs(e,Pi.ct);return this.Ai(t).next(()=>this.Pi(t))}),this.wi.close(),this.Mi()}Si(e,t){return e.filter(e=>this.Vi(e.updateTimeMs,t)&&!this.Ci(e.clientId))}$i(){return this.runTransaction("getActiveClients","readonly",e=>Ul(e).j().next(e=>this.Si(e,18e5).map(e=>e.clientId)))}get started(){return this.Fs}getMutationQueue(e,t){return Yu.de(e,this.serializer,t,this.referenceDelegate)}getTargetCache(){return this.Bs}getRemoteDocumentCache(){return this.remoteDocumentCache}getIndexManager(e){return new Vu(e,this.serializer.fe.databaseId)}getDocumentOverlayCache(e){return gu.de(this.serializer,e)}getBundleCache(){return this.qs}runTransaction(e,t,n){Rr("IndexedDbPersistence","Starting transaction:",e);const r="readonly"===t?"readonly":"readwrite",i=15===(s=this.ui)?ls:14===s?us:13===s?cs:12===s?as:11===s?os:void Fr();var s;let o;return this.wi.runTransaction(e,r,i,r=>(o=new hs(r,this.Os?this.Os.next():Pi.ct),"readwrite-primary"===t?this.Ti(o).next(e=>!!e||this.Ei(o)).next(t=>{if(!t)throw Pr(`Failed to obtain primary lease for action '${e}'.`),this.isPrimary=!1,this.ii.enqueueRetryable(()=>this.fi(!1)),new qr(Br.FAILED_PRECONDITION,wi);return n(o)}).next(e=>this.vi(o).next(()=>e)):this.Oi(o).next(()=>n(o)))).then(e=>(o.raiseOnCommittedEvent(),e))}Oi(e){return jl(e).get("owner").next(e=>{if(null!==e&&this.Vi(e.leaseTimestampMs,5e3)&&!this.Ci(e.ownerId)&&!this.Ri(e)&&!(this.oi||this.allowTabSynchronization&&e.allowTabSynchronization))throw new qr(Br.FAILED_PRECONDITION,Ml)})}vi(e){const t={ownerId:this.clientId,allowTabSynchronization:this.allowTabSynchronization,leaseTimestampMs:Date.now()};return jl(e).put("owner",t)}static D(){return Ti.D()}Ai(e){const t=jl(e);return t.get("owner").next(e=>this.Ri(e)?(Rr("IndexedDbPersistence","Releasing primary lease."),t.delete("owner")):Ii.resolve())}Vi(e,t){const n=Date.now();return!(e<n-t||e>n&&(Pr(`Detected an update time that is in the future: ${e} > ${n}`),1))}gi(){null!==this.document&&"function"==typeof this.document.addEventListener&&(this.ai=()=>{this.ii.enqueueAndForget(()=>(this.inForeground="visible"===this.document.visibilityState,this.mi()))},this.document.addEventListener("visibilitychange",this.ai),this.inForeground="visible"===this.document.visibilityState)}Ni(){this.ai&&(this.document.removeEventListener("visibilitychange",this.ai),this.ai=null)}yi(){var e;"function"==typeof(null===(e=this.window)||void 0===e?void 0:e.addEventListener)&&(this.ci=()=>{this.xi();const e=/(?:Version|Mobile)\/1[456]/;(0,a.nr)()&&(navigator.appVersion.match(e)||navigator.userAgent.match(e))&&this.ii.enterRestrictedMode(!0),this.ii.enqueueAndForget(()=>this.shutdown())},this.window.addEventListener("pagehide",this.ci))}ki(){this.ci&&(this.window.removeEventListener("pagehide",this.ci),this.ci=null)}Ci(e){var t;try{const n=null!==(null===(t=this._i)||void 0===t?void 0:t.getItem(this.Di(e)));return Rr("IndexedDbPersistence",`Client '${e}' ${n?"is":"is not"} zombied in LocalStorage`),n}catch(e){return Pr("IndexedDbPersistence","Failed to get zombied client id.",e),!1}}xi(){if(this._i)try{this._i.setItem(this.Di(this.clientId),String(Date.now()))}catch(e){Pr("Failed to set zombie client id.",e)}}Mi(){if(this._i)try{this._i.removeItem(this.Di(this.clientId))}catch(e){}}Di(e){return`firestore_zombie_${this.persistenceKey}_${e}`}}function jl(e){return ds(e,"owner")}function Ul(e){return ds(e,"clientMetadata")}function Vl(e,t){let n=e.projectId;return e.isDefaultDatabase||(n+="."+e.database),"firestore/"+t+"/"+n+"/"}class Bl{constructor(e,t,n,r){this.targetId=e,this.fromCache=t,this.Fi=n,this.Bi=r}static Li(e,t){let n=fa(),r=fa();for(const e of t.docChanges)switch(e.type){case 0:n=n.add(e.doc.key);break;case 1:r=r.add(e.doc.key)}return new Bl(e,t.fromCache,n,r)}}class ql{constructor(){this.qi=!1}initialize(e,t){this.Ui=e,this.indexManager=t,this.qi=!0}getDocumentsMatchingQuery(e,t,n,r){return this.Ki(e,t).next(i=>i||this.Gi(e,t,r,n)).next(n=>n||this.Qi(e,t))}Ki(e,t){if(Bo(t))return Ii.resolve(null);let n=Ko(t);return this.indexManager.getIndexType(e,n).next(r=>0===r?null:(null!==t.limit&&1===r&&(t=Ho(t,null,"F"),n=Ko(t)),this.indexManager.getDocumentsMatchingTarget(e,n).next(r=>{const i=fa(...r);return this.Ui.getDocuments(e,i).next(r=>this.indexManager.getMinOffset(e,n).next(n=>{const s=this.ji(t,r);return this.zi(t,s,i,n.readTime)?this.Ki(e,Ho(t,null,"F")):this.Wi(e,s,t,n)}))})))}Gi(e,t,n,r){return Bo(t)||r.isEqual(ii.min())?this.Qi(e,t):this.Ui.getDocuments(e,n).next(i=>{const s=this.ji(t,i);return this.zi(t,s,n,r)?this.Qi(e,t):(Dr()<=o.$b.DEBUG&&Rr("QueryEngine","Re-using previous result from %s to execute query: %s",r.toString(),Xo(t)),this.Wi(e,s,t,gi(r,-1)))})}ji(e,t){let n=new ws(ea(e));return t.forEach((t,r)=>{Jo(e,r)&&(n=n.add(r))}),n}zi(e,t,n,r){if(null===e.limit)return!1;if(n.size!==t.size)return!0;const i="F"===e.limitType?t.last():t.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(r)>0)}Qi(e,t){return Dr()<=o.$b.DEBUG&&Rr("QueryEngine","Using full collection scan to execute query:",Xo(t)),this.Ui.getDocumentsMatchingQuery(e,t,vi.min())}Wi(e,t,n,r){return this.Ui.getDocumentsMatchingQuery(e,n,r).next(e=>(t.forEach(t=>{e=e.insert(t.key,t)}),e))}}class zl{constructor(e,t,n,r){this.persistence=e,this.Hi=t,this.serializer
2=r,this.Ji=new ms(ei),this.Yi=new na(e=>No(e),Ro),this.Xi=new Map,this.Zi=e.getRemoteDocumentCache(),this.Bs=e.getTargetCache(),this.qs=e.getBundleCache(),this.tr(n)}tr(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new Il(this.Zi,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Zi.setIndexManager(this.indexManager),this.Hi.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.Ji))}}function $l(e,t,n,r){return new zl(e,t,n,r)}async function Gl(e,t){const n=Vr(e);return await n.persistence.runTransaction("Handle user change","readonly",e=>{let r;return n.mutationQueue.getAllMutationBatches(e).next(i=>(r=i,n.tr(t),n.mutationQueue.getAllMutationBatches(e))).next(t=>{const i=[],s=[];let o=fa();for(const e of r){i.push(e.batchId);for(const t of e.mutations)o=o.add(t.key)}for(const e of t){s.push(e.batchId);for(const t of e.mutations)o=o.add(t.key)}return n.localDocuments.getDocuments(e,o).next(e=>({er:e,removedBatchIds:i,addedBatchIds:s}))})})}function Kl(e){const t=Vr(e);return t.persistence.runTransaction("Get last remote snapshot version","readonly",e=>t.Bs.getLastRemoteSnapshotVersion(e))}function Wl(e,t,n){let r=fa(),i=fa();return n.forEach(e=>r=r.add(e)),t.getEntries(e,r).next(e=>{let r=ia();return n.forEach((n,s)=>{const o=e.get(n);s.isFoundDocument()!==o.isFoundDocument()&&(i=i.add(n)),s.isNoDocument()&&s.version.isEqual(ii.min())?(t.removeEntry(n,s.readTime),r=r.insert(n,s)):!o.isValidDocument()||s.version.compareTo(o.version)>0||0===s.version.compareTo(o.version)&&o.hasPendingWrites?(t.addEntry(s),r=r.insert(n,s)):Rr("LocalStore","Ignoring outdated watch update for ",n,". Current version:",o.version," Watch version:",s.version)}),{nr:r,sr:i}})}function Hl(e,t){const n=Vr(e);return n.persistence.runTransaction("Get next mutation batch","readonly",e=>(void 0===t&&(t=-1),n.mutationQueue.getNextMutationBatchAfterBatchId(e,t)))}function Ql(e,t){const n=Vr(e);return n.persistence.runTransaction("Allocate target","readwrite",e=>{let r;return n.Bs.getTargetData(e,t).next(i=>i?(r=i,Ii.resolve(r)):n.Bs.allocateTargetId(e).next(i=>(r=new Zc(t,i,"TargetPurposeListen",e.currentSequenceNumber),n.Bs.addTargetData(e,r).next(()=>r))))}).then(e=>{const r=n.Ji.get(e.targetId);return(null===r||e.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(n.Ji=n.Ji.insert(e.targetId,e),n.Yi.set(t,e.targetId)),e})}async function Yl(e,t,n){const r=Vr(e),i=r.Ji.get(t),s=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",s,e=>r.persistence.referenceDelegate.removeTarget(e,i))}catch(e){if(!Ai(e))throw e;Rr("LocalStore",`Failed to update sequence numbers for target ${t}: ${e}`)}r.Ji=r.Ji.remove(t),r.Yi.delete(i.target)}function Xl(e,t,n){const r=Vr(e);let i=ii.min(),s=fa();return r.persistence.runTransaction("Execute query","readonly",e=>function(e,t,n){const r=Vr(e),i=r.Yi.get(n);return void 0!==i?Ii.resolve(r.Ji.get(i)):r.Bs.getTargetData(t,n)}(r,e,Ko(t)).next(t=>{if(t)return i=t.lastLimboFreeSnapshotVersion,r.Bs.getMatchingKeysForTargetId(e,t.targetId).next(e=>{s=e})}).next(()=>r.Hi.getDocumentsMatchingQuery(e,t,n?i:ii.min(),n?s:fa())).next(e=>(eh(r,Zo(t),e),{documents:e,ir:s})))}function Jl(e,t){const n=Vr(e),r=Vr(n.Bs),i=n.Ji.get(t);return i?Promise.resolve(i.target):n.persistence.runTransaction("Get target data","readonly",e=>r.le(e,t).next(e=>e?e.target:null))}function Zl(e,t){const n=Vr(e),r=n.Xi.get(t)||ii.min();return n.persistence.runTransaction("Get new document changes","readonly",e=>n.Zi.getAllFromCollectionGroup(e,t,gi(r,-1),Number.MAX_SAFE_INTEGER)).then(e=>(eh(n,t,e),e))}function eh(e,t,n){let r=e.Xi.get(t)||ii.min();n.forEach((e,t)=>{t.readTime.compareTo(r)>0&&(r=t.readTime)}),e.Xi.set(t,r)}async function th(e,t,n=fa()){const r=await Ql(e,Ko(cu(t.bundledQuery))),i=Vr(e);return i.persistence.runTransaction("Save named query","readwrite",e=>{const s=Cc(t.readTime);if(r.snapshotVersion.compareTo(s)>=0)return i.qs.saveNamedQuery(e,t);const o=r.withResumeToken(Ss.EMPTY_BYTE_STRING,s);return i.Ji=i.Ji.insert(o.targetId,o),i.Bs.updateTargetData(e,o).next(()=>i.Bs.removeMatchingKeysForTargetId(e,r.targetId)).next(()=>i.Bs.addMatchingKeys(e,n,r.targetId)).next(()=>i.qs.saveNamedQuery(e,t))})}function nh(e,t){return`firestore_clients_${e}_${t}`}function rh(e,t,n){let r=`firestore_mutations_${e}_${n}`;return t.isAuthenticated()&&(r+=`_${t.uid}`),r}function ih(e,t){return`firestore_targets_${e}_${t}`}class sh{constructor(e,t,n,r){this.user=e,this.batchId=t,this.state=n,this.error=r}static ar(e,t,n){const r=JSON.parse(n);let i,s="object"==typeof r&&-1!==["pending","acknowledged","rejected"].indexOf(r.state)&&(void 0===r.error||"object"==typeof r.error);return s&&r.error&&(s="string"==typeof r.error.message&&"string"==typeof r.error.code,s&&(i=new qr(r.error.code,r.error.message))),s?new sh(e,t,r.state,i):(Pr("SharedCl
2ientState",`Failed to parse mutation state for ID '${t}': ${n}`),null)}hr(){const e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}}class oh{constructor(e,t,n){this.targetId=e,this.state=t,this.error=n}static ar(e,t){const n=JSON.parse(t);let r,i="object"==typeof n&&-1!==["not-current","current","rejected"].indexOf(n.state)&&(void 0===n.error||"object"==typeof n.error);return i&&n.error&&(i="string"==typeof n.error.message&&"string"==typeof n.error.code,i&&(r=new qr(n.error.code,n.error.message))),i?new oh(e,n.state,r):(Pr("SharedClientState",`Failed to parse target state for ID '${e}': ${t}`),null)}hr(){const e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}}class ah{constructor(e,t){this.clientId=e,this.activeTargetIds=t}static ar(e,t){const n=JSON.parse(t);let r="object"==typeof n&&n.activeTargetIds instanceof Array,i=ga();for(let e=0;r&&e<n.activeTargetIds.length;++e)r=Fi(n.activeTargetIds[e]),i=i.add(n.activeTargetIds[e]);return r?new ah(e,i):(Pr("SharedClientState",`Failed to parse client data for instance '${e}': ${t}`),null)}}class ch{constructor(e,t){this.clientId=e,this.onlineState=t}static ar(e){const t=JSON.parse(e);return"object"==typeof t&&-1!==["Unknown","Online","Offline"].indexOf(t.onlineState)&&"string"==typeof t.clientId?new ch(t.clientId,t.onlineState):(Pr("SharedClientState",`Failed to parse online state: ${e}`),null)}}class uh{constructor(){this.activeTargetIds=ga()}lr(e){this.activeTargetIds=this.activeTargetIds.add(e)}dr(e){this.activeTargetIds=this.activeTargetIds.delete(e)}hr(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class lh{constructor(e,t,n,r,i){this.window=e,this.ii=t,this.persistenceKey=n,this.wr=r,this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null,this._r=this.mr.bind(this),this.gr=new ms(ei),this.started=!1,this.yr=[];const s=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=i,this.pr=nh(this.persistenceKey,this.wr),this.Ir=function(e){return`firestore_sequence_number_${e}`}(this.persistenceKey),this.gr=this.gr.insert(this.wr,new uh),this.Tr=new RegExp(`^firestore_clients_${s}_([^_]*)$`),this.Er=new RegExp(`^firestore_mutations_${s}_(\\d+)(?:_(.*))?$`),this.Ar=new RegExp(`^firestore_targets_${s}_(\\d+)$`),this.vr=function(e){return`firestore_online_state_${e}`}(this.persistenceKey),this.Rr=function(e){return`firestore_bundle_loaded_v2_${e}`}(this.persistenceKey),this.window.addEventListener("storage",this._r)}static D(e){return!(!e||!e.localStorage)}async start(){const e=await this.syncEngine.$i();for(const t of e){if(t===this.wr)continue;const e=this.getItem(nh(this.persistenceKey,t));if(e){const n=ah.ar(t,e);n&&(this.gr=this.gr.insert(n.clientId,n))}}this.Pr();const t=this.storage.getItem(this.vr);if(t){const e=this.br(t);e&&this.Vr(e)}for(const e of this.yr)this.mr(e);this.yr=[],this.window.addEventListener("pagehide",()=>this.shutdown()),this.started=!0}writeSequenceNumber(e){this.setItem(this.Ir,JSON.stringify(e))}getAllActiveQueryTargets(){return this.Sr(this.gr)}isActiveQueryTarget(e){let t=!1;return this.gr.forEach((n,r)=>{r.activeTargetIds.has(e)&&(t=!0)}),t}addPendingMutation(e){this.Dr(e,"pending")}updateMutationState(e,t,n){this.Dr(e,t,n),this.Cr(e)}addLocalQueryTarget(e){let t="not-current";if(this.isActiveQueryTarget(e)){const n=this.storage.getItem(ih(this.persistenceKey,e));if(n){const r=oh.ar(e,n);r&&(t=r.state)}}return this.Nr.lr(e),this.Pr(),t}removeLocalQueryTarget(e){this.Nr.dr(e),this.Pr()}isLocalQueryTarget(e){return this.Nr.activeTargetIds.has(e)}clearQueryState(e){this.removeItem(ih(this.persistenceKey,e))}updateQueryState(e,t,n){this.kr(e,t,n)}handleUserChange(e,t,n){t.forEach(e=>{this.Cr(e)}),this.currentUser=e,n.forEach(e=>{this.addPendingMutation(e)})}setOnlineState(e){this.Mr(e)}notifyBundleLoaded(e){this.$r(e)}shutdown(){this.started&&(this.window.removeEventListener("storage",this._r),this.removeItem(this.pr),this.started=!1)}getItem(e){const t=this.storage.getItem(e);
2return Rr("SharedClientState","READ",e,t),t}setItem(e,t){Rr("SharedClientState","SET",e,t),this.storage.setItem(e,t)}removeItem(e){Rr("SharedClientState","REMOVE",e),this.storage.removeItem(e)}mr(e){const t=e;if(t.storageArea===this.storage){if(Rr("SharedClientState","EVENT",t.key,t.newValue),t.key===this.pr)return void Pr("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.ii.enqueueRetryable(async()=>{if(this.started){if(null!==t.key)if(this.Tr.test(t.key)){if(null==t.newValue){const e=this.Or(t.key);return this.Fr(e,null)}{const e=this.Br(t.key,t.newValue);if(e)return this.Fr(e.clientId,e)}}else if(this.Er.test(t.key)){if(null!==t.newValue){const e=this.Lr(t.key,t.newValue);if(e)return this.qr(e)}}else if(this.Ar.test(t.key)){if(null!==t.newValue){const e=this.Ur(t.key,t.newValue);if(e)return this.Kr(e)}}else if(t.key===this.vr){if(null!==t.newValue){const e=this.br(t.newValue);if(e)return this.Vr(e)}}else if(t.key===this.Ir){const e=function(e){let t=Pi.ct;if(null!=e)try{const n=JSON.parse(e);jr("number"==typeof n),t=n}catch(e){Pr("SharedClientState","Failed to read sequence number from WebStorage",e)}return t}(t.newValue);e!==Pi.ct&&this.sequenceNumberHandler(e)}else if(t.key===this.Rr){const e=this.Gr(t.newValue);await Promise.all(e.map(e=>this.syncEngine.Qr(e)))}}else this.yr.push(t)})}}get Nr(){return this.gr.get(this.wr)}Pr(){this.setItem(this.pr,this.Nr.hr())}Dr(e,t,n){const r=new sh(this.currentUser,e,t,n),i=rh(this.persistenceKey,this.currentUser,e);this.setItem(i,r.hr())}Cr(e){const t=rh(this.persistenceKey,this.currentUser,e);this.removeItem(t)}Mr(e){const t={clientId:this.wr,onlineState:e};this.storage.setItem(this.vr,JSON.stringify(t))}kr(e,t,n){const r=ih(this.persistenceKey,e),i=new oh(e,t,n);this.setItem(r,i.hr())}$r(e){const t=JSON.stringify(Array.from(e));this.setItem(this.Rr,t)}Or(e){const t=this.Tr.exec(e);return t?t[1]:null}Br(e,t){const n=this.Or(e);return ah.ar(n,t)}Lr(e,t){const n=this.Er.exec(e),r=Number(n[1]),i=void 0!==n[2]?n[2]:null;return sh.ar(new Cr(i),r,t)}Ur(e,t){const n=this.Ar.exec(e),r=Number(n[1]);return oh.ar(r,t)}br(e){return ch.ar(e)}Gr(e){return JSON.parse(e)}async qr(e){if(e.user.uid===this.currentUser.uid)return this.syncEngine.jr(e.batchId,e.state,e.error);Rr("SharedClientState",`Ignoring mutation for non-active user ${e.user.uid}`)}Kr(e){return this.syncEngine.zr(e.targetId,e.state,e.error)}Fr(e,t){const n=t?this.gr.insert(e,t):this.gr.remove(e),r=this.Sr(this.gr),i=this.Sr(n),s=[],o=[];return i.forEach(e=>{r.has(e)||s.push(e)}),r.forEach(e=>{i.has(e)||o.push(e)}),this.syncEngine.Wr(s,o).then(()=>{this.gr=n})}Vr(e){this.gr.get(e.clientId)&&this.onlineStateHandler(e.onlineState)}Sr(e){let t=ga();return e.forEach((e,n)=>{t=t.unionWith(n.activeTargetIds)}),t}}class hh{constructor(){this.Hr=new uh,this.Jr={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,n){}addLocalQueryTarget(e){return this.Hr.lr(e),this.Jr[e]||"not-current"}updateQueryState(e,t,n){this.Jr[e]=t}removeLocalQueryTarget(e){this.Hr.dr(e)}isLocalQueryTarget(e){return this.Hr.activeTargetIds.has(e)}clearQueryState(e){delete this.Jr[e]}getAllActiveQueryTargets(){return this.Hr.activeTargetIds}isActiveQueryTarget(e){return this.Hr.activeTargetIds.has(e)}start(){return this.Hr=new uh,Promise.resolve()}handleUserChange(e,t,n){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}class dh{Yr(e){}shutdown(){}}class fh{constructor(){this.Xr=()=>this.Zr(),this.eo=()=>this.no(),this.so=[],this.io()}Yr(e){this.so.push(e)}shutdown(){window.removeEventListener("online",this.Xr),window.removeEventListener("offline",this.eo)}io(){window.addEventListener("online",this.Xr),window.addEventListener("offline",this.eo)}Zr(){Rr("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const e of this.so)e(0)}no(){Rr("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const e of this.so)e(1)}static D(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}let ph=null;function gh(){return null===ph?ph=268435456+Math.round(2147483648*Math.random()):ph++,"0x"+ph.toString(16)}const mh={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregation
2Query:"runAggregationQuery"};class vh{constructor(e){this.ro=e.ro,this.oo=e.oo}uo(e){this.co=e}ao(e){this.ho=e}onMessage(e){this.lo=e}close(){this.oo()}send(e){this.ro(e)}fo(){this.co()}wo(e){this.ho(e)}_o(e){this.lo(e)}}const yh="WebChannelConnection";class wh extends class{constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http";this.mo=t+"://"+e.host,this.yo="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}get po(){return!1}Io(e,t,n,r,i){const s=gh(),o=this.To(e,t);Rr("RestConnection",`Sending RPC '${e}' ${s}:`,o,n);const a={};return this.Eo(a,r,i),this.Ao(e,o,a,n).then(t=>(Rr("RestConnection",`Received RPC '${e}' ${s}: `,t),t),t=>{throw Lr("RestConnection",`RPC '${e}' ${s} failed with error: `,t,"url: ",o,"request:",n),t})}vo(e,t,n,r,i,s){return this.Io(e,t,n,r,i)}Eo(e,t,n){e["X-Goog-Api-Client"]="gl-js/ fire/"+xr,e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((t,n)=>e[n]=t),n&&n.headers.forEach((t,n)=>e[n]=t)}To(e,t){const n=mh[e];return`${this.mo}/v1/${t}:${n}`}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Ao(e,t,n,r){const i=gh();return new Promise((s,o)=>{const a=new Tr;a.setWithCredentials(!0),a.listenOnce(wr.COMPLETE,()=>{try{switch(a.getLastErrorCode()){case yr.NO_ERROR:const t=a.getResponseJson();Rr(yh,`XHR for RPC '${e}' ${i} received:`,JSON.stringify(t)),s(t);break;case yr.TIMEOUT:Rr(yh,`RPC '${e}' ${i} timed out`),o(new qr(Br.DEADLINE_EXCEEDED,"Request time out"));break;case yr.HTTP_ERROR:const n=a.getStatus();if(Rr(yh,`RPC '${e}' ${i} failed with status:`,n,"response text:",a.getResponseText()),n>0){let e=a.getResponseJson();Array.isArray(e)&&(e=e[0]);const t=null==e?void 0:e.error;if(t&&t.status&&t.message){const e=function(e){const t=e.toLowerCase().replace(/_/g,"-");return Object.values(Br).indexOf(t)>=0?t:Br.UNKNOWN}(t.status);o(new qr(e,t.message))}else o(new qr(Br.UNKNOWN,"Server responded with status "+a.getStatus()))}else o(new qr(Br.UNAVAILABLE,"Connection failed."));break;default:Fr()}}finally{Rr(yh,`RPC '${e}' ${i} completed.`)}});const c=JSON.stringify(r);Rr(yh,`RPC '${e}' ${i} sending request:`,r),a.send(t,"POST",c,n,15)})}Ro(e,t,n){const r=gh(),i=[this.mo,"/","google.firestore.v1.Firestore","/",e,"/channel"],s=mr(),o=vr(),a={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},c=this.longPollingOptions.timeoutSeconds;void 0!==c&&(a.longPollingTimeout=Math.round(1e3*c)),this.useFetchStreams&&(a.xmlHttpFactory=new Ir({})),this.Eo(a.initMessageHeaders,t,n),a.encodeInitMessageHeaders=!0;const u=i.join("");Rr(yh,`Creating RPC '${e}' stream ${r}: ${u}`,a);const l=s.createWebChannel(u,a);let h=!1,d=!1;const f=new vh({ro:t=>{d?Rr(yh,`Not sending because RPC '${e}' stream ${r} is closed:`,t):(h||(Rr(yh,`Opening RPC '${e}' stream ${r} transport.`),l.open(),h=!0),Rr(yh,`RPC '${e}' stream ${r} sending:`,t),l.send(t))},oo:()=>l.close()}),p=(e,t,n)=>{e.listen(t,e=>{try{n(e)}catch(e){setTimeout(()=>{throw e},0)}})};return p(l,Er.EventType.OPEN,()=>{d||Rr(yh,`RPC '${e}' stream ${r} transport opened.`)}),p(l,Er.EventType.CLOSE,()=>{d||(d=!0,Rr(yh,`RPC '${e}' stream ${r} transport closed`),f.wo())}),p(l,Er.EventType.ERROR,t=>{d||(d=!0,Lr(yh,`RPC '${e}' stream ${r} transport errored:`,t),f.wo(new qr(Br.UNAVAILABLE,"The operation could not be completed")))}),p(l,Er.EventType.MESSAGE,t=>{var n;if(!d){const i=t.data[0];jr(!!i);const s=i,o=s.error||(null===(n=s[0])||void 0===n?void 0:n.error);if(o){Rr(yh,`RPC '${e}' stream ${r} received error:`,o);const t=o.status;let n=function(e){const t=Za[e];if(void 0!==t)return nc(t)}(t),i=o.message;void 0===n&&(n=Br.INTERNAL,i="Unknown error status: "+t+" with message "+o.message),d=!0,f.wo(new qr(n,i)),l.close()}else Rr(yh,`RPC '${e}' stream ${r} received:`,i),f._o(i)}}),p(o,br.STAT_EVENT,t=>{t.stat===_r.PROXY?Rr(yh,`RPC '${e}' stream ${r} detected buffering proxy`):t.stat===_r.NOPROXY&&Rr(yh,`RPC '${e}' stream ${r} detected no buffering proxy`)}),setTimeout(()=>{f.fo()},0),f}}function bh(){return"undefined"!=typeof window?window:null}function _h(){return"undefined"!=typeof document?document:null}function Ih(e){return new Ec(e,!0)}class Eh{constructor(e,t,n=1e3,r=1.5,i=6e4){this.ii=e,this.timerId=t,this.Po=n,this.bo=r,this.Vo=i,this.So=0,this.Do=null,this.Co=Date.now(),this.reset()}reset(){this.So=0}xo(){this.So=this.Vo}No(e){this.cancel();const t=Math.floor(this.So+this.ko()),n=Math.max(0,Date.now()-this.Co),r=Math.max(0,t-n);r>0&&Rr("ExponentialBackoff",`Backing off for ${r} ms (base delay: ${this.So}
2 ms, delay with jitter: ${t} ms, last attempt: ${n} ms ago)`),this.Do=this.ii.enqueueAfterDelay(this.timerId,r,()=>(this.Co=Date.now(),e())),this.So*=this.bo,this.So<this.Po&&(this.So=this.Po),this.So>this.Vo&&(this.So=this.Vo)}Mo(){null!==this.Do&&(this.Do.skipDelay(),this.Do=null)}cancel(){null!==this.Do&&(this.Do.cancel(),this.Do=null)}ko(){return(Math.random()-.5)*this.So}}class Th{constructor(e,t,n,r,i,s,o,a){this.ii=e,this.$o=n,this.Oo=r,this.connection=i,this.authCredentialsProvider=s,this.appCheckCredentialsProvider=o,this.listener=a,this.state=0,this.Fo=0,this.Bo=null,this.Lo=null,this.stream=null,this.qo=new Eh(e,t)}Uo(){return 1===this.state||5===this.state||this.Ko()}Ko(){return 2===this.state||3===this.state}start(){4!==this.state?this.auth():this.Go()}async stop(){this.Uo()&&await this.close(0)}Qo(){this.state=0,this.qo.reset()}jo(){this.Ko()&&null===this.Bo&&(this.Bo=this.ii.enqueueAfterDelay(this.$o,6e4,()=>this.zo()))}Wo(e){this.Ho(),this.stream.send(e)}async zo(){if(this.Ko())return this.close(0)}Ho(){this.Bo&&(this.Bo.cancel(),this.Bo=null)}Jo(){this.Lo&&(this.Lo.cancel(),this.Lo=null)}async close(e,t){this.Ho(),this.Jo(),this.qo.cancel(),this.Fo++,4!==e?this.qo.reset():t&&t.code===Br.RESOURCE_EXHAUSTED?(Pr(t.toString()),Pr("Using maximum backoff delay to prevent overloading the backend."),this.qo.xo()):t&&t.code===Br.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this.Yo(),this.stream.close(),this.stream=null),this.state=e,await this.listener.ao(t)}Yo(){}auth(){this.state=1;const e=this.Xo(this.Fo),t=this.Fo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([e,n])=>{this.Fo===t&&this.Zo(e,n)},t=>{e(()=>{const e=new qr(Br.UNKNOWN,"Fetching auth token failed: "+t.message);return this.tu(e)})})}Zo(e,t){const n=this.Xo(this.Fo);this.stream=this.eu(e,t),this.stream.uo(()=>{n(()=>(this.state=2,this.Lo=this.ii.enqueueAfterDelay(this.Oo,1e4,()=>(this.Ko()&&(this.state=3),Promise.resolve())),this.listener.uo()))}),this.stream.ao(e=>{n(()=>this.tu(e))}),this.stream.onMessage(e=>{n(()=>this.onMessage(e))})}Go(){this.state=5,this.qo.No(async()=>{this.state=0,this.start()})}tu(e){return Rr("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}Xo(e){return t=>{this.ii.enqueueAndForget(()=>this.Fo===e?t():(Rr("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class Sh extends Th{constructor(e,t,n,r,i,s){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,n,r,s),this.serializer=i}eu(e,t){return this.connection.Ro("Listen",e,t)}onMessage(e){this.qo.reset();const t=function(e,t){let n;if("targetChange"in t){t.targetChange;const r=function(e){return"NO_CHANGE"===e?0:"ADD"===e?1:"REMOVE"===e?2:"CURRENT"===e?3:"RESET"===e?4:Fr()}(t.targetChange.targetChangeType||"NO_CHANGE"),i=t.targetChange.targetIds||[],s=function(e,t){return e.useProto3Json?(jr(void 0===t||"string"==typeof t),Ss.fromBase64String(t||"")):(jr(void 0===t||t instanceof Uint8Array),Ss.fromUint8Array(t||new Uint8Array))}(e,t.targetChange.resumeToken),o=t.targetChange.cause,a=o&&function(e){const t=void 0===e.code?Br.UNKNOWN:nc(e.code);return new qr(t,e.message||"")}(o);n=new gc(r,i,s,a||null)}else if("documentChange"in t){t.documentChange;const r=t.documentChange;r.document,r.document.name,r.document.updateTime;const i=Nc(e,r.document.name),s=Cc(r.document.updateTime),o=r.document.createTime?Cc(r.document.createTime):ii.min(),a=new no({mapValue:{fields:r.document.fields}}),c=io.newFoundDocument(i,s,o,a),u=r.targetIds||[],l=r.removedTargetIds||[];n=new fc(u,l,c.key,c)}else if("documentDelete"in t){t.documentDelete;const r=t.documentDelete;r.document;const i=Nc(e,r.document),s=r.readTime?Cc(r.readTime):ii.min(),o=io.newNoDocument(i,s),a=r.removedTargetIds||[];n=new fc([],a,o.key,o)}else if("documentRemove"in t){t.documentRemove;const r=t.documentRemove;r.document;const i=Nc(e,r.document),s=r.removedTargetIds||[];n=new fc([],s,i,null)}else{if(!("filter"in t))return Fr();{t.filter;const e=t.filter;e.targetId;const{count:r=0,unchangedNames:i}=e,s=new Ja(r,i),o=e.targetId;n=new pc(o,s)}}return n}(this.serializer,e),n=function(e){if(!("targetChange"in e))return ii.min();const t=e.targetChange;return t.targetIds&&t.targetIds.length?ii.min():t.readTime?Cc(t.readTime):ii.min()}(e);return this.listener.nu(t,n)}su(e){const t={};t.database=Lc(this.serializer),t.addTarget=function(e,t){let n;const r=t.target;if(n=Po(r)?{documents:Bc(e,r)}:{query:qc(e,r)},n.targetId=t.targetId,t.resumeToken.approximateByteSize()>0){n.resumeToken=kc(e,t.resumeToken);const r=Tc(e,t.expectedCount);null!==r&&(n.expectedCount=r)}else if(t.snapshotVersion.compareTo(ii.min())>0){n.readTime=Sc(e,t.snapshotVersion.toTimestamp());const r=Tc(e,t.expectedCount);null!==r&&(n.expectedCount=r)}return n}(this.serializer,e);const n=function(e,t){const n=function(e){switch(e){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return Fr()}}(t.purpose);return null==n?null:{"goog-listen-tags":n}}(this.serializer,e);n&&(t.labels=n),this.Wo(t)}iu(e){const t={};t.database=Lc(this.serializer),t.removeTarget=e,this.Wo(t)}}class kh extends Th{constructor(e,t,n,r,i,s){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,n,r,s
2),this.serializer=i,this.ru=!1}get ou(){return this.ru}start(){this.ru=!1,this.lastStreamToken=void 0,super.start()}Yo(){this.ru&&this.uu([])}eu(e,t){return this.connection.Ro("Write",e,t)}onMessage(e){if(jr(!!e.streamToken),this.lastStreamToken=e.streamToken,this.ru){this.qo.reset();const t=function(e,t){return e&&e.length>0?(jr(void 0!==t),e.map(e=>function(e,t){let n=e.updateTime?Cc(e.updateTime):Cc(t);return n.isEqual(ii.min())&&(n=Cc(t)),new Na(n,e.transformResults||[])}(e,t))):[]}(e.writeResults,e.commitTime),n=Cc(e.commitTime);return this.listener.cu(n,t)}return jr(!e.writeResults||0===e.writeResults.length),this.ru=!0,this.listener.au()}hu(){const e={};e.database=Lc(this.serializer),this.Wo(e)}uu(e){const t={streamToken:this.lastStreamToken,writes:e.map(e=>Uc(this.serializer,e))};this.Wo(t)}}class Ah extends class{}{constructor(e,t,n,r){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=n,this.serializer=r,this.lu=!1}fu(){if(this.lu)throw new qr(Br.FAILED_PRECONDITION,"The client has already been terminated.")}Io(e,t,n){return this.fu(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([r,i])=>this.connection.Io(e,t,n,r,i)).catch(e=>{throw"FirebaseError"===e.name?(e.code===Br.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new qr(Br.UNKNOWN,e.toString())})}vo(e,t,n,r){return this.fu(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([i,s])=>this.connection.vo(e,t,n,i,s,r)).catch(e=>{throw"FirebaseError"===e.name?(e.code===Br.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),e):new qr(Br.UNKNOWN,e.toString())})}terminate(){this.lu=!0}}class Ch{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.wu=0,this._u=null,this.mu=!0}gu(){0===this.wu&&(this.yu("Unknown"),this._u=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this._u=null,this.pu("Backend didn't respond within 10 seconds."),this.yu("Offline"),Promise.resolve())))}Iu(e){"Online"===this.state?this.yu("Unknown"):(this.wu++,this.wu>=1&&(this.Tu(),this.pu(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.yu("Offline")))}set(e){this.Tu(),this.wu=0,"Online"===e&&(this.mu=!1),this.yu(e)}yu(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}pu(e){const t=`Could not reach Cloud Firestore backend. ${e}\nThis typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.mu?(Pr(t),this.mu=!1):Rr("OnlineStateTracker",t)}Tu(){null!==this._u&&(this._u.cancel(),this._u=null)}}class xh{constructor(e,t,n,r,i){this.localStore=e,this.datastore=t,this.asyncQueue=n,this.remoteSyncer={},this.Eu=[],this.Au=new Map,this.vu=new Set,this.Ru=[],this.Pu=i,this.Pu.Yr(e=>{n.enqueueAndForget(async()=>{jh(this)&&(Rr("RemoteStore","Restarting streams for network reachability change."),await async function(e){const t=Vr(e);t.vu.add(4),await Dh(t),t.bu.set("Unknown"),t.vu.delete(4),await Oh(t)}(this))})}),this.bu=new Ch(n,r)}}async function Oh(e){if(jh(e))for(const t of e.Ru)await t(!0)}async function Dh(e){for(const t of e.Ru)await t(!1)}function Nh(e,t){const n=Vr(e);n.Au.has(t.targetId)||(n.Au.set(t.targetId,t),Fh(n)?Mh(n):nd(n).Ko()&&Ph(n,t))}function Rh(e,t){const n=Vr(e),r=nd(n);n.Au.delete(t),r.Ko()&&Lh(n,t),0===n.Au.size&&(r.Ko()?r.jo():jh(n)&&n.bu.set("Unknown"))}function Ph(e,t){if(e.Vu.qt(t.targetId),t.resumeToken.approximateByteSize()>0||t.snapshotVersion.compareTo(ii.min())>0){const n=e.remoteSyncer.getRemoteKeysForTarget(t.targetId).size;t=t.withExpectedCount(n)}nd(e).su(t)}function Lh(e,t){e.Vu.qt(t),nd(e).iu(t)}function Mh(e){e.Vu=new vc({getRemoteKeysForTarget:t=>e.remoteSyncer.getRemoteKeysForTarget(t),le:t=>e.Au.get(t)||null,ue:()=>e.datastore.serializer.databaseId}),nd(e).start(),e.bu.gu()}function Fh(e){return jh(e)&&!nd(e).Uo()&&e.Au.size>0}function jh(e){return 0===Vr(e).vu.size}function Uh(e){e.Vu=void 0}async function Vh(e){e.Au.forEach((t,n)=>{Ph(e,t)})}async function Bh(e,t){Uh(e),Fh(e)?(e.bu.Iu(t),Mh(e)):e.bu.set("Unknown")}async function qh(e,t,n){if(e.bu.set("Online"),t instanceof gc&&2===t.state&&t.cause)try{await async function(e,t){const n=t.cause;for(const r of t.targetIds)e.Au.has(r)&&(await e.remoteSyncer.rejectListen(r,n),e.Au.delete(r),e.Vu.removeTarget(r))}(e,t)}catch(n){Rr("RemoteStore","Failed to remove targets %s: %s ",t.targetIds.join(","),n),await zh(e,n)}else if(t instanceof fc?e.Vu.Ht(t):t instanceof pc?e.Vu.ne(t):e.Vu.Xt(t),!n.isEqual(ii.min()))try{const t=await Kl(e.localStore);n.compareTo(t)>=0&&await function(e,t){const n=e.Vu.ce(t);
2return n.targetChanges.forEach((n,r)=>{if(n.resumeToken.approximateByteSize()>0){const i=e.Au.get(r);i&&e.Au.set(r,i.withResumeToken(n.resumeToken,t))}}),n.targetMismatches.forEach((t,n)=>{const r=e.Au.get(t);if(!r)return;e.Au.set(t,r.withResumeToken(Ss.EMPTY_BYTE_STRING,r.snapshotVersion)),Lh(e,t);const i=new Zc(r.target,t,n,r.sequenceNumber);Ph(e,i)}),e.remoteSyncer.applyRemoteEvent(n)}(e,n)}catch(t){Rr("RemoteStore","Failed to raise snapshot:",t),await zh(e,t)}}async function zh(e,t,n){if(!Ai(t))throw t;e.vu.add(1),await Dh(e),e.bu.set("Offline"),n||(n=()=>Kl(e.localStore)),e.asyncQueue.enqueueRetryable(async()=>{Rr("RemoteStore","Retrying IndexedDB access"),await n(),e.vu.delete(1),await Oh(e)})}function $h(e,t){return t().catch(n=>zh(e,n,t))}async function Gh(e){const t=Vr(e),n=rd(t);let r=t.Eu.length>0?t.Eu[t.Eu.length-1].batchId:-1;for(;Kh(t);)try{const e=await Hl(t.localStore,r);if(null===e){0===t.Eu.length&&n.jo();break}r=e.batchId,Wh(t,e)}catch(e){await zh(t,e)}Hh(t)&&Qh(t)}function Kh(e){return jh(e)&&e.Eu.length<10}function Wh(e,t){e.Eu.push(t);const n=rd(e);n.Ko()&&n.ou&&n.uu(t.mutations)}function Hh(e){return jh(e)&&!rd(e).Uo()&&e.Eu.length>0}function Qh(e){rd(e).start()}async function Yh(e){rd(e).hu()}async function Xh(e){const t=rd(e);for(const n of e.Eu)t.uu(n.mutations)}async function Jh(e,t,n){const r=e.Eu.shift(),i=Qa.from(r,t,n);await $h(e,()=>e.remoteSyncer.applySuccessfulWrite(i)),await Gh(e)}async function Zh(e,t){t&&rd(e).ou&&await async function(e,t){if(tc(n=t.code)&&n!==Br.ABORTED){const n=e.Eu.shift();rd(e).Qo(),await $h(e,()=>e.remoteSyncer.rejectFailedWrite(n.batchId,t)),await Gh(e)}var n}(e,t),Hh(e)&&Qh(e)}async function ed(e,t){const n=Vr(e);n.asyncQueue.verifyOperationInProgress(),Rr("RemoteStore","RemoteStore received new credentials");const r=jh(n);n.vu.add(3),await Dh(n),r&&n.bu.set("Unknown"),await n.remoteSyncer.handleCredentialChange(t),n.vu.delete(3),await Oh(n)}async function td(e,t){const n=Vr(e);t?(n.vu.delete(2),await Oh(n)):t||(n.vu.add(2),await Dh(n),n.bu.set("Unknown"))}function nd(e){return e.Su||(e.Su=function(e,t,n){const r=Vr(e);return r.fu(),new Sh(t,r.connection,r.authCredentials,r.appCheckCredentials,r.serializer,n)}(e.datastore,e.asyncQueue,{uo:Vh.bind(null,e),ao:Bh.bind(null,e),nu:qh.bind(null,e)}),e.Ru.push(async t=>{t?(e.Su.Qo(),Fh(e)?Mh(e):e.bu.set("Unknown")):(await e.Su.stop(),Uh(e))})),e.Su}function rd(e){return e.Du||(e.Du=function(e,t,n){const r=Vr(e);return r.fu(),new kh(t,r.connection,r.authCredentials,r.appCheckCredentials,r.serializer,n)}(e.datastore,e.asyncQueue,{uo:Yh.bind(null,e),ao:Zh.bind(null,e),au:Xh.bind(null,e),cu:Jh.bind(null,e)}),e.Ru.push(async t=>{t?(e.Du.Qo(),await Gh(e)):(await e.Du.stop(),e.Eu.length>0&&(Rr("RemoteStore",`Stopping write stream with ${e.Eu.length} pending writes`),e.Eu=[]))})),e.Du}class id{constructor(e,t,n,r,i){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=n,this.op=r,this.removalCallback=i,this.deferred=new zr,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(e=>{})}static createAndSchedule(e,t,n,r,i){const s=Date.now()+n,o=new id(e,t,s,r,i);return o.start(n),o}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new qr(Br.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function sd(e,t){if(Pr("AsyncQueue",`${t}: ${e}`),Ai(e))return new qr(Br.UNAVAILABLE,`${t}: ${e}`);throw e}class od{constructor(e){this.comparator=e?(t,n)=>e(t,n)||ui.comparator(t.key,n.key):(e,t)=>ui.comparator(e.key,t.key),this.keyedMap=oa(),this.sortedSet=new ms(this.comparator)}static emptySet(e){return new od(e.comparator)}has(e){return null!=this.keyedMap.get(e)}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,n)=>(e(t),!1))}add(e){const t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){const t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof od))return!1;if(this.size!==e.size)return!1;const t=this.sortedSet.getIterator(),n=e.sortedSet.getIterator();for(;t.hasNext();){const e=t.getNext().key,r=n.getNext().key;if(!e.isEqual(r))return!1}return!0}toString(){const e=[];return this.forEach(t=>{e.push(t.toString())}),0===e.length?"DocumentSet ()":"DocumentSet (\n "+e.join(" \n")+"\n)"}copy(e,t){const n=new od;return n.comparator=this.comparator,n.keyedMap=e,n.sortedSet=t,n}}class ad{constructor(){this.Cu=new ms(ui.comparator)}track(e){const t=e.doc.key,n=this.Cu.get(t);n?0!==e.type&&3===n.type?this.Cu=this.Cu.insert(t,e):3===e.type&&1!==n.type?this.Cu=this.Cu.insert(t,{type:n.type,doc:e.doc}):2===e.type&&2===n.type?this.Cu=this.Cu.insert(t,{type:2,doc:e.doc}):2===e.type&&0===n.type?this.Cu=this.Cu.insert(t,{type:0,doc:e.doc}):1===e.type&&0===n.type?this.Cu=this.Cu.remove(t):1===e.type&&2===n.type?this.Cu=this.Cu.insert(t,{type:1,doc:n.doc}):0===e.type&&1===n.type?this.Cu=this.Cu.insert(t,{type:2,doc:e.doc}
2):Fr():this.Cu=this.Cu.insert(t,e)}xu(){const e=[];return this.Cu.inorderTraversal((t,n)=>{e.push(n)}),e}}class cd{constructor(e,t,n,r,i,s,o,a,c){this.query=e,this.docs=t,this.oldDocs=n,this.docChanges=r,this.mutatedKeys=i,this.fromCache=s,this.syncStateChanged=o,this.excludesMetadataChanges=a,this.hasCachedResults=c}static fromInitialDocuments(e,t,n,r,i){const s=[];return t.forEach(e=>{s.push({type:0,doc:e})}),new cd(e,t,od.emptySet(t),s,n,r,!0,!1,i)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&Qo(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,n=e.docChanges;if(t.length!==n.length)return!1;for(let e=0;e<t.length;e++)if(t[e].type!==n[e].type||!t[e].doc.isEqual(n[e].doc))return!1;return!0}}class ud{constructor(){this.Nu=void 0,this.listeners=[]}}class ld{constructor(){this.queries=new na(e=>Yo(e),Qo),this.onlineState="Unknown",this.ku=new Set}}async function hd(e,t){const n=Vr(e),r=t.query;let i=!1,s=n.queries.get(r);if(s||(i=!0,s=new ud),i)try{s.Nu=await n.onListen(r)}catch(e){const n=sd(e,`Initialization of query '${Xo(t.query)}' failed`);return void t.onError(n)}n.queries.set(r,s),s.listeners.push(t),t.Mu(n.onlineState),s.Nu&&t.$u(s.Nu)&&gd(n)}async function dd(e,t){const n=Vr(e),r=t.query;let i=!1;const s=n.queries.get(r);if(s){const e=s.listeners.indexOf(t);e>=0&&(s.listeners.splice(e,1),i=0===s.listeners.length)}if(i)return n.queries.delete(r),n.onUnlisten(r)}function fd(e,t){const n=Vr(e);let r=!1;for(const e of t){const t=e.query,i=n.queries.get(t);if(i){for(const t of i.listeners)t.$u(e)&&(r=!0);i.Nu=e}}r&&gd(n)}function pd(e,t,n){const r=Vr(e),i=r.queries.get(t);if(i)for(const e of i.listeners)e.onError(n);r.queries.delete(t)}function gd(e){e.ku.forEach(e=>{e.next()})}class md{constructor(e,t,n){this.query=e,this.Ou=t,this.Fu=!1,this.Bu=null,this.onlineState="Unknown",this.options=n||{}}$u(e){if(!this.options.includeMetadataChanges){const t=[];for(const n of e.docChanges)3!==n.type&&t.push(n);e=new cd(e.query,e.docs,e.oldDocs,t,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.Fu?this.Lu(e)&&(this.Ou.next(e),t=!0):this.qu(e,this.onlineState)&&(this.Uu(e),t=!0),this.Bu=e,t}onError(e){this.Ou.error(e)}Mu(e){this.onlineState=e;let t=!1;return this.Bu&&!this.Fu&&this.qu(this.Bu,e)&&(this.Uu(this.Bu),t=!0),t}qu(e,t){if(!e.fromCache)return!0;const n="Offline"!==t;return(!this.options.Ku||!n)&&(!e.docs.isEmpty()||e.hasCachedResults||"Offline"===t)}Lu(e){if(e.docChanges.length>0)return!0;const t=this.Bu&&this.Bu.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&!0===this.options.includeMetadataChanges}Uu(e){e=cd.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Fu=!0,this.Ou.next(e)}}class vd{constructor(e,t){this.Gu=e,this.byteLength=t}Qu(){return"metadata"in this.Gu}}class yd{constructor(e){this.serializer=e}rr(e){return Nc(this.serializer,e)}ur(e){return e.metadata.exists?jc(this.serializer,e.document,!1):io.newNoDocument(this.rr(e.metadata.name),this.cr(e.metadata.readTime))}cr(e){return Cc(e)}}class wd{constructor(e,t,n){this.ju=e,this.localStore=t,this.serializer=n,this.queries=[],this.documents=[],this.collectionGroups=new Set,this.progress=bd(e)}zu(e){this.progress.bytesLoaded+=e.byteLength;let t=this.progress.documentsLoaded;if(e.Gu.namedQuery)this.queries.push(e.Gu.namedQuery);else if(e.Gu.documentMetadata){this.documents.push({metadata:e.Gu.documentMetadata}),e.Gu.documentMetadata.exists||++t;const n=oi.fromString(e.Gu.documentMetadata.name);this.collectionGroups.add(n.get(n.length-2))}else e.Gu.document&&(this.documents[this.documents.length-1].document=e.Gu.document,++t);return t!==this.progress.documentsLoaded?(this.progress.documentsLoaded=t,Object.assign({},this.progress)):null}Wu(e){const t=new Map,n=new yd(this.serializer);for(const r of e)if(r.metadata.queries){const e=n.rr(r.metadata.name);for(const n of r.metadata.queries){const r=(t.get(n)||fa()).add(e);t.set(n,r)}}return t}async complete(){const e=await async function(e,t,n,r){const i=Vr(e);let s=fa(),o=ia();for(const e of n){const n=t.rr(e.metadata.name);e.document&&(s=s.add(n));const r=t.ur(e);r.setReadTime(t.cr(e.metadata.readTime)),o=o.insert(n,r)}const a=i.Zi.newChangeBuffer({trackRemovals:!0}),c=await Ql(i,function(e){return Ko(Vo(oi.fromString(`__bundle__/docs/${e}`)))}(r));return i.persistence.runTransaction("Apply bundle documents","readwrite",e=>Wl(e,a,o).next(t=>(a.apply(e),t)).next(t=>i.Bs.removeMatchingKeysForTargetId(e,c.targetId).next(()=>i.Bs.addMatchingKeys(e,s,c.targetId)).next(()=>i.localDocuments.getLocalViewOfDocuments(e,t.nr,t.sr)).next(()=>t.nr)))}(this.localStore,new yd(this.serializer),this.documents,this.ju.id),t=this.Wu(this.documents);for(const e of this.queries)await th(this.localStore,e,t.get(e.n
2ame));return this.progress.taskState="Success",{progress:this.progress,Hu:this.collectionGroups,Ju:e}}}function bd(e){return{taskState:"Running",documentsLoaded:0,bytesLoaded:0,totalDocuments:e.totalDocuments,totalBytes:e.totalBytes}}class _d{constructor(e){this.key=e}}class Id{constructor(e){this.key=e}}class Ed{constructor(e,t){this.query=e,this.Yu=t,this.Xu=null,this.hasCachedResults=!1,this.current=!1,this.Zu=fa(),this.mutatedKeys=fa(),this.tc=ea(e),this.ec=new od(this.tc)}get nc(){return this.Yu}sc(e,t){const n=t?t.ic:new ad,r=t?t.ec:this.ec;let i=t?t.mutatedKeys:this.mutatedKeys,s=r,o=!1;const a="F"===this.query.limitType&&r.size===this.query.limit?r.last():null,c="L"===this.query.limitType&&r.size===this.query.limit?r.first():null;if(e.inorderTraversal((e,t)=>{const u=r.get(e),l=Jo(this.query,t)?t:null,h=!!u&&this.mutatedKeys.has(u.key),d=!!l&&(l.hasLocalMutations||this.mutatedKeys.has(l.key)&&l.hasCommittedMutations);let f=!1;u&&l?u.data.isEqual(l.data)?h!==d&&(n.track({type:3,doc:l}),f=!0):this.rc(u,l)||(n.track({type:2,doc:l}),f=!0,(a&&this.tc(l,a)>0||c&&this.tc(l,c)<0)&&(o=!0)):!u&&l?(n.track({type:0,doc:l}),f=!0):u&&!l&&(n.track({type:1,doc:u}),f=!0,(a||c)&&(o=!0)),f&&(l?(s=s.add(l),i=d?i.add(e):i.delete(e)):(s=s.delete(e),i=i.delete(e)))}),null!==this.query.limit)for(;s.size>this.query.limit;){const e="F"===this.query.limitType?s.last():s.first();s=s.delete(e.key),i=i.delete(e.key),n.track({type:1,doc:e})}return{ec:s,ic:n,zi:o,mutatedKeys:i}}rc(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,n){const r=this.ec;this.ec=e.ec,this.mutatedKeys=e.mutatedKeys;const i=e.ic.xu();i.sort((e,t)=>function(e,t){const n=e=>{switch(e){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Fr()}};return n(e)-n(t)}(e.type,t.type)||this.tc(e.doc,t.doc)),this.oc(n);const s=t?this.uc():[],o=0===this.Zu.size&&this.current?1:0,a=o!==this.Xu;return this.Xu=o,0!==i.length||a?{snapshot:new cd(this.query,e.ec,r,i,e.mutatedKeys,0===o,a,!1,!!n&&n.resumeToken.approximateByteSize()>0),cc:s}:{cc:s}}Mu(e){return this.current&&"Offline"===e?(this.current=!1,this.applyChanges({ec:this.ec,ic:new ad,mutatedKeys:this.mutatedKeys,zi:!1},!1)):{cc:[]}}ac(e){return!this.Yu.has(e)&&!!this.ec.has(e)&&!this.ec.get(e).hasLocalMutations}oc(e){e&&(e.addedDocuments.forEach(e=>this.Yu=this.Yu.add(e)),e.modifiedDocuments.forEach(e=>{}),e.removedDocuments.forEach(e=>this.Yu=this.Yu.delete(e)),this.current=e.current)}uc(){if(!this.current)return[];const e=this.Zu;this.Zu=fa(),this.ec.forEach(e=>{this.ac(e.key)&&(this.Zu=this.Zu.add(e.key))});const t=[];return e.forEach(e=>{this.Zu.has(e)||t.push(new Id(e))}),this.Zu.forEach(n=>{e.has(n)||t.push(new _d(n))}),t}hc(e){this.Yu=e.ir,this.Zu=fa();const t=this.sc(e.documents);return this.applyChanges(t,!0)}lc(){return cd.fromInitialDocuments(this.query,this.ec,this.mutatedKeys,0===this.Xu,this.hasCachedResults)}}class Td{constructor(e,t,n){this.query=e,this.targetId=t,this.view=n}}class Sd{constructor(e){this.key=e,this.fc=!1}}class kd{constructor(e,t,n,r,i,s){this.localStore=e,this.remoteStore=t,this.eventManager=n,this.sharedClientState=r,this.currentUser=i,this.maxConcurrentLimboResolutions=s,this.dc={},this.wc=new na(e=>Yo(e),Qo),this._c=new Map,this.mc=new Set,this.gc=new ms(ui.comparator),this.yc=new Map,this.Ic=new Sl,this.Tc={},this.Ec=new Map,this.Ac=tl.Mn(),this.onlineState="Unknown",this.vc=void 0}get isPrimaryClient(){return!0===this.vc}}async function Ad(e,t){const n=Zd(e);let r,i;const s=n.wc.get(t);if(s)r=s.targetId,n.sharedClientState.addLocalQueryTarget(r),i=s.view.lc();else{const e=await Ql(n.localStore,Ko(t)),s=n.sharedClientState.addLocalQueryTarget(e.targetId);r=e.targetId,i=await Cd(n,t,r,"current"===s,e.resumeToken),n.isPrimaryClient&&Nh(n.remoteStore,e)}return i}async function Cd(e,t,n,r,i){e.Rc=(t,n,r)=>async function(e,t,n,r){let i=t.view.sc(n);i.zi&&(i=await Xl(e.localStore,t.query,!1).then(({documents:e})=>t.view.sc(e,i)));const s=r&&r.targetChanges.get(t.targetId),o=t.view.applyChanges(i,e.isPrimaryClient,s);return Ud(e,t.targetId,o.cc),o.snapshot}(e,t,n,r);
2const s=await Xl(e.localStore,t,!0),o=new Ed(t,s.ir),a=o.sc(s.documents),c=dc.createSynthesizedTargetChangeForCurrentChange(n,r&&"Offline"!==e.onlineState,i),u=o.applyChanges(a,e.isPrimaryClient,c);Ud(e,n,u.cc);const l=new Td(t,n,o);return e.wc.set(t,l),e._c.has(n)?e._c.get(n).push(t):e._c.set(n,[t]),u.snapshot}async function xd(e,t){const n=Vr(e),r=n.wc.get(t),i=n._c.get(r.targetId);if(i.length>1)return n._c.set(r.targetId,i.filter(e=>!Qo(e,t))),void n.wc.delete(t);n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(r.targetId),n.sharedClientState.isActiveQueryTarget(r.targetId)||await Yl(n.localStore,r.targetId,!1).then(()=>{n.sharedClientState.clearQueryState(r.targetId),Rh(n.remoteStore,r.targetId),Fd(n,r.targetId)}).catch(_i)):(Fd(n,r.targetId),await Yl(n.localStore,r.targetId,!0))}async function Od(e,t){const n=Vr(e);try{const e=await function(e,t){const n=Vr(e),r=t.snapshotVersion;let i=n.Ji;return n.persistence.runTransaction("Apply remote event","readwrite-primary",e=>{const s=n.Zi.newChangeBuffer({trackRemovals:!0});i=n.Ji;const o=[];
2t.targetChanges.forEach((s,a)=>{const c=i.get(a);if(!c)return;o.push(n.Bs.removeMatchingKeys(e,s.removedDocuments,a).next(()=>n.Bs.addMatchingKeys(e,s.addedDocuments,a)));let u=c.withSequenceNumber(e.currentSequenceNumber);null!==t.targetMismatches.get(a)?u=u.withResumeToken(Ss.EMPTY_BYTE_STRING,ii.min()).withLastLimboFreeSnapshotVersion(ii.min()):s.resumeToken.approximateByteSize()>0&&(u=u.withResumeToken(s.resumeToken,r)),i=i.insert(a,u),function(e,t,n){return 0===e.resumeToken.approximateByteSize()||t.snapshotVersion.toMicroseconds()-e.snapshotVersion.toMicroseconds()>=3e8||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0}(c,u,s)&&o.push(n.Bs.updateTargetData(e,u))});let a=ia(),c=fa();if(t.documentUpdates.forEach(r=>{t.resolvedLimboDocuments.has(r)&&o.push(n.persistence.referenceDelegate.updateLimboDocument(e,r))}),o.push(Wl(e,s,t.documentUpdates).next(e=>{a=e.nr,c=e.sr})),!r.isEqual(ii.min())){const t=n.Bs.getLastRemoteSnapshotVersion(e).next(t=>n.Bs.setTargetsMetadata(e,e.currentSequenceNumber,r));o.push(t)}return Ii.waitFor(o).next(()=>s.apply(e)).next(()=>n.localDocuments.getLocalViewOfDocuments(e,a,c)).next(()=>a)}).then(e=>(n.Ji=i,e))}(n.localStore,t);
2t.targetChanges.forEach((e,t)=>{const r=n.yc.get(t);r&&(jr(e.addedDocuments.size+e.modifiedDocuments.size+e.removedDocuments.size<=1),e.addedDocuments.size>0?r.fc=!0:e.modifiedDocuments.size>0?jr(r.fc):e.removedDocuments.size>0&&(jr(r.fc),r.fc=!1))}),await qd(n,e,t)}catch(e){await _i(e)}}function Dd(e,t,n){const r=Vr(e);if(r.isPrimaryClient&&0===n||!r.isPrimaryClient&&1===n){const e=[];r.wc.forEach((n,r)=>{const i=r.view.Mu(t);i.snapshot&&e.push(i.snapshot)}),function(e,t){const n=Vr(e);n.onlineState=t;let r=!1;n.queries.forEach((e,n)=>{for(const e of n.listeners)e.Mu(t)&&(r=!0)}),r&&gd(n)}(r.eventManager,t),e.length&&r.dc.nu(e),r.onlineState=t,r.isPrimaryClient&&r.sharedClientState.setOnlineState(t)}}async function Nd(e,t,n){const r=Vr(e);r.sharedClientState.updateQueryState(t,"rejected",n);const i=r.yc.get(t),s=i&&i.key;if(s){let e=new ms(ui.comparator);e=e.insert(s,io.newNoDocument(s,ii.min()));const n=fa().add(s),i=new hc(ii.min(),new Map,new ms(ei),e,n);await Od(r,i),r.gc=r.gc.remove(s),r.yc.delete(t),Bd(r)}else await Yl(r.localStore,t,!1).then(()=>Fd(r,t,n)).catch(_i)}async function Rd(e,t){const n=Vr(e),r=t.batch.batchId;try{const e=await function(e,t){const n=Vr(e);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",e=>{const r=t.batch.keys(),i=n.Zi.newChangeBuffer({trackRemovals:!0});return function(e,t,n,r){const i=n.batch,s=i.keys();let o=Ii.resolve();return s.forEach(e=>{o=o.next(()=>r.getEntry(t,e)).next(t=>{const s=n.docVersions.get(e);jr(null!==s),t.version.compareTo(s)<0&&(i.applyToRemoteDocument(t,n),t.isValidDocument()&&(t.setReadTime(n.commitVersion),r.addEntry(t)))})}),o.next(()=>e.mutationQueue.removeMutationBatch(t,i))}(n,e,t,i).next(()=>i.apply(e)).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,r,t.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,function(e){let t=fa();for(let n=0;n<e.mutationResults.length;++n)e.mutationResults[n].transformResults.length>0&&(t=t.add(e.batch.mutations[n].key));return t}(t))).next(()=>n.localDocuments.getDocuments(e,r))})}(n.localStore,t);Md(n,r,null),Ld(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await qd(n,e)}catch(e){await _i(e)}}async function Pd(e,t,n){const r=Vr(e);try{const e=await function(e,t){const n=Vr(e);return n.persistence.runTransaction("Reject batch","readwrite-primary",e=>{let r;
2return n.mutationQueue.lookupMutationBatch(e,t).next(t=>(jr(null!==t),r=t.keys(),n.mutationQueue.removeMutationBatch(e,t))).next(()=>n.mutationQueue.performConsistencyCheck(e)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(e,r,t)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(e,r)).next(()=>n.localDocuments.getDocuments(e,r))})}(r.localStore,t);Md(r,t,n),Ld(r,t),r.sharedClientState.updateMutationState(t,"rejected",n),await qd(r,e)}catch(n){await _i(n)}}function Ld(e,t){(e.Ec.get(t)||[]).forEach(e=>{e.resolve()}),e.Ec.delete(t)}function Md(e,t,n){const r=Vr(e);let i=r.Tc[r.currentUser.toKey()];if(i){const e=i.get(t);e&&(n?e.reject(n):e.resolve(),i=i.remove(t)),r.Tc[r.currentUser.toKey()]=i}}function Fd(e,t,n=null){e.sharedClientState.removeLocalQueryTarget(t);for(const r of e._c.get(t))e.wc.delete(r),n&&e.dc.Pc(r,n);e._c.delete(t),e.isPrimaryClient&&e.Ic.Is(t).forEach(t=>{e.Ic.containsKey(t)||jd(e,t)})}function jd(e,t){e.mc.delete(t.path.canonicalString());const n=e.gc.get(t);null!==n&&(Rh(e.remoteStore,n),e.gc=e.gc.remove(t),e.yc.delete(n),Bd(e))}function Ud(e,t,n){for(const r of n)r instanceof _d?(e.Ic.addReference(r.key,t),Vd(e,r)):r instanceof Id?(Rr("SyncEngine","Document no longer in limbo: "+r.key),e.Ic.removeReference(r.key,t),e.Ic.containsKey(r.key)||jd(e,r.key)):Fr()}function Vd(e,t){const n=t.key,r=n.path.canonicalString();e.gc.get(n)||e.mc.has(r)||(Rr("SyncEngine","New document in limbo: "+n),e.mc.add(r),Bd(e))}function Bd(e){for(;e.mc.size>0&&e.gc.size<e.maxConcurrentLimboResolutions;){const t=e.mc.values().next().value;e.mc.delete(t);const n=new ui(oi.fromString(t)),r=e.Ac.next();e.yc.set(r,new Sd(n)),e.gc=e.gc.insert(n,r),Nh(e.remoteStore,new Zc(Ko(Vo(n.path)),r,"TargetPurposeLimboResolution",Pi.ct))}}async function qd(e,t,n){const r=Vr(e),i=[],s=[],o=[];r.wc.isEmpty()||(r.wc.forEach((e,a)=>{o.push(r.Rc(a,t,n).then(e=>
2{if((e||n)&&r.isPrimaryClient&&r.sharedClientState.updateQueryState(a.targetId,(null==e?void 0:e.fromCache)?"not-current":"current"),e){i.push(e);const t=Bl.Li(a.targetId,e);s.push(t)}}))}),await Promise.all(o),r.dc.nu(i),await async function(e,t){const n=Vr(e);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",e=>Ii.forEach(t,t=>Ii.forEach(t.Fi,r=>n.persistence.referenceDelegate.addReference(e,t.targetId,r)).next(()=>Ii.forEach(t.Bi,r=>n.persistence.referenceDelegate.removeReference(e,t.targetId,r)))))}catch(e){if(!Ai(e))throw e;Rr("LocalStore","Failed to update sequence numbers: "+e)}for(const e of t){const t=e.targetId;if(!e.fromCache){const e=n.Ji.get(t),r=e.snapshotVersion,i=e.withLastLimboFreeSnapshotVersion(r);n.Ji=n.Ji.insert(t,i)}}}(r.localStore,s))}async function zd(e,t){const n=Vr(e);if(!n.currentUser.isEqual(t)){Rr("SyncEngine","User change. New user:",t.toKey());const e=await Gl(n.localStore,t);n.currentUser=t,function(e){e.Ec.forEach(e=>{e.forEach(e=>{e.reject(new qr(Br.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))})}),e.Ec.clear()}(n),n.sharedClientState.handleUserChange(t,e.removedBatchIds,e.addedBatchIds),await qd(n,e.er)}}function $d(e,t){const n=Vr(e),r=n.yc.get(t);if(r&&r.fc)return fa().add(r.key);{let e=fa();const r=n._c.get(t);if(!r)return e;for(const t of r){const r=n.wc.get(t);e=e.unionWith(r.view.nc)}return e}}async function Gd(e,t){const n=Vr(e),r=await Xl(n.localStore,t.query,!0),i=t.view.hc(r);return n.isPrimaryClient&&Ud(n,t.targetId,i.cc),i}async function Kd(e,t){const n=Vr(e);return Zl(n.localStore,t).then(e=>qd(n,e))}async function Wd(e,t,n,r){const i=Vr(e),s=await function(e,t){const n=Vr(e),r=Vr(n.mutationQueue);return n.persistence.runTransaction("Lookup mutation documents","readonly",e=>r.Sn(e,t).next(t=>t?n.localDocuments.getDocuments(e,t):Ii.resolve(null)))}(i.localStore,t);null!==s?("pending"===n?await Gh(i.remoteStore):"acknowledged"===n||"rejected"===n?(Md(i,t,r||null),Ld(i,t),function(e,t){Vr(Vr(e).mutationQueue).Cn(t)}(i.localStore,t)):Fr(),await qd(i,s)):Rr("SyncEngine","Cannot apply mutation batch with id: "+t)}async function Hd(e,t,n){const r=Vr(e),i=[],s=[];for(const e of t){let t;const n=r._c.get(e);if(n&&0!==n.length){t=await Ql(r.localStore,Ko(n[0]));for(const e of n){const t=r.wc.get(e),n=await Gd(r,t);n.snapshot&&s.push(n.snapshot)}}else{const n=await Jl(r.localStore,e);t=await Ql(r.localStore,n),await Cd(r,Qd(n),e,!1,t.resumeToken)}i.push(t)}return r.dc.nu(s),i}function Qd(e){return Uo(e.path,e.collectionGroup,e.orderBy,e.filters,e.limit,"F",e.startAt,e.endAt)}function Yd(e){const t=Vr(e);return Vr(Vr(t.localStore).persistence).$i()}async function Xd(e,t,n,r){const i=Vr(e);if(i.vc)return void Rr("SyncEngine","Ignoring unexpected query state notification.");const s=i._c.get(t);if(s&&s.length>0)switch(n){case"current":case"not-current":{const e=await Zl(i.localStore,Zo(s[0])),r=hc.createSynthesizedRemoteEventForCurrentChange(t,"current"===n,Ss.EMPTY_BYTE_STRING);await qd(i,e,r);break}case"rejected":await Yl(i.localStore,t,!0),Fd(i,t,r);break;default:Fr()}}async function Jd(e,t,n){const r=Zd(e);if(r.vc){for(const e of t){if(r._c.has(e)){Rr("SyncEngine","Adding an already active target "+e);continue}const t=await Jl(r.localStore,e),n=await Ql(r.localStore,t);await Cd(r,Qd(t),n.targetId,!1,n.resumeToken),Nh(r.remoteStore,n)}for(const e of n)r._c.has(e)&&await Yl(r.localStore,e,!1).then(()=>{Rh(r.remoteStore,e),Fd(r,e)}).catch(_i)}}function Zd(e){const t=Vr(e);return t.remoteStore.remoteSyncer.applyRemoteEvent=Od.bind(null,t),t.remoteStore.remoteSyncer.getRemoteKeysForTarget=$d.bind(null,t),t.remoteStore.remoteSyncer.rejectListen=Nd.bind(null,t),t.dc.nu=fd.bind(null,t.eventManager),t.dc.Pc=pd.bind(null,t.eventManager),t}function ef(e){const t=Vr(e);return t.remoteStore.remoteSyncer.applySuccessfulWrite=Rd.bind(null,t),t.remoteStore.remoteSyncer.rejectFailedWrite=Pd.bind(null,t),t}class tf{constructor(){this.synchronizeTabs=!1}async initialize(e){this.serializer=Ih(e.databaseInfo.databaseId),this.sharedClientState=this.createSharedCl
2ientState(e),this.persistence=this.createPersistence(e),await this.persistence.start(),this.localStore=this.createLocalStore(e),this.gcScheduler=this.createGarbageCollectionScheduler(e,this.localStore),this.indexBackfillerScheduler=this.createIndexBackfillerScheduler(e,this.localStore)}createGarbageCollectionScheduler(e,t){return null}createIndexBackfillerScheduler(e,t){return null}createLocalStore(e){return $l(this.persistence,new ql,e.initialUser,this.serializer)}createPersistence(e){return new Dl(Rl.zs,this.serializer)}createSharedClientState(e){return new hh}async terminate(){this.gcScheduler&&this.gcScheduler.stop(),await this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class nf extends tf{constructor(e,t,n){super(),this.Vc=e,this.cacheSizeBytes=t,this.forceOwnership=n,this.synchronizeTabs=!1}async initialize(e){await super.initialize(e),await this.Vc.initialize(this,e),await ef(this.Vc.syncEngine),await Gh(this.Vc.remoteStore),await this.persistence.Ii(()=>(this.gcScheduler&&!this.gcScheduler.started&&this.gcScheduler.start(),this.indexBackfillerScheduler&&!this.indexBackfillerScheduler.started&&this.indexBackfillerScheduler.start(),Promise.resolve()))}createLocalStore(e){return $l(this.persistence,new ql,e.initialUser,this.serializer)}createGarbageCollectionScheduler(e,t){const n=this.persistence.referenceDelegate.garbageCollector;return new cl(n,e.asyncQueue,t)}createIndexBackfillerScheduler(e,t){const n=new Ri(t,this.persistence);return new Ni(e.asyncQueue,n)}createPersistence(e){const t=Vl(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey),n=void 0!==this.cacheSizeBytes?Wu.withCacheSize(this.cacheSizeBytes):Wu.DEFAULT;return new Fl(this.synchronizeTabs,t,e.clientId,n,e.asyncQueue,bh(),_h(),this.serializer,this.sharedClientState,!!this.forceOwnership)}createSharedClientState(e){return new hh}}class rf extends nf{constructor(e,t){super(e,t,!1),this.Vc=e,this.cacheSizeBytes=t,this.synchronizeTabs=!0}async initialize(e){await super.initialize(e);const t=this.Vc.syncEngine;this.sharedClientState instanceof lh&&(this.sharedClientState.syncEngine={jr:Wd.bind(null,t),zr:Xd.bind(null,t),Wr:Jd.bind(null,t),$i:Yd.bind(null,t),Qr:Kd.bind(null,t)},await this.sharedClientState.start()),await this.persistence.Ii(async e=>{await async function(e,t){const n=Vr(e);if(Zd(n),ef(n),!0===t&&!0!==n.vc){const e=n.sharedClientState.getAllActiveQueryTargets(),t=await Hd(n,e.toArray());n.vc=!0,await td(n.remoteStore,!0);for(const e of t)Nh(n.remoteStore,e)}else if(!1===t&&!1!==n.vc){const e=[];let t=Promise.resolve();n._c.forEach((r,i)=>{n.sharedClientState.isLocalQueryTarget(i)?e.push(i):t=t.then(()=>(Fd(n,i),Yl(n.localStore,i,!0))),Rh(n.remoteStore,i)}),await t,await Hd(n,e),function(e){const t=Vr(e);t.yc.forEach((e,n)=>{Rh(t.remoteStore,n)}),t.Ic.Ts(),t.yc=new Map,t.gc=new ms(ui.comparator)}(n),n.vc=!1,await td(n.remoteStore,!1)}}(this.Vc.syncEngine,e),this.gcScheduler&&(e&&!this.gcScheduler.started?this.gcScheduler.start():e||this.gcScheduler.stop()),this.indexBackfillerScheduler&&(e&&!this.indexBackfillerScheduler.started?this.indexBackfillerScheduler.start():e||this.indexBackfillerScheduler.stop())})}createSharedClientState(e){const t=bh();if(!lh.D(t))throw new qr(Br.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");const n=Vl(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey);return new lh(t,e.asyncQueue,n,e.clientId,e.initialUser)}}class sf{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=e=>Dd(this.syncEngine,e,1),this.remoteStore.remoteSyncer.handleCredentialChange=zd.bind(null,this.syncEngine),await td(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return new ld}createDatastore(e){const t=Ih(e.databaseInfo.databaseId),n=(r=e.databaseInfo,new wh(r));var r;return function(e,t,n,r){return new Ah(e,t,n,r)}(e.authCredentials,e.appCheckCredentials,n,t)}createRemoteStore(e){return t=this.localStore,n=this.datastore,r=e.asyncQueue,i=e=>Dd(this.syncEngine,e,0),s=fh.D()?new fh:new dh,new xh(t,n,r,i,s);var t,n,r,i,s}createSyncEngine(e,t){return function(e,t,n,r,i,s,o){const a=new kd(e,t,n,r,i,s);return o&&(a.vc=!0),a}(this.localStore,this.remoteStore,this.eventManager,this.sharedCl
2ientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}terminate(){return async function(e){const t=Vr(e);Rr("RemoteStore","RemoteStore shutting down."),t.vu.add(5),await Dh(t),t.Pu.shutdown(),t.bu.set("Unknown")}(this.remoteStore)}}function of(e,t=10240){let n=0;return{async read(){if(n<e.byteLength){const r={value:e.slice(n,n+t),done:!1};return n+=t,r}return{done:!0}},async cancel(){},releaseLock(){},closed:Promise.resolve()}}class af{constructor(e){this.observer=e,this.muted=!1}next(e){this.observer.next&&this.Sc(this.observer.next,e)}error(e){this.observer.error?this.Sc(this.observer.error,e):Pr("Uncaught Error in snapshot listener:",e.toString())}Dc(){this.muted=!0}Sc(e,t){this.muted||setTimeout(()=>{this.muted||e(t)},0)}}class cf{constructor(e,t){this.Cc=e,this.serializer=t,this.metadata=new zr,this.buffer=new Uint8Array,this.xc=new TextDecoder("utf-8"),this.Nc().then(e=>{e&&e.Qu()?this.metadata.resolve(e.Gu.metadata):this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is\n ${JSON.stringify(null==e?void 0:e.Gu)}`))},e=>this.metadata.reject(e))}close(){return this.Cc.cancel()}async getMetadata(){return this.metadata.promise}async bc(){return await this.getMetadata(),this.Nc()}async Nc(){const e=await this.kc();if(null===e)return null;const t=this.xc.decode(e),n=Number(t);isNaN(n)&&this.Mc(`length string (${t}) is not valid number`);const r=await this.$c(n);return new vd(JSON.parse(r),e.length+n)}Oc(){return this.buffer.findIndex(e=>e==="{".charCodeAt(0))}async kc(){for(;this.Oc()<0&&!await this.Fc(););if(0===this.buffer.length)return null;const e=this.Oc();e<0&&this.Mc("Reached the end of bundle when a length string is expected.");const t=this.buffer.slice(0,e);return this.buffer=this.buffer.slice(e),t}async $c(e){for(;this.buffer.length<e;)await this.Fc()&&this.Mc("Reached the end of bundle when more is expected.");const t=this.xc.decode(this.buffer.slice(0,e));return this.buffer=this.buffer.slice(e),t}Mc(e){throw this.Cc.cancel(),new Error(`Invalid bundle format: ${e}`)}async Fc(){const e=await this.Cc.read();if(!e.done){const t=new Uint8Array(this.buffer.length+e.value.length);t.set(this.buffer),t.set(e.value,this.buffer.length),this.buffer=t}return e.done}}class uf{constructor(e){this.datastore=e,this.readVersions=new Map,this.mutations=[],this.committed=!1,this.lastWriteError=null,this.writtenDocs=new Set}async lookup(e){if(this.ensureCommitNotCalled(),this.mutations.length>0)throw new qr(Br.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes.");const t=await async function(e,t){const n=Vr(e),r=Lc(n.serializer)+"/documents",i={documents:t.map(e=>Dc(n.serializer,e))},s=await n.vo("BatchGetDocuments",r,i,t.length),o=new Map;s.forEach(e=>{const t=function(e,t){return"found"in t?function(e,t){jr(!!t.found),t.found.name,t.found.updateTime;const n=Nc(e,t.found.name),r=Cc(t.found.updateTime),i=t.found.createTime?Cc(t.found.createTime):ii.min(),s=new no({mapValue:{fields:t.found.fields}});return io.newFoundDocument(n,r,i,s)}(e,t):"missing"in t?function(e,t){jr(!!t.missing),jr(!!t.readTime);const n=Nc(e,t.missing),r=Cc(t.readTime);return io.newNoDocument(n,r)}(e,t):Fr()}(n.serializer,e);o.set(t.key.toString(),t)});const a=[];return t.forEach(e=>{const t=o.get(e.toString());jr(!!t),a.push(t)}),a}(this.datastore,e);return t.forEach(e=>this.recordVersion(e)),t}set(e,t){this.write(t.toMutation(e,this.precondition(e))),this.writtenDocs.add(e.toString())}update(e,t){try{this.write(t.toMutation(e,this.preconditionForUpdate(e)))}catch(e){this.lastWriteError=e}this.writtenDocs.add(e.toString())}delete(e){this.write(new Ka(e,this.precondition(e))),this.writtenDocs.add(e.toString())}async commit(){if(this.ensureCommitNotCalled(),this.lastWriteError)throw this.lastWriteError;const e=this.readVersions;this.mutations.forEach(t=>{e.delete(t.key.toString())}),e.forEach((e,t)=>{const n=ui.fromPath(t);this.mutations.push(new Wa(n,this.precondition(n)))}),await async function(e,t){const n=Vr(e),r=Lc(n.serializer)+"/documents",i={writes:t.map(e=>Uc(n.serializer,e))};await n.Io("Commit",r,i)}(this.datastore,this.mutations),this.committed=!0}recordVersion(e){let t;if(e.isFoundDocument())t=e.version;else{if(!e.isNoDocument())throw Fr();t=ii.min()}const n=this.readVersions.get(e.key.toString());if(n){if(!t.isEqual(n))throw new qr(Br.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(e.key.toString(),t)}precondition(e){const t=this.readVersions.get(e.toString());return!this.writtenDocs.has(e.toString())&&t?t.isEqual(ii.min())?Ra.exists(!1):Ra.updateTime(t):Ra.none()}preconditionForUpdate(e){const t=this.readVersions.get(e.toString());if(!this.writtenDocs.has(e.toString())&&t){if(t.isEqual(ii.min()))throw new qr(Br.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return Ra.updateTime(t)}return Ra.exists(!0)}write(e){this.ensureCommitNotCalled(),this.mutations.push(e)}ensureCommitNotCalled(){}}class lf{constructor(e,t,n,r,i){this.asyncQueue=e,this.datastore=t,this.options=n,this.updateFunction=r,this.deferred=i,this.Bc=n.maxAttempts,this.qo=new Eh(this.asyncQueue,"transaction_retry")}run(){this.Bc-=1,this.Lc()}Lc(){this.qo.No(async()=>{const e=new uf(this.datastore),t=this.qc(e);t&&t.then(t=>{this.asyncQueue.enqueueAndForget(()=>e.commit().then(()=>{this.deferred.resolve(t)}).catch(e=>{this.Uc(e)}))}).catch(e=>{this.Uc(e)})})}qc(e){try{const t=this.updateFunction(e);return!Li(t)&&t.catch&&t.then?t:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(e){return this.deferred.reject(e),null}}Uc(e){this.Bc>0&&this.Kc(e)?(this.Bc-=1,this.asyncQueue.enqueueAndForget(()=>(this.Lc(),Promise.resolve()))):this.deferred.reject(e)}Kc(e){if("FirebaseError"===e.name){const t=e.code;return"aborted"===t||"failed-precondition"===t||"already-exists"===t||!tc(t)}return!1}}class hf{constructor(e,t,n,r){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=n,this.databaseInfo=r,this.user=Cr.UNAUTHENTICATED,this.clientId=Zr.A(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this.authCredentials.start(n,async e=>{Rr("FirestoreClient","Received user=",e.uid),await this.authCredentialListener(e),this.user=e}),this.appCheckCredentials.start(n,e=>(Rr("FirestoreClient","Received new app check token=",e),this.appCheckCredentialListener(e,this.user)))}async getConfiguration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new qr(Br.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const e=new zr;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const n=sd(t,"Failed to shutdown persistence");e.reject(n)}}),e.promise}}async function df(e,t){e.asyncQueue.verifyOperationInProgress(),Rr("FirestoreClient","Initializing OfflineComponentProvider");const n=await e.getConfiguration();await t.initialize(n);let r=n.initialUser;e.setCredentialChangeListener(async e=>{r.isEqual(e)||(await Gl(t.localStore,e),r=e)}),t.persistence.setDatabaseDeletedListener(()=>e.terminate()),e._offlineComponents=t}async function ff(e,t){e.asyncQueue.verifyOperationInProgress();const n=await gf(e);Rr("FirestoreClient","Initializing OnlineComponentProvider");const r=await e.getConfiguration();await t.initialize(n,r),e.setCredentialChangeListener(e=>ed(t.remoteStore,e)),e.setAppCheckTokenChangeListener((e,n)=>ed(t.remoteStore,n)),e._onlineComponents=t}function pf(e){return"FirebaseError"===e.name?e.code===Br.FAILED_PRECONDITION||e.code===Br.UNIMPLEMENT
2ED:!("undefined"!=typeof DOMException&&e instanceof DOMException)||22===e.code||20===e.code||11===e.code}async function gf(e){if(!e._offlineComponents)if(e._uninitializedComponentsProvider){Rr("FirestoreClient","Using user provided OfflineComponentProvider");try{await df(e,e._uninitializedComponentsProvider._offline)}catch(t){const n=t;if(!pf(n))throw n;Lr("Error using user provided cache. Falling back to memory cache: "+n),await df(e,new tf)}}else Rr("FirestoreClient","Using default OfflineComponentProvider"),await df(e,new tf);return e._offlineComponents}async function mf(e){return e._onlineComponents||(e._uninitializedComponentsProvider?(Rr("FirestoreClient","Using user provided OnlineComponentProvider"),await ff(e,e._uninitializedComponentsProvider._online)):(Rr("FirestoreClient","Using default OnlineComponentProvider"),await ff(e,new sf))),e._onlineComponents}function vf(e){return gf(e).then(e=>e.persistence)}function yf(e){return gf(e).then(e=>e.localStore)}function wf(e){return mf(e).then(e=>e.remoteStore)}function bf(e){return mf(e).then(e=>e.syncEngine)}function _f(e){return mf(e).then(e=>e.datastore)}async function If(e){const t=await mf(e),n=t.eventManager;return n.onListen=Ad.bind(null,t.syncEngine),n.onUnlisten=xd.bind(null,t.syncEngine),n}function Ef(e,t,n={}){const r=new zr;return e.asyncQueue.enqueueAndForget(async()=>function(e,t,n,r,i){const s=new af({next:s=>{t.enqueueAndForget(()=>dd(e,o));const a=s.docs.has(n);!a&&s.fromCache?i.reject(new qr(Br.UNAVAILABLE,"Failed to get document because the client is offline.")):a&&s.fromCache&&r&&"server"===r.source?i.reject(new qr(Br.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.)')):i.resolve(s)},error:e=>i.reject(e)}),o=new md(Vo(n.path),s,{includeMetadataChanges:!0,Ku:!0});return hd(e,o)}(await If(e),e.asyncQueue,t,n,r)),r.promise}function Tf(e,t,n={}){const r=new zr;return e.asyncQueue.enqueueAndForget(async()=>function(e,t,n,r,i){const s=new af({next:n=>{t.enqueueAndForget(()=>dd(e,o)),n.fromCache&&"server"===r.source?i.reject(new qr(Br.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.)')):i.resolve(n)},error:e=>i.reject(e)}),o=new md(n,s,{includeMetadataChanges:!0,Ku:!0});return hd(e,o)}(await If(e),e.asyncQueue,t,n,r)),r.promise}function Sf(e){const t={};return void 0!==e.timeoutSeconds&&(t.timeoutSeconds=e.timeoutSeconds),t}const kf=new Map;function Af(e,t,n){if(!n)throw new qr(Br.INVALID_ARGUMENT,`Function ${e}() cannot be called with an empty ${t}.`)}function Cf(e,t,n,r){if(!0===t&&!0===r)throw new qr(Br.INVALID_ARGUMENT,`${e} and ${n} cannot be used together.`)}function xf(e){if(!ui.isDocumentKey(e))throw new qr(Br.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${e} has ${e.length}.`)}function Of(e){if(ui.isDocumentKey(e))throw new qr(Br.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${e} has ${e.length}.`)}function Df(e){if(void 0===e)return"undefined";if(null===e)return"null";if("string"==typeof e)return e.length>20&&(e=`${e.substring(0,20)}...`),JSON.stringify(e);if("number"==typeof e||"boolean"==typeof e)return""+e;if("object"==typeof e){if(e instanceof Array)return"an array";{const t=function(e){return e.constructor?e.constructor.name:null}(e);return t?`a custom ${t} object`:"an object"}}return"function"==typeof e?"a function":Fr()}function Nf(e,t){if("_delegate"in e&&(e=e._delegate),!(e instanceof t)){if(t.name===e.constructor.name)throw new qr(Br.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=Df(e);throw new qr(Br.INVALID_ARGUMENT,`Expected type '${t.name}', but it was: ${n}`)}}return e}function Rf(e,t){if(t<=0)throw new qr(Br.INVALID_ARGUMENT,`Function ${e}() requires a positive number, but it was: ${t}.`)}class Pf{constructor(e){var t,n;if(void 0===e.host){if(void 0!==e.ssl)throw new qr(Br.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=null===(t=e.ssl)||void 0===t||t;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.cache=e.localCache,void 0===e.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==e.cacheSizeBytes&&e.cacheSizeBytes<1048576)throw new qr(Br.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}Cf("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:void 0===e.experimentalAutoDetectLongPolling?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=Sf(null!==(n=e.experimentalLongPollingOptions)&&void 0!==n?n:{}),function(e){if(void 0!==e.timeoutSeconds){if(isNaN(e.timeoutSeconds))throw new qr(Br.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (must not be NaN)`);if(e.timeoutSeconds<5)throw new qr(Br.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (minimum allowed value is 5)`);if(e.timeoutSeconds>30)throw new qr(Br.INVALID_ARGUMENT,`invalid long polling timeout: ${e.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&(t=this.experimentalLongPollingOptions,n=e.experimentalLongPollingOptions,t.timeoutSeconds===n.timeoutSeconds)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams;var t,n}}class Lf{constructor(e,t,n,r){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=n,this._app=r,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Pf({}),this._settingsFrozen=!1}get app(){if(!this._app)throw new qr(Br.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return void 0!==this._terminateTask}_setSettings(e){if(this._settingsFrozen)throw new qr(Br.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 Pf(e),void 0!==e.credentials&&(this._authCredentials=function(e){if(!e)return new Gr;switch(e.type){case"firstParty":return new Qr(e.sessionIndex||"0",e.iamToken||null,e.authTokenFactory||null);case"provider":return e.client;default:throw new qr(Br.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invali
2d credential type")}}(e.credentials))}_getSettings(){return this._settings}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask||(this._terminateTask=this._terminate()),this._terminateTask}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(e){const t=kf.get(e);t&&(Rr("ComponentProvider","Removing Datastore"),kf.delete(e),t.terminate())}(this),Promise.resolve()}}function Mf(e,t,n,r={}){var i;const s=(e=Nf(e,Lf))._getSettings(),o=`${t}:${n}`;if("firestore.googleapis.com"!==s.host&&s.host!==o&&Lr("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),e._setSettings(Object.assign(Object.assign({},s),{host:o,ssl:!1})),r.mockUserToken){let t,n;if("string"==typeof r.mockUserToken)t=r.mockUserToken,n=Cr.MOCK_USER;else{t=(0,a.Fy)(r.mockUserToken,null===(i=e._app)||void 0===i?void 0:i.options.projectId);const s=r.mockUserToken.sub||r.mockUserToken.user_id;if(!s)throw new qr(Br.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");n=new Cr(s)}e._authCredentials=new Kr(new $r(t,n))}}class Ff{constructor(e,t,n){this.converter=t,this._key=n,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Uf(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new Ff(this.firestore,e,this._key)}}class jf{constructor(e,t,n){this.converter=t,this._query=n,this.type="query",this.firestore=e}withConverter(e){return new jf(this.firestore,e,this._query)}}class Uf extends jf{constructor(e,t,n){super(e,t,Vo(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new Ff(this.firestore,null,new ui(e))}withConverter(e){return new Uf(this.firestore,e,this._path)}}function Vf(e,t,...n){if(e=(0,a.Ku)(e),Af("collection","path",t),e instanceof Lf){const r=oi.fromString(t,...n);return Of(r),new Uf(e,null,r)}{if(!(e instanceof Ff||e instanceof Uf))throw new qr(Br.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=e._path.child(oi.fromString(t,...n));return Of(r),new Uf(e.firestore,null,r)}}function Bf(e,t){if(e=Nf(e,Lf),Af("collectionGroup","collection id",t),t.indexOf("/")>=0)throw new qr(Br.INVALID_ARGUMENT,`Invalid collection ID '${t}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);return new jf(e,null,function(e){return new jo(oi.emptyPath(),e)}(t))}function qf(e,t,...n){if(e=(0,a.Ku)(e),1===arguments.length&&(t=Zr.A()),Af("doc","path",t),e instanceof Lf){const r=oi.fromString(t,...n);return xf(r),new Ff(e,null,new ui(r))}{if(!(e instanceof Ff||e instanceof Uf))throw new qr(Br.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=e._path.child(oi.fromString(t,...n));return xf(r),new Ff(e.firestore,e instanceof Uf?e.converter:null,new ui(r))}}function zf(e,t){return e=(0,a.Ku)(e),t=(0,a.Ku)(t),(e instanceof Ff||e instanceof Uf)&&(t instanceof Ff||t instanceof Uf)&&e.firestore===t.firestore&&e.path===t.path&&e.converter===t.converter}function $f(e,t){return e=(0,a.Ku)(e),t=(0,a.Ku)(t),e instanceof jf&&t instanceof jf&&e.firestore===t.firestore&&Qo(e._query,t._query)&&e.converter===t.converter}class Gf{constructor(){this.Gc=Promise.resolve(),this.Qc=[],this.jc=!1,this.zc=[],this.Wc=null,this.Hc=!1,this.Jc=!1,this.Yc=[],this.qo=new Eh(this,"async_queue_retry"),this.Xc=()=>{const e=_h();e&&Rr("AsyncQueue","Visibility state changed to "+e.visibilityState),this.qo.Mo()};const e=_h();e&&"function"==typeof e.addEventListener&&e.addEventListener("visibilitychange",this.Xc)}get isShuttingDown(){return this.jc}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Zc(),this.ta(e)}enterRestrictedMode(e){if(!this.jc){this.jc=!0,this.Jc=e||!1;const t=_h();t&&"function"==typeof t.removeEventListener&&t.removeEventListener("visibilitychange",this.Xc)}}enqueue(e){if(this.Zc(),this.jc)return new Promise(()=>{});const t=new zr;return this.ta(()=>this.jc&&this.Jc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Qc.push(e),this.ea()))}async ea(){if(0!==this.Qc.length){try{await this.Qc[0](),this.Qc.shift(),this.qo.reset()}catch(e){if(!Ai(e))throw e;Rr("AsyncQueue","Operation failed with retryable error: "+e)}this.Qc.length>0&&this.qo.No(()=>this.ea())}}ta(e){const t=this.Gc.then(()=>(this.Hc=!0,e().catch(e=>{this.Wc=e,this.Hc=!1;const t=function(e){let t=e.message||"";return e.stack&&(t=e.stack.includes(e.message)?e.stack:e.message+"\n"+e.stack),t}(e);throw Pr("INTERNAL UNHANDLED ERROR: ",t),e}).then(e=>(this.Hc=!1,e))));return this.Gc=t,t}enqueueAfterDelay(e,t,n){this.Zc(),this.Yc.indexOf(e)>-1&&(t=0);const r=id.createAndSchedule(this,e,t,n,e=>this.na(e));return this.zc.push(r),r}Zc(){this.Wc&&Fr()}verifyOperationInProgress(){}async sa(){let e;do{e=this.Gc,await e}while(e!==this.Gc)}ia(e){for(const t of this.zc)if(t.timerId===e)return!0;return!1}ra(e){return this.sa().then(()=>{this.zc.sort((e,t)=>
2e.targetTimeMs-t.targetTimeMs);for(const t of this.zc)if(t.skipDelay(),"all"!==e&&t.timerId===e)break;return this.sa()})}oa(e){this.Yc.push(e)}na(e){const t=this.zc.indexOf(e);this.zc.splice(t,1)}}function Kf(e){return function(e){if("object"!=typeof e||null===e)return!1;const t=e;for(const e of["next","error","complete"])if(e in t&&"function"==typeof t[e])return!0;return!1}(e)}class Wf{constructor(){this._progressObserver={},this._taskCompletionResolver=new zr,this._lastProgress={taskState:"Running",totalBytes:0,totalDocuments:0,bytesLoaded:0,documentsLoaded:0}}onProgress(e,t,n){this._progressObserver={next:e,error:t,complete:n}}catch(e){return this._taskCompletionResolver.promise.catch(e)}then(e,t){return this._taskCompletionResolver.promise.then(e,t)}_completeWith(e){this._updateProgress(e),this._progressObserver.complete&&this._progressObserver.complete(),this._taskCompletionResolver.resolve(e)}_failWith(e){this._lastProgress.taskState="Error",this._progressObserver.next&&this._progressObserver.next(this._lastProgress),this._progressObserver.error&&this._progressObserver.error(e),this._taskCompletionResolver.reject(e)}_updateProgress(e){this._lastProgress=e,this._progressObserver.next&&this._progressObserver.next(e)}}const Hf=-1;class Qf extends Lf{constructor(e,t,n,r){super(e,t,n,r),this.type="firestore",this._queue=new Gf,this._persistenceKey=(null==r?void 0:r.name)||"[DEFAULT]"}_terminate(){return this._firestoreClient||Jf(this),this._firestoreClient.terminate()}}function Yf(e,t){const n="object"==typeof e?e:(0,i.getApp)(),r="string"==typeof e?e:t||"(default)",s=(0,i._getProvider)(n,"firestore").getImmediate({identifier:r});if(!s._initialized){const e=(0,a.yU)("firestore");e&&Mf(s,...e)}return s}function Xf(e){return e._firestoreClient||Jf(e),e._firestoreClient.verifyNotTerminated(),e._firestoreClient}function Jf(e){var t,n,r;const i=e._freezeSettings(),s=function(e,t,n,r){return new Rs(e,t,n,r.host,r.ssl,r.experimentalForceLongPolling,r.experimentalAutoDetectLongPolling,Sf(r.experimentalLongPollingOptions),r.useFetchStreams)}(e._databaseId,(null===(t=e._app)||void 0===t?void 0:t.options.appId)||"",e._persistenceKey,i);e._firestoreClient=new hf(e._authCredentials,e._appCheckCredentials,e._queue,s),(null===(n=i.cache)||void 0===n?void 0:n._offlineComponentProvider)&&(null===(r=i.cache)||void 0===r?void 0:r._onlineComponentProvider)&&(e._firestoreClient._uninitializedComponentsProvider={_offlineKind:i.cache.kind,_offline:i.cache._offlineComponentProvider,_online:i.cache._onlineComponentProvider})}function Zf(e,t){cp(e=Nf(e,Qf));const n=Xf(e);if(n._uninitializedComponentsProvider)throw new qr(Br.FAILED_PRECONDITION,"SDK cache is already specified.");
2Lr("enableIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");const r=e._freezeSettings(),i=new sf;return tp(n,i,new nf(i,r.cacheSizeBytes,null==t?void 0:t.forceOwnership))}function ep(e){cp(e=Nf(e,Qf));const t=Xf(e);if(t._uninitializedComponentsProvider)throw new qr(Br.FAILED_PRECONDITION,"SDK cache is already specified.");Lr("enableMultiTabIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");const n=e._freezeSettings(),r=new sf;return tp(t,r,new rf(r,n.cacheSizeBytes))}function tp(e,t,n){const r=new zr;return e.asyncQueue.enqueue(async()=>{try{await df(e,n),await ff(e,t),r.resolve()}catch(e){const t=e;if(!pf(t))throw t;Lr("Error enabling indexeddb cache. Falling back to memory cache: "+t),r.reject(t)}}).then(()=>r.promise)}function np(e){if(e._initialized&&!e._terminated)throw new qr(Br.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");const t=new zr;return e._queue.enqueueAndForgetEvenWhileRestricted(async()=>{try{await async function(e){if(!Ti.D())return Promise.resolve();const t=e+"main";await Ti.delete(t)}(Vl(e._databaseId,e._persistenceKey)),t.resolve()}catch(e){t.reject(e)}}),t.promise}function rp(e){return function(e){const t=new zr;return e.asyncQueue.enqueueAndForget(async()=>async function(e,t){const n=Vr(e);jh(n.remoteStore)||Rr("SyncEngine","The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.");try{const e=await function(e){const t=Vr(e);return t.persistence.runTransaction("Get highest unacknowledged batch id","readonly",e=>t.mutationQueue.getHighestUnacknowledgedBatchId(e))}(n.localStore);if(-1===e)return void t.resolve();const r=n.Ec.get(e)||[];r.push(t),n.Ec.set(e,r)}catch(e){const n=sd(e,"Initialization of waitForPendingWrites() operation failed");t.reject(n)}}(await bf(e),t)),t.promise}(Xf(e=Nf(e,Qf)))}function ip(e){return function(e){return e.asyncQueue.enqueue(async()=>{const t=await vf(e),n=await wf(e);return t.setNetworkEnabled(!0),function(e){const t=Vr(e);return t.vu.delete(0),Oh(t)}(n)})}(Xf(e=Nf(e,Qf)))}function sp(e){return function(e){return e.asyncQueue.enqueue(async()=>{const t=await vf(e),n=await wf(e);return t.setNetworkEnabled(!1),async function(e){const t=Vr(e);t.vu.add(0),await Dh(t),t.bu.set("Offline")}(n)})}(Xf(e=Nf(e,Qf)))}function op(e,t){const n=Xf(e=Nf(e,Qf)),r=new Wf;return function(e,t,n,r){const i=function(e,t){let n;return n="string"==typeof e?sc().encode(e):e,function(e,t){return new cf(e,t)}(function(e,t){if(e instanceof Uint8Array)return of(e,t);if(e instanceof ArrayBuffer)return of(new Uint8Array(e),t);if(e instanceof ReadableStream)return e.getReader();throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream")}(n),t)}(n,Ih(t));e.asyncQueue.enqueueAndForget(async()=>{!function(e,t,n){const r=Vr(e);(async function(e,t,n){try{const r=await t.getMetadata();if(await function(e,t){const n=Vr(e),r=Cc(t.createTime);return n.persistence.runTransaction("hasNewerBundle","readonly",e=>n.qs.getBundleMetadata(e,t.id)).then(e=>!!e&&e.createTime.compareTo(r)>=0)}(e.localStore,r))return await t.close(),n._completeWith(function(e){return{taskState:"Success",documentsLoaded:e.totalDocuments,bytesLoaded:e.totalBytes,totalDocuments:e.totalDocuments,totalBytes:e.totalBytes}}(r)),Promise.resolve(new Set);n._updateProgress(bd(r));const i=new wd(r,e.localStore,t.serializer);let s=await t.bc();for(;s;){const e=await i.zu(s);e&&n._updateProgress(e),s=await t.bc()}const o=await i.complete();return await qd(e,o.Ju,void 0),await function(e,t){const n=Vr(e);return n.persistence.runTransaction("Save bundle","readwrite",e=>n.qs.saveBundleMetadata(e,t))}(e.localStore,r),n._completeWith(o.progress),Promise.resolve(o.Hu)}catch(e){return Lr("SyncEngine",`Loading bundle failed with ${e}`),n._failWith(e),Promise.resolve(new Set)}})(r,t,n).then(e=>{r.sharedClientState.notifyBundleLoaded(e)})}(await bf(e),i,r)})}(n,e._databaseId,t,r),r}function ap(e,t){return function(e,t){return e.asyncQueue.enqueue(async()=>function(e,t){const n=Vr(e);return n.persistence.runTransaction("Get named query","readonly",e=>
vendor: 6,486 bytes, line 2
2n.qs.getNamedQuery(e,t))}(await yf(e),t))}(Xf(e=Nf(e,Qf)),t).then(t=>t?new jf(e,null,t.query):null)}function cp(e){if(e._initialized||e._terminated)throw new qr(Br.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.")}class up{constructor(e="count",t){this._aggregateType=e,this._internalFieldPath=t,this.type="AggregateField"}}class lp{constructor(e,t,n){this._userDataWriter=t,this._data=n,this.type="AggregateQuerySnapshot",this.query=e}data(){return this._userDataWriter.convertObjectMap(this._data)}}class hp{constructor(e){this._byteString=e}static fromBase64String(e){try{return new hp(Ss.fromBase64String(e))}catch(e){throw new qr(Br.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+e)}}static fromUint8Array(e){return new hp(Ss.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}}class dp{constructor(...e){for(let t=0;t<e.length;++t)if(0===e[t].length)throw new qr(Br.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new ci(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}class fp{constructor(e){this._methodName=e}}class pp{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new qr(Br.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new qr(Br.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return ei(this._lat,e._lat)||ei(this._long,e._long)}}const gp=/^__.*__$/;class mp{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return null!==this.fieldMask?new qa(e,this.data,this.fieldMask,t,this.fieldTransforms):new Ba(e,this.data,t,this.fieldTransforms)}}class vp{constructor(e,t,n){this.data=e,this.fieldMask=t,this.fieldTransforms=n}toMutation(e,t){return new qa(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function yp(e){switch(e){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Fr()}}class wp{constructor(e,t,n,r,i,s){this.settings=e,this.databaseId=t,this.serializer=n,this.ignoreUndefinedProperties=r,void 0===i&&this.ua(),this.fieldTransforms=i||[],this.fieldMask=s||[]}get path(){return this.settings.path}get ca(){return this.settings.ca}aa(e){return new wp(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}ha(e){var t;const n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.aa({path:n,la:!1});return r.fa(e),r}da(e){var t;const n=null===(t=this.path)||void 0===t?void 0:t.child(e),r=this.aa({path:n,la:!1});return r.ua(),r}wa(e){return this.aa({path:void 0,la:!0})}_a(e){return Up(e,this.settings.methodName,this.settings.ma||!1,this.path,this.settings.ga)}contains(e){return void 0!==this.fieldMask.find(t=>e.isPrefixOf(t))||void 0!==this.fieldTransforms.find(t=>e.isPrefixOf(t.field))}ua(){if(this.path)for(let e=0;e<this.path.length;e++)this.fa(this.path.get(e))}fa(e){if(0===e.length)throw this._a("Document fields must not be empty");if(yp(this.ca)&&gp.test(e))throw this._a('Document fields cannot begin and end with "__"')}}class bp{constructor(e,t,n){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer=n||Ih(e)}ya(e,t,n,r=!1){return new wp({ca:e,methodName:t,ga:n,path:ci.emptyPath(),la:!1,ma:r},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function _p(e){const t=e._freezeSettings(),n=Ih(e._databaseId);return new bp(e._databaseId,!!t.ignoreUndefinedProperties,n)}function Ip(e,t,n,r,i,s={}){const o=e.ya(s.merge||s.mergeFields?2:0,t,n,i);Lp("Data must be an object, but it was:",o,r);const a=Rp(r,o);let c,u;if(s.merge)c=new Is(o.fieldMask),u=o.fieldTransforms;else if(s.mergeFields){const e=[];for(const r of s.mergeFields){const i=Mp(t,r,n);if(!o.contains(i))throw new qr(Br.INVALID_ARGUMENT,`Field '${i}' is specified in your field mask but missing from your input data.`);Vp(e,i)||e.push(i)}c=new Is(e),u=o.fieldTransforms.filter(e=>c.covers(e.field))}else c=null,u=o.fieldTransforms;return new mp(new no(a),c,u)}class Ep extends fp{_toFieldTransform(e){if(2!==e.ca)throw 1===e.ca?e._a(`${this._methodName}() can only appear at the top level of your update data`):e._a(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof Ep}}function Tp(e,t,n){return new wp({ca:3,ga:t.settings.ga,methodName:e._methodName,la:n},t.databaseId,t.serializer,t.ignoreUndefinedProperties)}class Sp extends fp{_toFieldTransform(e){return new Da(e.path,new Ea)}isEqual(e){return e instanceof Sp}}class kp extends fp{constructor(e,t){super(e),this.pa=t}_toFieldTransform(e){const t=Tp(this,e,!0),n=this.pa.map(e=>Np(e,t)),r=new Ta(n);return new Da(e.path,r)}isEqual(e){return this===e}}class Ap extends fp{constructor(e,t){super(e),this.pa=t}_toFieldTransform(e){const t=Tp(this,e,!0),n=this.pa.map(e=>Np(e,t)),r=new ka(n);return new Da(e.path,r)}isEqual(e){return this===e}}class Cp extends fp{constructor(e,t){super(e),this.Ia=t}_toFieldTransform(e){const t=new Ca(e.serializer,ya(e.serializer,this.Ia));return new Da(e.path,t)}isEqual(e){return this===e}}function xp(e,t,n,r){const i=e.ya(1,t,n);Lp("Data must be an object, but it was:",i,r);const s=[],o=no.empty();ps(r,(e,r)=>{const c=jp(t,e,n);r=(0,a.Ku)(r);const u=i.da(c);if(r instanceof Ep)s.push(c);else{const e=Np(r,u);null!=e&&(s.push(c),o.set(c,e))}});const c=new Is(s);return new vp(o,c,i.fieldTransforms)}function Op(e,t,n,r,i,s){const o=e.ya(1,t,n),c=[Mp(t,r,n)],u=[i];if(s.length%2!=0)throw new qr(Br.INVALID_ARGUMENT,`Function ${t}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let e=0;e<s.length;e+=2)c.push(Mp(t,s[e])),u.push(s[e+1]);const l=[],h=no.empty();for(let e=c.length-1;e>=0;--e)if(!Vp(l,c[e])){const t=c[e];let n=u[e];n=(0,a.Ku)(n);const r=o.da(t);if(n instanceof Ep)l.push(t);else{const e=Np(n,r);
vendor: 14,593 bytes, line 2
2null!=e&&(l.push(t),h.set(t,e))}}const d=new Is(l);return new vp(h,d,o.fieldTransforms)}function Dp(e,t,n,r=!1){return Np(n,e.ya(r?4:3,t))}function Np(e,t){if(Pp(e=(0,a.Ku)(e)))return Lp("Unsupported field value:",t,e),Rp(e,t);if(e instanceof fp)return function(e,t){if(!yp(t.ca))throw t._a(`${e._methodName}() can only be used with update() and set()`);if(!t.path)throw t._a(`${e._methodName}() is not currently supported inside arrays`);const n=e._toFieldTransform(t);n&&t.fieldTransforms.push(n)}(e,t),null;if(void 0===e&&t.ignoreUndefinedProperties)return null;if(t.path&&t.fieldMask.push(t.path),e instanceof Array){if(t.settings.la&&4!==t.ca)throw t._a("Nested arrays are not supported");return function(e,t){const n=[];let r=0;for(const i of e){let e=Np(i,t.wa(r));null==e&&(e={nullValue:"NULL_VALUE"}),n.push(e),r++}return{arrayValue:{values:n}}}(e,t)}return function(e,t){if(null===(e=(0,a.Ku)(e)))return{nullValue:"NULL_VALUE"};if("number"==typeof e)return ya(t.serializer,e);if("boolean"==typeof e)return{booleanValue:e};if("string"==typeof e)return{stringValue:e};if(e instanceof Date){const n=ri.fromDate(e);return{timestampValue:Sc(t.serializer,n)}}if(e instanceof ri){const n=new ri(e.seconds,1e3*Math.floor(e.nanoseconds/1e3));return{timestampValue:Sc(t.serializer,n)}}if(e instanceof pp)return{geoPointValue:{latitude:e.latitude,longitude:e.longitude}};if(e instanceof hp)return{bytesValue:kc(t.serializer,e._byteString)};if(e instanceof Ff){const n=t.databaseId,r=e.firestore._databaseId;if(!r.isEqual(n))throw t._a(`Document reference is for database ${r.projectId}/${r.database} but should be for database ${n.projectId}/${n.database}`);return{referenceValue:xc(e.firestore._databaseId||t.databaseId,e._key.path)}}throw t._a(`Unsupported field value: ${Df(e)}`)}(e,t)}function Rp(e,t){const n={};return gs(e)?t.path&&t.path.length>0&&t.fieldMask.push(t.path):ps(e,(e,r)=>{const i=Np(r,t.ha(e));null!=i&&(n[e]=i)}),{mapValue:{fields:n}}}function Pp(e){return!("object"!=typeof e||null===e||e instanceof Array||e instanceof Date||e instanceof ri||e instanceof pp||e instanceof hp||e instanceof Ff||e instanceof fp)}function Lp(e,t,n){if(!Pp(n)||!function(e){return"object"==typeof e&&null!==e&&(Object.getPrototypeOf(e)===Object.prototype||null===Object.getPrototypeOf(e))}(n)){const r=Df(n);throw"an object"===r?t._a(e+" a custom object"):t._a(e+" "+r)}}function Mp(e,t,n){if((t=(0,a.Ku)(t))instanceof dp)return t._internalPath;if("string"==typeof t)return jp(e,t);throw Up("Field path arguments must be of type string or ",e,!1,void 0,n)}const Fp=new RegExp("[~\\*/\\[\\]]");function jp(e,t,n){if(t.search(Fp)>=0)throw Up(`Invalid field path (${t}). Paths must not contain '~', '*', '/', '[', or ']'`,e,!1,void 0,n);try{return new dp(...t.split("."))._internalPath}catch(r){throw Up(`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,e,!1,void 0,n)}}function Up(e,t,n,r,i){const s=r&&!r.isEmpty(),o=void 0!==i;let a=`Function ${t}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let c="";return(s||o)&&(c+=" (found",s&&(c+=` in field ${r}`),o&&(c+=` in document ${i}`),c+=")"),new qr(Br.INVALID_ARGUMENT,a+e+c)}function Vp(e,t){return e.some(e=>e.isEqual(t))}class Bp{constructor(e,t,n,r,i){this._firestore=e,this._userDataWriter=t,this._key=n,this._document=r,this._converter=i}get id(){return this._key.path.lastSegment()}get ref(){return new Ff(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const e=new qp(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const t=this._document.data.field(zp("DocumentSnapshot.get",e));if(null!==t)return this._userDataWriter.convertValue(t)}}}class qp extends Bp{data(){return super.data()}}function zp(e,t){return"string"==typeof t?jp(e,t):t instanceof dp?t._internalPath:t._delegate._internalPath}function $p(e){if("L"===e.limitType&&0===e.explicitOrderBy.length)throw new qr(Br.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class Gp{}class Kp extends Gp{}function Wp(e,t,...n){let r=[];t instanceof Gp&&r.push(t),r=r.concat(n),function(e){const t=e.filter(e=>e instanceof Yp).length,n=e.filter(e=>e instanceof Hp).length;if(t>1||t>0&&n>0)throw new qr(Br.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(r);for(const t of r)e=t._apply(e);return e}class Hp extends Kp{constructor(e,t,n){super(),this._field=e,this._op=t,this._value=n,this.type="where"}static _create(e,t,n){return new Hp(e,t,n)}_apply(e){const t=this._parse(e);return hg(e._query,t),new jf(e.firestore,e.converter,Wo(e._query,t))}_parse(e){const t=_p(e.firestore),n=function(e,t,n,r,i,s,o){let a;if(i.isKeyField()){if("array-contains"===s||"array-contains-any"===s)throw new qr(Br.INVALID_ARGUMENT,`Invalid Query. You can't perform '${s}' queries on documentId().`);if("in"===s||"not-in"===s){lg(o,s);const t=[];for(const n of o)t.push(ug(r,e,n));a={arrayValue:{values:t}}}else a=ug(r,e,o)}else"in"!==s&&"not-in"!==s&&"array-contains-any"!==s||lg(o,s),a=Dp(n,"where",o,"in"===s||"not-in"===s);return ho.create(i,s,a)}(e._query,0,t,e.firestore._databaseId,this._field,this._op,this._value);return n}}function Qp(e,t,n){const r=t,i=zp("where",e);return Hp._create(i,r,n)}class Yp extends Gp{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new Yp(e,t)}_parse(e){const t=this._queryConstraints.map(t=>t._parse(e)).filter(e=>e.getFilters().length>0);return 1===t.length?t[0]:fo.create(t,this._getOperator())}_apply(e){const t=this._parse(e);return 0===t.getFilters().length?e:(function(e,t){let n=e;const r=t.getFlattenedFilters();for(const e of r)hg(n,e),n=Wo(n,e)}(e._query,t),new jf(e.firestore,e.converter,Wo(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return"and"===this.type?"and":"or"}}class Xp extends Kp{constructor(e,t){super(),this._field=e,this._direction=t,this.type="orderBy"}static _create(e,t){return new Xp(e,t)}_apply(e){const t=function(e,t,n){if(null!==e.startAt)throw new qr(Br.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(null!==e.endAt)throw new qr(Br.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");const r=new co(t,n);return function(e,t){if(null===qo(e)){const n=zo(e);null!==n&&dg(0,n,t.field)}}(e,r),r}(e._query,this._field,this._direction);return new jf(e.firestore,e.converter,function(e,t){const n=e.explicitOrderBy.concat([t]);return new jo(e.path,e.collectionGroup,n,e.filters.slice(),e.limit,e.limitType,e.startAt,e.endAt)}(e._query,t))}}function Jp(e,t="asc"){const n=t,r=zp("orderBy",e);return Xp._create(r,n)}class Zp extends Kp{constructor(e,t,n){super(),this.type=e,this._limit=t,this._limitType=n}static _create(e,t,n){return new Zp(e,t,n)}_apply(e){return new jf(e.firestore,e.converter,Ho(e._query,this._limit,this._limitType))}}function eg(e){return Rf("limit",e),Zp._create("limit",e,"F")}function tg(e){return Rf("limitToLast",e),Zp._create("limitToLast",e,"L")}class ng extends Kp{constructor(e,t,n){super(),this.type=e,this._docOrFields=t,this._inclusive=n}static _create(e,t,n){return new ng(e,t,n)}_apply(e){const t=cg(e,this.type,this._docOrFields,this._inclusive);return new jf(e.firestore,e.converter,function(e,t){return new jo(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,t,e.endAt)}(e._query,t))}}function rg(...e){return ng._create("startAt",e,!0)}function ig(...e){return ng._create("startAfter",e,!1)}class sg extends Kp{constructor(e,t,n){super(),this.type=e,this._docOrFields=t,this._inclusive=n}static _create(e,t,n){return new sg(e,t,n)}_apply(e){const t=cg(e,this.type,this._docOrFields,this._inclusive);return new jf(e.firestore,e.converter,function(e,t){return new jo(e.path,e.collectionGroup,e.explicitOrderBy.slice(),e.filters.slice(),e.limit,e.limitType,e.startAt,t)}(e._query,t))}}function og(...e){return sg._create("endBefore",e,!1)}function ag(...e){return sg._create("endAt",e,!0)}function cg(e,t,n,r){if(n[0]=(0,a.Ku)(n[0]),n[0]instanceof Bp)return function(e,t,n,r,i){if(!r)throw new qr(Br.NOT_FOUND,`Can't use a DocumentSnapshot that doesn't exist for ${n}().`);const s=[];for(const n of Go(e))if(n.field.isKeyField())s.push($s(t,r.key));else{const e=r.data.field(n.field);if(Os(e))throw new qr(Br.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+n.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(null===e){const e=n.field.canonicalString();throw new qr(Br.INVALID_ARGUMENT,`Invalid query. You are trying to start or end a query using a document for which the field '${e}' (used as the orderBy) does not exist.`)}s.push(e)}return new so(s,i)}(e._query,e.firestore._databaseId,t,n[0]._document,r);{const i=_p(e.firestore);return function(e,t,n,r,i,s){const o=e.explicitOrderBy;if(i.length>o.length)throw new qr(Br.INVALID_ARGUMENT,`Too many arguments provided to ${r}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);const a=[];for(let s=0;s<i.length;s++){const c=i[s];if(o[s].field.isKeyField()){if("string"!=typeof c)throw new qr(Br.INVALID_ARGUMENT,`Invalid query. Expected a string for document ID in ${r}(), but got a ${typeof c}`);if(!$o(e)&&-1!==c.indexOf("/"))throw new qr(Br.INVALID_ARGUMENT,`Invalid query. When querying a collection and ordering by documentId(), the value passed to ${r}() must be a plain document ID, but '${c}' contains a slash.`);const n=e.path.child(oi.fromString(c));if(!ui.isDocumentKey(n))throw new qr(Br.INVALID_ARGUMENT,`Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${r}() must result in a valid document path, but '${n}' is not because it contains an odd number of segments.`);const i=new ui(n);a.push($s(t,i))}else{const e=Dp(n,r,c);a.push(e)}}return new so(a,s)}(e._query,e.firestore._databaseId,i,t,n,r)}}function ug(e,t,n){if("string"==typeof(n=(0,a.Ku)(n))){if(""===n)throw new qr(Br.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!$o(t)&&-1!==n.indexOf("/"))throw new qr(Br.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);const r=t.path.child(oi.fromString(n));if(!ui.isDocumentKey(r))throw new qr(Br.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return $s(e,new ui(r))}if(n instanceof Ff)return $s(e,n._key);throw new qr(Br.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${Df(n)}.`)}function lg(e,t){if(!Array.isArray(e)||0===e.length)throw new qr(Br.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${t.toString()}' filters.`)}function hg(e,t){if(t.isInequality()){const n=zo(e),r=t.field;if(null!==n&&!n.isEqual(r))throw new qr(Br.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 '${n.toString()}' and '${r.toString()}'`);const i=qo(e);null!==i&&dg(0,r,i)}const n=function(e,t){for(const n of e)for(const e of n.getFlattenedFilters())if(t.indexOf(e.op)>=0)return e.op;return null}(e.filters,function(e){switch(e){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(t.op));if(null!==n)throw n===t.op?new qr(Br.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${t.op.toString()}' filter.`):new qr(Br.INVALID_ARGUMENT,`Invalid query. You cannot use '${t.op.toString()}' filters with '${n.toString()}' filters.`)}function dg(e,t,n){if(!n.isEqual(t))throw new qr(Br.INVALID_ARGUMENT,`Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${t.toString()}' and so you must also use '${t.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`)}class fg{convertValue(e,t="none"){switch(Fs(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Cs(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(xs(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 10:return this.convertObject(e.mapValue,t);default:throw Fr()}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){const n={};return ps(e,(e,r)=>{n[e]=this.convertValue(r,t)}),n}convertGeoPoint(e){return new pp(Cs(e.latitude),Cs(e.longitude))}convertArray(e,t){return(e.values||[]).map(e=>this.convertValue(e,t))}convertServerTimestamp(e,t){switch(t){case"previous":const n=Ds(e);return null==n?null:this.convertValue(n,t);case"estimate":return this.convertTimestamp(Ns(e));default:return null}}convertTimestamp(e){const t=As(e);return new ri(t.seconds,t.nanos)}convertDocumentKey(e,t){const n=oi.fromString(e);jr(Jc(n));const r=new Ps(n.get(1),n.get(3)),i=new ui(n.popFirst(5));return r.isEqual(t)||Pr(`Document ${i} contains a document reference within a different database (${r.projectId}/${r.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),i}}function pg(e,t,n){let r;return r=e?n&&(n.merge||n.mergeFields)?e.toFirestore(t,n):e.toFirestore(t):t,r}class gg extends fg{constructor(e){super(),this.firestore=e}convertBytes(e){return new hp(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);
2return new Ff(this.firestore,null,t)}}class mg{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class vg extends Bp{constructor(e,t,n,r,i,s){super(e,t,n,r,s),this._firestore=e,this._firestoreImpl=e,this.metadata=i}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new yg(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const n=this._document.data.field(zp("DocumentSnapshot.get",e));if(null!==n)return this._userDataWriter.convertValue(n,t.serverTimestamps)}}}class yg extends vg{data(e={}){return super.data(e)}}class wg{constructor(e,t,n,r){this._firestore=e,this._userDataWriter=t,this._snapshot=r,this.metadata=new mg(r.hasPendingWrites,r.fromCache),this.query=n}get docs(){const e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(e,t){this._snapshot.docs.forEach(n=>{e.call(t,new yg(this._firestore,this._userDataWriter,n.key,n,new mg(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new qr(Br.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(e,t){if(e._snapshot.oldDocs.isEmpty()){let t=0;return e._snapshot.docChanges.map(n=>{const r=new yg(e._firestore,e._userDataWriter,n.doc.key,n.doc,new mg(e._snapshot.mutatedKeys.has(n.doc.key),e._snapshot.fromCache),e.query.converter);return n.doc,{type:"added",doc:r,oldIndex:-1,newIndex:t++}})}{let n=e._snapshot.oldDocs;return e._snapshot.docChanges.filter(e=>t||3!==e.type).map(t=>{const r=new yg(e._firestore,e._userDataWriter,t.doc.key,t.doc,new mg(e._snapshot.mutatedKeys.has(t.doc.key),e._snapshot.fromCache),e.query.converter);let i=-1,s=-1;return 0!==t.type&&(i=n.indexOf(t.doc.key),n=n.delete(t.doc.key)),1!==t.type&&(n=n.add(t.doc),s=n.indexOf(t.doc.key)),{type:bg(t.type),doc:r,oldIndex:i,newIndex:s}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}}function bg(e){switch(e){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Fr()}}function _g(e,t){return e instanceof vg&&t instanceof vg?e._firestore===t._firestore&&e._key.isEqual(t._key)&&(null===e._document?null===t._document:e._document.isEqual(t._document))&&e._converter===t._converter:e instanceof wg&&t instanceof wg&&e._firestore===t._firestore&&$f(e.query,t.query)&&e.metadata.isEqual(t.metadata)&&e._snapshot.isEqual(t._snapshot)}function Ig(e){e=Nf(e,Ff);const t=Nf(e.firestore,Qf);return Ef(Xf(t),e._key).then(n=>Mg(t,e,n))}class Eg extends fg{constructor(e){super(),this.firestore=e}convertBytes(e){return new hp(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new Ff(this.firestore,null,t)}}function Tg(e){e=Nf(e,Ff);const t=Nf(e.firestore,Qf),n=Xf(t),r=new Eg(t);return function(e,t){const n=new zr;return e.asyncQueue.enqueueAndForget(async()=>async function(e,t,n){try{const r=await function(e,t){const n=Vr(e);return n.persistence.runTransaction("read document","readonly",e=>n.localDocuments.getDocument(e,t))}(e,t);r.isFoundDocument()?n.resolve(r):r.isNoDocument()?n.resolve(null):n.reject(new qr(Br.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.)"))}catch(e){const r=sd(e,`Failed to get document '${t} from cache`);n.reject(r)}}(await yf(e),t,n)),n.promise}(n,e._key).then(n=>new vg(t,r,e._key,n,new mg(null!==n&&n.hasLocalMutations,!0),e.converter))}function Sg(e){e=Nf(e,Ff);const t=Nf(e.firestore,Qf);return Ef(Xf(t),e._key,{source:"server"}).then(n=>Mg(t,e,n))}function kg(e){e=Nf(e,jf);const t=Nf(e.firestore,Qf),n=Xf(t),r=new Eg(t);return $p(e._query),Tf(n,e._query).then(n=>new wg(t,r,e,n))}function Ag(e){e=Nf(e,jf);const t=Nf(e.firestore,Qf),n=Xf(t),r=new Eg(t);return function(e,t){const n=new zr;return e.asyncQueue.enqueueAndForget(async()=>async function(e,t,n){try{const r=await Xl(e,t,!0),i=new Ed(t,r.ir),s=i.sc(r.documents),o=i.applyChanges(s,
2!1);n.resolve(o.snapshot)}catch(e){const r=sd(e,`Failed to execute query '${t} against cache`);n.reject(r)}}(await yf(e),t,n)),n.promise}(n,e._query).then(n=>new wg(t,r,e,n))}function Cg(e){e=Nf(e,jf);const t=Nf(e.firestore,Qf),n=Xf(t),r=new Eg(t);return Tf(n,e._query,{source:"server"}).then(n=>new wg(t,r,e,n))}function xg(e,t,n){e=Nf(e,Ff);const r=Nf(e.firestore,Qf),i=pg(e.converter,t,n);return Lg(r,[Ip(_p(r),"setDoc",e._key,i,null!==e.converter,n).toMutation(e._key,Ra.none())])}function Og(e,t,n,...r){e=Nf(e,Ff);const i=Nf(e.firestore,Qf),s=_p(i);let o;return o="string"==typeof(t=(0,a.Ku)(t))||t instanceof dp?Op(s,"updateDoc",e._key,t,n,r):xp(s,"updateDoc",e._key,t),Lg(i,[o.toMutation(e._key,Ra.exists(!0))])}function Dg(e){return Lg(Nf(e.firestore,Qf),[new Ka(e._key,Ra.none())])}function Ng(e,t){const n=Nf(e.firestore,Qf),r=qf(e),i=pg(e.converter,t);return Lg(n,[Ip(_p(e.firestore),"addDoc",r._key,i,null!==e.converter,{}).toMutation(r._key,Ra.exists(!1))]).then(()=>r)}function Rg(e,...t){var n,r,i;e=(0,a.Ku)(e);let s={includeMetadataChanges:!1},o=0;"object"!=typeof t[o]||Kf(t[o])||(s=t[o],o++);const c={includeMetadataChanges:s.includeMetadataChanges};if(Kf(t[o])){const e=t[o];t[o]=null===(n=e.next)||void 0===n?void 0:n.bind(e),t[o+1]=null===(r=e.error)||void 0===r?void 0:r.bind(e),t[o+2]=null===(i=e.complete)||void 0===i?void 0:i.bind(e)}let u,l,h;if(e instanceof Ff)l=Nf(e.firestore,Qf),h=Vo(e._key.path),u={next:n=>{t[o]&&t[o](Mg(l,e,n))},error:t[o+1],complete:t[o+2]};else{const n=Nf(e,jf);l=Nf(n.firestore,Qf),h=n._query;const r=new Eg(l);u={next:e=>{t[o]&&t[o](new wg(l,r,n,e))},error:t[o+1],complete:t[o+2]},$p(e._query)}return function(e,t,n,r){const i=new af(r),s=new md(t,i,n);return e.asyncQueue.enqueueAndForget(async()=>hd(await If(e),s)),()=>{i.Dc(),e.asyncQueue.enqueueAndForget(async()=>dd(await If(e),s))}}(Xf(l),h,c,u)}function Pg(e,t){return function(e,t){const n=new af(t);return e.asyncQueue.enqueueAndForget(async()=>function(e,t){Vr(e).ku.add(t),t.next()}(await If(e),n)),()=>{n.Dc(),e.asyncQueue.enqueueAndForget(async()=>function(e,t){Vr(e).ku.delete(t)}(await If(e),n))}}(Xf(e=Nf(e,Qf)),Kf(t)?t:{next:t})}function Lg(e,t){return function(e,t){const n=new zr;return e.asyncQueue.enqueueAndForget(async()=>async function(e,t,n){const r=ef(e);try{const e=await function(e,t){const n=Vr(e),r=ri.now(),i=t.reduce((e,t)=>e.add(t.key),fa());let s,o;return n.persistence.runTransaction("Locally write mutations","readwrite",e=>{let a=ia(),c=fa();return n.Zi.getEntries(e,i).next(e=>{a=e,a.forEach((e,t)=>{t.isValidDocument()||(c=c.add(e))})}).next(()=>n.localDocuments.getOverlayedDocuments(e,a)).next(i=>{s=i;const o=[];for(const e of t){const t=Ua(e,s.get(e.key).overlayedDocument);null!=t&&o.push(new qa(e.key,t,ro(t.value.mapValue),Ra.exists(!0)))}
2return n.mutationQueue.addMutationBatch(e,r,o,t)}).next(t=>{o=t;const r=t.applyToLocalDocumentSet(s,c);return n.documentOverlayCache.saveOverlays(e,t.batchId,r)})}).then(()=>({batchId:o.batchId,changes:aa(s)}))}(r.localStore,t);r.sharedClientState.addPendingMutation(e.batchId),function(e,t,n){let r=e.Tc[e.currentUser.toKey()];r||(r=new ms(ei)),r=r.insert(t,n),e.Tc[e.currentUser.toKey()]=r}(r,e.batchId,n),await qd(r,e.changes),await Gh(r.remoteStore)}catch(e){const t=sd(e,"Failed to persist write");n.reject(t)}}(await bf(e),t,n)),n.promise}(Xf(e),t)}function Mg(e,t,n){const r=n.docs.get(t._key),i=new Eg(e);return new vg(e,i,t._key,r,new mg(n.hasPendingWrites,n.fromCache),t.converter)}function Fg(e){return function(e,t){const n=Nf(e.firestore,Qf),r=Xf(n),i=function(e,t){const n=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.push(t(e[r],r));return n}(t,(e,t)=>new Xa(t,e._aggregateType,e._internalFieldPath));return function(e,t,n){const r=new zr;return e.asyncQueue.enqueueAndForget(async()=>{try{const i=await _f(e);r.resolve(async function(e,t,n){var r;const i=Vr(e),{request:s,du:o}=function(e,t,n){const r=qc(e,t),i={},s=[];let o=0;return n.forEach(e=>{const t="aggregate_"+o++;i[t]=e.alias,"count"===e.yt?s.push({alias:t,count:{}}):"avg"===e.yt?s.push({alias:t,avg:{field:Hc(e.fieldPath)}}):"sum"===e.yt&&s.push({alias:t,sum:{field:Hc(e.fieldPath)}})}),{request:{structuredAggregationQuery:{aggregations:s,structuredQuery:r.structuredQuery},parent:r.parent},du:i}}(i.serializer,Ko(t),n),a=s.parent;i.connection.po||delete s.parent;const c=(await i.vo("RunAggregationQuery",a,s,1)).filter(e=>!!e.result);jr(1===c.length);const u=null===(r=c[0].result)||void 0===r?void 0:r.aggregateFields;return Object.keys(u).reduce((e,t)=>(e[o[t]]=u[t],e),{})}(i,t,n))}catch(e){r.reject(e)}}),r.promise}(r,e._query,i).then(t=>function(e,t,n){const r=new Eg(e);return new lp(t,r,n)}(n,e,t))}(e,{count:new up("count")})}const jg={maxAttempts:5};class Ug{constructor(e,t){this._firestore=e,this._commitHandler=t,this._mutations=[],this._committed=!1,this._dataReader=_p(e)}set(e,t,n){this._verifyNotCommitted();const r=Vg(e,this._firestore),i=pg(r.converter,t,n),s=Ip(this._dataReader,"WriteBatch.set",r._key,i,null!==r.converter,n);return this._mutations.push(s.toMutation(r._key,Ra.none())),this}update(e,t,n,...r){this._verifyNotCommitted();const i=Vg(e,this._firestore);let s;return s="string"==typeof(t=(0,a.Ku)(t))||t instanceof dp?Op(this._dataReader,"WriteBatch.update",i._key,t,n,r):xp(this._dataReader,"WriteBatch.update",i._key,t),this._mutations.push(s.toMutation(i._key,Ra.exists(!0))),this}delete(e){this._verifyNotCommitted();const t=Vg(e,this._firestore);return this._mutations=this._mutations.concat(new Ka(t._key,Ra.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new qr(Br.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function Vg(e,t){if((e=(0,a.Ku)(e)).firestore!==t)throw new qr(Br.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return e}class Bg extends class{constructor(e,t){this._firestore=e,this._transaction=t,this._dataReader=_p(e)}get(e){const t=Vg(e,this._firestore),n=new gg(this._firestore);return this._transaction.lookup([t._key]).then(e=>{if(!e||1!==e.length)return Fr();const r=e[0];if(r.isFoundDocument())return new Bp(this._firestore,n,r.key,r,t.converter);if(r.isNoDocument())return new Bp(this._firestore,n,t._key,null,t.converter);throw Fr()})}set(e,t,n){const r=Vg(e,this._firestore),i=pg(r.converter,t,n),s=Ip(this._dataReader,"Transaction.set",r._key,i,null!==r.converter,n);return this._transaction.set(r._key,s),this}update(e,t,n,...r){const i=Vg(e,this._firestore);let s;return s="string"==typeof(t=(0,a.Ku)(t))||t instanceof dp?Op(this._dataReader,"Transaction.update",i._key,t,n,r):xp(this._dataReader,"Transaction.update",i._key,t),this._transaction.update(i._key,s),this}delete(e){const t=Vg(e,this._firestore);return this._transaction.delete(t._key),this}}{constructor(e,t){super(e,t),this._firestore=e}get(e){const t=Vg(e,this._firestore),n=new Eg(this._firestore);return super.get(e).then(e=>
2new vg(this._firestore,n,t._key,e._document,new mg(!1,!1),t.converter))}}function qg(e,t,n){e=Nf(e,Qf);const r=Object.assign(Object.assign({},jg),n);return function(e){if(e.maxAttempts<1)throw new qr(Br.INVALID_ARGUMENT,"Max attempts must be at least 1")}(r),function(e,t,n){const r=new zr;return e.asyncQueue.enqueueAndForget(async()=>{const i=await _f(e);new lf(e.asyncQueue,i,n,t,r).run()}),r.promise}(Xf(e),n=>t(new Bg(e,n)),r)}function zg(){return new Ep("deleteField")}function $g(){return new Sp("serverTimestamp")}function Gg(...e){return new kp("arrayUnion",e)}function Kg(...e){return new Ap("arrayRemove",e)}function Wg(e){return new Cp("increment",e)}!function(e,t=!0){!function(e){xr=e}(i.SDK_VERSION),(0,i._registerComponent)(new s.uA("firestore",(e,{instanceIdentifier:n,options:r})=>{const i=e.getProvider("app").getImmediate(),s=new Qf(new Wr(e.getProvider("auth-internal")),new Xr(e.getProvider("app-check-internal")),function(e,t){if(!Object.prototype.hasOwnProperty.apply(e.options,["projectId"]))throw new qr(Br.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Ps(e.options.projectId,t)}(i,n),i);return r=Object.assign({useFetchStreams:t},r),s._setSettings(r),s},"PUBLIC").setMultipleInstances(!0)),(0,i.registerVersion)(Ar,"3.13.0",e),(0,i.registerVersion)(Ar,"3.13.0","esm2017")}()},91874:function(e){"use strict";var t={};e.exports=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}},91998:function(e,t,n){"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(this,arguments)}var i;n.d(t,{AO:function(){return l},Gh:function(){return D},HS:function(){return N},Oi:function(){return a},Rr:function(){return h},pX:function(){return F},pb:function(){return A},rc:function(){return i},sd:function(){return O},tH:function(){return M},ue:function(){return f},zR:function(){return o}}),function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(i||(i={}));const s="popstate";function o(e){return void 0===e&&(e={}),function(e,t,n,o){void 0===o&&(o={});let{window:h=document.defaultView,v5Compat:d=!1}=o,f=h.history,p=i.Pop,g=null,m=v();function v(){return(f.state||{idx:null}).idx}function y(){p=i.Pop;let e=v(),t=null==e?null:e-m;m=e,g&&g({action:p,location:b.location,delta:t})}function w(e){let t="null"!==h.location.origin?h.location.origin:h.location.href,n="string"==typeof e?e:l(e);return a(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==m&&(m=0,f.replaceState(r({},f.state,{idx:m}),""));let b={get action(){return p},get location(){return e(h,f)},listen(e){if(g)throw new Error("A history only accepts one active listener");return h.addEventListener(s,y),g=e,()=>{h.removeEventListener(s,y),g=null}},createHref(e){return t(h,e)},createURL:w,encodeLocation(e){let t=w(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){p=i.Push;let r=u(b.location,e,t);n&&n(r,e),m=v()+1;let s=c(r,m),o=b.createHref(r);try{f.pushState(s,"",o)}catch(e){h.location.assign(o)}d&&g&&g({action:p,location:b.location,delta:1})},replace:function(e,t){p=i.Replace;let r=u(b.location,e,t);n&&n(r,e),m=v();let s=c(r,m),o=b.createHref(r);f.replaceState(s,"",o),d&&g&&g({action:p,location:b.location,delta:0})},go(e){return f.go(e)}};return b}(function(e,t){let{pathname:n,search:r,hash:i}=e.location;return u("",{pathname:n,search:r,hash:i},t.state&&t.state.usr||null,t.state&&t.state.key||"default")},function(e,t){return"string"==typeof t?t:l(t)},null,e)}function a(e,t){if(!1===e||null==e)throw new Error(t)}function c(e,t){return{usr:e.state,key:e.key,idx:t}}function u(e,t,n,i){return void 0===n&&(n=null),r({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?h(t):t,{state:n,key:t&&t.key||i||Math.random().toString(36).substr(2,8)})}function l(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function h(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var d;function f(e,t,n){void 0===n&&(n="/");let r=A(("string"==typeof t?h(t):t).pathname||"/",n);if(null==r)return null;let i=p(e);!function(e){e.sort((e,t)=>
vendor: 1,998 bytes, line 2
2e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)))}(i);let s=null;for(let e=0;null==s&&e<i.length;++e)s=T(i[e],k(r));return s}function p(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r="");let i=(e,i,s)=>{let o={relativePath:void 0===s?e.path||"":s,caseSensitive:!0===e.caseSensitive,childrenIndex:i,route:e};o.relativePath.startsWith("/")&&(a(o.relativePath.startsWith(r),'Absolute route path "'+o.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),o.relativePath=o.relativePath.slice(r.length));let c=N([r,o.relativePath]),u=n.concat(o);e.children&&e.children.length>0&&(a(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+c+'".'),p(e.children,t,u,c)),(null!=e.path||e.index)&&t.push({path:c,score:E(c,e.index),routesMeta:u})};return e.forEach((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let n of g(e.path))i(e,t,n);else i(e,t)}),t}function g(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(0===r.length)return i?[s,""]:[s];let o=g(r.join("/")),a=[];return a.push(...o.map(e=>""===e?s:[s,e].join("/"))),i&&a.push(...o),a.map(t=>e.startsWith("/")&&""===t?"/":t)}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(d||(d={}));const m=/^:\w+$/,v=3,y=2,w=1,b=10,_=-2,I=e=>"*"===e;function E(e,t){let n=e.split("/"),r=n.length;return n.some(I)&&(r+=_),t&&(r+=y),n.filter(e=>!I(e)).reduce((e,t)=>e+(m.test(t)?v:""===t?w:b),r)}function T(e,t){let{routesMeta:n}=e,r={},i="/",s=[];for(let e=0;e<n.length;++e){let o=n[e],a=e===n.length-1,c="/"===i?t:t.slice(i.length)||"/",u=S({path:o.relativePath,caseSensitive:o.caseSensitive,end:a},c);if(!u)return null;
2Object.assign(r,u.params);let l=o.route;s.push({params:r,pathname:N([i,u.pathname]),pathnameBase:R(N([i,u.pathnameBase])),route:l}),"/"!==u.pathnameBase&&(i=N([i,u.pathnameBase]))}return s}function S(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),C("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(e,t)=>(r.push(t),"/([^\\/]+)"));return e.endsWith("*")?(r.push("*"),i+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":""!==e&&"/"!==e&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((e,t,n)=>{if("*"===t){let e=a[n]||"";o=s.slice(0,s.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(n){return C(!1,'The value for the URL param "'+t+'" will not be decoded because the string "'+e+'" is a malformed URL segment. This is probably due to a bad percent encoding ('+n+")."),e}}(a[n]||"",t),e},{}),pathname:s,pathnameBase:o,pattern:e}}function k(e){try{return decodeURI(e)}catch(t){return C(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function A(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function C(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function x(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function O(e){return e.filter((e,t)=>0===t||e.route.path&&e.route.path.length>0)}function D(e,t,n,i){let s;void 0===i&&(i=!1),"string"==typeof e?s=h(e):(s=r({},e),a(!s.pathname||!s.pathname.includes("?"),x("?","pathname","search",s)),a(!s.pathname||!s.pathname.includes("#"),x("#","pathname","hash",s)),a(!s.search||!s.search.includes("#"),x("#","search","hash",s)));let o,c=""===e||""===s.pathname,u=c?"/":s.pathname;if(i||null==u)o=n;else{let e=t.length-1;if(u.startsWith("..")){let t=u.split("/");for(;".."===t[0];)t.shift(),e-=1;s.pathname=t.join("/")}o=e>=0?t[e]:"/"}let l=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:i=""}="string"==typeof e?h(e):e,s=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)}),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:s,search:P(r),hash:L(i)}}(s,o),d=u&&"/"!==u&&u.endsWith("/"),f=(c||"."===u)&&n.endsWith("/");return l.pathname.endsWith("/")||!d&&!f||(l.pathname+="/"),l}const N=e=>e.join("/").replace(/\/\/+/g,"/"),R=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),P=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",L=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";class M extends Error{}function F(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}const j=["post","put","patch","delete"],U=(new Set(j),["get",...j]);new Set(U),new Set([301,302,303,307,308]),new Set([307,308]),"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement,Symbol("deferred")},92636:function(e,t,n){var r=n(57956),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},93796:function(e){e.exports="object"==typeof window},93992:function(e){e.exports=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e}},94063:function(e){e.exports={}},94214:function(e){var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";
vendor: 4,155 bytes, line 2
2function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof m?t:m,s=Object.create(i.prototype),o=new C(r||[]);return s._invoke=function(e,t,n){var r=h;return function(i,s){if(r===f)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw s;return O()}for(n.method=i,n.arg=s;;){var o=n.delegate;if(o){var a=S(o,n);if(a){if(a===g)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=f;var c=l(e,t,n);if("normal"===c.type){if(r=n.done?p:d,c.arg===g)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=p,n.method="throw",n.arg=c.arg)}}}(e,n,o),s}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var h="suspendedStart",d="suspendedYield",f="executing",p="completed",g={};function m(){}function v(){}function y(){}var w={};c(w,s,function(){return this});var b=Object.getPrototypeOf,_=b&&b(b(x([])));_&&_!==n&&r.call(_,s)&&(w=_);var I=y.prototype=m.prototype=Object.create(w);function E(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function T(e,t){function n(i,s,o,a){var c=l(e[i],e,s);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==typeof h&&r.call(h,"__await")?t.resolve(h.__await).then(function(e){n("next",e,o,a)},function(e){n("throw",e,o,a)}):t.resolve(h).then(function(e){u.value=e,o(u)},function(e){return n("throw",e,o,a)})}a(c.arg)}var i;this._invoke=function(e,r){function s(){return new t(function(t,i){n(e,r,t,i)})}return i=i?i.then(s,s):s()}}function S(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method))return g;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return g}var i=l(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var s=i.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function x(e){if(e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:O}}function O(){return{value:t,done:!0}}return v.prototype=y,c(I,"constructor",y),c(y,"constructor",v),v.displayName=c(y,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,c(e,a,"GeneratorFunction")),e.prototype=Object.create(I),e},e.awrap=function(e){return{__await:e}},E(T.prototype),c(T.prototype,o,function(){return this}),e.AsyncIterator=T,e.async=function(t,n,r,i,s){void 0===s&&(s=Promise);var o=new T(u(t,n,r,i),s);return e.isGeneratorFunction(n)?o:o.next().then(function(e){return e.done?e.value:o.next()})},E(I),c(I,a,"Generator"),c(I,s,function(){return this}),c(I,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=x,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEac
2h(A),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return a.type="throw",a.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var o=this.tryEntries[s],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(c&&u){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var o=s?s.completion:{};return o.type=e,o.arg=t,s?(this.method="next",this.next=s.finallyLoc,g):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),g},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),A(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;A(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:x(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},94343:function(e){function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}e.exports=function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e},e.exports.default=e.exports,e.exports.__esModule=!0},94400:function(e,t,n){var r=n(39793),i=n(86031),s=n(81670),o=n(2825);e.exports=function(e){return r(e)||i(e)||s(e)||o()},e.exports.default=e.exports,e.exports.__esModule=!0},94762:function(e,t,n){"use strict";n.d(t,{h1:function(){return a},uA:function(){return i}});var r=n(1266);class i{constructor(e,t,n){this.name=e,this.instanceFactory=t,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const s="[DEFAULT]";class o{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const e=new r.cY;if(this.instancesDeferred.set(t,e),this.isInitialized(t)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:t});n&&e.resolve(n)}catch(e){}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const n=this.normalizeInstanceIdentifier(null==e?void 0:e.identifier),r=null!==(t=null==e?void 0:e.optional)&&void 0!==t&&t;if(!this.isInitialized(n)&&!this.shouldAutoInitialize()){if(r)return null;throw Error(`Service ${this.name} is not available`)}try{return this.getOrInitializeService({instanceIdentifier:n})}catch(e){if(r)return null;throw e}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,this.shouldAutoInitialize()){if(function(e){return"EAGER"===e.instantiationMode}(e))try{this.getOrInitializeService({instanceIdentifier:s})}catch(e){}for(const[e,t]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(e);try{const e=this.getOrInitializeService({instanceIdentifier:n});t.resolve(e)}catch(e){}}}}clearInstance(e=s){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(e=>"INTERNAL"in e).map(e=>e.INTERNAL.delete()),...e.filter(e=>"_delete"in e).map(e=>e._delete())])}isComponentSet(){return null!=this.component}isInitialized(e=s){return this.instances.has(e)}getOptions(e=s){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const r=this.getOrInitializeService({instanceIdentifier:n,options:t});for(const[e,t]of this.instancesDeferred.entries())n===this.normalizeInstanceIdentifier(e)&&t.resolve(r);return r}onInit(e,t){var n;const r=this.normalizeInstanceIdentifier(t),i=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;i.add(e),this.onInitCallbacks.set(r,i);const s=this.instances.get(r);return s&&e(s,r),()=>{i.delete(e)}}invokeOnInitCallbacks(e,t){const n=this.onInitCallbacks.get(t);if(n)for(const r of n)try{r(e,t)}catch(e){}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(r=e,r===s?void 0:r),options:t}),this.instances.set(e,n),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch(e){}var r;return n||null}normalizeInstanceIdentifier(e=s){return this.component?this.component.multipleInstances?e:s:e}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class a{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new o(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}},95843:function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,s=n?Symbol.for("react.fragment"):60107,o=n?Symbol.for("react.strict_mode"):60108,a=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,h=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,f=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,m=n?Symbol.for("react.lazy"):60116,v=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,w=n?Symbol.for("react.responder"):60118,b=n?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case l:case h:case s:case a:case o:case f:return e;default:switch(e=e&&e.$$typeof){case u:case d:case m:case g:case c:return e;default:return t}}case i:return t}}}function I(e){return _(e)===h}t.AsyncMode=l,t.ConcurrentMode=h,t.ContextConsumer=u,t.ContextProvider=c,t.Element=r,t.ForwardRef=d,t.Fragment=s,t.Lazy=m,t.Memo=g,t.Portal=i,t.Profiler=a,t.StrictMode=o,t.Suspense=f,t.isAsyncMode=function(e){return I(e)||_(e)===l},t.isConcurrentMode=I,t.isContextConsumer=function(e){return _(e)===u},t.isContextProvider=function(e){return _(e)===c},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return _(e)===d},t.isFragment=function(e){return _(e)===s},t.isLazy=function(e){return _(e)===m},t.isMemo=function(e){return _(e)===g},t.isPortal=function(e){return _(e)===i},t.isProfiler=function(e){return _(e)===a},t.isStrictMode=function(e){return _(e)===o},t.isSuspense=function(e){return _(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===h||e===a||e===o||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===g||e.$$typeof===c||e.$$typeof===u||e.$$typeof===d||e.$$typeof===y||e.$$typeof===w||e.$$typeof===b||e.$$typeof===v)},t.typeOf=_},96220:function(e,t,n){"use strict";var r=n(51624),i=n(40080),s=n(94762);class o{constructor(e,t,n){this._delegate=e,this.task=t,this.ref=n}get bytesTransferred(){return this._delegate.bytesTransferred}get metadata(){return this._delegate.metadata}get state(){return this._delegate.state}get totalBytes(){return this._delegate.totalBytes}}class a{constructor(e,t){this._delegate=e,this._ref=t,this.cancel=this._delegate.cancel.bind(this._delegate),this.catch=this._delegate.catch.bind(this._delegate),this.pause=this._delegate.pause.bind(this._delegate),this.resume=this._delegate.resume.bind(this._delegate)}get snapshot(){return new o(this._delegate.snapshot,this,this._ref)}then(e,t){return this._delegate.then(t=>{if(e)return e(new o(t,this,this._ref))},t)}on(e,t,n,r){let i;return t&&(i="function"==typeof t?e=>t(new o(e,this,this._ref)):{next:t.next?e=>t.next(new o(e,this,this._ref)):void 0,complete:t.complete||void 0,error:t.error||void 0}),this._delegate.on(e,i,n||void 0,r||void 0)}}class c{constructor(e,t){this._delegate=e,this._service=t}get prefixes(){return this._delegate.prefixes.map(e=>new u(e,this._service))}get items(){return this._delegate.items.map(e=>new u(e,this._service))}get nextPageToken(){return this._delegate.nextPageToken||null}}class u{constructor(e,t){this._delegate=e,this.storage=t}get name(){return this._delegate.name}get bucket(){return this._delegate.bucket}get fullPath(){return this._delegate.fullPath}toString(){return this._delegate.toString()}child(e){const t=(0,i.Mp)(this._delegate,e);return new u(t,this.storage)}get root(){return new u(this._delegate.root,this.storage)}get parent(){const e=this._delegate.parent;return null==e?null:new u(e,this.storage)}put(e,t){return this._throwIfRoot("put"),new a((0,i.bp)(this._delegate,e,t),this)}putString(e,t=i.nw.RAW,n){this._throwIfRoot("putString");const r=(0,i.ZH)(t,e),s=Object.assign({},n);return null==s.contentType&&null!=r.contentType&&(s.contentType=r.contentType),new a(new i.UC(this._delegate,new i.Mx(r.data,!0),s),this)}listAll(){return(0,i._w)(this._delegate).then(e=>new c(e,this.storage))}list(e){return(0,i.p_)(this._delegate,e||void 0).then(e=>new c(e,this.storage))}getMetadata(){return(0,i.yb)(this._delegate)}updateMetadata(e){return(0,i.D5)(this._delegate,e)}getDownloadURL(){return(0,i.qk)(this._delegate)}delete(){return this._throwIfRoot("delete"),(0,i.XR)(this._delegate)}_throwIfRoot(e){if(""===this._delegate._location.path)throw(0,i.UY)(e)}}class l{constructor(e,t){this.app=e,this._delegate=t}get maxOperationRetryTime(){return this._delegate.maxOperationRetryTime}get maxUploadRetryTime(){return this._delegate.maxUploadRetryTime}ref(e){if(h(e))throw(0,i.uj)("ref() expected a child path but got a URL, use refFromURL instead.");return new u((0,i.KR)(this._delegate,e),this)}refFromURL(e){if(!h(e))throw(0,i.uj)("refFromURL() expected a full URL but got a child path, use ref() instead.");try{i.TZ.makeFromUrl(e,this._delegate.host)}catch(e){throw(0,i.uj)("refFromUrl() expected a valid full URL but got an invali
2d one.")}return new u((0,i.KR)(this._delegate,e),this)}setMaxUploadRetryTime(e){this._delegate.maxUploadRetryTime=e}setMaxOperationRetryTime(e){this._delegate.maxOperationRetryTime=e}useEmulator(e,t,n={}){(0,i.nb)(this._delegate,e,t,n)}}function h(e){return/^[A-Za-z]+:\/\//.test(e)}function d(e,{instanceIdentifier:t}){const n=e.getProvider("app-compat").getImmediate(),r=e.getProvider("storage").getImmediate({identifier:t});return new l(n,r)}!function(e){const t={TaskState:i.Ad,TaskEvent:i.xc,StringFormat:i.nw,Storage:l,Reference:u};e.INTERNAL.registerComponent(new s.uA("storage-compat",d,"PUBLIC").setServiceProps(t).setMultipleInstances(!0)),e.registerVersion("@firebase/storage-compat","0.3.2")}(r.A)},96331:function(e){e.exports={}},96433:function(e,t,n){n(97004)({target:"Object",stat:!0},{setPrototypeOf:n(70489)})},96435:function(e,t,n){var r=n(5686),i=n(23311),s=n(63661),o=n(7099),a=Object.defineProperty;t.f=r?a:function(e,t,n){if(s(e),t=o(t,!0),s(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},96456:function(e){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,s=[],o=!0,a=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(s.push(r.value),!t||s.length!==t);o=!0);}catch(e){a=!0,i=e}finally{try{o||null==n.return||n.return()}finally{if(a)throw i}}return s}},e.exports.default=e.exports,e.exports.__esModule=!0},96665:function(e,t,n){var r=n(74250),i=n(16054),s=n(85929)("toStringTag"),o="Arguments"==i(function(){return arguments}());e.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),s))?n:o?i(t):"Object"==(r=i(t))&&"function"==typeof t.callee?"Arguments":r}},97004:function(e,t,n){var r=n(61581),i=n(78825).f,s=n(11941),o=n(75748),a=n(6618),c=n(56158),u=n(4754);e.exports=function(e,t){var n,l,h,d,f,p=e.target,g=e.global,m=e.stat;if(n=g?r:m?r[p]||a(p,{}):(r[p]||{}).prototype)for(l in t){if(d=t[l],h=e.noTargetGet?(f=i(n,l))&&f.value:n[l],!u(g?l:p+(m?".":"#")+l,e.forced)&&void 0!==h){if(typeof d==typeof h)continue;c(d,h)}(e.sham||h&&h.sham)&&s(d,"sham",!0),o(n,l,d,e)}}},97152:function(e,t,n){"use strict";var r=n(97004),i=n(99569),s=n(4794),o=n(12368),a=n(54595),c=n(92636),u=n(66774),l=n(41551),h=n(73131),d=n(85929),f=n(1106),p=d("isConcatSpreadable"),g=9007199254740991,m="Maximum allowed index exceeded",v=f>=51||!i(function(){var e=[];return e[p]=!1,e.concat()[0]!==e}),y=h("concat"),w=function(e){if(!o(e))return!1;var t=e[p];return void 0!==t?!!t:s(e)};r({target:"Array",proto:!0,forced:!v||!y},{concat:function(e){var t,n,r,i,s,o=a(this),h=l(o,0),d=0;for(t=-1,r=arguments.length;t<r;t++)if(w(s=-1===t?o:arguments[t])){if(d+(i=c(s.length))>g)throw TypeError(m);for(n=0;n<i;n++,d++)n in s&&u(h,d,s[n])}else{if(d>=g)throw TypeError(m);u(h,d++,s)}return h.length=d,h}})},97561:function(e,t,n){"use strict";n.d(t,{I:function(){return a}});var r=function(e){return e.hasOwnProperty("x")&&e.hasOwnProperty("y")},i=function(e){return r(e)&&e.hasOwnProperty("z")},s=n(62527),o=function(e,t){return Math.abs(e-t)};function a(e,t){if((0,s.T)(e)&&(0,s.T)(t))return o(e,t);if(r(e)&&r(t)){var n=o(e.x,t.x),a=o(e.y,t.y),c=i(e)&&i(t)?o(e.z,t.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(a,2)+Math.pow(c,2))}}},97590:function(e,t,n){var r=n(10965),i=n(1918);Object.defineProperty(t,"__esModule",{value:!0}),t.useDocument=t.getDocument=void 0;var s=i(n(16987)),o=i(n(60896)),a=i(n(49145)),c=r(n(44134)),u=n(85191),l=n(37953),h=n(8732),d=n(24370),f=n(14943),p=n(3650),g=n(68837);function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function v(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach(function(t){(0,a.default)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEac
2h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var y=function(e){var t,n,r,i,s,a,l=arguments;return o.default.async(function(g){for(;;)switch(g.prev=g.next){case 0:return t=l.length>1&&void 0!==l[1]?l[1]:h.empty.object,n=t.parseDates,r=t.ignoreFirestoreDocumentSnapshotField,i=void 0===r||r,g.next=3,o.default.awrap(u.fuego.db.doc(e).get().then(function(e){var t,r=null!==(t=e.data({serverTimestamps:"estimate"}))&&void 0!==t?t:h.empty.object;return f.isDev&&(r.exists||r.id||r.hasPendingWrites)&&console.warn("[get-document] warning: Your document, ",e.id," is using one of the following reserved fields: [exists, id, hasPendingWrites]. These fields are reserved. Please remove them from your documents."),(0,p.withDocumentDatesParsed)(v({},r,{id:e.id,exists:e.exists,hasPendingWrites:e.metadata.hasPendingWrites,__snapshot:i?void 0:e}),n)}));case 3:return s=g.sent,(a=e.split("/".concat(s.id))).pop(),(a=a.join("/"))&&d.collectionCache.getSWRKeysFromCollectionPath(a).forEach(function(e){(0,c.mutate)(e,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h.empty.array;return e.some(function(e){return e.id===s.id})?e.map(function(e){return e.id===s.id?s:e}):e},!1)}),g.abrupt("return",s);case 9:case"end":return g.stop()}},null,null,null,Promise)};t.getDocument=y;var w=function(e){var t,n,r,i,s=arguments;return o.default.async(function(a){for(;;)switch(a.prev=a.next){case 0:return n=(t=s.length>1&&void 0!==s[1]?s[1]:{}).parseDates,r=t.ignoreFirestoreDocumentSnapshotField,i=void 0===r||r,a.next=3,o.default.awrap(new Promise(function(t){var r=u.fuego.db.doc(e).onSnapshot(function(s){var o,a=null!==(o=s.data())&&void 0!==o?o:h.empty.object,u=(0,p.withDocumentDatesParsed)(v({},a,{id:s.id,exists:s.exists,hasPendingWrites:s.metadata.hasPendingWrites,__snapshot:i?void 0:s}),n);(0,c.mutate)(e,u,!1),f.isDev&&(a.exists||a.id||a.hasPendingWrites)&&console.warn("[use-document] warning: Your document, ",s.id," is using one of the following reserved fields: [exists, id, hasPendingWrites]. These fields are reserved. Please remove them from your documents.");var l=e.split("/".concat(s.id)).filter(Boolean);l.pop(),(l=l.join("/"))&&d.collectionCache.getSWRKeysFromCollectionPath(l).forEach(function(e){(0,c.mutate)(e,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h.empty.array;return e.some(function(e){return e.id&&e.id===u.id})?e.map(function(e){return e.id===u.id?u:e}):e},!1)}),t({initialData:u,unsubscribe:r})})}));case 3:return a.abrupt("return",a.sent);case 4:case"end":return a.stop()}},null,null,null,Promise)};t.useDocument=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:h.empty.object,n=(0,l.useRef)(null),r=t.listen,i=void 0!==r&&r,a=t.parseDates,d=t.ignoreFirestoreDocumentSnapshotField,f=void 0===d||d,p=(0,s.default)(t,["listen","parseDates","ignoreFirestoreDocumentSnapshotField"]),m=t.refreshInterval,b=void 0===m?i?0:void 0:m,_=t.refreshWhenHidden,I=void 0===_?!i&&void 0:_,E=t.refreshWhenOffline,T=void 0===E?!i&&void 0:E,S=t.revalidateOnFocus,k=void 0===S?!i&&void 0:S,A=t.revalidateOnReconnect,C=void 0===A?!i&&void 0:A,x=t.dedupingInterval,O=v({},p,{refreshInterval:b,refreshWhenHidden:I,refreshWhenOffline:T,revalidateOnFocus:k,revalidateOnReconnect:C,dedupingInterval:void 0===x?i?0:void 0:x}),D=(0,l.useRef)(i);(0,l.useEffect)(function(){D.current=i},[i]);var N=(0,l.useRef)(a);(0,l.useEffect)(function(){N.current=a},[a]);var R=(0,l.useRef)(f);(0,l.useEffect)(function(){R.current=f},[f]);var P=(0,c.default)(e,function(e){var t,r,i,s;return o.default.async(function(a){for(;;)switch(a.prev=a.next){case 0:if(!D.current){a.next=9;break}return n.current&&(n.current(),n.current=null),a.next=4,o.default.awrap(w(e,{parseDates:N.current,ignoreFirestoreDocumentSnapshotField:R.current}));case 4:return t=a.sent,r=t.unsubscribe,i=t.initialData,n.current=r,a.abrupt("return",i);case 9:return a.next=11,o.default.awrap(y(e,{parseDates:N.current,ignoreFirestoreDocumentSnapshotField:R.current}));case 11:return s=a.sent,a.abrupt("return",s);case 13:case"end":return a.stop()}},null,null,null,Promise)},O),L=P.data,M=P.isValidating,F=P.revalidate,j=P.mutate,U=P.error,V=(0,l.useRef)(!1);(0,l.useEffect)(function(){V.current?B.current():V.current=!0},[i]);var B=(0,l.useRef)(P.revalidate);(0,l.useEffect)(function(){B.current=P.revalidate}),(0,l.useEffect)(function(){return function(){n.current&&(n.current(),n.current=null)}},[e,i]);var q=(0,l.useCallback)(function(t,n){return i||j(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h.empty.object;return(null==n?void 0:n.merge)?v({},e,{},t):t}),e?u.fuego.db.doc(e).set(t,n):null},[e,i,j]),z=(0,l.useCallback)(function(t){return i||j(function(){return v({},arguments.length>0&&void 0!==arguments[0]?arguments[0]:h.empty.object,{},t)}),e?u.fuego.db.doc(e).update(t):null},[i,e,j]),$=(0,l.useCallback)(function(){return(0,g.deleteDocument)(e,i)},[e,i]);return{data:L,isValidating:M,revalidate:F,mutate:j,error:U,set:q,update:z,loading:!L&&!U,deleteDocument:$,unsubscribe:n.current}}}
2,97945:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});var r=n(55900);Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})})},99569:function(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}}}]); 3//# sourceMappingURL=chunk-vendors.69da4d1b.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.