/*! For license information please see LICENSES */ (window.webpackJsonp=window.webpackJsonp||[]).push([[11],{0:function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return h})),n.d(e,"b",(function(){return A})),n.d(e,"c",(function(){return _})),n.d(e,"d",(function(){return E})),n.d(e,"e",(function(){return c})),n.d(e,"f",(function(){return F})),n.d(e,"g",(function(){return d})),n.d(e,"h",(function(){return L})),n.d(e,"i",(function(){return D})),n.d(e,"j",(function(){return R})),n.d(e,"k",(function(){return B})),n.d(e,"l",(function(){return f})),n.d(e,"m",(function(){return y})),n.d(e,"n",(function(){return w})),n.d(e,"o",(function(){return I})),n.d(e,"p",(function(){return C})),n.d(e,"q",(function(){return S})),n.d(e,"r",(function(){return m})),n.d(e,"s",(function(){return v})),n.d(e,"t",(function(){return T})),n.d(e,"u",(function(){return x})),n.d(e,"v",(function(){return j})),n.d(e,"w",(function(){return P})),n.d(e,"x",(function(){return k}));const r=function(t){const e=[];let p=0;for(let i=0;i>6|192,e[p++]=63&n|128):55296==(64512&n)&&i+1>18|240,e[p++]=n>>12&63|128,e[p++]=n>>6&63|128,e[p++]=63&n|128):(e[p++]=n>>12|224,e[p++]=n>>6&63|128,e[p++]=63&n|128)}return e},o={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:"function"==typeof atob,encodeByteArray(input,t){if(!Array.isArray(input))throw Error("encodeByteArray takes an array as a parameter");this.init_();const e=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,output=[];for(let i=0;i>2,h=(3&t)<<4|r>>4;let d=(15&r)<<2|l>>6,f=63&l;o||(f=64,n||(d=64)),output.push(e[c],e[h],e[d],e[f])}return output.join("")},encodeString(input,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(input):this.encodeByteArray(r(input),t)},decodeString(input,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(input):function(t){const e=[];let n=0,r=0;for(;n191&&o<224){const l=t[n++];e[r++]=String.fromCharCode((31&o)<<6|63&l)}else if(o>239&&o<365){const u=((7&o)<<18|(63&t[n++])<<12|(63&t[n++])<<6|63&t[n++])-65536;e[r++]=String.fromCharCode(55296+(u>>10)),e[r++]=String.fromCharCode(56320+(1023&u))}else{const l=t[n++],c=t[n++];e[r++]=String.fromCharCode((15&o)<<12|(63&l)<<6|63&c)}}return e.join("")}(this.decodeStringToByteArray(input,t))},decodeStringToByteArray(input,t){this.init_();const e=t?this.charToByteMapWebSafe_:this.charToByteMap_,output=[];for(let i=0;i>4;if(output.push(l),64!==r){const t=n<<4&240|r>>2;if(output.push(t),64!==o){const t=r<<6&192|o;output.push(t)}}}return output},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let i=0;i=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(i)]=i,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(i)]=i)}}},l=function(t){return function(t){const e=r(t);return o.encodeByteArray(e,!0)}(t).replace(/\./g,"")},c=function(t){try{return o.decodeString(t,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};class h{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}wrapCallback(t){return(e,n)=>{e?this.reject(e):this.resolve(n),"function"==typeof t&&(this.promise.catch((()=>{})),1===t.length?t(e):t(e,n))}}}function d(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n=e||"demo-project",r=t.iat||0,sub=t.sub||t.user_id;if(!sub)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o=Object.assign({iss:`https://securetoken.google.com/${n}`,aud:n,iat:r,exp:r+3600,auth_time:r,sub:sub,user_id:sub,firebase:{sign_in_provider:"custom",identities:{}}},t);return[l(JSON.stringify({alg:"none",type:"JWT"})),l(JSON.stringify(o)),""].join(".")}function f(){return"undefined"!=typeof navigator&&"string"==typeof navigator.userAgent?navigator.userAgent:""}function m(){return"undefined"!=typeof window&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(f())}function y(){const t="object"==typeof chrome?chrome.runtime:"object"==typeof browser?browser.runtime:void 0;return"object"==typeof t&&void 0!==t.id}function v(){return"object"==typeof navigator&&"ReactNative"===navigator.product}function w(){return f().indexOf("Electron/")>=0}function C(){const t=f();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function x(){return f().indexOf("MSAppHost/")>=0}function T(){return!function(){try{return"[object process]"===Object.prototype.toString.call(t.process)}catch(t){return!1}}()&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function S(){return"object"==typeof indexedDB}function k(){return new Promise(((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",o=self.indexedDB.open(r);o.onsuccess=()=>{o.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},o.onupgradeneeded=()=>{n=!1},o.onerror=()=>{var t;e((null===(t=o.error)||void 0===t?void 0:t.message)||"")}}catch(t){e(t)}}))}function E(){return!("undefined"==typeof navigator||!navigator.cookieEnabled)}class _ extends Error{constructor(code,t,e){super(t),this.code=code,this.customData=e,this.name="FirebaseError",Object.setPrototypeOf(this,_.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,A.prototype.create)}}class A{constructor(t,e,n){this.service=t,this.serviceName=e,this.errors=n}create(code,...data){const t=data[0]||{},e=`${this.service}/${code}`,template=this.errors[code],n=template?function(template,data){return template.replace(O,((t,e)=>{const n=data[e];return null!=n?String(n):`<${e}?>`}))}(template,t):"Error",r=`${this.serviceName}: ${n} (${e}).`;return new _(e,r,t)}}const O=/\{\$([^}]+)}/g;function I(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function D(a,b){if(a===b)return!0;const t=Object.keys(a),e=Object.keys(b);for(const n of t){if(!e.includes(n))return!1;const t=a[n],r=b[n];if(N(t)&&N(r)){if(!D(t,r))return!1}else if(t!==r)return!1}for(const n of e)if(!t.includes(n))return!1;return!0}function N(t){return null!==t&&"object"==typeof t}function j(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach((t=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(t))})):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function P(t){const e={};return t.replace(/^\?/,"").split("&").forEach((t=>{if(t){const[n,r]=t.split("=");e[decodeURIComponent(n)]=decodeURIComponent(r)}})),e}function R(t){const e=t.indexOf("?");if(!e)return"";const n=t.indexOf("#",e);return t.substring(e,n>0?n:void 0)}function L(t,e){const n=new $(t,e);return n.subscribe.bind(n)}class ${constructor(t,e){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=e,this.task.then((()=>{t(this)})).catch((t=>{this.error(t)}))}next(t){this.forEachObserver((e=>{e.next(t)}))}error(t){this.forEachObserver((e=>{e.error(t)})),this.close(t)}complete(){this.forEachObserver((t=>{t.complete()})),this.close()}subscribe(t,e,n){let r;if(void 0===t&&void 0===e&&void 0===n)throw new Error("Missing Observer.");r=function(t,e){if("object"!=typeof t||null===t)return!1;for(const n of e)if(n in t&&"function"==typeof t[n])return!0;return!1}(t,["next","error","complete"])?t:{next:t,error:e,complete:n},void 0===r.next&&(r.next=M),void 0===r.error&&(r.error=M),void 0===r.complete&&(r.complete=M);const o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then((()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch(t){}})),this.observers.push(r),o}unsubscribeOne(i){void 0!==this.observers&&void 0!==this.observers[i]&&(delete this.observers[i],this.observerCount-=1,0===this.observerCount&&void 0!==this.onNoObservers&&this.onNoObservers(this))}forEachObserver(t){if(!this.finalized)for(let i=0;i{if(void 0!==this.observers&&void 0!==this.observers[i])try{t(this.observers[i])}catch(t){"undefined"!=typeof console&&console.error&&console.error(t)}}))}close(t){this.finalized||(this.finalized=!0,void 0!==t&&(this.finalError=t),this.task.then((()=>{this.observers=void 0,this.onNoObservers=void 0})))}}function M(){}function F(t,e=1e3,n=2){const r=e*Math.pow(n,t),o=Math.round(.5*r*(Math.random()-.5)*2);return Math.min(144e5,r+o)}function B(t){return t&&t._delegate?t._delegate:t}}).call(this,n(13))},109:function(t,e,n){"use strict";n(53),n(19),n(47),n(52),n(69),n(65),n(45),n(55),n(46),n(60),n(33),n(32),n(41),n(62),n(63),n(34);var r=n(2);function o(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return l(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,c=!0,h=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return c=t.done,t},e:function(t){h=!0,o=t},f:function(){try{c||null==n.return||n.return()}finally{if(h)throw o}}}}function l(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0},canPrefetch:function(){var t=navigator.connection;return!(this.$nuxt.isOffline||t&&((t.effectiveType||"").includes("2g")||t.saveData))},getPrefetchComponents:function(){return this.$router.resolve(this.to,this.$route,this.append).resolved.matched.map((function(t){return t.components.default})).filter((function(t){return"function"==typeof t&&!t.options&&!t.__prefetched}))},prefetchLink:function(){if(this.canPrefetch()){d.unobserve(this.$el);var t,e=o(this.getPrefetchComponents());try{for(e.s();!(t=e.n()).done;){var n=t.value,r=n();r instanceof Promise&&r.catch((function(){})),n.__prefetched=!0}}catch(t){e.e(t)}finally{e.f()}}}}}},110:function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var content=t(e);return e[2]?"@media ".concat(e[2]," {").concat(content,"}"):content})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var o={};if(r)for(var i=0;ie.parts.length&&(n.parts.length=e.parts.length)}else{var o=[];for(r=0;r0?c.map((function(){return t(!1)})):t(!1))}};t.exports=r},15:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return f})),n.d(e,"c",(function(){return m})),n.d(e,"d",(function(){return y}));const r=[];var o;!function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"}(o||(o={}));const l={debug:o.DEBUG,verbose:o.VERBOSE,info:o.INFO,warn:o.WARN,error:o.ERROR,silent:o.SILENT},c=o.INFO,h={[o.DEBUG]:"log",[o.VERBOSE]:"log",[o.INFO]:"info",[o.WARN]:"warn",[o.ERROR]:"error"},d=(t,e,...n)=>{if(e{e.setLogLevel(t)}))}function y(t,e){for(const n of r){let r=null;e&&e.level&&(r=l[e.level]),n.userLogHandler=null===t?null:(e,n,...l)=>{const c=l.map((t=>{if(null==t)return null;if("string"==typeof t)return t;if("number"==typeof t||"boolean"==typeof t)return t.toString();if(t instanceof Error)return t.message;try{return JSON.stringify(t)}catch(t){return null}})).filter((t=>t)).join(" ");n>=(null!=r?r:e.logLevel)&&t({level:o[n].toLowerCase(),message:c,args:l,type:e.name})}}}},17:function(t,e,n){"use strict";var r=n(180);n.d(e,"a",(function(){return r.a})),n.d(e,"b",(function(){return r.b})),n.d(e,"c",(function(){return r.c})),n.d(e,"d",(function(){return r.d})),n.d(e,"e",(function(){return r.e})),n.d(e,"f",(function(){return r.f})),n.d(e,"g",(function(){return r.g})),n.d(e,"h",(function(){return r.h})),n.d(e,"i",(function(){return r.i})),n.d(e,"j",(function(){return r.j})),n.d(e,"k",(function(){return r.k})),n.d(e,"l",(function(){return r.l}))},178:function(t,e,n){var content=n(239);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(111).default)("3c219fab",content,!0,{sourceMap:!1})},179:function(t,e,n){var content=n(241);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(111).default)("b682ae5a",content,!0,{sourceMap:!1})},18:function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return h}));var r=n(0);class o{constructor(t,e,n){this.name=t,this.instanceFactory=e,this.type=n,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}const l="[DEFAULT]";class c{constructor(t,e){this.name=t,this.container=e,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const e=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(e)){const t=new r.a;if(this.instancesDeferred.set(e,t),this.isInitialized(e)||this.shouldAutoInitialize())try{const n=this.getOrInitializeService({instanceIdentifier:e});n&&t.resolve(n)}catch(t){}}return this.instancesDeferred.get(e).promise}getImmediate(t){var e;const n=this.normalizeInstanceIdentifier(null==t?void 0:t.identifier),r=null!==(e=null==t?void 0:t.optional)&&void 0!==e&&e;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(t){if(r)return null;throw t}}getComponent(){return this.component}setComponent(component){if(component.name!==this.name)throw Error(`Mismatching Component ${component.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=component,this.shouldAutoInitialize()){if(function(component){return"EAGER"===component.instantiationMode}(component))try{this.getOrInitializeService({instanceIdentifier:l})}catch(t){}for(const[t,e]of this.instancesDeferred.entries()){const n=this.normalizeInstanceIdentifier(t);try{const t=this.getOrInitializeService({instanceIdentifier:n});e.resolve(t)}catch(t){}}}}clearInstance(t="[DEFAULT]"){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}async delete(){const t=Array.from(this.instances.values());await Promise.all([...t.filter((t=>"INTERNAL"in t)).map((t=>t.INTERNAL.delete())),...t.filter((t=>"_delete"in t)).map((t=>t._delete()))])}isComponentSet(){return null!=this.component}isInitialized(t="[DEFAULT]"){return this.instances.has(t)}getOptions(t="[DEFAULT]"){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:e={}}=t,n=this.normalizeInstanceIdentifier(t.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:e});for(const[t,e]of this.instancesDeferred.entries()){n===this.normalizeInstanceIdentifier(t)&&e.resolve(r)}return r}onInit(t,e){var n;const r=this.normalizeInstanceIdentifier(e),o=null!==(n=this.onInitCallbacks.get(r))&&void 0!==n?n:new Set;o.add(t),this.onInitCallbacks.set(r,o);const l=this.instances.get(r);return l&&t(l,r),()=>{o.delete(t)}}invokeOnInitCallbacks(t,e){const n=this.onInitCallbacks.get(e);if(n)for(const r of n)try{r(t,e)}catch(t){}}getOrInitializeService({instanceIdentifier:t,options:e={}}){let n=this.instances.get(t);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:(r=t,r===l?void 0:r),options:e}),this.instances.set(t,n),this.instancesOptions.set(t,e),this.invokeOnInitCallbacks(n,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,n)}catch(t){}var r;return n||null}normalizeInstanceIdentifier(t="[DEFAULT]"){return this.component?this.component.multipleInstances?t:l:t}shouldAutoInitialize(){return!!this.component&&"EXPLICIT"!==this.component.instantiationMode}}class h{constructor(t){this.name=t,this.providers=new Map}addComponent(component){const t=this.getProvider(component.name);if(t.isComponentSet())throw new Error(`Component ${component.name} has already been registered with ${this.name}`);t.setComponent(component)}addOrOverwriteComponent(component){this.getProvider(component.name).isComponentSet()&&this.providers.delete(component.name),this.addComponent(component)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const e=new c(t,this);return this.providers.set(t,e),e}getProviders(){return Array.from(this.providers.values())}}},180:function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return sa})),n.d(e,"b",(function(){return ua})),n.d(e,"c",(function(){return Zs})),n.d(e,"d",(function(){return to})),n.d(e,"e",(function(){return ea})),n.d(e,"f",(function(){return ra})),n.d(e,"g",(function(){return io})),n.d(e,"h",(function(){return Yo})),n.d(e,"i",(function(){return oa})),n.d(e,"j",(function(){return Wo})),n.d(e,"k",(function(){return ia})),n.d(e,"l",(function(){return Ko}));var r=n(4),o=n(18),l=n(15),c=n(0),h=n(21);const d="@firebase/firestore";class f{constructor(t){this.uid=t}isAuthenticated(){return null!=this.uid}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(t){return t.uid===this.uid}}f.UNAUTHENTICATED=new f(null),f.GOOGLE_CREDENTIALS=new f("google-credentials-uid"),f.FIRST_PARTY=new f("first-party-uid"),f.MOCK_USER=new f("mock-user");let m="9.6.3";const y=new l.b("@firebase/firestore");function v(){return y.logLevel}function w(t,...e){if(y.logLevel<=l.a.DEBUG){const n=e.map(T);y.debug(`Firestore (${m}): ${t}`,...n)}}function C(t,...e){if(y.logLevel<=l.a.ERROR){const n=e.map(T);y.error(`Firestore (${m}): ${t}`,...n)}}function x(t,...e){if(y.logLevel<=l.a.WARN){const n=e.map(T);y.warn(`Firestore (${m}): ${t}`,...n)}}function T(t){if("string"==typeof t)return t;try{return e=t,JSON.stringify(e)}catch(e){return t}var e}function S(t="Unexpected state"){const e=`FIRESTORE (${m}) INTERNAL ASSERTION FAILED: `+t;throw C(e),new Error(e)}function k(t,e){t||S()}function E(t,e){return t}const _={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 A extends c.c{constructor(t,e){super(t,e),this.code=t,this.message=e,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}class O{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}}class I{constructor(t,e){this.user=e,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${t}`)}}class D{getToken(){return Promise.resolve(null)}invalidateToken(){}start(t,e){t.enqueueRetryable((()=>e(f.UNAUTHENTICATED)))}shutdown(){}}class N{constructor(t){this.t=t,this.currentUser=f.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(t,e){let n=this.i;const s=t=>this.i!==n?(n=this.i,e(t)):Promise.resolve();let i=new O;this.o=()=>{this.i++,this.currentUser=this.u(),i.resolve(),i=new O,t.enqueueRetryable((()=>s(this.currentUser)))};const r=()=>{const e=i;t.enqueueRetryable((async()=>{await e.promise,await s(this.currentUser)}))},o=t=>{w("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=t,this.auth.addAuthTokenListener(this.o),r()};this.t.onInit((t=>o(t))),setTimeout((()=>{if(!this.auth){const t=this.t.getImmediate({optional:!0});t?o(t):(w("FirebaseAuthCredentialsProvider","Auth not yet detected"),i.resolve(),i=new O)}}),0),r()}getToken(){const t=this.i,e=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(e).then((e=>this.i!==t?(w("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):e?(k("string"==typeof e.accessToken),new I(e.accessToken,this.currentUser)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.auth.removeAuthTokenListener(this.o)}u(){const t=this.auth&&this.auth.getUid();return k(null===t||"string"==typeof t),new f(t)}}class j{constructor(t,e,n){this.type="FirstParty",this.user=f.FIRST_PARTY,this.headers=new Map,this.headers.set("X-Goog-AuthUser",e);const s=t.auth.getAuthHeaderValueForFirstParty([]);s&&this.headers.set("Authorization",s),n&&this.headers.set("X-Goog-Iam-Authorization-Token",n)}}class P{constructor(t,e,n){this.h=t,this.l=e,this.m=n}getToken(){return Promise.resolve(new j(this.h,this.l,this.m))}start(t,e){t.enqueueRetryable((()=>e(f.FIRST_PARTY)))}shutdown(){}invalidateToken(){}}class R{constructor(t){this.value=t,this.type="AppCheck",this.headers=new Map,t&&t.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class L{constructor(t){this.g=t,this.forceRefresh=!1,this.appCheck=null}start(t,e){this.o=n=>{t.enqueueRetryable((()=>(t=>(null!=t.error&&w("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${t.error.message}`),e(t.token)))(n)))};const n=t=>{w("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=t,this.appCheck.addTokenListener(this.o)};this.g.onInit((t=>n(t))),setTimeout((()=>{if(!this.appCheck){const t=this.g.getImmediate({optional:!0});t?n(t):w("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}}),0)}getToken(){const t=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(t).then((t=>t?(k("string"==typeof t.token),new R(t.token)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.appCheck.removeTokenListener(this.o)}}class ${constructor(t,e){this.previousValue=t,e&&(e.sequenceNumberHandler=t=>this.p(t),this.T=t=>e.writeSequenceNumber(t))}p(t){return this.previousValue=Math.max(t,this.previousValue),this.previousValue}next(){const t=++this.previousValue;return this.T&&this.T(t),t}}function M(t){const e="undefined"!=typeof self&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&"function"==typeof e.getRandomValues)e.getRandomValues(n);else for(let e=0;ee?1:0}function B(t,e,n){return t.length===e.length&&t.every(((t,s)=>n(t,e[s])))}class V{constructor(t,e){if(this.seconds=t,this.nanoseconds=e,e<0)throw new A(_.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(e>=1e9)throw new A(_.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+e);if(t<-62135596800)throw new A(_.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t);if(t>=253402300800)throw new A(_.INVALID_ARGUMENT,"Timestamp seconds out of range: "+t)}static now(){return V.fromMillis(Date.now())}static fromDate(t){return V.fromMillis(t.getTime())}static fromMillis(t){const e=Math.floor(t/1e3),n=Math.floor(1e6*(t-1e3*e));return new V(e,n)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(t){return this.seconds===t.seconds?rt(this.nanoseconds,t.nanoseconds):rt(this.seconds,t.seconds)}isEqual(t){return t.seconds===this.seconds&&t.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const t=this.seconds- -62135596800;return String(t).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}class U{constructor(t){this.timestamp=t}static fromTimestamp(t){return new U(t)}static min(){return new U(new V(0,0))}compareTo(t){return this.timestamp._compareTo(t.timestamp)}isEqual(t){return this.timestamp.isEqual(t.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}function H(t){let e=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function W(t,e){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function z(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}class dt{constructor(t,e,n){void 0===e?e=0:e>t.length&&S(),void 0===n?n=t.length-e:n>t.length-e&&S(),this.segments=t,this.offset=e,this.len=n}get length(){return this.len}isEqual(t){return 0===dt.comparator(this,t)}child(t){const e=this.segments.slice(this.offset,this.limit());return t instanceof dt?t.forEach((t=>{e.push(t)})):e.push(t),this.construct(e)}limit(){return this.offset+this.length}popFirst(t){return t=void 0===t?1:t,this.construct(this.segments,this.offset+t,this.length-t)}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(t){return this.segments[this.offset+t]}isEmpty(){return 0===this.length}isPrefixOf(t){if(t.lengthi)return 1}return t.lengthe.length?1:0}}class K extends dt{construct(t,e,n){return new K(t,e,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}static fromString(...t){const e=[];for(const n of t){if(n.indexOf("//")>=0)throw new A(_.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);e.push(...n.split("/").filter((t=>t.length>0)))}return new K(e)}static emptyPath(){return new K([])}}const G=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class Y extends dt{construct(t,e,n){return new Y(t,e,n)}static isValidIdentifier(t){return G.test(t)}canonicalString(){return this.toArray().map((t=>(t=t.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),Y.isValidIdentifier(t)||(t="`"+t+"`"),t))).join(".")}toString(){return this.canonicalString()}isKeyField(){return 1===this.length&&"__name__"===this.get(0)}static keyField(){return new Y(["__name__"])}static fromServerFormat(t){const e=[];let n="",s=0;const i=()=>{if(0===n.length)throw new A(_.INVALID_ARGUMENT,`Invalid field path (${t}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);e.push(n),n=""};let r=!1;for(;st.isEqual(e)))}}class Q{constructor(t){this.binaryString=t}static fromBase64String(t){const e=atob(t);return new Q(e)}static fromUint8Array(t){const e=function(t){let e="";for(let n=0;nt=Number.MIN_SAFE_INTEGER}class ut{constructor(t){this.path=t}static fromPath(t){return new ut(K.fromString(t))}static fromName(t){return new ut(K.fromString(t).popFirst(5))}hasCollectionId(t){return this.path.length>=2&&this.path.get(this.path.length-2)===t}isEqual(t){return null!==t&&0===K.comparator(this.path,t.path)}toString(){return this.path.toString()}static comparator(t,e){return K.comparator(t.path,e.path)}static isDocumentKey(t){return t.length%2==0}static fromSegments(t){return new ut(new K(t.slice()))}}function ct(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?nt(t)?4:10:S()}function ht(t,e){if(t===e)return!0;const n=ct(t);if(n!==ct(e))return!1;switch(n){case 0:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return st(t).isEqual(st(e));case 3:return function(t,e){if("string"==typeof t.timestampValue&&"string"==typeof e.timestampValue&&t.timestampValue.length===e.timestampValue.length)return t.timestampValue===e.timestampValue;const n=Z(t.timestampValue),s=Z(e.timestampValue);return n.seconds===s.seconds&&n.nanos===s.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(t,e){return et(t.bytesValue).isEqual(et(e.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(t,e){return tt(t.geoPointValue.latitude)===tt(e.geoPointValue.latitude)&&tt(t.geoPointValue.longitude)===tt(e.geoPointValue.longitude)}(t,e);case 2:return function(t,e){if("integerValue"in t&&"integerValue"in e)return tt(t.integerValue)===tt(e.integerValue);if("doubleValue"in t&&"doubleValue"in e){const n=tt(t.doubleValue),s=tt(e.doubleValue);return n===s?at(n)===at(s):isNaN(n)&&isNaN(s)}return!1}(t,e);case 9:return B(t.arrayValue.values||[],e.arrayValue.values||[],ht);case 10:return function(t,e){const n=t.mapValue.fields||{},s=e.mapValue.fields||{};if(H(n)!==H(s))return!1;for(const t in n)if(n.hasOwnProperty(t)&&(void 0===s[t]||!ht(n[t],s[t])))return!1;return!0}(t,e);default:return S()}}function pt(t,e){return void 0!==(t.values||[]).find((t=>ht(t,e)))}function ft(t,e){if(t===e)return 0;const n=ct(t),s=ct(e);if(n!==s)return rt(n,s);switch(n){case 0:return 0;case 1:return rt(t.booleanValue,e.booleanValue);case 2:return function(t,e){const n=tt(t.integerValue||t.doubleValue),s=tt(e.integerValue||e.doubleValue);return ns?1:n===s?0:isNaN(n)?isNaN(s)?0:-1:1}(t,e);case 3:return mt(t.timestampValue,e.timestampValue);case 4:return mt(st(t),st(e));case 5:return rt(t.stringValue,e.stringValue);case 6:return function(t,e){const n=et(t),s=et(e);return n.compareTo(s)}(t.bytesValue,e.bytesValue);case 7:return function(t,e){const n=t.split("/"),s=e.split("/");for(let t=0;te.mapValue.fields[t]=St(n))),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=St(t.arrayValue.values[n]);return e}return Object.assign({},t)}class kt{constructor(t){this.value=t}static empty(){return new kt({mapValue:{}})}field(t){if(t.isEmpty())return this.value;{let e=this.value;for(let n=0;n{if(!e.isImmediateParentOf(i)){const t=this.getFieldsMap(e);this.applyChanges(t,n,s),n={},s=[],e=i.popLast()}t?n[i.lastSegment()]=St(t):s.push(i.lastSegment())}));const i=this.getFieldsMap(e);this.applyChanges(i,n,s)}delete(t){const e=this.field(t.popLast());Tt(e)&&e.mapValue.fields&&delete e.mapValue.fields[t.lastSegment()]}isEqual(t){return ht(this.value,t.value)}getFieldsMap(t){let e=this.value;e.mapValue.fields||(e.mapValue={fields:{}});for(let n=0;nt[e]=n));for(const e of n)delete t[e]}clone(){return new kt(St(this.value))}}function Et(t){const e=[];return W(t.fields,((t,n)=>{const s=new Y([t]);if(Tt(n)){const t=Et(n.mapValue).fields;if(0===t.length)e.push(s);else for(const n of t)e.push(s.child(n))}else e.push(s)})),new J(e)}class _t{constructor(t,e,n,s,i){this.key=t,this.documentType=e,this.version=n,this.data=s,this.documentState=i}static newInvalidDocument(t){return new _t(t,0,U.min(),kt.empty(),0)}static newFoundDocument(t,e,n){return new _t(t,1,e,n,0)}static newNoDocument(t,e){return new _t(t,2,e,kt.empty(),0)}static newUnknownDocument(t,e){return new _t(t,3,e,kt.empty(),2)}convertToFoundDocument(t,e){return this.version=t,this.documentType=1,this.data=e,this.documentState=0,this}convertToNoDocument(t){return this.version=t,this.documentType=2,this.data=kt.empty(),this.documentState=0,this}convertToUnknownDocument(t){return this.version=t,this.documentType=3,this.data=kt.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,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(t){return t instanceof _t&&this.key.isEqual(t.key)&&this.version.isEqual(t.version)&&this.documentType===t.documentType&&this.documentState===t.documentState&&this.data.isEqual(t.data)}mutableCopy(){return new _t(this.key,this.documentType,this.version,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}class At{constructor(t,e=null,n=[],s=[],i=null,r=null,o=null){this.path=t,this.collectionGroup=e,this.orderBy=n,this.filters=s,this.limit=i,this.startAt=r,this.endAt=o,this.R=null}}function Ot(t,e=null,n=[],s=[],i=null,r=null,o=null){return new At(t,e,n,s,i,r,o)}function It(t){const e=E(t);if(null===e.R){let t=e.path.canonicalString();null!==e.collectionGroup&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map((t=>function(t){return t.field.canonicalString()+t.op.toString()+gt(t.value)}(t))).join(","),t+="|ob:",t+=e.orderBy.map((t=>function(t){return t.field.canonicalString()+t.dir}(t))).join(","),ot(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=Ut(e.startAt)),e.endAt&&(t+="|ub:",t+=Ut(e.endAt)),e.R=t}return e.R}function Dt(t,e){if(t.limit!==e.limit)return!1;if(t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n":return t>0;case">=":return t>=0;default:return S()}}V(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}}class Pt extends jt{constructor(t,e,n){super(t,e,n),this.key=ut.fromName(n.referenceValue)}matches(t){const e=ut.comparator(t.key,this.key);return this.v(e)}}class Rt extends jt{constructor(t,e){super(t,"in",e),this.keys=$t("in",e)}matches(t){return this.keys.some((e=>e.isEqual(t.key)))}}class Lt extends jt{constructor(t,e){super(t,"not-in",e),this.keys=$t("not-in",e)}matches(t){return!this.keys.some((e=>e.isEqual(t.key)))}}function $t(t,e){var n;return((null===(n=e.arrayValue)||void 0===n?void 0:n.values)||[]).map((t=>ut.fromName(t.referenceValue)))}class Mt extends jt{constructor(t,e){super(t,"array-contains",e)}matches(t){const e=t.data.field(this.field);return wt(e)&&pt(e.arrayValue,this.value)}}class Ft extends jt{constructor(t,e){super(t,"in",e)}matches(t){const e=t.data.field(this.field);return null!==e&&pt(this.value.arrayValue,e)}}class Bt extends jt{constructor(t,e){super(t,"not-in",e)}matches(t){if(pt(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const e=t.data.field(this.field);return null!==e&&!pt(this.value.arrayValue,e)}}class Vt extends jt{constructor(t,e){super(t,"array-contains-any",e)}matches(t){const e=t.data.field(this.field);return!(!wt(e)||!e.arrayValue.values)&&e.arrayValue.values.some((t=>pt(this.value.arrayValue,t)))}}class qt{constructor(t,e){this.position=t,this.before=e}}function Ut(t){return`${t.before?"b":"a"}:${t.position.map((t=>gt(t))).join(",")}`}class Ht{constructor(t,e="asc"){this.field=t,this.dir=e}}function Wt(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}function zt(t,e,n){let s=0;for(let i=0;i0?t.explicitOrderBy[0].field:null}function te(t){for(const e of t.filters)if(e.V())return e.field;return null}function ee(t){return null!==t.collectionGroup}function ne(t){const e=E(t);if(null===e.S){e.S=[];const t=te(e),n=Zt(e);if(null!==t&&null===n)t.isKeyField()||e.S.push(new Ht(t)),e.S.push(new Ht(Y.keyField(),"asc"));else{let t=!1;for(const n of e.explicitOrderBy)e.S.push(n),n.field.isKeyField()&&(t=!0);if(!t){const t=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";e.S.push(new Ht(Y.keyField(),t))}}}return e.S}function re(t){const e=E(t);if(!e.D)if("F"===e.limitType)e.D=Ot(e.path,e.collectionGroup,ne(e),e.filters,e.limit,e.startAt,e.endAt);else{const t=[];for(const n of ne(e)){const e="desc"===n.dir?"asc":"desc";t.push(new Ht(n.field,e))}const n=e.endAt?new qt(e.endAt.position,!e.endAt.before):null,s=e.startAt?new qt(e.startAt.position,!e.startAt.before):null;e.D=Ot(e.path,e.collectionGroup,t,e.filters,e.limit,n,s)}return e.D}function ie(t,e,n){return new Gt(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function se(t,e){return Dt(re(t),re(e))&&t.limitType===e.limitType}function oe(t){return`${It(re(t))}|lt:${t.limitType}`}function ae(t){return`Query(target=${function(t){let e=t.path.canonicalString();return null!==t.collectionGroup&&(e+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(e+=`, filters: [${t.filters.map((t=>{return`${(e=t).field.canonicalString()} ${e.op} ${gt(e.value)}`;var e})).join(", ")}]`),ot(t.limit)||(e+=", limit: "+t.limit),t.orderBy.length>0&&(e+=`, orderBy: [${t.orderBy.map((t=>function(t){return`${t.field.canonicalString()} (${t.dir})`}(t))).join(", ")}]`),t.startAt&&(e+=", startAt: "+Ut(t.startAt)),t.endAt&&(e+=", endAt: "+Ut(t.endAt)),`Target(${e})`}(re(t))}; limitType=${t.limitType})`}function le(t,e){return e.isFoundDocument()&&function(t,e){const n=e.key.path;return null!==t.collectionGroup?e.key.hasCollectionId(t.collectionGroup)&&t.path.isPrefixOf(n):ut.isDocumentKey(t.path)?t.path.isEqual(n):t.path.isImmediateParentOf(n)}(t,e)&&function(t,e){for(const n of t.explicitOrderBy)if(!n.field.isKeyField()&&null===e.data.field(n.field))return!1;return!0}(t,e)&&function(t,e){for(const n of t.filters)if(!n.matches(e))return!1;return!0}(t,e)&&function(t,e){return!(t.startAt&&!zt(t.startAt,ne(t),e))&&(!t.endAt||!zt(t.endAt,ne(t),e))}(t,e)}function ue(t){return(e,n)=>{let s=!1;for(const i of ne(t)){const t=ce(i,e,n);if(0!==t)return t;s=s||i.field.isKeyField()}return 0}}function ce(t,e,n){const s=t.field.isKeyField()?ut.comparator(e.key,n.key):function(t,e,n){const s=e.data.field(t),i=n.data.field(t);return null!==s&&null!==i?ft(s,i):S()}(t.field,e,n);switch(t.dir){case"asc":return s;case"desc":return-1*s;default:return S()}}function he(t,e){if(t.C){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:at(e)?"-0":e}}function de(t){return{integerValue:""+t}}function pe(t,e){return lt(e)?de(e):he(t,e)}class fe{constructor(){this._=void 0}}function me(t,e,n){return t instanceof ve?function(t,e){const n={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:t.seconds,nanos:t.nanoseconds}}}};return e&&(n.fields.__previous_value__=e),{mapValue:n}}(n,e):t instanceof be?we(t,e):t instanceof Ce?xe(t,e):function(t,e){const n=ye(t,e),s=Se(n)+Se(t.N);return bt(n)&&bt(t.N)?de(s):he(t.k,s)}(t,e)}function ge(t,e,n){return t instanceof be?we(t,e):t instanceof Ce?xe(t,e):n}function ye(t,e){return t instanceof Te?bt(n=e)||function(t){return!!t&&"doubleValue"in t}(n)?e:{integerValue:0}:null;var n}class ve extends fe{}class be extends fe{constructor(t){super(),this.elements=t}}function we(t,e){const n=ke(e);for(const e of t.elements)n.some((t=>ht(t,e)))||n.push(e);return{arrayValue:{values:n}}}class Ce extends fe{constructor(t){super(),this.elements=t}}function xe(t,e){let n=ke(e);for(const e of t.elements)n=n.filter((t=>!ht(t,e)));return{arrayValue:{values:n}}}class Te extends fe{constructor(t,e){super(),this.k=t,this.N=e}}function Se(t){return tt(t.integerValue||t.doubleValue)}function ke(t){return wt(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}class Ee{constructor(t,e){this.field=t,this.transform=e}}class _e{constructor(t,e){this.version=t,this.transformResults=e}}class Ae{constructor(t,e){this.updateTime=t,this.exists=e}static none(){return new Ae}static exists(t){return new Ae(void 0,t)}static updateTime(t){return new Ae(t)}get isNone(){return void 0===this.updateTime&&void 0===this.exists}isEqual(t){return this.exists===t.exists&&(this.updateTime?!!t.updateTime&&this.updateTime.isEqual(t.updateTime):!t.updateTime)}}function Oe(t,e){return void 0!==t.updateTime?e.isFoundDocument()&&e.version.isEqual(t.updateTime):void 0===t.exists||t.exists===e.isFoundDocument()}class Ie{}function De(t,e,n){t instanceof Le?function(t,e,n){const s=t.value.clone(),i=Fe(t.fieldTransforms,e,n.transformResults);s.setAll(i),e.convertToFoundDocument(n.version,s).setHasCommittedMutations()}(t,e,n):t instanceof $e?function(t,e,n){if(!Oe(t.precondition,e))return void e.convertToUnknownDocument(n.version);const s=Fe(t.fieldTransforms,e,n.transformResults),i=e.data;i.setAll(Me(t)),i.setAll(s),e.convertToFoundDocument(n.version,i).setHasCommittedMutations()}(t,e,n):function(t,e,n){e.convertToNoDocument(n.version).setHasCommittedMutations()}(0,e,n)}function Ne(t,e,n){t instanceof Le?function(t,e,n){if(!Oe(t.precondition,e))return;const s=t.value.clone(),i=Be(t.fieldTransforms,n,e);s.setAll(i),e.convertToFoundDocument(Re(e),s).setHasLocalMutations()}(t,e,n):t instanceof $e?function(t,e,n){if(!Oe(t.precondition,e))return;const s=Be(t.fieldTransforms,n,e),i=e.data;i.setAll(Me(t)),i.setAll(s),e.convertToFoundDocument(Re(e),i).setHasLocalMutations()}(t,e,n):function(t,e){Oe(t.precondition,e)&&e.convertToNoDocument(U.min())}(t,e)}function je(t,e){let n=null;for(const s of t.fieldTransforms){const t=e.data.field(s.field),i=ye(s.transform,t||null);null!=i&&(null==n&&(n=kt.empty()),n.set(s.field,i))}return n||null}function Pe(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(t,e){return void 0===t&&void 0===e||!(!t||!e)&&B(t,e,((t,e)=>function(t,e){return t.field.isEqual(e.field)&&function(t,e){return t instanceof be&&e instanceof be||t instanceof Ce&&e instanceof Ce?B(t.elements,e.elements,ht):t instanceof Te&&e instanceof Te?ht(t.N,e.N):t instanceof ve&&e instanceof ve}(t.transform,e.transform)}(t,e)))}(t.fieldTransforms,e.fieldTransforms)&&(0===t.type?t.value.isEqual(e.value):1!==t.type||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}function Re(t){return t.isFoundDocument()?t.version:U.min()}class Le extends Ie{constructor(t,e,n,s=[]){super(),this.key=t,this.value=e,this.precondition=n,this.fieldTransforms=s,this.type=0}}class $e extends Ie{constructor(t,e,n,s,i=[]){super(),this.key=t,this.data=e,this.fieldMask=n,this.precondition=s,this.fieldTransforms=i,this.type=1}}function Me(t){const e=new Map;return t.fieldMask.fields.forEach((n=>{if(!n.isEmpty()){const s=t.data.field(n);e.set(n,s)}})),e}function Fe(t,e,n){const s=new Map;k(t.length===n.length);for(let i=0;i0&&(e=e.right)}return null}indexOf(t){let e=0,n=this.root;for(;!n.isEmpty();){const s=this.comparator(t,n.key);if(0===s)return e+n.left.size;s<0?n=n.left:(e+=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(t){return this.root.inorderTraversal(t)}forEach(t){this.inorderTraversal(((e,n)=>(t(e,n),!1)))}toString(){const t=[];return this.inorderTraversal(((e,n)=>(t.push(`${e}:${n}`),!1))),`{${t.join(", ")}}`}reverseTraversal(t){return this.root.reverseTraversal(t)}getIterator(){return new Ye(this.root,null,this.comparator,!1)}getIteratorFrom(t){return new Ye(this.root,t,this.comparator,!1)}getReverseIterator(){return new Ye(this.root,null,this.comparator,!0)}getReverseIteratorFrom(t){return new Ye(this.root,t,this.comparator,!0)}}class Ye{constructor(t,e,n,s){this.isReverse=s,this.nodeStack=[];let i=1;for(;!t.isEmpty();)if(i=e?n(t.key,e):1,s&&(i*=-1),i<0)t=this.isReverse?t.left:t.right;else{if(0===i){this.nodeStack.push(t);break}this.nodeStack.push(t),t=this.isReverse?t.right:t.left}}getNext(){let t=this.nodeStack.pop();const e={key:t.key,value:t.value};if(this.isReverse)for(t=t.left;!t.isEmpty();)this.nodeStack.push(t),t=t.right;else for(t=t.right;!t.isEmpty();)this.nodeStack.push(t),t=t.left;return e}hasNext(){return this.nodeStack.length>0}peek(){if(0===this.nodeStack.length)return null;const t=this.nodeStack[this.nodeStack.length-1];return{key:t.key,value:t.value}}}class Je{constructor(t,e,n,s,i){this.key=t,this.value=e,this.color=null!=n?n:Je.RED,this.left=null!=s?s:Je.EMPTY,this.right=null!=i?i:Je.EMPTY,this.size=this.left.size+1+this.right.size}copy(t,e,n,s,i){return new Je(null!=t?t:this.key,null!=e?e:this.value,null!=n?n:this.color,null!=s?s:this.left,null!=i?i:this.right)}isEmpty(){return!1}inorderTraversal(t){return this.left.inorderTraversal(t)||t(this.key,this.value)||this.right.inorderTraversal(t)}reverseTraversal(t){return this.right.reverseTraversal(t)||t(this.key,this.value)||this.left.reverseTraversal(t)}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(t,e,n){let s=this;const i=n(t,s.key);return s=i<0?s.copy(null,null,null,s.left.insert(t,e,n),null):0===i?s.copy(null,e,null,null,null):s.copy(null,null,null,null,s.right.insert(t,e,n)),s.fixUp()}removeMin(){if(this.left.isEmpty())return Je.EMPTY;let t=this;return t.left.isRed()||t.left.left.isRed()||(t=t.moveRedLeft()),t=t.copy(null,null,null,t.left.removeMin(),null),t.fixUp()}remove(t,e){let n,s=this;if(e(t,s.key)<0)s.left.isEmpty()||s.left.isRed()||s.left.left.isRed()||(s=s.moveRedLeft()),s=s.copy(null,null,null,s.left.remove(t,e),null);else{if(s.left.isRed()&&(s=s.rotateRight()),s.right.isEmpty()||s.right.isRed()||s.right.left.isRed()||(s=s.moveRedRight()),0===e(t,s.key)){if(s.right.isEmpty())return Je.EMPTY;n=s.right.min(),s=s.copy(n.key,n.value,null,null,s.right.removeMin())}s=s.copy(null,null,null,null,s.right.remove(t,e))}return s.fixUp()}isRed(){return this.color}fixUp(){let t=this;return t.right.isRed()&&!t.left.isRed()&&(t=t.rotateLeft()),t.left.isRed()&&t.left.left.isRed()&&(t=t.rotateRight()),t.left.isRed()&&t.right.isRed()&&(t=t.colorFlip()),t}moveRedLeft(){let t=this.colorFlip();return t.right.left.isRed()&&(t=t.copy(null,null,null,null,t.right.rotateRight()),t=t.rotateLeft(),t=t.colorFlip()),t}moveRedRight(){let t=this.colorFlip();return t.left.left.isRed()&&(t=t.rotateRight(),t=t.colorFlip()),t}rotateLeft(){const t=this.copy(null,null,Je.RED,null,this.right.left);return this.right.copy(null,null,this.color,t,null)}rotateRight(){const t=this.copy(null,null,Je.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,t)}colorFlip(){const t=this.left.copy(null,null,!this.left.color,null,null),e=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,t,e)}checkMaxDepth(){const t=this.check();return Math.pow(2,t)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw S();if(this.right.isRed())throw S();const t=this.left.check();if(t!==this.right.check())throw S();return t+(this.isRed()?0:1)}}Je.EMPTY=null,Je.RED=!0,Je.BLACK=!1,Je.EMPTY=new class{constructor(){this.size=0}get key(){throw S()}get value(){throw S()}get color(){throw S()}get left(){throw S()}get right(){throw S()}copy(t,e,n,s,i){return this}insert(t,e,n){return new Je(t,e)}remove(t,e){return this}isEmpty(){return!0}inorderTraversal(t){return!1}reverseTraversal(t){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class Qe{constructor(t){this.comparator=t,this.data=new Ge(this.comparator)}has(t){return null!==this.data.get(t)}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(t){return this.data.indexOf(t)}forEach(t){this.data.inorderTraversal(((e,n)=>(t(e),!1)))}forEachInRange(t,e){const n=this.data.getIteratorFrom(t[0]);for(;n.hasNext();){const s=n.getNext();if(this.comparator(s.key,t[1])>=0)return;e(s.key)}}forEachWhile(t,e){let n;for(n=void 0!==e?this.data.getIteratorFrom(e):this.data.getIterator();n.hasNext();)if(!t(n.getNext().key))return}firstAfterOrEqual(t){const e=this.data.getIteratorFrom(t);return e.hasNext()?e.getNext().key:null}getIterator(){return new Xe(this.data.getIterator())}getIteratorFrom(t){return new Xe(this.data.getIteratorFrom(t))}add(t){return this.copy(this.data.remove(t).insert(t,!0))}delete(t){return this.has(t)?this.copy(this.data.remove(t)):this}isEmpty(){return this.data.isEmpty()}unionWith(t){let e=this;return e.size{e=e.add(t)})),e}isEqual(t){if(!(t instanceof Qe))return!1;if(this.size!==t.size)return!1;const e=this.data.getIterator(),n=t.data.getIterator();for(;e.hasNext();){const t=e.getNext().key,s=n.getNext().key;if(0!==this.comparator(t,s))return!1}return!0}toArray(){const t=[];return this.forEach((e=>{t.push(e)})),t}toString(){const t=[];return this.forEach((e=>t.push(e))),"SortedSet("+t.toString()+")"}copy(t){const e=new Qe(this.comparator);return e.data=t,e}}class Xe{constructor(t){this.iter=t}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}const Ze=new Ge(ut.comparator);function tn(){return Ze}const en=new Ge(ut.comparator);function nn(){return en}const rn=new Ge(ut.comparator);function sn(){return rn}const on=new Qe(ut.comparator);function an(...t){let e=on;for(const n of t)e=e.add(n);return e}const ln=new Qe(rt);function un(){return ln}class cn{constructor(t,e,n,s,i){this.snapshotVersion=t,this.targetChanges=e,this.targetMismatches=n,this.documentUpdates=s,this.resolvedLimboDocuments=i}static createSynthesizedRemoteEventForCurrentChange(t,e){const n=new Map;return n.set(t,hn.createSynthesizedTargetChangeForCurrentChange(t,e)),new cn(U.min(),n,un(),tn(),an())}}class hn{constructor(t,e,n,s,i){this.resumeToken=t,this.current=e,this.addedDocuments=n,this.modifiedDocuments=s,this.removedDocuments=i}static createSynthesizedTargetChangeForCurrentChange(t,e){return new hn(Q.EMPTY_BYTE_STRING,e,an(),an(),an())}}class dn{constructor(t,e,n,s){this.$=t,this.removedTargetIds=e,this.key=n,this.O=s}}class pn{constructor(t,e){this.targetId=t,this.M=e}}class fn{constructor(t,e,n=Q.EMPTY_BYTE_STRING,s=null){this.state=t,this.targetIds=e,this.resumeToken=n,this.cause=s}}class mn{constructor(){this.F=0,this.L=vn(),this.B=Q.EMPTY_BYTE_STRING,this.U=!1,this.q=!0}get current(){return this.U}get resumeToken(){return this.B}get K(){return 0!==this.F}get j(){return this.q}W(t){t.approximateByteSize()>0&&(this.q=!0,this.B=t)}G(){let t=an(),e=an(),n=an();return this.L.forEach(((s,i)=>{switch(i){case 0:t=t.add(s);break;case 2:e=e.add(s);break;case 1:n=n.add(s);break;default:S()}})),new hn(this.B,this.U,t,e,n)}H(){this.q=!1,this.L=vn()}J(t,e){this.q=!0,this.L=this.L.insert(t,e)}Y(t){this.q=!0,this.L=this.L.remove(t)}X(){this.F+=1}Z(){this.F-=1}tt(){this.q=!0,this.U=!0}}class gn{constructor(t){this.et=t,this.nt=new Map,this.st=tn(),this.it=yn(),this.rt=new Qe(rt)}ot(t){for(const e of t.$)t.O&&t.O.isFoundDocument()?this.ct(e,t.O):this.at(e,t.key,t.O);for(const e of t.removedTargetIds)this.at(e,t.key,t.O)}ut(t){this.forEachTarget(t,(e=>{const n=this.ht(e);switch(t.state){case 0:this.lt(e)&&n.W(t.resumeToken);break;case 1:n.Z(),n.K||n.H(),n.W(t.resumeToken);break;case 2:n.Z(),n.K||this.removeTarget(e);break;case 3:this.lt(e)&&(n.tt(),n.W(t.resumeToken));break;case 4:this.lt(e)&&(this.ft(e),n.W(t.resumeToken));break;default:S()}}))}forEachTarget(t,e){t.targetIds.length>0?t.targetIds.forEach(e):this.nt.forEach(((t,n)=>{this.lt(n)&&e(n)}))}dt(t){const e=t.targetId,n=t.M.count,s=this.wt(e);if(s){const t=s.target;if(Nt(t))if(0===n){const n=new ut(t.path);this.at(e,n,_t.newNoDocument(n,U.min()))}else k(1===n);else this._t(e)!==n&&(this.ft(e),this.rt=this.rt.add(e))}}gt(t){const e=new Map;this.nt.forEach(((n,s)=>{const i=this.wt(s);if(i){if(n.current&&Nt(i.target)){const e=new ut(i.target.path);null!==this.st.get(e)||this.yt(s,e)||this.at(s,e,_t.newNoDocument(e,t))}n.j&&(e.set(s,n.G()),n.H())}}));let n=an();this.it.forEach(((t,e)=>{let s=!0;e.forEachWhile((t=>{const e=this.wt(t);return!e||2===e.purpose||(s=!1,!1)})),s&&(n=n.add(t))}));const s=new cn(t,e,this.rt,this.st,n);return this.st=tn(),this.it=yn(),this.rt=new Qe(rt),s}ct(t,e){if(!this.lt(t))return;const n=this.yt(t,e.key)?2:0;this.ht(t).J(e.key,n),this.st=this.st.insert(e.key,e),this.it=this.it.insert(e.key,this.Tt(e.key).add(t))}at(t,e,n){if(!this.lt(t))return;const s=this.ht(t);this.yt(t,e)?s.J(e,1):s.Y(e),this.it=this.it.insert(e,this.Tt(e).delete(t)),n&&(this.st=this.st.insert(e,n))}removeTarget(t){this.nt.delete(t)}_t(t){const e=this.ht(t).G();return this.et.getRemoteKeysForTarget(t).size+e.addedDocuments.size-e.removedDocuments.size}X(t){this.ht(t).X()}ht(t){let e=this.nt.get(t);return e||(e=new mn,this.nt.set(t,e)),e}Tt(t){let e=this.it.get(t);return e||(e=new Qe(rt),this.it=this.it.insert(t,e)),e}lt(t){const e=null!==this.wt(t);return e||w("WatchChangeAggregator","Detected inactive target",t),e}wt(t){const e=this.nt.get(t);return e&&e.K?null:this.et.Et(t)}ft(t){this.nt.set(t,new mn),this.et.getRemoteKeysForTarget(t).forEach((e=>{this.at(t,e,null)}))}yt(t,e){return this.et.getRemoteKeysForTarget(t).has(e)}}function yn(){return new Ge(ut.comparator)}function vn(){return new Ge(ut.comparator)}const bn={asc:"ASCENDING",desc:"DESCENDING"},wn={"<":"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"};class Cn{constructor(t,e){this.databaseId=t,this.C=e}}function xn(t,e){return t.C?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function Tn(t,e){return t.C?e.toBase64():e.toUint8Array()}function Sn(t,e){return xn(t,e.toTimestamp())}function kn(t){return k(!!t),U.fromTimestamp(function(t){const e=Z(t);return new V(e.seconds,e.nanos)}(t))}function En(t,e){return function(t){return new K(["projects",t.projectId,"databases",t.database])}(t).child("documents").child(e).canonicalString()}function _n(t){const e=K.fromString(t);return k(Yn(e)),e}function An(t,e){return En(t.databaseId,e.path)}function On(t,e){const n=_n(e);if(n.get(1)!==t.databaseId.projectId)throw new A(_.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new A(_.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new ut(jn(n))}function In(t,e){return En(t.databaseId,e)}function Dn(t){const e=_n(t);return 4===e.length?K.emptyPath():jn(e)}function Nn(t){return new K(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function jn(t){return k(t.length>4&&"documents"===t.get(4)),t.popFirst(5)}function Pn(t,e,n){return{name:An(t,e),fields:n.value.mapValue.fields}}function Rn(t,e){let n;if(e instanceof Le)n={update:Pn(t,e.key,e.value)};else if(e instanceof Ve)n={delete:An(t,e.key)};else if(e instanceof $e)n={update:Pn(t,e.key,e.data),updateMask:Gn(e.fieldMask)};else{if(!(e instanceof qe))return S();n={verify:An(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map((t=>function(t,e){const n=e.transform;if(n instanceof ve)return{fieldPath:e.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(n instanceof be)return{fieldPath:e.field.canonicalString(),appendMissingElements:{values:n.elements}};if(n instanceof Ce)return{fieldPath:e.field.canonicalString(),removeAllFromArray:{values:n.elements}};if(n instanceof Te)return{fieldPath:e.field.canonicalString(),increment:n.N};throw S()}(0,t)))),e.precondition.isNone||(n.currentDocument=function(t,e){return void 0!==e.updateTime?{updateTime:Sn(t,e.updateTime)}:void 0!==e.exists?{exists:e.exists}:S()}(t,e.precondition)),n}function Ln(t,e){return{documents:[In(t,e.path)]}}function $n(t,e){const n={structuredQuery:{}},s=e.path;null!==e.collectionGroup?(n.parent=In(t,s),n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(n.parent=In(t,s.popLast()),n.structuredQuery.from=[{collectionId:s.lastSegment()}]);const i=function(t){if(0===t.length)return;const e=t.map((t=>function(t){if("=="===t.op){if(xt(t.value))return{unaryFilter:{field:Hn(t.field),op:"IS_NAN"}};if(Ct(t.value))return{unaryFilter:{field:Hn(t.field),op:"IS_NULL"}}}else if("!="===t.op){if(xt(t.value))return{unaryFilter:{field:Hn(t.field),op:"IS_NOT_NAN"}};if(Ct(t.value))return{unaryFilter:{field:Hn(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Hn(t.field),op:Un(t.op),value:t.value}}}(t)));return 1===e.length?e[0]:{compositeFilter:{op:"AND",filters:e}}}(e.filters);i&&(n.structuredQuery.where=i);const r=function(t){if(0!==t.length)return t.map((t=>function(t){return{field:Hn(t.field),direction:qn(t.dir)}}(t)))}(e.orderBy);r&&(n.structuredQuery.orderBy=r);const o=function(t,e){return t.C||ot(e)?e:{value:e}}(t,e.limit);return null!==o&&(n.structuredQuery.limit=o),e.startAt&&(n.structuredQuery.startAt=Bn(e.startAt)),e.endAt&&(n.structuredQuery.endAt=Bn(e.endAt)),n}function Mn(t){let e=Dn(t.parent);const n=t.structuredQuery,s=n.from?n.from.length:0;let i=null;if(s>0){k(1===s);const t=n.from[0];t.allDescendants?i=t.collectionId:e=e.child(t.collectionId)}let r=[];n.where&&(r=Fn(n.where));let o=[];n.orderBy&&(o=n.orderBy.map((t=>function(t){return new Ht(Wn(t.field),function(t){switch(t){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(t.direction))}(t))));let l=null;n.limit&&(l=function(t){let e;return e="object"==typeof t?t.value:t,ot(e)?null:e}(n.limit));let a=null;n.startAt&&(a=Vn(n.startAt));let u=null;return n.endAt&&(u=Vn(n.endAt)),Yt(e,i,o,r,l,"F",a,u)}function Fn(t){return t?void 0!==t.unaryFilter?[Kn(t)]:void 0!==t.fieldFilter?[zn(t)]:void 0!==t.compositeFilter?t.compositeFilter.filters.map((t=>Fn(t))).reduce(((t,e)=>t.concat(e))):S():[]}function Bn(t){return{before:t.before,values:t.position}}function Vn(t){const e=!!t.before,n=t.values||[];return new qt(n,e)}function qn(t){return bn[t]}function Un(t){return wn[t]}function Hn(t){return{fieldPath:t.canonicalString()}}function Wn(t){return Y.fromServerFormat(t.fieldPath)}function zn(t){return jt.create(Wn(t.fieldFilter.field),function(t){switch(t){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 S()}}(t.fieldFilter.op),t.fieldFilter.value)}function Kn(t){switch(t.unaryFilter.op){case"IS_NAN":const e=Wn(t.unaryFilter.field);return jt.create(e,"==",{doubleValue:NaN});case"IS_NULL":const n=Wn(t.unaryFilter.field);return jt.create(n,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const s=Wn(t.unaryFilter.field);return jt.create(s,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const i=Wn(t.unaryFilter.field);return jt.create(i,"!=",{nullValue:"NULL_VALUE"});default:return S()}}function Gn(t){const e=[];return t.fields.forEach((t=>e.push(t.canonicalString()))),{fieldPaths:e}}function Yn(t){return t.length>=4&&"projects"===t.get(0)&&"databases"===t.get(2)}function Jn(t){let e="";for(let n=0;n0&&(e=Xn(e)),e=Qn(t.get(n),e);return Xn(e)}function Qn(t,e){let n=e;const s=t.length;for(let e=0;et()))}}class gr{constructor(t){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,t((t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)}),(t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)}))}catch(t){return this.next(void 0,t)}next(t,e){return this.callbackAttached&&S(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(e,this.error):this.wrapSuccess(t,this.result):new gr(((n,s)=>{this.nextCallback=e=>{this.wrapSuccess(t,e).next(n,s)},this.catchCallback=t=>{this.wrapFailure(e,t).next(n,s)}}))}toPromise(){return new Promise(((t,e)=>{this.next(t,e)}))}wrapUserFunction(t){try{const e=t();return e instanceof gr?e:gr.resolve(e)}catch(t){return gr.reject(t)}}wrapSuccess(t,e){return t?this.wrapUserFunction((()=>t(e))):gr.resolve(e)}wrapFailure(t,e){return t?this.wrapUserFunction((()=>t(e))):gr.reject(e)}static resolve(t){return new gr(((e,n)=>{e(t)}))}static reject(t){return new gr(((e,n)=>{n(t)}))}static waitFor(t){return new gr(((e,n)=>{let s=0,i=0,r=!1;t.forEach((t=>{++s,t.next((()=>{++i,r&&i===s&&e()}),(t=>n(t)))})),r=!0,i===s&&e()}))}static or(t){let e=gr.resolve(!1);for(const n of t)e=e.next((t=>t?gr.resolve(t):n()));return e}static forEach(t,e){const n=[];return t.forEach(((t,s)=>{n.push(e.call(this,t,s))})),this.waitFor(n)}}function yr(t){return"IndexedDbTransactionError"===t.name}class vr{constructor(t,e,n,s){this.batchId=t,this.localWriteTime=e,this.baseMutations=n,this.mutations=s}applyToRemoteDocument(t,e){const n=e.mutationResults;for(let e=0;e{const n=t.get(e.key),s=n;this.applyToLocalView(s),n.isValidDocument()||s.convertToNoDocument(U.min())}))}keys(){return this.mutations.reduce(((t,e)=>t.add(e.key)),an())}isEqual(t){return this.batchId===t.batchId&&B(this.mutations,t.mutations,((t,e)=>Pe(t,e)))&&B(this.baseMutations,t.baseMutations,((t,e)=>Pe(t,e)))}}class wr{constructor(t,e,n,s){this.batch=t,this.commitVersion=e,this.mutationResults=n,this.docVersions=s}static from(t,e,n){k(t.mutations.length===n.length);let s=sn();const i=t.mutations;for(let t=0;t{for(const[e,s]of n)t(e,s)}))}isEmpty(){return z(this.inner)}}class Ir{constructor(){this.changes=new Or((t=>t.toString()),((t,e)=>t.isEqual(e))),this.changesApplied=!1}getReadTime(t){const e=this.changes.get(t);return e?e.readTime:U.min()}addEntry(t,e){this.assertNotApplied(),this.changes.set(t.key,{document:t,readTime:e})}removeEntry(t,e=null){this.assertNotApplied(),this.changes.set(t,{document:_t.newInvalidDocument(t),readTime:e})}getEntry(t,e){this.assertNotApplied();const n=this.changes.get(e);return void 0!==n?gr.resolve(n.document):this.getFromCache(t,e)}getEntries(t,e){return this.getAllFromCache(t,e)}apply(t){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(t)}assertNotApplied(){}}class Dr{constructor(t,e,n){this.Je=t,this.An=e,this.Jt=n}Rn(t,e){return this.An.getAllMutationBatchesAffectingDocumentKey(t,e).next((n=>this.bn(t,e,n)))}bn(t,e,n){return this.Je.getEntry(t,e).next((t=>{for(const e of n)e.applyToLocalView(t);return t}))}Pn(t,e){t.forEach(((t,n)=>{for(const t of e)t.applyToLocalView(n)}))}vn(t,e){return this.Je.getEntries(t,e).next((e=>this.Vn(t,e).next((()=>e))))}Vn(t,e){return this.An.getAllMutationBatchesAffectingDocumentKeys(t,e).next((t=>this.Pn(e,t)))}getDocumentsMatchingQuery(t,e,n){return function(t){return ut.isDocumentKey(t.path)&&null===t.collectionGroup&&0===t.filters.length}(e)?this.Sn(t,e.path):ee(e)?this.Dn(t,e,n):this.Cn(t,e,n)}Sn(t,e){return this.Rn(t,new ut(e)).next((t=>{let e=nn();return t.isFoundDocument()&&(e=e.insert(t.key,t)),e}))}Dn(t,e,n){const s=e.collectionGroup;let i=nn();return this.Jt.getCollectionParents(t,s).next((r=>gr.forEach(r,(r=>{const o=function(t,e){return new Gt(e,null,t.explicitOrderBy.slice(),t.filters.slice(),t.limit,t.limitType,t.startAt,t.endAt)}(e,r.child(s));return this.Cn(t,o,n).next((t=>{t.forEach(((t,e)=>{i=i.insert(t,e)}))}))})).next((()=>i))))}Cn(t,e,n){let s,i;return this.Je.getDocumentsMatchingQuery(t,e,n).next((n=>(s=n,this.An.getAllMutationBatchesAffectingQuery(t,e)))).next((e=>(i=e,this.Nn(t,i,s).next((t=>{s=t;for(const t of i)for(const e of t.mutations){const n=e.key;let i=s.get(n);null==i&&(i=_t.newInvalidDocument(n),s=s.insert(n,i)),Ne(e,i,t.localWriteTime),i.isFoundDocument()||(s=s.remove(n))}}))))).next((()=>(s.forEach(((t,n)=>{le(e,n)||(s=s.remove(t))})),s)))}Nn(t,e,n){let s=an();for(const t of e)for(const e of t.mutations)e instanceof $e&&null===n.get(e.key)&&(s=s.add(e.key));let i=n;return this.Je.getEntries(t,s).next((t=>(t.forEach(((t,e)=>{e.isFoundDocument()&&(i=i.insert(t,e))})),i)))}}class hr{constructor(t,e,n,s){this.targetId=t,this.fromCache=e,this.kn=n,this.xn=s}static $n(t,e){let n=an(),s=an();for(const t of e.docChanges)switch(t.type){case 0:n=n.add(t.doc.key);break;case 1:s=s.add(t.doc.key)}return new hr(t,e.fromCache,n,s)}}class Nr{On(t){this.Mn=t}getDocumentsMatchingQuery(t,e,n,s){return function(t){return 0===t.filters.length&&null===t.limit&&null==t.startAt&&null==t.endAt&&(0===t.explicitOrderBy.length||1===t.explicitOrderBy.length&&t.explicitOrderBy[0].field.isKeyField())}(e)||n.isEqual(U.min())?this.Fn(t,e):this.Mn.vn(t,s).next((i=>{const r=this.Ln(e,i);return(Qt(e)||Xt(e))&&this.Bn(e.limitType,r,s,n)?this.Fn(t,e):(v()<=l.a.DEBUG&&w("QueryEngine","Re-using previous result from %s to execute query: %s",n.toString(),ae(e)),this.Mn.getDocumentsMatchingQuery(t,e,n).next((t=>(r.forEach((e=>{t=t.insert(e.key,e)})),t))))}))}Ln(t,e){let n=new Qe(ue(t));return e.forEach(((e,s)=>{le(t,s)&&(n=n.add(s))})),n}Bn(t,e,n,s){if(n.size!==e.size)return!0;const i="F"===t?e.last():e.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(s)>0)}Fn(t,e){return v()<=l.a.DEBUG&&w("QueryEngine","Using full collection scan to execute query:",ae(e)),this.Mn.getDocumentsMatchingQuery(t,e,U.min())}}class jr{constructor(t,e,n,s){this.persistence=t,this.Un=e,this.k=s,this.qn=new Ge(rt),this.Kn=new Or((t=>It(t)),Dt),this.jn=U.min(),this.An=t.getMutationQueue(n),this.Qn=t.getRemoteDocumentCache(),this.He=t.getTargetCache(),this.Wn=new Dr(this.Qn,this.An,this.persistence.getIndexManager()),this.Ye=t.getBundleCache(),this.Un.On(this.Wn)}collectGarbage(t){return this.persistence.runTransaction("Collect garbage","readwrite-primary",(e=>t.collect(e,this.qn)))}}function Pr(t,e,n,s){return new jr(t,e,n,s)}async function Rr(t,e){const n=E(t);let s=n.An,i=n.Wn;const r=await n.persistence.runTransaction("Handle user change","readonly",(t=>{let r;return n.An.getAllMutationBatches(t).next((o=>(r=o,s=n.persistence.getMutationQueue(e),i=new Dr(n.Qn,s,n.persistence.getIndexManager()),s.getAllMutationBatches(t)))).next((e=>{const n=[],s=[];let o=an();for(const t of r){n.push(t.batchId);for(const e of t.mutations)o=o.add(e.key)}for(const t of e){s.push(t.batchId);for(const e of t.mutations)o=o.add(e.key)}return i.vn(t,o).next((t=>({Gn:t,removedBatchIds:n,addedBatchIds:s})))}))}));return n.An=s,n.Wn=i,n.Un.On(n.Wn),r}function Lr(t){const e=E(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(t=>e.He.getLastRemoteSnapshotVersion(t)))}function $r(t,e,n,s,i){let r=an();return n.forEach((t=>r=r.add(t))),e.getEntries(t,r).next((t=>{let r=tn();return n.forEach(((n,o)=>{const l=t.get(n),a=(null==i?void 0:i.get(n))||s;o.isNoDocument()&&o.version.isEqual(U.min())?(e.removeEntry(n,a),r=r.insert(n,o)):!l.isValidDocument()||o.version.compareTo(l.version)>0||0===o.version.compareTo(l.version)&&l.hasPendingWrites?(e.addEntry(o,a),r=r.insert(n,o)):w("LocalStore","Ignoring outdated watch update for ",n,". Current version:",l.version," Watch version:",o.version)})),r}))}function Mr(t,e){const n=E(t);return n.persistence.runTransaction("Get next mutation batch","readonly",(t=>(void 0===e&&(e=-1),n.An.getNextMutationBatchAfterBatchId(t,e))))}function Fr(t,e){const n=E(t);return n.persistence.runTransaction("Allocate target","readwrite",(t=>{let s;return n.He.getTargetData(t,e).next((i=>i?(s=i,gr.resolve(s)):n.He.allocateTargetId(t).next((i=>(s=new Cr(e,i,0,t.currentSequenceNumber),n.He.addTargetData(t,s).next((()=>s)))))))})).then((t=>{const s=n.qn.get(t.targetId);return(null===s||t.snapshotVersion.compareTo(s.snapshotVersion)>0)&&(n.qn=n.qn.insert(t.targetId,t),n.Kn.set(e,t.targetId)),t}))}async function Br(t,e,n){const s=E(t),i=s.qn.get(e),r=n?"readwrite":"readwrite-primary";try{n||await s.persistence.runTransaction("Release target",r,(t=>s.persistence.referenceDelegate.removeTarget(t,i)))}catch(t){if(!yr(t))throw t;w("LocalStore",`Failed to update sequence numbers for target ${e}: ${t}`)}s.qn=s.qn.remove(e),s.Kn.delete(i.target)}function Vr(t,e,n){const s=E(t);let i=U.min(),r=an();return s.persistence.runTransaction("Execute query","readonly",(t=>function(t,e,n){const s=E(t),i=s.Kn.get(n);return void 0!==i?gr.resolve(s.qn.get(i)):s.He.getTargetData(e,n)}(s,t,re(e)).next((e=>{if(e)return i=e.lastLimboFreeSnapshotVersion,s.He.getMatchingKeysForTargetId(t,e.targetId).next((t=>{r=t}))})).next((()=>s.Un.getDocumentsMatchingQuery(t,e,n?i:U.min(),n?r:an()))).next((t=>({documents:t,zn:r})))))}class qr{constructor(t){this.k=t,this.Xn=new Map,this.Zn=new Map}getBundleMetadata(t,e){return gr.resolve(this.Xn.get(e))}saveBundleMetadata(t,e){var n;return this.Xn.set(e.id,{id:(n=e).id,version:n.version,createTime:kn(n.createTime)}),gr.resolve()}getNamedQuery(t,e){return gr.resolve(this.Zn.get(e))}saveNamedQuery(t,e){return this.Zn.set(e.name,function(t){return{name:t.name,query:Tr(t.bundledQuery),readTime:kn(t.readTime)}}(e)),gr.resolve()}}class Ur{constructor(){this.ts=new Qe(Hr.es),this.ns=new Qe(Hr.ss)}isEmpty(){return this.ts.isEmpty()}addReference(t,e){const n=new Hr(t,e);this.ts=this.ts.add(n),this.ns=this.ns.add(n)}rs(t,e){t.forEach((t=>this.addReference(t,e)))}removeReference(t,e){this.os(new Hr(t,e))}cs(t,e){t.forEach((t=>this.removeReference(t,e)))}us(t){const e=new ut(new K([])),n=new Hr(e,t),s=new Hr(e,t+1),i=[];return this.ns.forEachInRange([n,s],(t=>{this.os(t),i.push(t.key)})),i}hs(){this.ts.forEach((t=>this.os(t)))}os(t){this.ts=this.ts.delete(t),this.ns=this.ns.delete(t)}ls(t){const e=new ut(new K([])),n=new Hr(e,t),s=new Hr(e,t+1);let i=an();return this.ns.forEachInRange([n,s],(t=>{i=i.add(t.key)})),i}containsKey(t){const e=new Hr(t,0),n=this.ts.firstAfterOrEqual(e);return null!==n&&t.isEqual(n.key)}}class Hr{constructor(t,e){this.key=t,this.fs=e}static es(t,e){return ut.comparator(t.key,e.key)||rt(t.fs,e.fs)}static ss(t,e){return rt(t.fs,e.fs)||ut.comparator(t.key,e.key)}}class Wr{constructor(t,e){this.Jt=t,this.referenceDelegate=e,this.An=[],this.ds=1,this.ws=new Qe(Hr.es)}checkEmpty(t){return gr.resolve(0===this.An.length)}addMutationBatch(t,e,n,s){const i=this.ds;this.ds++,this.An.length>0&&this.An[this.An.length-1];const r=new vr(i,e,n,s);this.An.push(r);for(const e of s)this.ws=this.ws.add(new Hr(e.key,i)),this.Jt.addToCollectionParentIndex(t,e.key.path.popLast());return gr.resolve(r)}lookupMutationBatch(t,e){return gr.resolve(this._s(e))}getNextMutationBatchAfterBatchId(t,e){const n=e+1,s=this.gs(n),i=s<0?0:s;return gr.resolve(this.An.length>i?this.An[i]:null)}getHighestUnacknowledgedBatchId(){return gr.resolve(0===this.An.length?-1:this.ds-1)}getAllMutationBatches(t){return gr.resolve(this.An.slice())}getAllMutationBatchesAffectingDocumentKey(t,e){const n=new Hr(e,0),s=new Hr(e,Number.POSITIVE_INFINITY),i=[];return this.ws.forEachInRange([n,s],(t=>{const e=this._s(t.fs);i.push(e)})),gr.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(t,e){let n=new Qe(rt);return e.forEach((t=>{const e=new Hr(t,0),s=new Hr(t,Number.POSITIVE_INFINITY);this.ws.forEachInRange([e,s],(t=>{n=n.add(t.fs)}))})),gr.resolve(this.ys(n))}getAllMutationBatchesAffectingQuery(t,e){const n=e.path,s=n.length+1;let i=n;ut.isDocumentKey(i)||(i=i.child(""));const r=new Hr(new ut(i),0);let o=new Qe(rt);return this.ws.forEachWhile((t=>{const e=t.key.path;return!!n.isPrefixOf(e)&&(e.length===s&&(o=o.add(t.fs)),!0)}),r),gr.resolve(this.ys(o))}ys(t){const e=[];return t.forEach((t=>{const n=this._s(t);null!==n&&e.push(n)})),e}removeMutationBatch(t,e){k(0===this.ps(e.batchId,"removed")),this.An.shift();let n=this.ws;return gr.forEach(e.mutations,(s=>{const i=new Hr(s.key,e.batchId);return n=n.delete(i),this.referenceDelegate.markPotentiallyOrphaned(t,s.key)})).next((()=>{this.ws=n}))}ee(t){}containsKey(t,e){const n=new Hr(e,0),s=this.ws.firstAfterOrEqual(n);return gr.resolve(e.isEqual(s&&s.key))}performConsistencyCheck(t){return this.An.length,gr.resolve()}ps(t,e){return this.gs(t)}gs(t){return 0===this.An.length?0:t-this.An[0].batchId}_s(t){const e=this.gs(t);return e<0||e>=this.An.length?null:this.An[e]}}class zr{constructor(t,e){this.Jt=t,this.Ts=e,this.docs=new Ge(ut.comparator),this.size=0}addEntry(t,e,n){const s=e.key,i=this.docs.get(s),r=i?i.size:0,o=this.Ts(e);return this.docs=this.docs.insert(s,{document:e.mutableCopy(),size:o,readTime:n}),this.size+=o-r,this.Jt.addToCollectionParentIndex(t,s.path.popLast())}removeEntry(t){const e=this.docs.get(t);e&&(this.docs=this.docs.remove(t),this.size-=e.size)}getEntry(t,e){const n=this.docs.get(e);return gr.resolve(n?n.document.mutableCopy():_t.newInvalidDocument(e))}getEntries(t,e){let n=tn();return e.forEach((t=>{const e=this.docs.get(t);n=n.insert(t,e?e.document.mutableCopy():_t.newInvalidDocument(t))})),gr.resolve(n)}getDocumentsMatchingQuery(t,e,n){let s=tn();const i=new ut(e.path.child("")),r=this.docs.getIteratorFrom(i);for(;r.hasNext();){const{key:t,value:{document:i,readTime:o}}=r.getNext();if(!e.path.isPrefixOf(t.path))break;o.compareTo(n)<=0||le(e,i)&&(s=s.insert(i.key,i.mutableCopy()))}return gr.resolve(s)}Es(t,e){return gr.forEach(this.docs,(t=>e(t)))}newChangeBuffer(t){return new Kr(this)}getSize(t){return gr.resolve(this.size)}}class Kr extends Ir{constructor(t){super(),this.De=t}applyChanges(t){const e=[];return this.changes.forEach(((n,s)=>{s.document.isValidDocument()?e.push(this.De.addEntry(t,s.document,this.getReadTime(n))):this.De.removeEntry(n)})),gr.waitFor(e)}getFromCache(t,e){return this.De.getEntry(t,e)}getAllFromCache(t,e){return this.De.getEntries(t,e)}}class Gr{constructor(t){this.persistence=t,this.Is=new Or((t=>It(t)),Dt),this.lastRemoteSnapshotVersion=U.min(),this.highestTargetId=0,this.As=0,this.Rs=new Ur,this.targetCount=0,this.bs=_r.ie()}forEachTarget(t,e){return this.Is.forEach(((t,n)=>e(n))),gr.resolve()}getLastRemoteSnapshotVersion(t){return gr.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(t){return gr.resolve(this.As)}allocateTargetId(t){return this.highestTargetId=this.bs.next(),gr.resolve(this.highestTargetId)}setTargetsMetadata(t,e,n){return n&&(this.lastRemoteSnapshotVersion=n),e>this.As&&(this.As=e),gr.resolve()}ae(t){this.Is.set(t.target,t);const e=t.targetId;e>this.highestTargetId&&(this.bs=new _r(e),this.highestTargetId=e),t.sequenceNumber>this.As&&(this.As=t.sequenceNumber)}addTargetData(t,e){return this.ae(e),this.targetCount+=1,gr.resolve()}updateTargetData(t,e){return this.ae(e),gr.resolve()}removeTargetData(t,e){return this.Is.delete(e.target),this.Rs.us(e.targetId),this.targetCount-=1,gr.resolve()}removeTargets(t,e,n){let s=0;const i=[];return this.Is.forEach(((r,o)=>{o.sequenceNumber<=e&&null===n.get(o.targetId)&&(this.Is.delete(r),i.push(this.removeMatchingKeysForTargetId(t,o.targetId)),s++)})),gr.waitFor(i).next((()=>s))}getTargetCount(t){return gr.resolve(this.targetCount)}getTargetData(t,e){const n=this.Is.get(e)||null;return gr.resolve(n)}addMatchingKeys(t,e,n){return this.Rs.rs(e,n),gr.resolve()}removeMatchingKeys(t,e,n){this.Rs.cs(e,n);const s=this.persistence.referenceDelegate,i=[];return s&&e.forEach((e=>{i.push(s.markPotentiallyOrphaned(t,e))})),gr.waitFor(i)}removeMatchingKeysForTargetId(t,e){return this.Rs.us(e),gr.resolve()}getMatchingKeysForTargetId(t,e){const n=this.Rs.ls(e);return gr.resolve(n)}containsKey(t,e){return gr.resolve(this.Rs.containsKey(e))}}class Yr{constructor(t,e){this.Ps={},this.Be=new $(0),this.Ue=!1,this.Ue=!0,this.referenceDelegate=t(this),this.He=new Gr(this),this.Jt=new Sr,this.Je=function(t,e){return new zr(t,e)}(this.Jt,(t=>this.referenceDelegate.vs(t))),this.k=new xr(e),this.Ye=new qr(this.k)}start(){return Promise.resolve()}shutdown(){return this.Ue=!1,Promise.resolve()}get started(){return this.Ue}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(){return this.Jt}getMutationQueue(t){let e=this.Ps[t.toKey()];return e||(e=new Wr(this.Jt,this.referenceDelegate),this.Ps[t.toKey()]=e),e}getTargetCache(){return this.He}getRemoteDocumentCache(){return this.Je}getBundleCache(){return this.Ye}runTransaction(t,e,n){w("MemoryPersistence","Starting transaction:",t);const s=new Jr(this.Be.next());return this.referenceDelegate.Vs(),n(s).next((t=>this.referenceDelegate.Ss(s).next((()=>t)))).toPromise().then((t=>(s.raiseOnCommittedEvent(),t)))}Ds(t,e){return gr.or(Object.values(this.Ps).map((n=>()=>n.containsKey(t,e))))}}class Jr extends mr{constructor(t){super(),this.currentSequenceNumber=t}}class Qr{constructor(t){this.persistence=t,this.Cs=new Ur,this.Ns=null}static ks(t){return new Qr(t)}get xs(){if(this.Ns)return this.Ns;throw S()}addReference(t,e,n){return this.Cs.addReference(n,e),this.xs.delete(n.toString()),gr.resolve()}removeReference(t,e,n){return this.Cs.removeReference(n,e),this.xs.add(n.toString()),gr.resolve()}markPotentiallyOrphaned(t,e){return this.xs.add(e.toString()),gr.resolve()}removeTarget(t,e){this.Cs.us(e.targetId).forEach((t=>this.xs.add(t.toString())));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(t,e.targetId).next((t=>{t.forEach((t=>this.xs.add(t.toString())))})).next((()=>n.removeTargetData(t,e)))}Vs(){this.Ns=new Set}Ss(t){const e=this.persistence.getRemoteDocumentCache().newChangeBuffer();return gr.forEach(this.xs,(n=>{const s=ut.fromPath(n);return this.$s(t,s).next((t=>{t||e.removeEntry(s)}))})).next((()=>(this.Ns=null,e.apply(t))))}updateLimboDocument(t,e){return this.$s(t,e).next((t=>{t?this.xs.delete(e.toString()):this.xs.add(e.toString())}))}vs(t){return 0}$s(t,e){return gr.or([()=>gr.resolve(this.Cs.containsKey(e)),()=>this.persistence.getTargetCache().containsKey(t,e),()=>this.persistence.Ds(t,e)])}}class Xr{constructor(){this.activeTargetIds=un()}Fs(t){this.activeTargetIds=this.activeTargetIds.add(t)}Ls(t){this.activeTargetIds=this.activeTargetIds.delete(t)}Ms(){const t={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(t)}}class Zr{constructor(){this.pi=new Xr,this.Ti={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(t){}updateMutationState(t,e,n){}addLocalQueryTarget(t){return this.pi.Fs(t),this.Ti[t]||"not-current"}updateQueryState(t,e,n){this.Ti[t]=e}removeLocalQueryTarget(t){this.pi.Ls(t)}isLocalQueryTarget(t){return this.pi.activeTargetIds.has(t)}clearQueryState(t){delete this.Ti[t]}getAllActiveQueryTargets(){return this.pi.activeTargetIds}isActiveQueryTarget(t){return this.pi.activeTargetIds.has(t)}start(){return this.pi=new Xr,Promise.resolve()}handleUserChange(t,e,n){}setOnlineState(t){}shutdown(){}writeSequenceNumber(t){}notifyBundleLoaded(){}}class ti{Ei(t){}shutdown(){}}class ei{constructor(){this.Ii=()=>this.Ai(),this.Ri=()=>this.bi(),this.Pi=[],this.vi()}Ei(t){this.Pi.push(t)}shutdown(){window.removeEventListener("online",this.Ii),window.removeEventListener("offline",this.Ri)}vi(){window.addEventListener("online",this.Ii),window.addEventListener("offline",this.Ri)}Ai(){w("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const t of this.Pi)t(0)}bi(){w("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const t of this.Pi)t(1)}static Pt(){return"undefined"!=typeof window&&void 0!==window.addEventListener&&void 0!==window.removeEventListener}}const ni={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery"};class ri{constructor(t){this.Vi=t.Vi,this.Si=t.Si}Di(t){this.Ci=t}Ni(t){this.ki=t}onMessage(t){this.xi=t}close(){this.Si()}send(t){this.Vi(t)}$i(){this.Ci()}Oi(t){this.ki(t)}Mi(t){this.xi(t)}}class ii extends class{constructor(t){this.databaseInfo=t,this.databaseId=t.databaseId;const e=t.ssl?"https":"http";this.Fi=e+"://"+t.host,this.Li="projects/"+this.databaseId.projectId+"/databases/"+this.databaseId.database+"/documents"}Bi(t,e,n,s,i){const r=this.Ui(t,e);w("RestConnection","Sending: ",r,n);const o={};return this.qi(o,s,i),this.Ki(t,r,o,n).then((t=>(w("RestConnection","Received: ",t),t)),(e=>{throw x("RestConnection",`${t} failed with error: `,e,"url: ",r,"request:",n),e}))}ji(t,e,n,s,i){return this.Bi(t,e,n,s,i)}qi(t,e,n){t["X-Goog-Api-Client"]="gl-js/ fire/"+m,t["Content-Type"]="text/plain",this.databaseInfo.appId&&(t["X-Firebase-GMPID"]=this.databaseInfo.appId),e&&e.headers.forEach(((e,n)=>t[n]=e)),n&&n.headers.forEach(((e,n)=>t[n]=e))}Ui(t,e){const n=ni[t];return`${this.Fi}/v1/${e}:${n}`}}{constructor(t){super(t),this.forceLongPolling=t.forceLongPolling,this.autoDetectLongPolling=t.autoDetectLongPolling,this.useFetchStreams=t.useFetchStreams}Ki(t,e,n,s){return new Promise(((i,r)=>{const o=new h.g;o.listenOnce(h.c.COMPLETE,(()=>{try{switch(o.getLastErrorCode()){case h.a.NO_ERROR:const e=o.getResponseJson();w("Connection","XHR received:",JSON.stringify(e)),i(e);break;case h.a.TIMEOUT:w("Connection",'RPC "'+t+'" timed out'),r(new A(_.DEADLINE_EXCEEDED,"Request time out"));break;case h.a.HTTP_ERROR:const n=o.getStatus();if(w("Connection",'RPC "'+t+'" failed with status:',n,"response text:",o.getResponseText()),n>0){const t=o.getResponseJson().error;if(t&&t.status&&t.message){const e=function(t){const e=t.toLowerCase().replace(/_/g,"-");return Object.values(_).indexOf(e)>=0?e:_.UNKNOWN}(t.status);r(new A(e,t.message))}else r(new A(_.UNKNOWN,"Server responded with status "+o.getStatus()))}else r(new A(_.UNAVAILABLE,"Connection failed."));break;default:S()}}finally{w("Connection",'RPC "'+t+'" completed.')}}));const l=JSON.stringify(s);o.send(e,"POST",l,n,15)}))}Qi(t,e,n){const s=[this.Fi,"/","google.firestore.v1.Firestore","/",t,"/channel"],i=Object(h.h)(),r=Object(h.i)(),o={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling};this.useFetchStreams&&(o.xmlHttpFactory=new h.d({})),this.qi(o.initMessageHeaders,e,n),Object(c.r)()||Object(c.s)()||Object(c.n)()||Object(c.p)()||Object(c.u)()||Object(c.m)()||(o.httpHeadersOverwriteParam="$httpHeaders");const l=s.join("");w("Connection","Creating WebChannel: "+l,o);const a=i.createWebChannel(l,o);let u=!1,d=!1;const f=new ri({Vi:t=>{d?w("Connection","Not sending because WebChannel is closed:",t):(u||(w("Connection","Opening WebChannel transport."),a.open(),u=!0),w("Connection","WebChannel sending:",t),a.send(t))},Si:()=>a.close()}),m=(t,e,n)=>{t.listen(e,(t=>{try{n(t)}catch(t){setTimeout((()=>{throw t}),0)}}))};return m(a,h.f.EventType.OPEN,(()=>{d||w("Connection","WebChannel transport opened.")})),m(a,h.f.EventType.CLOSE,(()=>{d||(d=!0,w("Connection","WebChannel transport closed"),f.Oi())})),m(a,h.f.EventType.ERROR,(t=>{d||(d=!0,x("Connection","WebChannel transport errored:",t),f.Oi(new A(_.UNAVAILABLE,"The operation could not be completed")))})),m(a,h.f.EventType.MESSAGE,(t=>{var e;if(!d){const n=t.data[0];k(!!n);const s=n,i=s.error||(null===(e=s[0])||void 0===e?void 0:e.error);if(i){w("Connection","WebChannel received error:",i);const t=i.status;let e=function(t){const e=He[t];if(void 0!==e)return Ke(e)}(t),n=i.message;void 0===e&&(e=_.INTERNAL,n="Unknown error status: "+t+" with message "+i.message),d=!0,f.Oi(new A(e,n)),a.close()}else w("Connection","WebChannel received:",n),f.Mi(n)}})),m(r,h.b.STAT_EVENT,(t=>{t.stat===h.e.PROXY?w("Connection","Detected buffering proxy"):t.stat===h.e.NOPROXY&&w("Connection","Detected no buffering proxy")})),setTimeout((()=>{f.$i()}),0),f}}function si(){return"undefined"!=typeof document?document:null}function oi(t){return new Cn(t,!0)}class ai{constructor(t,e,n=1e3,s=1.5,i=6e4){this.Me=t,this.timerId=e,this.Wi=n,this.Gi=s,this.zi=i,this.Hi=0,this.Ji=null,this.Yi=Date.now(),this.reset()}reset(){this.Hi=0}Xi(){this.Hi=this.zi}Zi(t){this.cancel();const e=Math.floor(this.Hi+this.tr()),n=Math.max(0,Date.now()-this.Yi),s=Math.max(0,e-n);s>0&&w("ExponentialBackoff",`Backing off for ${s} ms (base delay: ${this.Hi} ms, delay with jitter: ${e} ms, last attempt: ${n} ms ago)`),this.Ji=this.Me.enqueueAfterDelay(this.timerId,s,(()=>(this.Yi=Date.now(),t()))),this.Hi*=this.Gi,this.Hithis.zi&&(this.Hi=this.zi)}er(){null!==this.Ji&&(this.Ji.skipDelay(),this.Ji=null)}cancel(){null!==this.Ji&&(this.Ji.cancel(),this.Ji=null)}tr(){return(Math.random()-.5)*this.Hi}}class ui{constructor(t,e,n,s,i,r,o,l){this.Me=t,this.nr=n,this.sr=s,this.ir=i,this.authCredentialsProvider=r,this.appCheckCredentialsProvider=o,this.listener=l,this.state=0,this.rr=0,this.cr=null,this.ar=null,this.stream=null,this.ur=new ai(t,e)}hr(){return 1===this.state||5===this.state||this.lr()}lr(){return 2===this.state||3===this.state}start(){4!==this.state?this.auth():this.dr()}async stop(){this.hr()&&await this.close(0)}wr(){this.state=0,this.ur.reset()}_r(){this.lr()&&null===this.cr&&(this.cr=this.Me.enqueueAfterDelay(this.nr,6e4,(()=>this.mr())))}gr(t){this.yr(),this.stream.send(t)}async mr(){if(this.lr())return this.close(0)}yr(){this.cr&&(this.cr.cancel(),this.cr=null)}pr(){this.ar&&(this.ar.cancel(),this.ar=null)}async close(t,e){this.yr(),this.pr(),this.ur.cancel(),this.rr++,4!==t?this.ur.reset():e&&e.code===_.RESOURCE_EXHAUSTED?(C(e.toString()),C("Using maximum backoff delay to prevent overloading the backend."),this.ur.Xi()):e&&e.code===_.UNAUTHENTICATED&&3!==this.state&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),null!==this.stream&&(this.Tr(),this.stream.close(),this.stream=null),this.state=t,await this.listener.Ni(e)}Tr(){}auth(){this.state=1;const t=this.Er(this.rr),e=this.rr;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then((([t,n])=>{this.rr===e&&this.Ir(t,n)}),(e=>{t((()=>{const t=new A(_.UNKNOWN,"Fetching auth token failed: "+e.message);return this.Ar(t)}))}))}Ir(t,e){const n=this.Er(this.rr);this.stream=this.Rr(t,e),this.stream.Di((()=>{n((()=>(this.state=2,this.ar=this.Me.enqueueAfterDelay(this.sr,1e4,(()=>(this.lr()&&(this.state=3),Promise.resolve()))),this.listener.Di())))})),this.stream.Ni((t=>{n((()=>this.Ar(t)))})),this.stream.onMessage((t=>{n((()=>this.onMessage(t)))}))}dr(){this.state=5,this.ur.Zi((async()=>{this.state=0,this.start()}))}Ar(t){return w("PersistentStream",`close with error: ${t}`),this.stream=null,this.close(4,t)}Er(t){return e=>{this.Me.enqueueAndForget((()=>this.rr===t?e():(w("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())))}}}class ci extends ui{constructor(t,e,n,s,i,r){super(t,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",e,n,s,r),this.k=i}Rr(t,e){return this.ir.Qi("Listen",t,e)}onMessage(t){this.ur.reset();const e=function(t,e){let n;if("targetChange"in e){e.targetChange;const s=function(t){return"NO_CHANGE"===t?0:"ADD"===t?1:"REMOVE"===t?2:"CURRENT"===t?3:"RESET"===t?4:S()}(e.targetChange.targetChangeType||"NO_CHANGE"),i=e.targetChange.targetIds||[],r=function(t,e){return t.C?(k(void 0===e||"string"==typeof e),Q.fromBase64String(e||"")):(k(void 0===e||e instanceof Uint8Array),Q.fromUint8Array(e||new Uint8Array))}(t,e.targetChange.resumeToken),o=e.targetChange.cause,l=o&&function(t){const e=void 0===t.code?_.UNKNOWN:Ke(t.code);return new A(e,t.message||"")}(o);n=new fn(s,i,r,l||null)}else if("documentChange"in e){e.documentChange;const s=e.documentChange;s.document,s.document.name,s.document.updateTime;const i=On(t,s.document.name),r=kn(s.document.updateTime),o=new kt({mapValue:{fields:s.document.fields}}),l=_t.newFoundDocument(i,r,o),a=s.targetIds||[],u=s.removedTargetIds||[];n=new dn(a,u,l.key,l)}else if("documentDelete"in e){e.documentDelete;const s=e.documentDelete;s.document;const i=On(t,s.document),r=s.readTime?kn(s.readTime):U.min(),o=_t.newNoDocument(i,r),l=s.removedTargetIds||[];n=new dn([],l,o.key,o)}else if("documentRemove"in e){e.documentRemove;const s=e.documentRemove;s.document;const i=On(t,s.document),r=s.removedTargetIds||[];n=new dn([],r,i,null)}else{if(!("filter"in e))return S();{e.filter;const t=e.filter;t.targetId;const s=t.count||0,i=new Ue(s),r=t.targetId;n=new pn(r,i)}}return n}(this.k,t),n=function(t){if(!("targetChange"in t))return U.min();const e=t.targetChange;return e.targetIds&&e.targetIds.length?U.min():e.readTime?kn(e.readTime):U.min()}(t);return this.listener.br(e,n)}Pr(t){const e={};e.database=Nn(this.k),e.addTarget=function(t,e){let n;const s=e.target;return n=Nt(s)?{documents:Ln(t,s)}:{query:$n(t,s)},n.targetId=e.targetId,e.resumeToken.approximateByteSize()>0?n.resumeToken=Tn(t,e.resumeToken):e.snapshotVersion.compareTo(U.min())>0&&(n.readTime=xn(t,e.snapshotVersion.toTimestamp())),n}(this.k,t);const n=function(t,e){const n=function(t,e){switch(e){case 0:return null;case 1:return"existence-filter-mismatch";case 2:return"limbo-document";default:return S()}}(0,e.purpose);return null==n?null:{"goog-listen-tags":n}}(this.k,t);n&&(e.labels=n),this.gr(e)}vr(t){const e={};e.database=Nn(this.k),e.removeTarget=t,this.gr(e)}}class hi extends ui{constructor(t,e,n,s,i,r){super(t,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",e,n,s,r),this.k=i,this.Vr=!1}get Sr(){return this.Vr}start(){this.Vr=!1,this.lastStreamToken=void 0,super.start()}Tr(){this.Vr&&this.Dr([])}Rr(t,e){return this.ir.Qi("Write",t,e)}onMessage(t){if(k(!!t.streamToken),this.lastStreamToken=t.streamToken,this.Vr){this.ur.reset();const e=function(t,e){return t&&t.length>0?(k(void 0!==e),t.map((t=>function(t,e){let n=t.updateTime?kn(t.updateTime):kn(e);return n.isEqual(U.min())&&(n=kn(e)),new _e(n,t.transformResults||[])}(t,e)))):[]}(t.writeResults,t.commitTime),n=kn(t.commitTime);return this.listener.Cr(n,e)}return k(!t.writeResults||0===t.writeResults.length),this.Vr=!0,this.listener.Nr()}kr(){const t={};t.database=Nn(this.k),this.gr(t)}Dr(t){const e={streamToken:this.lastStreamToken,writes:t.map((t=>Rn(this.k,t)))};this.gr(e)}}class di extends class{}{constructor(t,e,n,s){super(),this.authCredentials=t,this.appCheckCredentials=e,this.ir=n,this.k=s,this.$r=!1}Or(){if(this.$r)throw new A(_.FAILED_PRECONDITION,"The client has already been terminated.")}Bi(t,e,n){return this.Or(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([s,i])=>this.ir.Bi(t,e,n,s,i))).catch((t=>{throw"FirebaseError"===t.name?(t.code===_.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),t):new A(_.UNKNOWN,t.toString())}))}ji(t,e,n){return this.Or(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([s,i])=>this.ir.ji(t,e,n,s,i))).catch((t=>{throw"FirebaseError"===t.name?(t.code===_.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),t):new A(_.UNKNOWN,t.toString())}))}terminate(){this.$r=!0}}class pi{constructor(t,e){this.asyncQueue=t,this.onlineStateHandler=e,this.state="Unknown",this.Mr=0,this.Fr=null,this.Lr=!0}Br(){0===this.Mr&&(this.Ur("Unknown"),this.Fr=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(()=>(this.Fr=null,this.qr("Backend didn't respond within 10 seconds."),this.Ur("Offline"),Promise.resolve()))))}Kr(t){"Online"===this.state?this.Ur("Unknown"):(this.Mr++,this.Mr>=1&&(this.jr(),this.qr(`Connection failed 1 times. Most recent error: ${t.toString()}`),this.Ur("Offline")))}set(t){this.jr(),this.Mr=0,"Online"===t&&(this.Lr=!1),this.Ur(t)}Ur(t){t!==this.state&&(this.state=t,this.onlineStateHandler(t))}qr(t){const e=`Could not reach Cloud Firestore backend. ${t}\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.Lr?(C(e),this.Lr=!1):w("OnlineStateTracker",e)}jr(){null!==this.Fr&&(this.Fr.cancel(),this.Fr=null)}}class fi{constructor(t,e,n,s,i){this.localStore=t,this.datastore=e,this.asyncQueue=n,this.remoteSyncer={},this.Qr=[],this.Wr=new Map,this.Gr=new Set,this.zr=[],this.Hr=i,this.Hr.Ei((t=>{n.enqueueAndForget((async()=>{Ti(this)&&(w("RemoteStore","Restarting streams for network reachability change."),await async function(t){const e=E(t);e.Gr.add(4),await gi(e),e.Jr.set("Unknown"),e.Gr.delete(4),await mi(e)}(this))}))})),this.Jr=new pi(n,s)}}async function mi(t){if(Ti(t))for(const e of t.zr)await e(!0)}async function gi(t){for(const e of t.zr)await e(!1)}function yi(t,e){const n=E(t);n.Wr.has(e.targetId)||(n.Wr.set(e.targetId,e),xi(n)?Ci(n):Bi(n).lr()&&bi(n,e))}function vi(t,e){const n=E(t),s=Bi(n);n.Wr.delete(e),s.lr()&&wi(n,e),0===n.Wr.size&&(s.lr()?s._r():Ti(n)&&n.Jr.set("Unknown"))}function bi(t,e){t.Yr.X(e.targetId),Bi(t).Pr(e)}function wi(t,e){t.Yr.X(e),Bi(t).vr(e)}function Ci(t){t.Yr=new gn({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),Et:e=>t.Wr.get(e)||null}),Bi(t).start(),t.Jr.Br()}function xi(t){return Ti(t)&&!Bi(t).hr()&&t.Wr.size>0}function Ti(t){return 0===E(t).Gr.size}function Si(t){t.Yr=void 0}async function ki(t){t.Wr.forEach(((e,n)=>{bi(t,e)}))}async function Ei(t,e){Si(t),xi(t)?(t.Jr.Kr(e),Ci(t)):t.Jr.set("Unknown")}async function _i(t,e,n){if(t.Jr.set("Online"),e instanceof fn&&2===e.state&&e.cause)try{await async function(t,e){const n=e.cause;for(const s of e.targetIds)t.Wr.has(s)&&(await t.remoteSyncer.rejectListen(s,n),t.Wr.delete(s),t.Yr.removeTarget(s))}(t,e)}catch(n){w("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),n),await Ai(t,n)}else if(e instanceof dn?t.Yr.ot(e):e instanceof pn?t.Yr.dt(e):t.Yr.ut(e),!n.isEqual(U.min()))try{const e=await Lr(t.localStore);n.compareTo(e)>=0&&await function(t,e){const n=t.Yr.gt(e);return n.targetChanges.forEach(((n,s)=>{if(n.resumeToken.approximateByteSize()>0){const i=t.Wr.get(s);i&&t.Wr.set(s,i.withResumeToken(n.resumeToken,e))}})),n.targetMismatches.forEach((e=>{const n=t.Wr.get(e);if(!n)return;t.Wr.set(e,n.withResumeToken(Q.EMPTY_BYTE_STRING,n.snapshotVersion)),wi(t,e);const s=new Cr(n.target,e,1,n.sequenceNumber);bi(t,s)})),t.remoteSyncer.applyRemoteEvent(n)}(t,n)}catch(e){w("RemoteStore","Failed to raise snapshot:",e),await Ai(t,e)}}async function Ai(t,e,n){if(!yr(e))throw e;t.Gr.add(1),await gi(t),t.Jr.set("Offline"),n||(n=()=>Lr(t.localStore)),t.asyncQueue.enqueueRetryable((async()=>{w("RemoteStore","Retrying IndexedDB access"),await n(),t.Gr.delete(1),await mi(t)}))}function Oi(t,e){return e().catch((n=>Ai(t,n,e)))}async function Ii(t){const e=E(t),n=Vi(e);let s=e.Qr.length>0?e.Qr[e.Qr.length-1].batchId:-1;for(;Di(e);)try{const t=await Mr(e.localStore,s);if(null===t){0===e.Qr.length&&n._r();break}s=t.batchId,Ni(e,t)}catch(t){await Ai(e,t)}ji(e)&&Pi(e)}function Di(t){return Ti(t)&&t.Qr.length<10}function Ni(t,e){t.Qr.push(e);const n=Vi(t);n.lr()&&n.Sr&&n.Dr(e.mutations)}function ji(t){return Ti(t)&&!Vi(t).hr()&&t.Qr.length>0}function Pi(t){Vi(t).start()}async function Ri(t){Vi(t).kr()}async function Li(t){const e=Vi(t);for(const n of t.Qr)e.Dr(n.mutations)}async function $i(t,e,n){const s=t.Qr.shift(),i=wr.from(s,e,n);await Oi(t,(()=>t.remoteSyncer.applySuccessfulWrite(i))),await Ii(t)}async function Mi(t,e){e&&Vi(t).Sr&&await async function(t,e){if(ze(n=e.code)&&n!==_.ABORTED){const n=t.Qr.shift();Vi(t).wr(),await Oi(t,(()=>t.remoteSyncer.rejectFailedWrite(n.batchId,e))),await Ii(t)}var n}(t,e),ji(t)&&Pi(t)}async function Fi(t,e){const n=E(t);e?(n.Gr.delete(2),await mi(n)):e||(n.Gr.add(2),await gi(n),n.Jr.set("Unknown"))}function Bi(t){return t.Xr||(t.Xr=function(t,e,n){const s=E(t);return s.Or(),new ci(e,s.ir,s.authCredentials,s.appCheckCredentials,s.k,n)}(t.datastore,t.asyncQueue,{Di:ki.bind(null,t),Ni:Ei.bind(null,t),br:_i.bind(null,t)}),t.zr.push((async e=>{e?(t.Xr.wr(),xi(t)?Ci(t):t.Jr.set("Unknown")):(await t.Xr.stop(),Si(t))}))),t.Xr}function Vi(t){return t.Zr||(t.Zr=function(t,e,n){const s=E(t);return s.Or(),new hi(e,s.ir,s.authCredentials,s.appCheckCredentials,s.k,n)}(t.datastore,t.asyncQueue,{Di:Ri.bind(null,t),Ni:Mi.bind(null,t),Nr:Li.bind(null,t),Cr:$i.bind(null,t)}),t.zr.push((async e=>{e?(t.Zr.wr(),await Ii(t)):(await t.Zr.stop(),t.Qr.length>0&&(w("RemoteStore",`Stopping write stream with ${t.Qr.length} pending writes`),t.Qr=[]))}))),t.Zr}class qi{constructor(t,e,n,s,i){this.asyncQueue=t,this.timerId=e,this.targetTimeMs=n,this.op=s,this.removalCallback=i,this.deferred=new O,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((t=>{}))}static createAndSchedule(t,e,n,s,i){const r=Date.now()+n,o=new qi(t,e,r,s,i);return o.start(n),o}start(t){this.timerHandle=setTimeout((()=>this.handleDelayElapsed()),t)}skipDelay(){return this.handleDelayElapsed()}cancel(t){null!==this.timerHandle&&(this.clearTimeout(),this.deferred.reject(new A(_.CANCELLED,"Operation cancelled"+(t?": "+t:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget((()=>null!==this.timerHandle?(this.clearTimeout(),this.op().then((t=>this.deferred.resolve(t)))):Promise.resolve()))}clearTimeout(){null!==this.timerHandle&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function Ui(t,e){if(C("AsyncQueue",`${e}: ${t}`),yr(t))return new A(_.UNAVAILABLE,`${e}: ${t}`);throw t}class Hi{constructor(t){this.comparator=t?(e,n)=>t(e,n)||ut.comparator(e.key,n.key):(t,e)=>ut.comparator(t.key,e.key),this.keyedMap=nn(),this.sortedSet=new Ge(this.comparator)}static emptySet(t){return new Hi(t.comparator)}has(t){return null!=this.keyedMap.get(t)}get(t){return this.keyedMap.get(t)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(t){const e=this.keyedMap.get(t);return e?this.sortedSet.indexOf(e):-1}get size(){return this.sortedSet.size}forEach(t){this.sortedSet.inorderTraversal(((e,n)=>(t(e),!1)))}add(t){const e=this.delete(t.key);return e.copy(e.keyedMap.insert(t.key,t),e.sortedSet.insert(t,null))}delete(t){const e=this.get(t);return e?this.copy(this.keyedMap.remove(t),this.sortedSet.remove(e)):this}isEqual(t){if(!(t instanceof Hi))return!1;if(this.size!==t.size)return!1;const e=this.sortedSet.getIterator(),n=t.sortedSet.getIterator();for(;e.hasNext();){const t=e.getNext().key,s=n.getNext().key;if(!t.isEqual(s))return!1}return!0}toString(){const t=[];return this.forEach((e=>{t.push(e.toString())})),0===t.length?"DocumentSet ()":"DocumentSet (\n "+t.join(" \n")+"\n)"}copy(t,e){const n=new Hi;return n.comparator=this.comparator,n.keyedMap=t,n.sortedSet=e,n}}class Wi{constructor(){this.eo=new Ge(ut.comparator)}track(t){const e=t.doc.key,n=this.eo.get(e);n?0!==t.type&&3===n.type?this.eo=this.eo.insert(e,t):3===t.type&&1!==n.type?this.eo=this.eo.insert(e,{type:n.type,doc:t.doc}):2===t.type&&2===n.type?this.eo=this.eo.insert(e,{type:2,doc:t.doc}):2===t.type&&0===n.type?this.eo=this.eo.insert(e,{type:0,doc:t.doc}):1===t.type&&0===n.type?this.eo=this.eo.remove(e):1===t.type&&2===n.type?this.eo=this.eo.insert(e,{type:1,doc:n.doc}):0===t.type&&1===n.type?this.eo=this.eo.insert(e,{type:2,doc:t.doc}):S():this.eo=this.eo.insert(e,t)}no(){const t=[];return this.eo.inorderTraversal(((e,n)=>{t.push(n)})),t}}class zi{constructor(t,e,n,s,i,r,o,l){this.query=t,this.docs=e,this.oldDocs=n,this.docChanges=s,this.mutatedKeys=i,this.fromCache=r,this.syncStateChanged=o,this.excludesMetadataChanges=l}static fromInitialDocuments(t,e,n,s){const i=[];return e.forEach((t=>{i.push({type:0,doc:t})})),new zi(t,e,Hi.emptySet(e),i,n,s,!0,!1)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(t){if(!(this.fromCache===t.fromCache&&this.syncStateChanged===t.syncStateChanged&&this.mutatedKeys.isEqual(t.mutatedKeys)&&se(this.query,t.query)&&this.docs.isEqual(t.docs)&&this.oldDocs.isEqual(t.oldDocs)))return!1;const e=this.docChanges,n=t.docChanges;if(e.length!==n.length)return!1;for(let t=0;toe(t)),se),this.onlineState="Unknown",this.io=new Set}}async function Yi(t,e){const n=E(t),s=e.query;let i=!1,r=n.queries.get(s);if(r||(i=!0,r=new Ki),i)try{r.so=await n.onListen(s)}catch(t){const n=Ui(t,`Initialization of query '${ae(e.query)}' failed`);return void e.onError(n)}n.queries.set(s,r),r.listeners.push(e),e.ro(n.onlineState),r.so&&e.oo(r.so)&&Zi(n)}async function Ji(t,e){const n=E(t),s=e.query;let i=!1;const r=n.queries.get(s);if(r){const t=r.listeners.indexOf(e);t>=0&&(r.listeners.splice(t,1),i=0===r.listeners.length)}if(i)return n.queries.delete(s),n.onUnlisten(s)}function Qi(t,e){const n=E(t);let s=!1;for(const t of e){const e=t.query,i=n.queries.get(e);if(i){for(const e of i.listeners)e.oo(t)&&(s=!0);i.so=t}}s&&Zi(n)}function Xi(t,e,n){const s=E(t),i=s.queries.get(e);if(i)for(const t of i.listeners)t.onError(n);s.queries.delete(e)}function Zi(t){t.io.forEach((t=>{t.next()}))}class ts{constructor(t,e,n){this.query=t,this.co=e,this.ao=!1,this.uo=null,this.onlineState="Unknown",this.options=n||{}}oo(t){if(!this.options.includeMetadataChanges){const e=[];for(const n of t.docChanges)3!==n.type&&e.push(n);t=new zi(t.query,t.docs,t.oldDocs,e,t.mutatedKeys,t.fromCache,t.syncStateChanged,!0)}let e=!1;return this.ao?this.ho(t)&&(this.co.next(t),e=!0):this.lo(t,this.onlineState)&&(this.fo(t),e=!0),this.uo=t,e}onError(t){this.co.error(t)}ro(t){this.onlineState=t;let e=!1;return this.uo&&!this.ao&&this.lo(this.uo,t)&&(this.fo(this.uo),e=!0),e}lo(t,e){if(!t.fromCache)return!0;const n="Offline"!==e;return!(this.options.wo&&n||t.docs.isEmpty()&&"Offline"!==e)}ho(t){if(t.docChanges.length>0)return!0;const e=this.uo&&this.uo.hasPendingWrites!==t.hasPendingWrites;return!(!t.syncStateChanged&&!e)&&!0===this.options.includeMetadataChanges}fo(t){t=zi.fromInitialDocuments(t.query,t.docs,t.mutatedKeys,t.fromCache),this.ao=!0,this.co.next(t)}}class es{constructor(t){this.key=t}}class ns{constructor(t){this.key=t}}class rs{constructor(t,e){this.query=t,this.To=e,this.Eo=null,this.current=!1,this.Io=an(),this.mutatedKeys=an(),this.Ao=ue(t),this.Ro=new Hi(this.Ao)}get bo(){return this.To}Po(t,e){const n=e?e.vo:new Wi,s=e?e.Ro:this.Ro;let i=e?e.mutatedKeys:this.mutatedKeys,r=s,o=!1;const l=Qt(this.query)&&s.size===this.query.limit?s.last():null,a=Xt(this.query)&&s.size===this.query.limit?s.first():null;if(t.inorderTraversal(((t,e)=>{const u=s.get(t),c=le(this.query,e)?e:null,h=!!u&&this.mutatedKeys.has(u.key),d=!!c&&(c.hasLocalMutations||this.mutatedKeys.has(c.key)&&c.hasCommittedMutations);let f=!1;u&&c?u.data.isEqual(c.data)?h!==d&&(n.track({type:3,doc:c}),f=!0):this.Vo(u,c)||(n.track({type:2,doc:c}),f=!0,(l&&this.Ao(c,l)>0||a&&this.Ao(c,a)<0)&&(o=!0)):!u&&c?(n.track({type:0,doc:c}),f=!0):u&&!c&&(n.track({type:1,doc:u}),f=!0,(l||a)&&(o=!0)),f&&(c?(r=r.add(c),i=d?i.add(t):i.delete(t)):(r=r.delete(t),i=i.delete(t)))})),Qt(this.query)||Xt(this.query))for(;r.size>this.query.limit;){const t=Qt(this.query)?r.last():r.first();r=r.delete(t.key),i=i.delete(t.key),n.track({type:1,doc:t})}return{Ro:r,vo:n,Bn:o,mutatedKeys:i}}Vo(t,e){return t.hasLocalMutations&&e.hasCommittedMutations&&!e.hasLocalMutations}applyChanges(t,e,n){const s=this.Ro;this.Ro=t.Ro,this.mutatedKeys=t.mutatedKeys;const i=t.vo.no();i.sort(((t,e)=>function(t,e){const n=t=>{switch(t){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return S()}};return n(t)-n(e)}(t.type,e.type)||this.Ao(t.doc,e.doc))),this.So(n);const r=e?this.Do():[],o=0===this.Io.size&&this.current?1:0,l=o!==this.Eo;return this.Eo=o,0!==i.length||l?{snapshot:new zi(this.query,t.Ro,s,i,t.mutatedKeys,0===o,l,!1),Co:r}:{Co:r}}ro(t){return this.current&&"Offline"===t?(this.current=!1,this.applyChanges({Ro:this.Ro,vo:new Wi,mutatedKeys:this.mutatedKeys,Bn:!1},!1)):{Co:[]}}No(t){return!this.To.has(t)&&!!this.Ro.has(t)&&!this.Ro.get(t).hasLocalMutations}So(t){t&&(t.addedDocuments.forEach((t=>this.To=this.To.add(t))),t.modifiedDocuments.forEach((t=>{})),t.removedDocuments.forEach((t=>this.To=this.To.delete(t))),this.current=t.current)}Do(){if(!this.current)return[];const t=this.Io;this.Io=an(),this.Ro.forEach((t=>{this.No(t.key)&&(this.Io=this.Io.add(t.key))}));const e=[];return t.forEach((t=>{this.Io.has(t)||e.push(new ns(t))})),this.Io.forEach((n=>{t.has(n)||e.push(new es(n))})),e}ko(t){this.To=t.zn,this.Io=an();const e=this.Po(t.documents);return this.applyChanges(e,!0)}xo(){return zi.fromInitialDocuments(this.query,this.Ro,this.mutatedKeys,0===this.Eo)}}class is{constructor(t,e,n){this.query=t,this.targetId=e,this.view=n}}class ss{constructor(t){this.key=t,this.$o=!1}}class os{constructor(t,e,n,s,i,r){this.localStore=t,this.remoteStore=e,this.eventManager=n,this.sharedClientState=s,this.currentUser=i,this.maxConcurrentLimboResolutions=r,this.Oo={},this.Mo=new Or((t=>oe(t)),se),this.Fo=new Map,this.Lo=new Set,this.Bo=new Ge(ut.comparator),this.Uo=new Map,this.qo=new Ur,this.Ko={},this.jo=new Map,this.Qo=_r.re(),this.onlineState="Unknown",this.Wo=void 0}get isPrimaryClient(){return!0===this.Wo}}async function as(t,e){const n=ks(t);let s,i;const r=n.Mo.get(e);if(r)s=r.targetId,n.sharedClientState.addLocalQueryTarget(s),i=r.view.xo();else{const t=await Fr(n.localStore,re(e)),r=n.sharedClientState.addLocalQueryTarget(t.targetId);s=t.targetId,i=await ls(n,e,s,"current"===r),n.isPrimaryClient&&yi(n.remoteStore,t)}return i}async function ls(t,e,n,s){t.Go=(e,n,s)=>async function(t,e,n,s){let i=e.view.Po(n);i.Bn&&(i=await Vr(t.localStore,e.query,!1).then((({documents:t})=>e.view.Po(t,i))));const r=s&&s.targetChanges.get(e.targetId),o=e.view.applyChanges(i,t.isPrimaryClient,r);return bs(t,e.targetId,o.Co),o.snapshot}(t,e,n,s);const i=await Vr(t.localStore,e,!0),r=new rs(e,i.zn),o=r.Po(i.documents),l=hn.createSynthesizedTargetChangeForCurrentChange(n,s&&"Offline"!==t.onlineState),a=r.applyChanges(o,t.isPrimaryClient,l);bs(t,n,a.Co);const u=new is(e,n,r);return t.Mo.set(e,u),t.Fo.has(n)?t.Fo.get(n).push(e):t.Fo.set(n,[e]),a.snapshot}async function us(t,e){const n=E(t),s=n.Mo.get(e),i=n.Fo.get(s.targetId);if(i.length>1)return n.Fo.set(s.targetId,i.filter((t=>!se(t,e)))),void n.Mo.delete(e);n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(s.targetId),n.sharedClientState.isActiveQueryTarget(s.targetId)||await Br(n.localStore,s.targetId,!1).then((()=>{n.sharedClientState.clearQueryState(s.targetId),vi(n.remoteStore,s.targetId),ys(n,s.targetId)})).catch(Ar)):(ys(n,s.targetId),await Br(n.localStore,s.targetId,!0))}async function cs(t,e){const n=E(t);try{const t=await function(t,e){const n=E(t),s=e.snapshotVersion;let i=n.qn;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(t=>{const r=n.Qn.newChangeBuffer({trackRemovals:!0});i=n.qn;const o=[];e.targetChanges.forEach(((r,l)=>{const a=i.get(l);if(!a)return;o.push(n.He.removeMatchingKeys(t,r.removedDocuments,l).next((()=>n.He.addMatchingKeys(t,r.addedDocuments,l))));let u=a.withSequenceNumber(t.currentSequenceNumber);e.targetMismatches.has(l)?u=u.withResumeToken(Q.EMPTY_BYTE_STRING,U.min()).withLastLimboFreeSnapshotVersion(U.min()):r.resumeToken.approximateByteSize()>0&&(u=u.withResumeToken(r.resumeToken,s)),i=i.insert(l,u),function(t,e,n){return 0===t.resumeToken.approximateByteSize()||e.snapshotVersion.toMicroseconds()-t.snapshotVersion.toMicroseconds()>=3e8||n.addedDocuments.size+n.modifiedDocuments.size+n.removedDocuments.size>0}(a,u,r)&&o.push(n.He.updateTargetData(t,u))}));let l=tn();if(e.documentUpdates.forEach(((s,i)=>{e.resolvedLimboDocuments.has(s)&&o.push(n.persistence.referenceDelegate.updateLimboDocument(t,s))})),o.push($r(t,r,e.documentUpdates,s,void 0).next((t=>{l=t}))),!s.isEqual(U.min())){const e=n.He.getLastRemoteSnapshotVersion(t).next((e=>n.He.setTargetsMetadata(t,t.currentSequenceNumber,s)));o.push(e)}return gr.waitFor(o).next((()=>r.apply(t))).next((()=>n.Wn.Vn(t,l))).next((()=>l))})).then((t=>(n.qn=i,t)))}(n.localStore,e);e.targetChanges.forEach(((t,e)=>{const s=n.Uo.get(e);s&&(k(t.addedDocuments.size+t.modifiedDocuments.size+t.removedDocuments.size<=1),t.addedDocuments.size>0?s.$o=!0:t.modifiedDocuments.size>0?k(s.$o):t.removedDocuments.size>0&&(k(s.$o),s.$o=!1))})),await xs(n,t,e)}catch(t){await Ar(t)}}function hs(t,e,n){const s=E(t);if(s.isPrimaryClient&&0===n||!s.isPrimaryClient&&1===n){const t=[];s.Mo.forEach(((n,s)=>{const i=s.view.ro(e);i.snapshot&&t.push(i.snapshot)})),function(t,e){const n=E(t);n.onlineState=e;let s=!1;n.queries.forEach(((t,n)=>{for(const t of n.listeners)t.ro(e)&&(s=!0)})),s&&Zi(n)}(s.eventManager,e),t.length&&s.Oo.br(t),s.onlineState=e,s.isPrimaryClient&&s.sharedClientState.setOnlineState(e)}}async function ds(t,e,n){const s=E(t);s.sharedClientState.updateQueryState(e,"rejected",n);const i=s.Uo.get(e),r=i&&i.key;if(r){let t=new Ge(ut.comparator);t=t.insert(r,_t.newNoDocument(r,U.min()));const n=an().add(r),i=new cn(U.min(),new Map,new Qe(rt),t,n);await cs(s,i),s.Bo=s.Bo.remove(r),s.Uo.delete(e),Cs(s)}else await Br(s.localStore,e,!1).then((()=>ys(s,e,n))).catch(Ar)}async function ps(t,e){const n=E(t),s=e.batch.batchId;try{const t=await function(t,e){const n=E(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(t=>{const s=e.batch.keys(),i=n.Qn.newChangeBuffer({trackRemovals:!0});return function(t,e,n,s){const i=n.batch,r=i.keys();let o=gr.resolve();return r.forEach((t=>{o=o.next((()=>s.getEntry(e,t))).next((e=>{const r=n.docVersions.get(t);k(null!==r),e.version.compareTo(r)<0&&(i.applyToRemoteDocument(e,n),e.isValidDocument()&&s.addEntry(e,n.commitVersion))}))})),o.next((()=>t.An.removeMutationBatch(e,i)))}(n,t,e,i).next((()=>i.apply(t))).next((()=>n.An.performConsistencyCheck(t))).next((()=>n.Wn.vn(t,s)))}))}(n.localStore,e);gs(n,s,null),ms(n,s),n.sharedClientState.updateMutationState(s,"acknowledged"),await xs(n,t)}catch(t){await Ar(t)}}async function fs(t,e,n){const s=E(t);try{const t=await function(t,e){const n=E(t);return n.persistence.runTransaction("Reject batch","readwrite-primary",(t=>{let s;return n.An.lookupMutationBatch(t,e).next((e=>(k(null!==e),s=e.keys(),n.An.removeMutationBatch(t,e)))).next((()=>n.An.performConsistencyCheck(t))).next((()=>n.Wn.vn(t,s)))}))}(s.localStore,e);gs(s,e,n),ms(s,e),s.sharedClientState.updateMutationState(e,"rejected",n),await xs(s,t)}catch(n){await Ar(n)}}function ms(t,e){(t.jo.get(e)||[]).forEach((t=>{t.resolve()})),t.jo.delete(e)}function gs(t,e,n){const s=E(t);let i=s.Ko[s.currentUser.toKey()];if(i){const t=i.get(e);t&&(n?t.reject(n):t.resolve(),i=i.remove(e)),s.Ko[s.currentUser.toKey()]=i}}function ys(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const s of t.Fo.get(e))t.Mo.delete(s),n&&t.Oo.zo(s,n);t.Fo.delete(e),t.isPrimaryClient&&t.qo.us(e).forEach((e=>{t.qo.containsKey(e)||vs(t,e)}))}function vs(t,e){t.Lo.delete(e.path.canonicalString());const n=t.Bo.get(e);null!==n&&(vi(t.remoteStore,n),t.Bo=t.Bo.remove(e),t.Uo.delete(n),Cs(t))}function bs(t,e,n){for(const s of n)s instanceof es?(t.qo.addReference(s.key,e),ws(t,s)):s instanceof ns?(w("SyncEngine","Document no longer in limbo: "+s.key),t.qo.removeReference(s.key,e),t.qo.containsKey(s.key)||vs(t,s.key)):S()}function ws(t,e){const n=e.key,s=n.path.canonicalString();t.Bo.get(n)||t.Lo.has(s)||(w("SyncEngine","New document in limbo: "+n),t.Lo.add(s),Cs(t))}function Cs(t){for(;t.Lo.size>0&&t.Bo.size{o.push(s.Go(l,e,n).then((t=>{if(t){s.isPrimaryClient&&s.sharedClientState.updateQueryState(l.targetId,t.fromCache?"not-current":"current"),i.push(t);const e=hr.$n(l.targetId,t);r.push(e)}})))})),await Promise.all(o),s.Oo.br(i),await async function(t,e){const n=E(t);try{await n.persistence.runTransaction("notifyLocalViewChanges","readwrite",(t=>gr.forEach(e,(e=>gr.forEach(e.kn,(s=>n.persistence.referenceDelegate.addReference(t,e.targetId,s))).next((()=>gr.forEach(e.xn,(s=>n.persistence.referenceDelegate.removeReference(t,e.targetId,s)))))))))}catch(t){if(!yr(t))throw t;w("LocalStore","Failed to update sequence numbers: "+t)}for(const t of e){const e=t.targetId;if(!t.fromCache){const t=n.qn.get(e),s=t.snapshotVersion,i=t.withLastLimboFreeSnapshotVersion(s);n.qn=n.qn.insert(e,i)}}}(s.localStore,r))}async function Ts(t,e){const n=E(t);if(!n.currentUser.isEqual(e)){w("SyncEngine","User change. New user:",e.toKey());const t=await Rr(n.localStore,e);n.currentUser=e,function(t,e){t.jo.forEach((t=>{t.forEach((t=>{t.reject(new A(_.CANCELLED,"'waitForPendingWrites' promise is rejected due to a user change."))}))})),t.jo.clear()}(n),n.sharedClientState.handleUserChange(e,t.removedBatchIds,t.addedBatchIds),await xs(n,t.Gn)}}function Ss(t,e){const n=E(t),s=n.Uo.get(e);if(s&&s.$o)return an().add(s.key);{let t=an();const s=n.Fo.get(e);if(!s)return t;for(const e of s){const s=n.Mo.get(e);t=t.unionWith(s.view.bo)}return t}}function ks(t){const e=E(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=cs.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=Ss.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=ds.bind(null,e),e.Oo.br=Qi.bind(null,e.eventManager),e.Oo.zo=Xi.bind(null,e.eventManager),e}function Es(t){const e=E(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=ps.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=fs.bind(null,e),e}class _s{constructor(){this.synchronizeTabs=!1}async initialize(t){this.k=oi(t.databaseInfo.databaseId),this.sharedClientState=this.Jo(t),this.persistence=this.Yo(t),await this.persistence.start(),this.gcScheduler=this.Xo(t),this.localStore=this.Zo(t)}Xo(t){return null}Zo(t){return Pr(this.persistence,new Nr,t.initialUser,this.k)}Yo(t){return new Yr(Qr.ks,this.k)}Jo(t){return new Zr}async terminate(){this.gcScheduler&&this.gcScheduler.stop(),await this.sharedClientState.shutdown(),await this.persistence.shutdown()}}class As{async initialize(t,e){this.localStore||(this.localStore=t.localStore,this.sharedClientState=t.sharedClientState,this.datastore=this.createDatastore(e),this.remoteStore=this.createRemoteStore(e),this.eventManager=this.createEventManager(e),this.syncEngine=this.createSyncEngine(e,!t.synchronizeTabs),this.sharedClientState.onlineStateHandler=t=>hs(this.syncEngine,t,1),this.remoteStore.remoteSyncer.handleCredentialChange=Ts.bind(null,this.syncEngine),await Fi(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(t){return new Gi}createDatastore(t){const e=oi(t.databaseInfo.databaseId),n=(s=t.databaseInfo,new ii(s));var s;return function(t,e,n,s){return new di(t,e,n,s)}(t.authCredentials,t.appCheckCredentials,n,e)}createRemoteStore(t){return e=this.localStore,n=this.datastore,s=t.asyncQueue,i=t=>hs(this.syncEngine,t,0),r=ei.Pt()?new ei:new ti,new fi(e,n,s,i,r);var e,n,s,i,r}createSyncEngine(t,e){return function(t,e,n,s,i,r,o){const l=new os(t,e,n,s,i,r);return o&&(l.Wo=!0),l}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,t.initialUser,t.maxConcurrentLimboResolutions,e)}terminate(){return async function(t){const e=E(t);w("RemoteStore","RemoteStore shutting down."),e.Gr.add(5),await gi(e),e.Hr.shutdown(),e.Jr.set("Unknown")}(this.remoteStore)}}class Os{constructor(t){this.observer=t,this.muted=!1}next(t){this.observer.next&&this.ec(this.observer.next,t)}error(t){this.observer.error?this.ec(this.observer.error,t):console.error("Uncaught Error in snapshot listener:",t)}nc(){this.muted=!0}ec(t,e){this.muted||setTimeout((()=>{this.muted||t(e)}),0)}}class Is{constructor(t,e,n,s){this.authCredentials=t,this.appCheckCredentials=e,this.asyncQueue=n,this.databaseInfo=s,this.user=f.UNAUTHENTICATED,this.clientId=F.A(),this.authCredentialListener=()=>Promise.resolve(),this.authCredentials.start(n,(async t=>{w("FirestoreClient","Received user=",t.uid),await this.authCredentialListener(t),this.user=t})),this.appCheckCredentials.start(n,(()=>Promise.resolve()))}async getConfiguration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(t){this.authCredentialListener=t}verifyNotTerminated(){if(this.asyncQueue.isShuttingDown)throw new A(_.FAILED_PRECONDITION,"The client has already been terminated.")}terminate(){this.asyncQueue.enterRestrictedMode();const t=new O;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async()=>{try{this.onlineComponents&&await this.onlineComponents.terminate(),this.offlineComponents&&await this.offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),t.resolve()}catch(e){const n=Ui(e,"Failed to shutdown persistence");t.reject(n)}})),t.promise}}async function Ds(t,e){t.asyncQueue.verifyOperationInProgress(),w("FirestoreClient","Initializing OfflineComponentProvider");const n=await t.getConfiguration();await e.initialize(n);let s=n.initialUser;t.setCredentialChangeListener((async t=>{s.isEqual(t)||(await Rr(e.localStore,t),s=t)})),e.persistence.setDatabaseDeletedListener((()=>t.terminate())),t.offlineComponents=e}async function Ns(t,e){t.asyncQueue.verifyOperationInProgress();const n=await js(t);w("FirestoreClient","Initializing OnlineComponentProvider");const s=await t.getConfiguration();await e.initialize(n,s),t.setCredentialChangeListener((t=>async function(t,e){const n=E(t);n.asyncQueue.verifyOperationInProgress(),w("RemoteStore","RemoteStore received new credentials");const s=Ti(n);n.Gr.add(3),await gi(n),s&&n.Jr.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.Gr.delete(3),await mi(n)}(e.remoteStore,t))),t.onlineComponents=e}async function js(t){return t.offlineComponents||(w("FirestoreClient","Using default OfflineComponentProvider"),await Ds(t,new _s)),t.offlineComponents}async function Ps(t){return t.onlineComponents||(w("FirestoreClient","Using default OnlineComponentProvider"),await Ns(t,new As)),t.onlineComponents}function Rs(t){return Ps(t).then((t=>t.syncEngine))}async function Ls(t){const e=await Ps(t),n=e.eventManager;return n.onListen=as.bind(null,e.syncEngine),n.onUnlisten=us.bind(null,e.syncEngine),n}function $s(t,e,n={}){const s=new O;return t.asyncQueue.enqueueAndForget((async()=>function(t,e,n,s,i){const r=new Os({next:r=>{e.enqueueAndForget((()=>Ji(t,o)));const l=r.docs.has(n);!l&&r.fromCache?i.reject(new A(_.UNAVAILABLE,"Failed to get document because the client is offline.")):l&&r.fromCache&&s&&"server"===s.source?i.reject(new A(_.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(r)},error:t=>i.reject(t)}),o=new ts(Jt(n.path),r,{includeMetadataChanges:!0,wo:!0});return Yi(t,o)}(await Ls(t),t.asyncQueue,e,n,s))),s.promise}function Ms(t,e,n={}){const s=new O;return t.asyncQueue.enqueueAndForget((async()=>function(t,e,n,s,i){const r=new Os({next:n=>{e.enqueueAndForget((()=>Ji(t,o))),n.fromCache&&"server"===s.source?i.reject(new A(_.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:t=>i.reject(t)}),o=new ts(n,r,{includeMetadataChanges:!0,wo:!0});return Yi(t,o)}(await Ls(t),t.asyncQueue,e,n,s))),s.promise}class Fs{constructor(t,e,n,s,i,r,o,l){this.databaseId=t,this.appId=e,this.persistenceKey=n,this.host=s,this.ssl=i,this.forceLongPolling=r,this.autoDetectLongPolling=o,this.useFetchStreams=l}}class Bs{constructor(t,e){this.projectId=t,this.database=e||"(default)"}get isDefaultDatabase(){return"(default)"===this.database}isEqual(t){return t instanceof Bs&&t.projectId===this.projectId&&t.database===this.database}}const Vs=new Map;function qs(t,e,n){if(!n)throw new A(_.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function Us(t){if(!ut.isDocumentKey(t))throw new A(_.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function Hs(t){if(ut.isDocumentKey(t))throw new A(_.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function Ws(t){if(void 0===t)return"undefined";if(null===t)return"null";if("string"==typeof t)return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if("number"==typeof t||"boolean"==typeof t)return""+t;if("object"==typeof t){if(t instanceof Array)return"an array";{const e=function(t){return t.constructor?t.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return"function"==typeof t?"a function":S()}function zs(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new A(_.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=Ws(t);throw new A(_.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}function Ks(t,e){if(e<=0)throw new A(_.INVALID_ARGUMENT,`Function ${t}() requires a positive number, but it was: ${e}.`)}class Gs{constructor(t){var e;if(void 0===t.host){if(void 0!==t.ssl)throw new A(_.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=t.host,this.ssl=null===(e=t.ssl)||void 0===e||e;if(this.credentials=t.credentials,this.ignoreUndefinedProperties=!!t.ignoreUndefinedProperties,void 0===t.cacheSizeBytes)this.cacheSizeBytes=41943040;else{if(-1!==t.cacheSizeBytes&&t.cacheSizeBytes<1048576)throw new A(_.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=t.cacheSizeBytes}this.experimentalForceLongPolling=!!t.experimentalForceLongPolling,this.experimentalAutoDetectLongPolling=!!t.experimentalAutoDetectLongPolling,this.useFetchStreams=!!t.useFetchStreams,function(t,e,n,s){if(!0===e&&!0===s)throw new A(_.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}("experimentalForceLongPolling",t.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",t.experimentalAutoDetectLongPolling)}isEqual(t){return this.host===t.host&&this.ssl===t.ssl&&this.credentials===t.credentials&&this.cacheSizeBytes===t.cacheSizeBytes&&this.experimentalForceLongPolling===t.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===t.experimentalAutoDetectLongPolling&&this.ignoreUndefinedProperties===t.ignoreUndefinedProperties&&this.useFetchStreams===t.useFetchStreams}}class Ys{constructor(t,e,n){this._authCredentials=e,this._appCheckCredentials=n,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new Gs({}),this._settingsFrozen=!1,t instanceof Bs?this._databaseId=t:(this._app=t,this._databaseId=function(t){if(!Object.prototype.hasOwnProperty.apply(t.options,["projectId"]))throw new A(_.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Bs(t.options.projectId)}(t))}get app(){if(!this._app)throw new A(_.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(t){if(this._settingsFrozen)throw new A(_.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 Gs(t),void 0!==t.credentials&&(this._authCredentials=function(t){if(!t)return new D;switch(t.type){case"gapi":const e=t.client;return k(!("object"!=typeof e||null===e||!e.auth||!e.auth.getAuthHeaderValueForFirstParty)),new P(e,t.sessionIndex||"0",t.iamToken||null);case"provider":return t.client;default:throw new A(_.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(t.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(t){const e=Vs.get(t);e&&(w("ComponentProvider","Removing Datastore"),Vs.delete(t),e.terminate())}(this),Promise.resolve()}}class Js{constructor(t,e,n){this.converter=e,this._key=n,this.type="document",this.firestore=t}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Xs(this.firestore,this.converter,this._key.path.popLast())}withConverter(t){return new Js(this.firestore,t,this._key)}}class Qs{constructor(t,e,n){this.converter=e,this._query=n,this.type="query",this.firestore=t}withConverter(t){return new Qs(this.firestore,t,this._query)}}class Xs extends Qs{constructor(t,e,n){super(t,e,Jt(n)),this._path=n,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const t=this._path.popLast();return t.isEmpty()?null:new Js(this.firestore,null,new ut(t))}withConverter(t){return new Xs(this.firestore,t,this._path)}}function Zs(t,e,...n){if(t=Object(c.k)(t),qs("collection","path",e),t instanceof Ys){const s=K.fromString(e,...n);return Hs(s),new Xs(t,null,s)}{if(!(t instanceof Js||t instanceof Xs))throw new A(_.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=t._path.child(K.fromString(e,...n));return Hs(s),new Xs(t.firestore,null,s)}}function to(t,e,...n){if(t=Object(c.k)(t),1===arguments.length&&(e=F.A()),qs("doc","path",e),t instanceof Ys){const s=K.fromString(e,...n);return Us(s),new Js(t,null,new ut(s))}{if(!(t instanceof Js||t instanceof Xs))throw new A(_.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const s=t._path.child(K.fromString(e,...n));return Us(s),new Js(t.firestore,t instanceof Xs?t.converter:null,new ut(s))}}class eo{constructor(){this.mc=Promise.resolve(),this.gc=[],this.yc=!1,this.Tc=[],this.Ec=null,this.Ic=!1,this.Ac=!1,this.Rc=[],this.ur=new ai(this,"async_queue_retry"),this.bc=()=>{const t=si();t&&w("AsyncQueue","Visibility state changed to "+t.visibilityState),this.ur.er()};const t=si();t&&"function"==typeof t.addEventListener&&t.addEventListener("visibilitychange",this.bc)}get isShuttingDown(){return this.yc}enqueueAndForget(t){this.enqueue(t)}enqueueAndForgetEvenWhileRestricted(t){this.Pc(),this.vc(t)}enterRestrictedMode(t){if(!this.yc){this.yc=!0,this.Ac=t||!1;const e=si();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("visibilitychange",this.bc)}}enqueue(t){if(this.Pc(),this.yc)return new Promise((()=>{}));const e=new O;return this.vc((()=>this.yc&&this.Ac?Promise.resolve():(t().then(e.resolve,e.reject),e.promise))).then((()=>e.promise))}enqueueRetryable(t){this.enqueueAndForget((()=>(this.gc.push(t),this.Vc())))}async Vc(){if(0!==this.gc.length){try{await this.gc[0](),this.gc.shift(),this.ur.reset()}catch(t){if(!yr(t))throw t;w("AsyncQueue","Operation failed with retryable error: "+t)}this.gc.length>0&&this.ur.Zi((()=>this.Vc()))}}vc(t){const e=this.mc.then((()=>(this.Ic=!0,t().catch((t=>{this.Ec=t,this.Ic=!1;const e=function(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+"\n"+t.stack),e}(t);throw C("INTERNAL UNHANDLED ERROR: ",e),t})).then((t=>(this.Ic=!1,t))))));return this.mc=e,e}enqueueAfterDelay(t,e,n){this.Pc(),this.Rc.indexOf(t)>-1&&(e=0);const s=qi.createAndSchedule(this,t,e,n,(t=>this.Sc(t)));return this.Tc.push(s),s}Pc(){this.Ec&&S()}verifyOperationInProgress(){}async Dc(){let t;do{t=this.mc,await t}while(t!==this.mc)}Cc(t){for(const e of this.Tc)if(e.timerId===t)return!0;return!1}Nc(t){return this.Dc().then((()=>{this.Tc.sort(((t,e)=>t.targetTimeMs-e.targetTimeMs));for(const e of this.Tc)if(e.skipDelay(),"all"!==t&&e.timerId===t)break;return this.Dc()}))}kc(t){this.Rc.push(t)}Sc(t){const e=this.Tc.indexOf(t);this.Tc.splice(e,1)}}function no(t){return function(t,e){if("object"!=typeof t||null===t)return!1;const n=t;for(const t of["next","error","complete"])if(t in n&&"function"==typeof n[t])return!0;return!1}(t)}class ro extends Ys{constructor(t,e,n){super(t,e,n),this.type="firestore",this._queue=new eo,this._persistenceKey="name"in t?t.name:"[DEFAULT]"}_terminate(){return this._firestoreClient||oo(this),this._firestoreClient.terminate()}}function io(t=Object(r.e)()){return Object(r.b)(t,"firestore").getImmediate()}function so(t){return t._firestoreClient||oo(t),t._firestoreClient.verifyNotTerminated(),t._firestoreClient}function oo(t){var e;const n=t._freezeSettings(),s=function(t,e,n,s){return new Fs(t,e,n,s.host,s.ssl,s.experimentalForceLongPolling,s.experimentalAutoDetectLongPolling,s.useFetchStreams)}(t._databaseId,(null===(e=t._app)||void 0===e?void 0:e.options.appId)||"",t._persistenceKey,n);t._firestoreClient=new Is(t._authCredentials,t._appCheckCredentials,t._queue,s)}class ao{constructor(...t){for(let e=0;e90)throw new A(_.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+t);if(!isFinite(e)||e<-180||e>180)throw new A(_.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+e);this._lat=t,this._long=e}get latitude(){return this._lat}get longitude(){return this._long}isEqual(t){return this._lat===t._lat&&this._long===t._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(t){return rt(this._lat,t._lat)||rt(this._long,t._long)}}const ho=/^__.*__$/;class po{constructor(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}toMutation(t,e){return null!==this.fieldMask?new $e(t,this.data,this.fieldMask,e,this.fieldTransforms):new Le(t,this.data,e,this.fieldTransforms)}}class fo{constructor(t,e,n){this.data=t,this.fieldMask=e,this.fieldTransforms=n}toMutation(t,e){return new $e(t,this.data,this.fieldMask,e,this.fieldTransforms)}}function mo(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw S()}}class go{constructor(t,e,n,s,i,r){this.settings=t,this.databaseId=e,this.k=n,this.ignoreUndefinedProperties=s,void 0===i&&this.xc(),this.fieldTransforms=i||[],this.fieldMask=r||[]}get path(){return this.settings.path}get $c(){return this.settings.$c}Oc(t){return new go(Object.assign(Object.assign({},this.settings),t),this.databaseId,this.k,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Mc(t){var e;const n=null===(e=this.path)||void 0===e?void 0:e.child(t),s=this.Oc({path:n,Fc:!1});return s.Lc(t),s}Bc(t){var e;const n=null===(e=this.path)||void 0===e?void 0:e.child(t),s=this.Oc({path:n,Fc:!1});return s.xc(),s}Uc(t){return this.Oc({path:void 0,Fc:!0})}qc(t){return jo(t,this.settings.methodName,this.settings.Kc||!1,this.path,this.settings.jc)}contains(t){return void 0!==this.fieldMask.find((e=>t.isPrefixOf(e)))||void 0!==this.fieldTransforms.find((e=>t.isPrefixOf(e.field)))}xc(){if(this.path)for(let t=0;ta.covers(t.field)))}else a=null,u=o.fieldTransforms;return new po(new kt(l),a,u)}class wo extends uo{_toFieldTransform(t){if(2!==t.$c)throw 1===t.$c?t.qc(`${this._methodName}() can only appear at the top level of your update data`):t.qc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return t.fieldMask.push(t.path),null}isEqual(t){return t instanceof wo}}function Co(t,e,n){return new go({$c:3,jc:e.settings.jc,methodName:t._methodName,Fc:n},e.databaseId,e.k,e.ignoreUndefinedProperties)}class xo extends uo{constructor(t,e){super(t),this.Wc=e}_toFieldTransform(t){const e=Co(this,t,!0),n=this.Wc.map((t=>Eo(t,e))),s=new be(n);return new Ee(t.path,s)}isEqual(t){return this===t}}function To(t,e,n,s){const i=t.Qc(1,e,n);Oo("Data must be an object, but it was:",i,s);const r=[],o=kt.empty();W(s,((t,s)=>{const l=No(e,t,n);s=Object(c.k)(s);const a=i.Bc(l);if(s instanceof wo)r.push(l);else{const t=Eo(s,a);null!=t&&(r.push(l),o.set(l,t))}}));const l=new J(r);return new fo(o,l,i.fieldTransforms)}function So(t,e,n,s,i,r){const o=t.Qc(1,e,n),l=[Io(e,s,n)],a=[i];if(r.length%2!=0)throw new A(_.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let t=0;t=0;--t)if(!Po(u,l[t])){const e=l[t];let n=a[t];n=Object(c.k)(n);const s=o.Bc(e);if(n instanceof wo)u.push(e);else{const t=Eo(n,s);null!=t&&(u.push(e),h.set(e,t))}}const d=new J(u);return new fo(h,d,o.fieldTransforms)}function ko(t,e,n,s=!1){return Eo(n,t.Qc(s?4:3,e))}function Eo(t,e){if(Ao(t=Object(c.k)(t)))return Oo("Unsupported field value:",e,t),_o(t,e);if(t instanceof uo)return function(t,e){if(!mo(e.$c))throw e.qc(`${t._methodName}() can only be used with update() and set()`);if(!e.path)throw e.qc(`${t._methodName}() is not currently supported inside arrays`);const n=t._toFieldTransform(e);n&&e.fieldTransforms.push(n)}(t,e),null;if(void 0===t&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.Fc&&4!==e.$c)throw e.qc("Nested arrays are not supported");return function(t,e){const n=[];let s=0;for(const i of t){let t=Eo(i,e.Uc(s));null==t&&(t={nullValue:"NULL_VALUE"}),n.push(t),s++}return{arrayValue:{values:n}}}(t,e)}return function(t,e){if(null===(t=Object(c.k)(t)))return{nullValue:"NULL_VALUE"};if("number"==typeof t)return pe(e.k,t);if("boolean"==typeof t)return{booleanValue:t};if("string"==typeof t)return{stringValue:t};if(t instanceof Date){const n=V.fromDate(t);return{timestampValue:xn(e.k,n)}}if(t instanceof V){const n=new V(t.seconds,1e3*Math.floor(t.nanoseconds/1e3));return{timestampValue:xn(e.k,n)}}if(t instanceof co)return{geoPointValue:{latitude:t.latitude,longitude:t.longitude}};if(t instanceof lo)return{bytesValue:Tn(e.k,t._byteString)};if(t instanceof Js){const n=e.databaseId,s=t.firestore._databaseId;if(!s.isEqual(n))throw e.qc(`Document reference is for database ${s.projectId}/${s.database} but should be for database ${n.projectId}/${n.database}`);return{referenceValue:En(t.firestore._databaseId||e.databaseId,t._key.path)}}throw e.qc(`Unsupported field value: ${Ws(t)}`)}(t,e)}function _o(t,e){const n={};return z(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):W(t,((t,s)=>{const i=Eo(s,e.Mc(t));null!=i&&(n[t]=i)})),{mapValue:{fields:n}}}function Ao(t){return!("object"!=typeof t||null===t||t instanceof Array||t instanceof Date||t instanceof V||t instanceof co||t instanceof lo||t instanceof Js||t instanceof uo)}function Oo(t,e,n){if(!Ao(n)||!function(t){return"object"==typeof t&&null!==t&&(Object.getPrototypeOf(t)===Object.prototype||null===Object.getPrototypeOf(t))}(n)){const s=Ws(n);throw"an object"===s?e.qc(t+" a custom object"):e.qc(t+" "+s)}}function Io(t,e,n){if((e=Object(c.k)(e))instanceof ao)return e._internalPath;if("string"==typeof e)return No(t,e);throw jo("Field path arguments must be of type string or ",t,!1,void 0,n)}const Do=new RegExp("[~\\*/\\[\\]]");function No(t,e,n){if(e.search(Do)>=0)throw jo(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new ao(...e.split("."))._internalPath}catch(r){throw jo(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function jo(t,e,n,s,i){const r=s&&!s.isEmpty(),o=void 0!==i;let l=`Function ${e}() called with invalid data`;n&&(l+=" (via `toFirestore()`)"),l+=". ";let a="";return(r||o)&&(a+=" (found",r&&(a+=` in field ${s}`),o&&(a+=` in document ${i}`),a+=")"),new A(_.INVALID_ARGUMENT,l+t+a)}function Po(t,e){return t.some((t=>t.isEqual(e)))}class Ro{constructor(t,e,n,s,i){this._firestore=t,this._userDataWriter=e,this._key=n,this._document=s,this._converter=i}get id(){return this._key.path.lastSegment()}get ref(){return new Js(this._firestore,this._converter,this._key)}exists(){return null!==this._document}data(){if(this._document){if(this._converter){const t=new Lo(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(t)}return this._userDataWriter.convertValue(this._document.data.value)}}get(t){if(this._document){const e=this._document.data.field($o("DocumentSnapshot.get",t));if(null!==e)return this._userDataWriter.convertValue(e)}}}class Lo extends Ro{data(){return super.data()}}function $o(t,e){return"string"==typeof e?No(t,e):e instanceof ao?e._internalPath:e._delegate._internalPath}class Mo{constructor(t,e){this.hasPendingWrites=t,this.fromCache=e}isEqual(t){return this.hasPendingWrites===t.hasPendingWrites&&this.fromCache===t.fromCache}}class Fo extends Ro{constructor(t,e,n,s,i,r){super(t,e,n,s,r),this._firestore=t,this._firestoreImpl=t,this.metadata=i}exists(){return super.exists()}data(t={}){if(this._document){if(this._converter){const e=new Bo(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(e,t)}return this._userDataWriter.convertValue(this._document.data.value,t.serverTimestamps)}}get(t,e={}){if(this._document){const n=this._document.data.field($o("DocumentSnapshot.get",t));if(null!==n)return this._userDataWriter.convertValue(n,e.serverTimestamps)}}}class Bo extends Fo{data(t={}){return super.data(t)}}class Vo{constructor(t,e,n,s){this._firestore=t,this._userDataWriter=e,this._snapshot=s,this.metadata=new Mo(s.hasPendingWrites,s.fromCache),this.query=n}get docs(){const t=[];return this.forEach((e=>t.push(e))),t}get size(){return this._snapshot.docs.size}get empty(){return 0===this.size}forEach(t,e){this._snapshot.docs.forEach((n=>{t.call(e,new Bo(this._firestore,this._userDataWriter,n.key,n,new Mo(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))}))}docChanges(t={}){const e=!!t.includeMetadataChanges;if(e&&this._snapshot.excludesMetadataChanges)throw new A(_.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===e||(this._cachedChanges=function(t,e){if(t._snapshot.oldDocs.isEmpty()){let e=0;return t._snapshot.docChanges.map((n=>({type:"added",doc:new Bo(t._firestore,t._userDataWriter,n.doc.key,n.doc,new Mo(t._snapshot.mutatedKeys.has(n.doc.key),t._snapshot.fromCache),t.query.converter),oldIndex:-1,newIndex:e++})))}{let n=t._snapshot.oldDocs;return t._snapshot.docChanges.filter((t=>e||3!==t.type)).map((e=>{const s=new Bo(t._firestore,t._userDataWriter,e.doc.key,e.doc,new Mo(t._snapshot.mutatedKeys.has(e.doc.key),t._snapshot.fromCache),t.query.converter);let i=-1,r=-1;return 0!==e.type&&(i=n.indexOf(e.doc.key),n=n.delete(e.doc.key)),1!==e.type&&(n=n.add(e.doc),r=n.indexOf(e.doc.key)),{type:qo(e.type),doc:s,oldIndex:i,newIndex:r}}))}}(this,e),this._cachedChangesIncludeMetadataChanges=e),this._cachedChanges}}function qo(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return S()}}function Uo(t){if(Xt(t)&&0===t.explicitOrderBy.length)throw new A(_.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class Ho{}function Wo(t,...e){for(const n of e)t=n._apply(t);return t}class zo extends Ho{constructor(t,e,n){super(),this.zc=t,this.Hc=e,this.Jc=n,this.type="where"}_apply(t){const e=vo(t.firestore),n=function(t,e,n,s,i,r,o){let l;if(i.isKeyField()){if("array-contains"===r||"array-contains-any"===r)throw new A(_.INVALID_ARGUMENT,`Invalid Query. You can't perform '${r}' queries on documentId().`);if("in"===r||"not-in"===r){Qo(o,r);const e=[];for(const n of o)e.push(Jo(s,t,n));l={arrayValue:{values:e}}}else l=Jo(s,t,o)}else"in"!==r&&"not-in"!==r&&"array-contains-any"!==r||Qo(o,r),l=ko(n,"where",o,"in"===r||"not-in"===r);const a=jt.create(i,r,l);return function(t,e){if(e.V()){const n=te(t);if(null!==n&&!n.isEqual(e.field))throw new A(_.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 '${e.field.toString()}'`);const s=Zt(t);null!==s&&Xo(t,e.field,s)}const n=function(t,e){for(const n of t.filters)if(e.indexOf(n.op)>=0)return n.op;return null}(t,function(t){switch(t){case"!=":return["!=","not-in"];case"array-contains":return["array-contains","array-contains-any","not-in"];case"in":return["array-contains-any","in","not-in"];case"array-contains-any":return["array-contains","array-contains-any","in","not-in"];case"not-in":return["array-contains","array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(null!==n)throw n===e.op?new A(_.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new A(_.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}(t,a),a}(t._query,0,e,t.firestore._databaseId,this.zc,this.Hc,this.Jc);return new Qs(t.firestore,t.converter,function(t,e){const n=t.filters.concat([e]);return new Gt(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}(t._query,n))}}function Ko(t,e,n){const s=e,i=$o("where",t);return new zo(i,s,n)}class Go extends Ho{constructor(t,e,n){super(),this.type=t,this.Xc=e,this.Zc=n}_apply(t){return new Qs(t.firestore,t.converter,ie(t._query,this.Xc,this.Zc))}}function Yo(t){return Ks("limit",t),new Go("limit",t,"F")}function Jo(t,e,n){if("string"==typeof(n=Object(c.k)(n))){if(""===n)throw new A(_.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!ee(e)&&-1!==n.indexOf("/"))throw new A(_.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);const s=e.path.child(K.fromString(n));if(!ut.isDocumentKey(s))throw new A(_.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${s}' is not because it has an odd number of segments (${s.length}).`);return vt(t,new ut(s))}if(n instanceof Js)return vt(t,n._key);throw new A(_.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${Ws(n)}.`)}function Qo(t,e){if(!Array.isArray(t)||0===t.length)throw new A(_.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`);if(t.length>10)throw new A(_.INVALID_ARGUMENT,`Invalid Query. '${e.toString()}' filters support a maximum of 10 elements in the value array.`)}function Xo(t,e,n){if(!n.isEqual(e))throw new A(_.INVALID_ARGUMENT,`Invalid query. You have a where filter with an inequality (<, <=, !=, not-in, >, or >=) on field '${e.toString()}' and so you must also use '${e.toString()}' as your first argument to orderBy(), but your first orderBy() is on field '${n.toString()}' instead.`)}class Zo{convertValue(t,e="none"){switch(ct(t)){case 0:return null;case 1:return t.booleanValue;case 2:return tt(t.integerValue||t.doubleValue);case 3:return this.convertTimestamp(t.timestampValue);case 4:return this.convertServerTimestamp(t,e);case 5:return t.stringValue;case 6:return this.convertBytes(et(t.bytesValue));case 7:return this.convertReference(t.referenceValue);case 8:return this.convertGeoPoint(t.geoPointValue);case 9:return this.convertArray(t.arrayValue,e);case 10:return this.convertObject(t.mapValue,e);default:throw S()}}convertObject(t,e){const n={};return W(t.fields,((t,s)=>{n[t]=this.convertValue(s,e)})),n}convertGeoPoint(t){return new co(tt(t.latitude),tt(t.longitude))}convertArray(t,e){return(t.values||[]).map((t=>this.convertValue(t,e)))}convertServerTimestamp(t,e){switch(e){case"previous":const n=it(t);return null==n?null:this.convertValue(n,e);case"estimate":return this.convertTimestamp(st(t));default:return null}}convertTimestamp(t){const e=Z(t);return new V(e.seconds,e.nanos)}convertDocumentKey(t,e){const n=K.fromString(t);k(Yn(n));const s=new Bs(n.get(1),n.get(3)),i=new ut(n.popFirst(5));return s.isEqual(e)||C(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${e.projectId}/${e.database}) instead.`),i}}function ta(t,e,n){let s;return s=t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e,s}function ea(t){t=zs(t,Js);const e=zs(t.firestore,ro);return $s(so(e),t._key).then((n=>la(e,t,n)))}class na extends Zo{constructor(t){super(),this.firestore=t}convertBytes(t){return new lo(t)}convertReference(t){const e=this.convertDocumentKey(t,this.firestore._databaseId);return new Js(this.firestore,null,e)}}function ra(t){t=zs(t,Qs);const e=zs(t.firestore,ro),n=so(e),s=new na(e);return Uo(t._query),Ms(n,t._query).then((n=>new Vo(e,s,t,n)))}function ia(t,e,n,...s){t=zs(t,Js);const i=zs(t.firestore,ro),r=vo(i);let o;return o="string"==typeof(e=Object(c.k)(e))||e instanceof ao?So(r,"updateDoc",t._key,e,n,s):To(r,"updateDoc",t._key,e),aa(i,[o.toMutation(t._key,Ae.exists(!0))])}function sa(t,e){const n=zs(t.firestore,ro),s=to(t),i=ta(t.converter,e);return aa(n,[bo(vo(t.firestore),"addDoc",s._key,i,null!==t.converter,{}).toMutation(s._key,Ae.exists(!1))]).then((()=>s))}function oa(t,...e){var n,s,i;t=Object(c.k)(t);let r={includeMetadataChanges:!1},o=0;"object"!=typeof e[o]||no(e[o])||(r=e[o],o++);const l={includeMetadataChanges:r.includeMetadataChanges};if(no(e[o])){const t=e[o];e[o]=null===(n=t.next)||void 0===n?void 0:n.bind(t),e[o+1]=null===(s=t.error)||void 0===s?void 0:s.bind(t),e[o+2]=null===(i=t.complete)||void 0===i?void 0:i.bind(t)}let a,u,h;if(t instanceof Js)u=zs(t.firestore,ro),h=Jt(t._key.path),a={next:n=>{e[o]&&e[o](la(u,t,n))},error:e[o+1],complete:e[o+2]};else{const n=zs(t,Qs);u=zs(n.firestore,ro),h=n._query;const s=new na(u);a={next:t=>{e[o]&&e[o](new Vo(u,s,n,t))},error:e[o+1],complete:e[o+2]},Uo(t._query)}return function(t,e,n,s){const i=new Os(s),r=new ts(e,i,n);return t.asyncQueue.enqueueAndForget((async()=>Yi(await Ls(t),r))),()=>{i.nc(),t.asyncQueue.enqueueAndForget((async()=>Ji(await Ls(t),r)))}}(so(u),h,l,a)}function aa(t,e){return function(t,e){const n=new O;return t.asyncQueue.enqueueAndForget((async()=>async function(t,e,n){const s=Es(t);try{const t=await function(t,e){const n=E(t),s=V.now(),i=e.reduce(((t,e)=>t.add(e.key)),an());let r;return n.persistence.runTransaction("Locally write mutations","readwrite",(t=>n.Wn.vn(t,i).next((i=>{r=i;const o=[];for(const t of e){const e=je(t,r.get(t.key));null!=e&&o.push(new $e(t.key,e,Et(e.value.mapValue),Ae.exists(!0)))}return n.An.addMutationBatch(t,s,o,e)})))).then((t=>(t.applyToLocalDocumentSet(r),{batchId:t.batchId,changes:r})))}(s.localStore,e);s.sharedClientState.addPendingMutation(t.batchId),function(t,e,n){let s=t.Ko[t.currentUser.toKey()];s||(s=new Ge(rt)),s=s.insert(e,n),t.Ko[t.currentUser.toKey()]=s}(s,t.batchId,n),await xs(s,t.changes),await Ii(s.remoteStore)}catch(t){const e=Ui(t,"Failed to persist write");n.reject(e)}}(await Rs(t),e,n))),n.promise}(so(t),e)}function la(t,e,n){const s=n.docs.get(e._key),i=new na(t);return new Fo(t,i,e._key,s,new Mo(n.hasPendingWrites,n.fromCache),e.converter)}function ua(...t){return new xo("arrayUnion",t)}!function(t,e=!0){!function(t){m=t}(r.a),Object(r.c)(new o.a("firestore",((t,{options:n})=>{const s=t.getProvider("app").getImmediate(),i=new ro(s,new N(t.getProvider("auth-internal")),new L(t.getProvider("app-check-internal")));return n=Object.assign({useFetchStreams:e},n),i._setSettings(n),i}),"PUBLIC")),Object(r.g)(d,"3.4.3",t),Object(r.g)(d,"3.4.3","esm2017")}()}).call(this,n(177))},181:function(t,e,n){(function(e){var n="__lodash_hash_undefined__",r="[object Function]",o="[object GeneratorFunction]",l=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,c=/^\w*$/,h=/^\./,d=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,f=/\\(\\)?/g,m=/^\[object .+?Constructor\]$/,y="object"==typeof e&&e&&e.Object===Object&&e,v="object"==typeof self&&self&&self.Object===Object&&self,w=y||v||Function("return this")();var C,x=Array.prototype,T=Function.prototype,S=Object.prototype,k=w["__core-js_shared__"],E=(C=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(src)_1."+C:"",_=T.toString,A=S.hasOwnProperty,O=S.toString,I=RegExp("^"+_.call(A).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),D=w.Symbol,N=x.splice,j=W(w,"Map"),P=W(Object,"create"),R=D?D.prototype:void 0,L=R?R.toString:void 0;function $(t){var e=-1,n=t?t.length:0;for(this.clear();++e-1},M.prototype.set=function(t,e){var data=this.__data__,n=B(data,t);return n<0?data.push([t,e]):data[n][1]=e,this},F.prototype.clear=function(){this.__data__={hash:new $,map:new(j||M),string:new $}},F.prototype.delete=function(t){return H(this,t).delete(t)},F.prototype.get=function(t){return H(this,t).get(t)},F.prototype.has=function(t){return H(this,t).has(t)},F.prototype.set=function(t,e){return H(this,t).set(t,e),this};var z=G((function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(Q(t))return L?L.call(t):"";var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}(e);var n=[];return h.test(t)&&n.push(""),t.replace(d,(function(t,e,r,o){n.push(r?o.replace(f,"$1"):e||t)})),n}));function K(t){if("string"==typeof t||Q(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e}function G(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],l=n.cache;if(l.has(o))return l.get(o);var c=t.apply(this,r);return n.cache=l.set(o,c),c};return n.cache=new(G.Cache||F),n}G.Cache=F;var Y=Array.isArray;function J(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Q(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==O.call(t)}t.exports=function(object,path,t){var e=null==object?void 0:V(object,path);return void 0===e?t:e}}).call(this,n(13))},182:function(t,e,n){"use strict";n.r(e),n.d(e,"disableBodyScroll",(function(){return C})),n.d(e,"clearAllBodyScrollLocks",(function(){return x})),n.d(e,"enableBodyScroll",(function(){return T}));var r=!1;if("undefined"!=typeof window){var o={get passive(){r=!0}};window.addEventListener("testPassive",null,o),window.removeEventListener("testPassive",null,o)}var l="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),c=[],h=!1,d=-1,f=void 0,m=void 0,y=function(t){return c.some((function(e){return!(!e.options.allowTouchMove||!e.options.allowTouchMove(t))}))},v=function(t){var e=t||window.event;return!!y(e.target)||(e.touches.length>1||(e.preventDefault&&e.preventDefault(),!1))},w=function(){void 0!==m&&(document.body.style.paddingRight=m,m=void 0),void 0!==f&&(document.body.style.overflow=f,f=void 0)},C=function(t,e){if(t){if(!c.some((function(e){return e.targetElement===t}))){var n={targetElement:t,options:e||{}};c=[].concat(function(t){if(Array.isArray(t)){for(var i=0,e=Array(t.length);i0||function(t){return!!t&&t.scrollHeight-t.scrollTop<=t.clientHeight}(e)&&n<0?v(t):t.stopPropagation())}(e,t)},h||(document.addEventListener("touchmove",v,r?{passive:!1}:void 0),h=!0)):function(t){if(void 0===m){var e=!!t&&!0===t.reserveScrollBarGap,n=window.innerWidth-document.documentElement.clientWidth;e&&n>0&&(m=document.body.style.paddingRight,document.body.style.paddingRight=n+"px")}void 0===f&&(f=document.body.style.overflow,document.body.style.overflow="hidden")}(e)}}else console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")},x=function(){l?(c.forEach((function(t){t.targetElement.ontouchstart=null,t.targetElement.ontouchmove=null})),h&&(document.removeEventListener("touchmove",v,r?{passive:!1}:void 0),h=!1),d=-1):w(),c=[]},T=function(t){t?(c=c.filter((function(e){return e.targetElement!==t})),l?(t.ontouchstart=null,t.ontouchmove=null,h&&0===c.length&&(document.removeEventListener("touchmove",v,r?{passive:!1}:void 0),h=!1)):c.length||w()):console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.")}},183:function(t,e,n){(function(t,n){var r="__lodash_hash_undefined__",o=9007199254740991,l="[object Arguments]",c="[object Array]",h="[object Boolean]",d="[object Date]",f="[object Error]",m="[object Function]",y="[object Map]",v="[object Number]",w="[object Object]",C="[object Promise]",x="[object RegExp]",T="[object Set]",S="[object String]",k="[object Symbol]",E="[object WeakMap]",_="[object ArrayBuffer]",A="[object DataView]",O=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,I=/^\w*$/,D=/^\./,N=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,j=/\\(\\)?/g,P=/^\[object .+?Constructor\]$/,R=/^(?:0|[1-9]\d*)$/,L={};L["[object Float32Array]"]=L["[object Float64Array]"]=L["[object Int8Array]"]=L["[object Int16Array]"]=L["[object Int32Array]"]=L["[object Uint8Array]"]=L["[object Uint8ClampedArray]"]=L["[object Uint16Array]"]=L["[object Uint32Array]"]=!0,L[l]=L[c]=L[_]=L[h]=L[A]=L[d]=L[f]=L[m]=L[y]=L[v]=L[w]=L[x]=L[T]=L[S]=L[E]=!1;var $="object"==typeof t&&t&&t.Object===Object&&t,M="object"==typeof self&&self&&self.Object===Object&&self,F=$||M||Function("return this")(),B=e&&!e.nodeType&&e,V=B&&"object"==typeof n&&n&&!n.nodeType&&n,U=V&&V.exports===B&&$.process,H=function(){try{return U&&U.binding("util")}catch(t){}}(),W=H&&H.isTypedArray;function z(t,e){for(var n=-1,r=t?t.length:0,o=Array(r);++n-1},Dt.prototype.set=function(t,e){var data=this.__data__,n=Lt(data,t);return n<0?data.push([t,e]):data[n][1]=e,this},Nt.prototype.clear=function(){this.__data__={hash:new It,map:new(yt||Dt),string:new It}},Nt.prototype.delete=function(t){return Jt(this,t).delete(t)},Nt.prototype.get=function(t){return Jt(this,t).get(t)},Nt.prototype.has=function(t){return Jt(this,t).has(t)},Nt.prototype.set=function(t,e){return Jt(this,t).set(t,e),this},jt.prototype.add=jt.prototype.push=function(t){return this.__data__.set(t,r),this},jt.prototype.has=function(t){return this.__data__.has(t)},Pt.prototype.clear=function(){this.__data__=new Dt},Pt.prototype.delete=function(t){return this.__data__.delete(t)},Pt.prototype.get=function(t){return this.__data__.get(t)},Pt.prototype.has=function(t){return this.__data__.has(t)},Pt.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Dt){var r=n.__data__;if(!yt||r.length<199)return r.push([t,e]),this;n=this.__data__=new Nt(r)}return n.set(t,e),this};var $t,Mt,Ft=($t=function(object,t){return object&&Bt(object,t,ye)},function(t,e){if(null==t)return t;if(!ce(t))return $t(t,e);for(var n=t.length,r=Mt?n:-1,o=Object(t);(Mt?r--:++rh))return!1;var f=l.get(t);if(f&&l.get(e))return f==e;var m=-1,y=!0,v=1&o?new jt:void 0;for(l.set(t,e),l.set(e,t);++m-1&&t%1==0&&t-1&&t%1==0&&t<=o}function pe(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function fe(t){return!!t&&"object"==typeof t}function me(t){return"symbol"==typeof t||fe(t)&<.call(t)==k}var ge=W?function(t){return function(e){return t(e)}}(W):function(t){return fe(t)&&de(t.length)&&!!L[lt.call(t)]};function ye(object){return ce(object)?Rt(object):zt(object)}function ve(t){return t}n.exports=function(t,e){return(ue(t)?z:Kt)(t,Wt(e))}}).call(this,n(13),n(105)(t))},184:function(t,e,n){"use strict";e.a=function(t,e){return e=e||{},new Promise((function(n,r){var s=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(s.status/100|0),statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(t){return i[t.toLowerCase()]},has:function(t){return t.toLowerCase()in i}}}};for(var l in s.open(e.method||"get",t,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,n){o.push(e=e.toLowerCase()),u.push([e,n]),i[e]=i[e]?i[e]+","+n:n})),n(a())},s.onerror=r,s.withCredentials="include"==e.credentials,e.headers)s.setRequestHeader(l,e.headers[l]);s.send(e.body||null)}))}},186:function(t,e,n){"use strict";var r=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===o}(t)}(t)};var o="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function l(t,e){return!1!==e.clone&&e.isMergeableObject(t)?m((n=t,Array.isArray(n)?[]:{}),t,e):t;var n}function c(t,source,e){return t.concat(source).map((function(element){return l(element,e)}))}function h(t){return Object.keys(t).concat(function(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter((function(symbol){return t.propertyIsEnumerable(symbol)})):[]}(t))}function d(object,t){try{return t in object}catch(t){return!1}}function f(t,source,e){var n={};return e.isMergeableObject(t)&&h(t).forEach((function(r){n[r]=l(t[r],e)})),h(source).forEach((function(r){(function(t,e){return d(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))})(t,r)||(d(t,r)&&e.isMergeableObject(source[r])?n[r]=function(t,e){if(!e.customMerge)return m;var n=e.customMerge(t);return"function"==typeof n?n:m}(r,e)(t[r],source[r],e):n[r]=l(source[r],e))})),n}function m(t,source,e){(e=e||{}).arrayMerge=e.arrayMerge||c,e.isMergeableObject=e.isMergeableObject||r,e.cloneUnlessOtherwiseSpecified=l;var n=Array.isArray(source);return n===Array.isArray(t)?n?e.arrayMerge(t,source,e):f(t,source,e):l(source,e)}m.all=function(t,e){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce((function(t,n){return m(t,n,e)}),{})};var y=m;t.exports=y},187:function(t,e,n){"use strict";var r=n(4);n.d(e,"a",(function(){return r.f}));Object(r.g)("firebase","9.6.4","app")},188:function(t,e,n){!function(t){"use strict";function e(t){return Array.prototype.slice.call(t)}function n(t){return new Promise((function(e,n){t.onsuccess=function(){e(t.result)},t.onerror=function(){n(t.error)}}))}function r(t,e,r){var o,p=new Promise((function(l,c){n(o=t[e].apply(t,r)).then(l,c)}));return p.request=o,p}function o(t,e,n){var p=r(t,e,n);return p.then((function(t){if(t)return new m(t,p.request)}))}function l(t,e,n){n.forEach((function(n){Object.defineProperty(t.prototype,n,{get:function(){return this[e][n]},set:function(t){this[e][n]=t}})}))}function c(t,e,n,o){o.forEach((function(o){o in n.prototype&&(t.prototype[o]=function(){return r(this[e],o,arguments)})}))}function h(t,e,n,r){r.forEach((function(r){r in n.prototype&&(t.prototype[r]=function(){return this[e][r].apply(this[e],arguments)})}))}function d(t,e,n,r){r.forEach((function(r){r in n.prototype&&(t.prototype[r]=function(){return o(this[e],r,arguments)})}))}function f(t){this._index=t}function m(cursor,t){this._cursor=cursor,this._request=t}function y(t){this._store=t}function v(t){this._tx=t,this.complete=new Promise((function(e,n){t.oncomplete=function(){e()},t.onerror=function(){n(t.error)},t.onabort=function(){n(t.error)}}))}function w(t,e,n){this._db=t,this.oldVersion=e,this.transaction=new v(n)}function C(t){this._db=t}function x(t,e,n){var p=r(indexedDB,"open",[t,e]),o=p.request;return o&&(o.onupgradeneeded=function(t){n&&n(new w(o.result,t.oldVersion,o.transaction))}),p.then((function(t){return new C(t)}))}function T(t){return r(indexedDB,"deleteDatabase",[t])}l(f,"_index",["name","keyPath","multiEntry","unique"]),c(f,"_index",IDBIndex,["get","getKey","getAll","getAllKeys","count"]),d(f,"_index",IDBIndex,["openCursor","openKeyCursor"]),l(m,"_cursor",["direction","key","primaryKey","value"]),c(m,"_cursor",IDBCursor,["update","delete"]),["advance","continue","continuePrimaryKey"].forEach((function(t){t in IDBCursor.prototype&&(m.prototype[t]=function(){var cursor=this,e=arguments;return Promise.resolve().then((function(){return cursor._cursor[t].apply(cursor._cursor,e),n(cursor._request).then((function(t){if(t)return new m(t,cursor._request)}))}))})})),y.prototype.createIndex=function(){return new f(this._store.createIndex.apply(this._store,arguments))},y.prototype.index=function(){return new f(this._store.index.apply(this._store,arguments))},l(y,"_store",["name","keyPath","indexNames","autoIncrement"]),c(y,"_store",IDBObjectStore,["put","add","delete","clear","get","getAll","getKey","getAllKeys","count"]),d(y,"_store",IDBObjectStore,["openCursor","openKeyCursor"]),h(y,"_store",IDBObjectStore,["deleteIndex"]),v.prototype.objectStore=function(){return new y(this._tx.objectStore.apply(this._tx,arguments))},l(v,"_tx",["objectStoreNames","mode"]),h(v,"_tx",IDBTransaction,["abort"]),w.prototype.createObjectStore=function(){return new y(this._db.createObjectStore.apply(this._db,arguments))},l(w,"_db",["name","version","objectStoreNames"]),h(w,"_db",IDBDatabase,["deleteObjectStore","close"]),C.prototype.transaction=function(){return new v(this._db.transaction.apply(this._db,arguments))},l(C,"_db",["name","version","objectStoreNames"]),h(C,"_db",IDBDatabase,["close"]),["openCursor","openKeyCursor"].forEach((function(t){[y,f].forEach((function(n){t in n.prototype&&(n.prototype[t.replace("open","iterate")]=function(){var n=e(arguments),r=n[n.length-1],o=this._store||this._index,l=o[t].apply(o,n.slice(0,-1));l.onsuccess=function(){r(l.result)}})}))})),[f,y].forEach((function(t){t.prototype.getAll||(t.prototype.getAll=function(t,e){var n=this,r=[];return new Promise((function(o){n.iterateCursor(t,(function(cursor){cursor?(r.push(cursor.value),void 0===e||r.length!=e?cursor.continue():o(r)):o(r)}))}))})})),t.openDb=x,t.deleteDb=T,Object.defineProperty(t,"__esModule",{value:!0})}(e)},189:function(t,e,n){!function(t,e,n,r,map){"use strict";function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var l,c,h=o(e),d=o(n),f=o(map);function m(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,l){function c(t){try{d(r.next(t))}catch(t){l(t)}}function h(t){try{d(r.throw(t))}catch(t){l(t)}}function d(t){t.done?n(t.value):o(t.value).then(c,h)}d((r=r.apply(t,e||[])).next())}))}(function(t){t.Outside="outside",t.Close="close",t.Esc="esc",t.Cancel="cancel",t.Ok="ok",t.Method="method",t.Value="value"})(l||(l={})),function(t){t.Alert="alert",t.Confirm="confirm",t.Prompt="prompt"}(c||(c={}));const y=(t,e)=>{let a=t,b=e;return Array.isArray(t)&&t.every((t=>"string"==typeof t||!!t))&&(a=t.filter((t=>!!t)).join(" ")),Array.isArray(e)&&e.every((t=>"string"==typeof t||!!t))&&(b=e.filter((t=>!!t)).join(" ")),"string"==typeof a&&"string"==typeof b?`${a} ${b}`:"string"==typeof a&&Array.isArray(b)?[a].concat(b):"string"==typeof b&&Array.isArray(a)?a.concat([b]):Array.isArray(a)&&Array.isArray(b)?a.concat(b):[a,b]},v=h.default.extend({props:{classes:{type:[String,Array,Object],default:void 0},fixedClasses:{type:[String,Array,Object],default:void 0},variants:{type:Object,default:void 0},variant:{type:[String,Object],default:void 0}},computed:{componentClass(){return this.getElementCssClass()},activeVariant(){if(this.variant)return"object"==typeof this.variant?Object.keys(this.variant).find((t=>!!this.variant[t]))||void 0:this.variant}},methods:{getElementCssClass(t,e=""){let n;if(t){if(this.activeVariant){const r=d.default(this.variants,`${this.activeVariant}.${t}`);n=void 0===r&&void 0!==d.default(this.variants,this.activeVariant)?d.default(this.classes,t,e):void 0===r?e:r}else n=d.default(this.classes,t,e);const r=d.default(this.fixedClasses,t);return r?y(r,n):n}return n=this.activeVariant?d.default(this.variants,this.activeVariant,e):void 0===this.classes?e:this.classes,this.fixedClasses?y(this.fixedClasses,n):n}}});var w;!function(t){t[t.LEFT=37]="LEFT",t[t.UP=38]="UP",t[t.RIGHT=39]="RIGHT",t[t.DOWN=40]="DOWN",t[t.ENTER=13]="ENTER",t[t.ESC=27]="ESC",t[t.SPACE=32]="SPACE",t[t.BACKSPACE=8]="BACKSPACE"}(w||(w={}));var C=w;const x=(option,t)=>t?d.default(option,t):d.default(option,"value",d.default(option,"id",d.default(option,"text"))),T=(option,t)=>t?d.default(option,t):d.default(option,"text",d.default(option,"label")),S=(option,t,e)=>{if("string"==typeof option||"number"==typeof option||"boolean"==typeof option)return{value:option,text:option,raw:option};if(option.children){const n=option.children.map((t=>S(t)));return{value:x(option,e),text:T(option,t),children:n}}const n={value:x(option,e),text:T(option,t),raw:option};return void 0!==option.disabled&&(n.disabled=option.disabled),n},k=(t,e,n)=>t?Array.isArray(t)?t.map((option=>S(option,e,n))):f.default(t,((option,t)=>({value:t,text:option}))):[],E=()=>Math.random().toString(36).substring(7),_=h.default.extend({name:"TDialogOverlayWrapperTransitionDialogContentInput",props:{getElementCssClass:{type:Function,required:!0},inputAttributes:{type:Object,default:void 0},inputType:{type:String,required:!0},inputValue:{type:[String,Array],default:void 0},inputPlaceholder:{type:String,default:void 0},inputOptions:{type:[Array,Object],default:void 0}},data:()=>({errorMessage:null}),mounted(){this.inputHandler()},methods:{getInputValue(){const input=this.$refs.input;if(!input)return;const t=input.name;if("radio"===input.type){const e=this.$refs.inputWrapper.querySelector(`input[name="${t}"]:checked`);return e?e.value:null}if("checkbox"===input.type){if(this.inputOptions){const e=this.$refs.inputWrapper.querySelectorAll(`input[name="${t}"]:checked`);return Array.from(e).map((t=>t.value))}return input.checked?input.value:null}return input.value},inputHandler(){this.errorMessage=null;const t=this.getInputValue();this.$emit("input",t)}},render(t){let input;if("select"===this.inputType){const e=k(this.inputOptions||[]).map((option=>{const e=this.inputValue===option.value;return t("option",{domProps:{value:option.value,selected:e}},String(option.text))}));input=t("select",{class:this.getElementCssClass("select"),ref:"input",attrs:Object.assign({name:"input"},this.inputAttributes),on:{change:this.inputHandler}},e)}else if("radio"===this.inputType)input=k(this.inputOptions||[]).map((option=>{const e=this.inputValue===option.value;return t("label",{class:this.getElementCssClass("radioWrapper"),attrs:{for:`input-${String(option.value)}`}},[t("input",{class:this.getElementCssClass("radio"),ref:"input",attrs:Object.assign({type:"radio",name:"input",id:`input-${String(option.value)}`,value:option.value,checked:e},this.inputAttributes),on:{change:this.inputHandler}}),t("span",{class:this.getElementCssClass("radioText")},String(option.text))])}));else if("checkbox"===this.inputType)if(this.inputOptions)input=k(this.inputOptions||[]).map((option=>{const e=Array.isArray(this.inputValue)?this.inputValue.includes(option.value):this.inputValue===option.value;return t("label",{class:this.getElementCssClass("checkboxWrapper"),attrs:{for:`input-${String(option.value)}`}},[t("input",{class:this.getElementCssClass("checkbox"),ref:"input",attrs:Object.assign({type:"checkbox",name:"input[]",id:`input-${String(option.value)}`,value:option.value,checked:e},this.inputAttributes),on:{change:this.inputHandler}}),t("span",{class:this.getElementCssClass("checkboxText")},String(option.text))])}));else{const e=E();input=t("label",{class:this.getElementCssClass("checkboxWrapper"),attrs:{for:`input-${e}`}},[t("input",{class:this.getElementCssClass("checkbox"),ref:"input",attrs:Object.assign({type:"checkbox",name:"input",id:`input-${e}`,value:this.inputValue},this.inputAttributes),on:{change:this.inputHandler}}),t("span",{class:this.getElementCssClass("checkboxText")},this.inputPlaceholder?String(this.inputPlaceholder):"")])}else input=t("input",{class:this.getElementCssClass("input"),ref:"input",domProps:{value:this.inputValue},attrs:Object.assign({name:"input",type:this.inputType,placeholder:this.inputPlaceholder},this.inputAttributes),on:{input:this.inputHandler}});return t("div",{ref:"inputWrapper",class:this.getElementCssClass("inputWrapper")},Array.isArray(input)?input:[input])}}),A=h.default.extend({name:"TDialogOverlayWrapperTransitionDialogContent",props:{getElementCssClass:{type:Function,required:!0},titleTag:{type:String,required:!0},title:{type:String,default:void 0},textTag:{type:String,required:!0},text:{type:String,default:void 0},type:{type:String,required:!0},inputAttributes:{type:Object,default:void 0},inputType:{type:String,required:!0},inputValue:{type:[String,Array],default:void 0},inputPlaceholder:{type:String,default:void 0},inputOptions:{type:[Array,Object],default:void 0},errorMessage:{type:String,required:!0}},render(t){const e=[];return(this.title||this.$scopedSlots.title)&&(this.$scopedSlots.title?e.push(t("div",{class:this.getElementCssClass("titleWrapper")},[this.$scopedSlots.title({class:this.getElementCssClass("title")})])):e.push(t("div",{class:this.getElementCssClass("titleWrapper")},[t(this.titleTag,{class:this.getElementCssClass("title")},this.title||"")]))),this.$slots.default?e.push(t("div",{class:this.getElementCssClass("textWrapper")},this.$slots.default)):this.text&&e.push(t("div",{class:this.getElementCssClass("textWrapper")},this.text?[t(this.textTag,{class:this.getElementCssClass("text")},this.text)]:void 0)),this.type===c.Prompt&&e.push(t(_,{props:{getElementCssClass:this.getElementCssClass,inputAttributes:this.inputAttributes,inputType:this.inputType,inputValue:this.inputValue,inputOptions:this.inputOptions,inputPlaceholder:this.inputPlaceholder},on:{input:t=>this.$emit("input",t)}})),this.errorMessage&&"string"==typeof this.errorMessage&&e.push(t("div",{class:this.getElementCssClass("errorMessage")},this.errorMessage)),t("div",{class:this.getElementCssClass("content")},e)}});var O;function I(t){if(!t)return;const e={};return e[O.Success]='',e[O.Error]='',e[O.Warning]='',e[O.Info]='',e[O.Question]='',e[t]}!function(t){t.Success="success",t.Error="error",t.Warning="warning",t.Info="info",t.Question="question"}(O||(O={}));const D=h.default.extend({name:"TDialogOverlayWrapperTransitionDialogIcon",props:{getElementCssClass:{type:Function,required:!0},icon:{type:String,default:void 0}},render(t){if(this.$scopedSlots.icon)return t("div",{class:this.getElementCssClass("iconWrapper")},[this.$scopedSlots.icon({})]);const e=I(this.icon);return e?t("div",{class:this.getElementCssClass("iconWrapper")},[t("svg",{class:this.getElementCssClass("icon"),attrs:{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},domProps:{innerHTML:e}})]):t()}}),N=h.default.extend({name:"TDialogOverlayWrapperTransitionDialogClose",props:{getElementCssClass:{type:Function,required:!0},showCloseButton:{type:Boolean,required:!0}},render(t){return this.showCloseButton?this.$scopedSlots.closeButton?t("button",{class:this.getElementCssClass("close"),attrs:{type:"button"},on:{click:t=>this.$emit("dismiss",t)}},[this.$scopedSlots.closeButton({})]):t("button",{class:this.getElementCssClass("close"),attrs:{type:"button"},on:{click:t=>this.$emit("dismiss",t)}},[t("svg",{attrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},class:this.getElementCssClass("closeIcon")},[t("path",{attrs:{"clip-rule":"evenodd","fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"}})])]):t()}}),j=h.default.extend({name:"TDialogOverlayWrapperTransitionDialogLoader",props:{getElementCssClass:{type:Function,required:!0},busy:{type:Boolean,required:!0}},render(t){return this.busy?this.$scopedSlots.loader?t("div",{class:this.getElementCssClass("busyWrapper")},[this.$scopedSlots.loader({})]):t("div",{class:this.getElementCssClass("busyWrapper")},[t("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:32,height:32,viewBox:"0 0 32 32"},class:this.getElementCssClass("busyIcon")},[t("g",{attrs:{transform:"scale(0.03125 0.03125)"}},[t("path",{attrs:{d:"M512 1024c-136.76 0-265.334-53.258-362.040-149.96-96.702-96.706-149.96-225.28-149.96-362.040 0-96.838 27.182-191.134 78.606-272.692 50-79.296 120.664-143.372 204.356-185.3l43 85.832c-68.038 34.084-125.492 86.186-166.15 150.67-41.746 66.208-63.812 142.798-63.812 221.49 0 229.382 186.618 416 416 416s416-186.618 416-416c0-78.692-22.066-155.282-63.81-221.49-40.66-64.484-98.114-116.584-166.15-150.67l43-85.832c83.692 41.928 154.358 106.004 204.356 185.3 51.422 81.558 78.604 175.854 78.604 272.692 0 136.76-53.258 265.334-149.96 362.040-96.706 96.702-225.28 149.96-362.040 149.96z"}})])])]):t()}}),P=h.default.extend({name:"TDialogOverlayWrapperTransitionDialogButtons",props:{getElementCssClass:{type:Function,required:!0},cancelButtonText:{type:String,required:!0},cancelButtonAriaLabel:{type:String,default:void 0},okButtonText:{type:String,required:!0},okButtonAriaLabel:{type:String,default:void 0},type:{type:String,required:!0}},methods:{cancel(t){this.$emit("cancel",t)},ok(t){this.$emit("submit",t)}},render(t){const e=this.type;if(this.$scopedSlots.buttons)return t("div",{class:this.getElementCssClass("buttons")},[this.$scopedSlots.buttons({cancelButtonAriaLabel:this.cancelButtonAriaLabel,okButtonAriaLabel:this.okButtonAriaLabel,cancelButtonText:this.cancelButtonText,okButtonText:this.okButtonText,okButtonClass:this.getElementCssClass("okButton"),cancelButtonClass:this.getElementCssClass("cancelButton"),dialogType:e,cancel:this.cancel,ok:this.ok})]);const n=[],r={cancel:t("button",{attrs:{type:"button","aria-label":this.cancelButtonAriaLabel},class:this.getElementCssClass("cancelButton"),on:{click:this.cancel}},this.cancelButtonText),ok:t("button",{attrs:{type:"button","aria-label":this.okButtonAriaLabel},class:this.getElementCssClass("okButton"),on:{click:this.ok}},this.okButtonText)};return e===c.Alert?n.push(r.ok):e!==c.Confirm&&e!==c.Prompt||(n.push(r.cancel),n.push(r.ok)),t("div",{class:this.getElementCssClass("buttons")},n)}}),R=h.default.extend({name:"TDialogOverlayWrapperTransitionDialog",props:{getElementCssClass:{type:Function,required:!0},dialogShow:{type:Boolean,required:!0},titleTag:{type:String,required:!0},title:{type:String,default:void 0},icon:{type:String,default:void 0},textTag:{type:String,required:!0},text:{type:String,default:void 0},cancelButtonText:{type:String,required:!0},cancelButtonAriaLabel:{type:String,default:void 0},okButtonText:{type:String,required:!0},okButtonAriaLabel:{type:String,default:void 0},showCloseButton:{type:Boolean,required:!0},preConfirm:{type:Function,default:void 0},inputAttributes:{type:Object,default:void 0},inputType:{type:String,required:!0},inputValidator:{type:Function,default:void 0},inputValue:{type:[String,Array],default:void 0},inputOptions:{type:[Array,Object],default:void 0},inputPlaceholder:{type:String,default:void 0},type:{type:String,required:!0}},data:()=>({currentValue:null,errorMessage:"",busy:!1}),methods:{submitHandler(t){return this.resolveParam(this.inputValidator,this.currentValue).then((e=>{e&&"string"==typeof e?this.errorMessage=String(e):this.resolveParam(this.preConfirm,this.currentValue).then((e=>{this.$emit("submit",t,this.currentValue,e)})).catch((e=>{this.$emit("submit-error",t,this.currentValue,e)})).then((()=>{this.busy=!1}))})).catch((t=>{this.errorMessage=String(t)}))},inputHandler(input){this.errorMessage="",this.currentValue=input},resolveParam(t,input){if("function"==typeof t){const e=t(input);return e instanceof Promise?(this.busy=!0,e):new Promise((t=>{t(e)}))}return new Promise((t=>t()))}},render(t){return this.dialogShow?t("div",{ref:"dialog",class:this.getElementCssClass("dialog")},[t(j,{props:{getElementCssClass:this.getElementCssClass,busy:this.busy},scopedSlots:{loader:this.$scopedSlots.loader}}),t(N,{props:{getElementCssClass:this.getElementCssClass,showCloseButton:this.showCloseButton},on:{dismiss:t=>this.$emit("dismiss",t)},scopedSlots:{closeButton:this.$scopedSlots.closeButton}}),t("div",{ref:"body",class:this.getElementCssClass("body")},[t(D,{props:{getElementCssClass:this.getElementCssClass,icon:this.icon},scopedSlots:{icon:this.$scopedSlots.icon}}),t(A,{props:{getElementCssClass:this.getElementCssClass,titleTag:this.titleTag,title:this.title,textTag:this.textTag,text:this.text,type:this.type,inputAttributes:this.inputAttributes,inputType:this.inputType,inputValue:this.inputValue,inputOptions:this.inputOptions,inputPlaceholder:this.inputPlaceholder,errorMessage:this.errorMessage},on:{input:this.inputHandler},scopedSlots:{title:this.$scopedSlots.title}},this.$slots.default)]),t(P,{props:{getElementCssClass:this.getElementCssClass,type:this.type,cancelButtonText:this.cancelButtonText,cancelButtonAriaLabel:this.cancelButtonAriaLabel,okButtonText:this.okButtonText,okButtonAriaLabel:this.okButtonAriaLabel},on:{cancel:t=>this.$emit("cancel",t),submit:this.submitHandler},scopedSlots:{buttons:this.$scopedSlots.buttons}})]):t()}}),L=h.default.extend({name:"TDialogOverlayWrapperTransition",props:{getElementCssClass:{type:Function,required:!0},dialogShow:{type:Boolean,required:!0},titleTag:{type:String,required:!0},title:{type:String,default:void 0},icon:{type:String,default:void 0},textTag:{type:String,required:!0},text:{type:String,default:void 0},cancelButtonText:{type:String,required:!0},cancelButtonAriaLabel:{type:String,default:void 0},okButtonText:{type:String,required:!0},okButtonAriaLabel:{type:String,default:void 0},showCloseButton:{type:Boolean,required:!0},preConfirm:{type:Function,default:void 0},inputAttributes:{type:Object,default:void 0},inputType:{type:String,required:!0},inputValidator:{type:Function,default:void 0},inputValue:{type:[String,Array],default:void 0},inputOptions:{type:[Array,Object],default:void 0},inputPlaceholder:{type:String,default:void 0},type:{type:String,required:!0}},render(t){return t("transition",{props:{enterClass:this.getElementCssClass("enterClass"),enterActiveClass:this.getElementCssClass("enterActiveClass"),enterToClass:this.getElementCssClass("enterToClass"),leaveClass:this.getElementCssClass("leaveClass"),leaveActiveClass:this.getElementCssClass("leaveActiveClass"),leaveToClass:this.getElementCssClass("leaveToClass")}},[t(R,{props:{getElementCssClass:this.getElementCssClass,dialogShow:this.dialogShow,titleTag:this.titleTag,title:this.title,icon:this.icon,textTag:this.textTag,text:this.text,cancelButtonText:this.cancelButtonText,cancelButtonAriaLabel:this.cancelButtonAriaLabel,okButtonText:this.okButtonText,okButtonAriaLabel:this.okButtonAriaLabel,showCloseButton:this.showCloseButton,preConfirm:this.preConfirm,inputAttributes:this.inputAttributes,inputType:this.inputType,inputValidator:this.inputValidator,inputValue:this.inputValue,inputOptions:this.inputOptions,inputPlaceholder:this.inputPlaceholder,type:this.type},scopedSlots:this.$scopedSlots,on:{dismiss:t=>this.$emit("dismiss",t),cancel:t=>this.$emit("cancel",t),submit:(t,input,e)=>this.$emit("submit",t,input,e),"submit-error":(t,input,e)=>this.$emit("submit-error",t,input,e)}},this.$slots.default)])}}),$=h.default.extend({name:"TDialogOverlayWrapper",props:{getElementCssClass:{type:Function,required:!0},dialogShow:{type:Boolean,required:!0},titleTag:{type:String,required:!0},title:{type:String,default:void 0},icon:{type:String,default:void 0},textTag:{type:String,required:!0},text:{type:String,default:void 0},cancelButtonText:{type:String,required:!0},cancelButtonAriaLabel:{type:String,default:void 0},okButtonText:{type:String,required:!0},okButtonAriaLabel:{type:String,default:void 0},showCloseButton:{type:Boolean,required:!0},preConfirm:{type:Function,default:void 0},inputAttributes:{type:Object,default:void 0},inputType:{type:String,required:!0},inputValidator:{type:Function,default:void 0},inputValue:{type:[String,Array],default:void 0},inputOptions:{type:[Array,Object],default:void 0},inputPlaceholder:{type:String,default:void 0},type:{type:String,required:!0}},render(t){return t("div",{ref:"wrapper",class:this.getElementCssClass("wrapper")},[t(L,{props:{type:this.type,dialogShow:this.dialogShow,getElementCssClass:this.getElementCssClass,titleTag:this.titleTag,title:this.title,icon:this.icon,textTag:this.textTag,text:this.text,cancelButtonText:this.cancelButtonText,cancelButtonAriaLabel:this.cancelButtonAriaLabel,okButtonText:this.okButtonText,okButtonAriaLabel:this.okButtonAriaLabel,showCloseButton:this.showCloseButton,preConfirm:this.preConfirm,inputAttributes:this.inputAttributes,inputType:this.inputType,inputValidator:this.inputValidator,inputValue:this.inputValue,inputOptions:this.inputOptions,inputPlaceholder:this.inputPlaceholder},scopedSlots:this.$scopedSlots,on:{dismiss:t=>this.$emit("dismiss",t),cancel:t=>this.$emit("cancel",t),submit:(t,input,e)=>this.$emit("submit",t,input,e),"submit-error":(t,input,e)=>this.$emit("submit-error",t,input,e)}},this.$slots.default)])}}),M=h.default.extend({name:"TDialogOverlay",props:{getElementCssClass:{type:Function,required:!0},overlayShow:{type:Boolean,required:!0},dialogShow:{type:Boolean,required:!0},titleTag:{type:String,required:!0},title:{type:String,default:void 0},textTag:{type:String,required:!0},text:{type:String,default:void 0},icon:{type:String,default:void 0},cancelButtonText:{type:String,required:!0},cancelButtonAriaLabel:{type:String,default:void 0},okButtonText:{type:String,required:!0},okButtonAriaLabel:{type:String,default:void 0},showCloseButton:{type:Boolean,required:!0},preConfirm:{type:Function,default:void 0},inputAttributes:{type:Object,default:void 0},inputType:{type:String,required:!0},inputValidator:{type:Function,default:void 0},inputValue:{type:[String,Array],default:void 0},inputOptions:{type:[Array,Object],default:void 0},inputPlaceholder:{type:String,default:void 0},type:{type:String,default:null}},methods:{clickHandler(t){t.target===this.$el&&this.$emit("outside-click",t)},keyupHandler(t){this.$emit("keyup",t)},focus(){const t=this.$el;t&&t.focus&&t.focus()},enableBodyScroll(){const t=this.$el;r.enableBodyScroll(t)},disableBodyScroll(){const t=this.$el;r.disableBodyScroll(t,{reserveScrollBarGap:!0})}},render(t){return this.overlayShow?t("div",{attrs:{tabindex:0},class:this.getElementCssClass("overlay"),on:{keyup:this.keyupHandler,click:this.clickHandler}},[t($,{props:{type:this.type,getElementCssClass:this.getElementCssClass,dialogShow:this.dialogShow,titleTag:this.titleTag,title:this.title,icon:this.icon,textTag:this.textTag,text:this.text,cancelButtonText:this.cancelButtonText,cancelButtonAriaLabel:this.cancelButtonAriaLabel,okButtonText:this.okButtonText,okButtonAriaLabel:this.okButtonAriaLabel,showCloseButton:this.showCloseButton,preConfirm:this.preConfirm,inputAttributes:this.inputAttributes,inputType:this.inputType,inputValidator:this.inputValidator,inputValue:this.inputValue,inputOptions:this.inputOptions,inputPlaceholder:this.inputPlaceholder},scopedSlots:this.$scopedSlots,on:{dismiss:t=>this.$emit("dismiss",t),cancel:t=>this.$emit("cancel",t),submit:(t,input,e)=>this.$emit("submit",t,input,e),"submit-error":(t,input,e)=>this.$emit("submit-error",t,input,e)}},this.$slots.default)]):t()}}),F=t=>({overlayShow:t.value,dialogShow:t.value,params:void 0,preventAction:!1,hideReason:void 0,input:void 0,resolve:null,reject:null,preConfirmResponse:void 0,preConfirmError:void 0}),B=v.extend({name:"TDialog",props:{value:{type:Boolean,default:!1},name:{type:String,default:void 0},titleTag:{type:String,default:"h3"},title:{type:String,default:void 0},icon:{type:String,default:void 0},textTag:{type:String,default:"p"},text:{type:String,default:void 0},clickToClose:{type:Boolean,default:!0},escToClose:{type:Boolean,default:!0},cancelButtonText:{type:String,default:"Cancel"},cancelButtonAriaLabel:{type:String,default:void 0},okButtonText:{type:String,default:"OK"},okButtonAriaLabel:{type:String,default:void 0},showCloseButton:{type:Boolean,default:!1},disableBodyScroll:{type:Boolean,default:!0},focusOnOpen:{type:Boolean,default:!0},preConfirm:{type:Function,default:void 0},inputAttributes:{type:Object,default:void 0},inputType:{type:String,default:"text"},inputValidator:{type:Function,default:void 0},inputValue:{type:[String,Array],default:void 0},inputOptions:{type:[Array,Object],default:void 0},inputPlaceholder:{type:String,default:void 0},type:{type:String,default:c.Alert},fixedClasses:{type:Object,default:()=>({overlay:"overflow-auto scrolling-touch left-0 top-0 bottom-0 right-0 w-full h-full fixed",wrapper:"relative mx-auto",modal:"overflow-visible relative ",close:"flex items-center justify-center",dialog:"overflow-visible relative"})},classes:{type:Object,default:()=>({close:"bg-gray-100 text-gray-600 rounded-full absolute right-0 top-0 -m-3 h-8 w-8 transition duration-100 ease-in-out hover:bg-gray-200 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50",closeIcon:"fill-current h-4 w-4",overlay:"z-40 bg-black bg-opacity-50",wrapper:"z-50 max-w-lg px-3 py-12",dialog:"bg-white shadow rounded text-left",body:"p-3 space-y-3",buttons:"p-3 flex space-x-4 justify-center bg-gray-100 rounded-b",iconWrapper:"bg-gray-100 flex flex-shrink-0 h-12 items-center justify-center rounded-full w-12 mx-auto",icon:"w-6 h-6 text-gray-500",content:"w-full flex justify-center flex-col",titleWrapper:"",title:"text-lg font-semibold text-center",textWrapper:"text-left w-full",text:"",cancelButton:"block px-4 py-2 transition duration-100 ease-in-out bg-white border border-gray-300 rounded shadow-sm hover:bg-gray-100 focus:border-gray-100 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed w-full max-w-xs",okButton:"block px-4 py-2 text-white transition duration-100 ease-in-out bg-blue-500 border border-transparent rounded shadow-sm hover:bg-blue-600 focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed w-full max-w-xs",inputWrapper:"mt-3 flex items-center space-x-3",input:"block w-full px-3 py-2 text-black placeholder-gray-400 transition duration-100 ease-in-out bg-white border border-gray-300 rounded shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed w-full",select:"block w-full px-3 py-2 text-black placeholder-gray-400 transition duration-100 ease-in-out bg-white border border-gray-300 rounded shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed w-full",radioWrapper:"flex items-center space-x-2",radio:"text-blue-500 transition duration-100 ease-in-out border-gray-300 shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 focus:ring-offset-0 disabled:opacity-50 disabled:cursor-not-allowed",radioText:"",checkboxWrapper:"flex items-center space-x-2",checkbox:"text-blue-500 transition duration-100 ease-in-out border-gray-300 rounded shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 focus:ring-offset-0 disabled:opacity-50 disabled:cursor-not-allowed",checkboxText:"",errorMessage:"text-red-500 block text-sm",busyWrapper:"absolute bg-opacity-50 bg-white flex h-full items-center justify-center left-0 top-0 w-full",busyIcon:"animate-spin h-6 w-6 fill-current text-gray-500",overlayEnterClass:"opacity-0",overlayEnterActiveClass:"transition ease-out duration-100",overlayEnterToClass:"opacity-100",overlayLeaveClass:"opacity-100",overlayLeaveActiveClass:"transition ease-in duration-75",overlayLeaveToClass:"opacity-0",enterClass:"",enterActiveClass:"",enterToClass:"",leaveClass:"",leaveActiveClass:"",leaveToClass:""})}},data(){return F(this)},watch:{value(t){t?this.show():(this.hideReason=l.Value,this.close())},overlayShow(t){return m(this,void 0,void 0,(function*(){t?(this.$emit("input",t),this.$emit("change",t),yield this.$nextTick(),this.dialogShow=!0):this.closed()}))},dialogShow(t){return m(this,void 0,void 0,(function*(){t?this.opened():(this.$emit("input",t),this.$emit("change",t),yield this.$nextTick(),this.overlayShow=!1)}))}},beforeDestroy(){const t=this.getOverlay();this.disableBodyScroll&&t&&(t.focus(),t.enableBodyScroll())},created(){this.name&&(this.$dialog.$on(`show-${this.name}`,((t,e,n)=>{this.resolve=t,this.reject=e,this.show(n)})),this.$dialog.$on(`hide-${this.name}`,(()=>{this.hideReason=l.Method,this.close()})))},render(t){return t("transition",{props:{enterClass:this.getElementCssClass("overlayEnterClass"),enterActiveClass:this.getElementCssClass("overlayEnterActiveClass"),enterToClass:this.getElementCssClass("overlayEnterToClass"),leaveClass:this.getElementCssClass("overlayLeaveClass"),leaveActiveClass:this.getElementCssClass("overlayLeaveActiveClass"),leaveToClass:this.getElementCssClass("overlayLeaveToClass")}},[t(M,{ref:"overlay",props:{type:this.type,overlayShow:this.overlayShow,dialogShow:this.dialogShow,titleTag:this.titleTag,title:this.title,icon:this.icon,textTag:this.textTag,text:this.text,cancelButtonText:this.cancelButtonText,cancelButtonAriaLabel:this.cancelButtonAriaLabel,okButtonText:this.okButtonText,okButtonAriaLabel:this.okButtonAriaLabel,showCloseButton:this.showCloseButton,preConfirm:this.preConfirm,inputAttributes:this.inputAttributes,inputType:this.inputType,inputValidator:this.inputValidator,inputValue:this.inputValue,inputOptions:this.inputOptions,inputPlaceholder:this.inputPlaceholder,getElementCssClass:this.getElementCssClass},scopedSlots:this.$scopedSlots,on:{"outside-click":this.outsideClick,keyup:this.keyupHandler,dismiss:t=>this.dismiss(t),cancel:t=>this.cancel(t),submit:(t,input,e)=>this.submit(t,input,e),"submit-error":(t,input,e)=>this.submitError(t,input,e)}},this.$slots.default)])},methods:{getOverlay(){return this.$refs.overlay},keyupHandler(t){t.keyCode===C.ESC&&this.escToClose&&this.esc(t)},beforeOpen(){this.$emit("before-open",{params:this.params,cancel:this.closeCancel})},opened(){this.$emit("opened",{params:this.params}),this.prepareDomForDialog()},beforeClose(t){if(this.disableBodyScroll){const t=this.getOverlay();t&&(t.focus(),t.enableBodyScroll())}const e={cancel:this.closeCancel,event:t,reason:this.hideReason};void 0!==this.input&&(e.input=this.input),void 0!==this.preConfirmResponse&&(e.response=this.preConfirmResponse),this.$emit("before-close",e)},closed(){const t={hideReason:this.hideReason,isOk:this.hideReason===l.Ok,isCancel:this.hideReason===l.Cancel,isDismissed:"string"==typeof this.hideReason&&[l.Close,l.Esc,l.Outside].includes(this.hideReason)};this.type===c.Prompt&&this.hideReason===l.Ok&&void 0!==this.input&&(t.input=this.input),void 0!==this.preConfirmResponse?t.response=this.preConfirmResponse:void 0!==this.preConfirmError&&(t.response=this.preConfirmError),this.$emit("closed",t),this.reject&&void 0!==this.preConfirmError?this.reject(this.preConfirmError):this.resolve&&this.resolve(t),this.reset()},prepareDomForDialog(){const t=this.getOverlay();t&&(this.disableBodyScroll&&t.disableBodyScroll(),this.focusOnOpen&&t.focus())},dismiss(t){this.hideReason=l.Close,this.close(t)},esc(t){this.hideReason=l.Esc,this.close(t)},cancel(t){this.hideReason=l.Cancel,this.close(t)},hide(t){this.hideReason=l.Method,this.close(t)},submit(t,input,e){this.hideReason=l.Ok,this.input=input,this.preConfirmResponse=e,this.close(t)},submitError(t,input,e){this.hideReason=l.Ok,this.input=input,this.preConfirmError=e,this.close(t)},close(t){this.beforeClose(t),this.preventAction?this.preventAction=!1:this.dialogShow=!1},show(t){this.params=t,this.beforeOpen(),this.preventAction?this.preventAction=!1:this.overlayShow=!0},closeCancel(){this.preventAction=!0},reset(){Object.assign(this.$data,F(this))},outsideClick(t){this.clickToClose&&(this.hideReason=l.Outside,this.close(t))}}}),V=(t,e,n,text,r)=>{const{props:o}=B.options,l=Object.assign({type:t},e);let c="body";return n&&("object"==typeof n?(Object.keys(o).forEach((t=>{if(t in n){const e=d.default(o,`${t}.default`);l[t]=d.default(n,t,e)}})),n.target&&(c=n.target)):"string"==typeof n&&(l.title=n,void 0!==text&&(l.text=text),void 0!==r&&(l.icon=r))),{propsData:l,target:c}},U=(t,e)=>{const n=document.querySelector(t);if(!n)throw new Error("Target not found!");const r=new B({propsData:e});return r.$mount(),n.appendChild(r.$el),r.show(),new Promise(((t,e)=>{r.resolve=t,r.reject=e}))},H=(t,e)=>{h.default.prototype.$dialog||(t.prototype.$dialog=new h.default({methods:{alert(t,text,n){const{propsData:r,target:o}=V(c.Alert,e,t,text,n);return U(o,r)},confirm(t,text,n){const{propsData:r,target:o}=V(c.Confirm,e,t,text,n);return U(o,r)},prompt(t,text,n){const{propsData:r,target:o}=V(c.Prompt,e,t,text,n);return U(o,r)},show(t,e){return new Promise(((n,r)=>{this.$emit(`show-${t}`,n,r,e)}))},hide(t){this.$emit(`hide-${t}`)}}})),t.prototype.$alert||(t.prototype.$alert=t.prototype.$dialog.alert,t.prototype.$confirm=t.prototype.$dialog.confirm,t.prototype.$prompt=t.prototype.$dialog.prompt)},W=(component,t)=>{var e,n;const r=null===(e=null==component?void 0:component.options)||void 0===e?void 0:e.props,o=null===(n=null==component?void 0:component.options)||void 0===n?void 0:n.name;if("TModal"===o?h.default.prototype.$modal=new h.default({methods:{show(t,e){this.$emit(`show-${t}`,e)},hide(t){this.$emit(`hide-${t}`)}}}):"TDialog"===o&&H(h.default,t),!t||!r)return component;const l={};return Object.keys(t).forEach((e=>{const n=r[e];if(!n)return;const o=t[e];l[e]={type:null==n?void 0:n.type,default:["object","function"].includes(typeof o)?()=>o:o}})),component.extend({props:l})},z=function(t,e){z.installed||(z.installed=!0,t.prototype.$vueTailwind=!0,e&&Object.keys(e).forEach((n=>{const r=e[n];if("function"==typeof r&&void 0!==typeof r.extend){const component=r;return void t.component(n,W(component))}const{component:component,props:o}=r;t.component(n,W(component,o))})))},K={install:z};t.BaseComponent=v,t.default=K,Object.defineProperty(t,"__esModule",{value:!0})}(e,n(2),n(181),n(182),n(183))},190:function(t,e,n){!function(t,e,n,r,map,o,l,c,h,d,f,m){"use strict";function y(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var v=y(e),w=y(n),C=y(r),x=y(map),T=y(o),S=y(l),k=y(h),E=y(d),_=y(f),A=y(m);const O=(t,e)=>{let a=t,b=e;return Array.isArray(t)&&t.every((t=>"string"==typeof t||!!t))&&(a=t.filter((t=>!!t)).join(" ")),Array.isArray(e)&&e.every((t=>"string"==typeof t||!!t))&&(b=e.filter((t=>!!t)).join(" ")),"string"==typeof a&&"string"==typeof b?`${a} ${b}`:"string"==typeof a&&Array.isArray(b)?[a].concat(b):"string"==typeof b&&Array.isArray(a)?a.concat([b]):Array.isArray(a)&&Array.isArray(b)?a.concat(b):[a,b]},I=v.default.extend({props:{classes:{type:[String,Array,Object],default:void 0},fixedClasses:{type:[String,Array,Object],default:void 0},variants:{type:Object,default:void 0},variant:{type:[String,Object],default:void 0}},computed:{componentClass(){return this.getElementCssClass()},activeVariant(){if(this.variant)return"object"==typeof this.variant?Object.keys(this.variant).find((t=>!!this.variant[t]))||void 0:this.variant}},methods:{getElementCssClass(t,e=""){let n;if(t){if(this.activeVariant){const r=w.default(this.variants,`${this.activeVariant}.${t}`);n=void 0===r&&void 0!==w.default(this.variants,this.activeVariant)?w.default(this.classes,t,e):void 0===r?e:r}else n=w.default(this.classes,t,e);const r=w.default(this.fixedClasses,t);return r?O(r,n):n}return n=this.activeVariant?w.default(this.variants,this.activeVariant,e):void 0===this.classes?e:this.classes,this.fixedClasses?O(this.fixedClasses,n):n}}}),D=I.extend({props:{id:{type:String,default:void 0},name:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},readonly:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},required:{type:Boolean,default:void 0},tabindex:{type:[String,Number],default:void 0}},methods:{getListeners(t){return Object.assign(Object.assign({},this.$listeners),t)}}});var N;!function(t){t[t.LEFT=37]="LEFT",t[t.UP=38]="UP",t[t.RIGHT=39]="RIGHT",t[t.DOWN=40]="DOWN",t[t.ENTER=13]="ENTER",t[t.ESC=27]="ESC",t[t.SPACE=32]="SPACE",t[t.BACKSPACE=8]="BACKSPACE"}(N||(N={}));var j=N;const P=D.extend({name:"TCheckbox",props:{value:{type:[String,Object,Number,Boolean,Array],default:!0},uncheckedValue:{type:[String,Object,Number,Boolean,Array],default:!1},indeterminate:{type:[Boolean,String],default:void 0},checked:{type:[Boolean,String],default:void 0},model:{type:[String,Object,Number,Boolean,Array],default:void 0},wrapped:{type:Boolean,default:!1},wrapperTag:{type:String,default:"label"},inputWrapperTag:{type:String,default:"span"},labelTag:{type:String,default:"span"},label:{type:[String,Number],default:void 0},classes:{type:[String,Array,Object],default:"text-blue-500 transition duration-100 ease-in-out border-gray-300 rounded shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50 focus:ring-offset-0 disabled:opacity-50 disabled:cursor-not-allowed"}},data(){return{localValue:this.model}},model:{prop:"model",event:"input"},render(t){const e=this.render,n=this.renderWrapped;return this.wrapped?n(t):e(t)},computed:{isChecked:{get(){return void 0===this.model?this.checked:Array.isArray(this.model)?this.model.indexOf(this.value)>=0:this.model===this.value},set(t){this.localValue=t}}},watch:{isChecked(t){const input=this.getInput();input.checked!==t&&(input.checked=t)},indeterminate(t){this.setIndeterminate(t)},checked(t){this.setChecked(t)}},methods:{getInput(){return this.$refs.input},renderWrapped(t){const e=[],input=this.render(t),n=this.getElementCssClass("inputWrapper"),r=this.getElementCssClass("inputWrapperChecked",this.getElementCssClass("inputWrapper"));e.push(t(this.inputWrapperTag,{ref:"inputWrapper",class:this.isChecked?r:n},[input]));const o=this.getElementCssClass("label"),l=this.getElementCssClass("labelChecked",this.getElementCssClass("label"));let label;label=void 0!==this.$scopedSlots.default?this.$scopedSlots.default({isChecked:this.isChecked,value:this.isChecked?this.value:this.uncheckedValue,label:this.label}):"number"==typeof this.label?String(this.label):this.label,e.push(t(this.labelTag,{ref:"label",class:this.isChecked?l:o},label));const c=this.getElementCssClass("wrapper"),h=this.getElementCssClass("wrapperChecked",this.getElementCssClass("wrapper"));return t(this.wrapperTag,{ref:"wrapper",class:this.isChecked?h:c,attrs:{for:this.id,tabindex:this.tabindex,autofocus:this.autofocus},on:{keydown:t=>{t.keyCode===j.SPACE&&this.wrapperSpaceHandler(t)}}},e)},render(t){return t("input",{class:this.wrapped?this.getElementCssClass("input"):this.componentClass,ref:"input",attrs:{checked:this.isChecked,value:this.value,id:this.id,type:"checkbox",name:this.name,disabled:this.disabled,readonly:this.readonly,required:this.required,autofocus:this.wrapped?void 0:this.autofocus,tabindex:this.wrapped&&void 0!==this.tabindex?-1:this.tabindex},on:this.getListeners({blur:this.blurHandler,focus:this.focusHandler,change:this.changeHandler,input:()=>{}})})},wrapperSpaceHandler(t){t.preventDefault(),this.click()},setIndeterminate(t){this.getInput().indeterminate=t,this.$emit("update:indeterminate",t)},setChecked(t){const input=this.getInput();input.checked=!t,input.click(),this.$emit("update:checked",t)},changeHandler(){const t=this.getInput().checked;let e;if(Array.isArray(this.model)){e=[...this.model];const n=e.indexOf(this.value);t&&n<0?e.push(this.value):!t&&n>=0&&e.splice(n,1)}else e=t?this.value:this.uncheckedValue;this.$emit("input",e),this.$emit("change",e),this.$emit("update:indeterminate",!1),this.$emit("update:checked",t)},blurHandler(t){this.$emit("blur",t)},focusHandler(t){this.$emit("focus",t)},blur(){this.getInput().blur()},click(){this.getInput().click()},focus(t){this.getInput().focus(t)}}});function R(t,e,n,r){function o(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,l){function c(t){try{d(r.next(t))}catch(t){l(t)}}function h(t){try{d(r.throw(t))}catch(t){l(t)}}function d(t){t.done?n(t.value):o(t.value).then(c,h)}d((r=r.apply(t,e||[])).next())}))}const L=(t,e,n)=>void 0===t?!!e:C.default(t,n),$=D.extend({name:"TRadio",props:{value:{type:[String,Object,Number,Boolean,Array],default:"on"},checked:{type:[Boolean,String],default:!1},model:{type:[String,Object,Number,Boolean,Array],default:void 0},wrapped:{type:Boolean,default:!1},wrapperTag:{type:String,default:"label"},inputWrapperTag:{type:String,default:"span"},labelTag:{type:String,default:"span"},label:{type:[String,Number],default:void 0},classes:{type:[String,Array,Object],default:"text-blue-500 transition duration-100 ease-in-out border-gray-300 shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50 focus:ring-offset-0 disabled:opacity-50 disabled:cursor-not-allowed"}},data(){return{localValue:this.checked?this.value:null}},model:{prop:"model",event:"input"},render(t){const e=this.render,n=this.renderWrapped;return this.wrapped?n(t):e(t)},watch:{model(t){C.default(t,this.localValue)||(this.localValue=t)},checked(t){const e=t?this.value:null;C.default(e,this.localValue)||(this.localValue=e)},localValue(t){C.default(this.model,t)||(this.$emit("input",t),this.$emit("change",t))},isChecked(t){const input=this.$refs.input;input&&input.checked!==t&&(input.checked=t)}},computed:{isChecked(){return L(this.model,this.checked,this.value)}},methods:{renderWrapped(t){const e=[],input=this.render(t),n=this.getElementCssClass("inputWrapper"),r=this.getElementCssClass("inputWrapperChecked",this.getElementCssClass("inputWrapper"));e.push(t(this.inputWrapperTag,{ref:"inputWrapper",class:this.isChecked?r:n},[input]));const o=this.getElementCssClass("label"),l=this.getElementCssClass("labelChecked",this.getElementCssClass("label"));let label;label=void 0!==this.$scopedSlots.default?this.$scopedSlots.default({isChecked:this.isChecked,value:this.localValue,label:this.label}):"number"==typeof this.label?String(this.label):this.label,e.push(t(this.labelTag,{ref:"label",class:this.isChecked?l:o},label));const c=this.getElementCssClass("wrapper"),h=this.getElementCssClass("wrapperChecked",this.getElementCssClass("wrapper"));return t(this.wrapperTag,{ref:"wrapper",class:this.isChecked?h:c,attrs:{for:this.id,tabindex:this.tabindex,autofocus:this.autofocus},on:{keydown:t=>{[j.DOWN,j.RIGHT].includes(t.keyCode)?this.selectNextRadio(t):[j.UP,j.LEFT].includes(t.keyCode)?this.selectPrevRadio(t):t.keyCode===j.SPACE&&this.wrapperSpaceHandler(t)}}},e)},render(t){return t("input",{class:this.wrapped?this.getElementCssClass("input"):this.componentClass,ref:"input",attrs:{value:this.value,id:this.id,type:"radio",checked:L(this.model,this.checked,this.value),name:this.name,disabled:this.disabled,readonly:this.readonly,required:this.required,autofocus:this.wrapped?void 0:this.autofocus,tabindex:this.wrapped&&void 0!==this.tabindex?-1:this.tabindex},on:this.getListeners({blur:this.blurHandler,focus:this.focusHandler,input:this.inputHandler})})},inputHandler(t){return R(this,void 0,void 0,(function*(){t.target.checked&&(this.localValue=this.value,this.sendInputEventToTheNotCheckedInputs())}))},sendInputEventToTheNotCheckedInputs(){document.querySelectorAll(`input[name=${this.name}]:not(:checked)`).forEach((t=>{t.dispatchEvent(new Event("input"))}))},selectPrevRadio(t){t.preventDefault();const e=this.$refs.input,n=Array.from(document.querySelectorAll(`input[name=${this.name}]`)),r=n.findIndex((t=>t===this.$refs.input)),o=n[r-1]||n[n.length-1];if(o!==e&&o){const t=o.parentNode?o.parentNode.parentNode:void 0;t&&t.tabIndex>=0?t.focus():o.focus()}},selectNextRadio(t){t.preventDefault();const e=this.$refs.input,n=Array.from(document.querySelectorAll(`input[name=${this.name}]`)),r=n.findIndex((t=>t===this.$refs.input)),o=n[r+1]||n[0];if(o!==e&&o){const t=o.parentNode?o.parentNode.parentNode:void 0;t&&t.tabIndex>=0?t.focus():o.focus()}},wrapperSpaceHandler(t){t.preventDefault(),this.localValue=this.value},blurHandler(t){this.$emit("blur",t)},focusHandler(t){this.$emit("focus",t)},blur(){this.$refs.input.blur()},click(){this.$refs.input.click()},focus(t){this.$refs.input.focus(t)}}}),M=D.extend({props:{value:{type:[String,Number],default:void 0},autocomplete:{type:String,default:void 0},maxlength:{type:[String,Number],default:void 0},minlength:{type:[String,Number],default:void 0},multiple:{type:Boolean,default:void 0},pattern:{type:String,default:void 0},placeholder:{type:String,default:void 0},classes:{type:[String,Array,Object],default:void 0}},data(){return{localValue:this.value,valueWhenFocus:null}},watch:{localValue(t){this.$emit("input",t)},value(t){this.localValue=t}},methods:{blurHandler(t){this.$emit("blur",t),this.localValue!==this.valueWhenFocus&&this.$emit("change",this.localValue)},focusHandler(t){this.$emit("focus",t),this.valueWhenFocus=this.localValue},keyupHandler(t){this.$emit("keyup",t)},keydownHandler(t){this.$emit("keydown",t)},blur(){this.$el.blur()},click(){this.$el.click()},focus(t){this.$el.focus(t)},select(){this.$el.select()},setSelectionRange(t,e,n){this.$el.setSelectionRange(t,e,n)},setRangeText(t){this.$el.setRangeText(t)}}}),F=M.extend({name:"TTextarea",props:{rows:{type:String,default:void 0},cols:{type:String,default:void 0},wrap:{type:String,default:"soft"},classes:{type:[String,Array,Object],default:"block w-full px-3 py-2 text-black placeholder-gray-400 transition duration-100 ease-in-out bg-white border border-gray-300 rounded shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed"}},render(t){return(0,this.render)(t)},methods:{render(t){return t("textarea",{class:this.componentClass,ref:"input",domProps:{value:this.localValue},attrs:{id:this.id,name:this.name,disabled:this.disabled,readonly:this.readonly,autocomplete:this.autocomplete,autofocus:this.autofocus,required:this.required,placeholder:this.placeholder,pattern:this.pattern,multiple:this.multiple,minlength:this.minlength,maxlength:this.maxlength,wrap:this.wrap,rows:this.rows,cols:this.cols},on:this.getListeners({blur:this.blurHandler,focus:this.focusHandler,keyup:this.keyupHandler,keydown:this.keydownHandler,input:this.inputHandler})})},inputHandler(t){const e=t.target;this.$emit("input",e.value)}}}),B=M.extend({name:"TInput",props:{type:{type:String,default:"text"},max:{type:[String,Number],default:void 0},min:{type:[String,Number],default:void 0},classes:{type:[String,Array,Object],default:"block w-full px-3 py-2 text-black placeholder-gray-400 transition duration-100 ease-in-out bg-white border border-gray-300 rounded shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed"}},render(t){return(0,this.render)(t)},methods:{render(t){return t("input",{class:this.componentClass,ref:"input",domProps:{value:this.localValue},attrs:{id:this.id,name:this.name,disabled:this.disabled,readonly:this.readonly,autocomplete:this.autocomplete,autofocus:this.autofocus,type:this.type,required:this.required,placeholder:this.placeholder,pattern:this.pattern,multiple:this.multiple,minlength:this.minlength,min:this.min,maxlength:this.maxlength,max:this.max},on:this.getListeners({blur:this.blurHandler,focus:this.focusHandler,keyup:this.keyupHandler,keydown:this.keydownHandler,input:this.inputHandler})})},inputHandler(t){const e=t.target;this.$emit("input",e.value)}}}),V=(option,t)=>t?w.default(option,t):w.default(option,"value",w.default(option,"id",w.default(option,"text"))),U=(option,t)=>t?w.default(option,t):w.default(option,"text",w.default(option,"label")),H=(option,t,e)=>{if("string"==typeof option||"number"==typeof option||"boolean"==typeof option)return{value:option,text:option,raw:option};if(option.children){const n=option.children.map((t=>H(t)));return{value:V(option,e),text:U(option,t),children:n}}const n={value:V(option,e),text:U(option,t),raw:option};return void 0!==option.disabled&&(n.disabled=option.disabled),n},W=(t,e,n)=>t?Array.isArray(t)?t.map((option=>H(option,e,n))):x.default(t,((option,t)=>({value:t,text:option}))):[],z=D.extend({props:{value:{type:[String,Object,Number,Boolean],default:null},valueAttribute:{type:String,default:void 0},textAttribute:{type:String,default:void 0},options:{type:[Array,Object],default:void 0}},data(){return{localValue:this.value}},computed:{normalizedOptions(){return this.normalizeOptions(this.options)},flattenedOptions(){return this.normalizedOptions.map((option=>option.children?option.children:option)).flat()}},methods:{normalizeOptions(t){return W(t,this.textAttribute,this.valueAttribute)}}}),K=z.extend({props:{value:{type:[Array,String,Number,Boolean,Object],default:null},multiple:{type:Boolean,default:void 0}}}),G=K.extend({name:"TSelect",props:{placeholder:{type:String,default:void 0},wrapped:{type:Boolean,default:!1},classes:{type:[String,Array,Object],default:"block w-full pl-3 pr-10 py-2 text-black placeholder-gray-400 transition duration-100 ease-in-out bg-white border border-gray-300 rounded shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed"}},data(){return{localValue:this.value}},computed:{normalizedOptionsWithPlaceholder(){if(void 0===this.placeholder)return this.normalizedOptions;const{normalizedOptions:t}=this;return[{value:null,text:this.placeholder}].concat(t)}},watch:{localValue(t){return R(this,void 0,void 0,(function*(){this.$emit("input",t),yield this.$nextTick(),this.$emit("change",t)}))},value(t){this.localValue=t}},render(t){const e=this.createSelect,n=this.createSelectWrapper;return this.wrapped?n(t):e(t)},methods:{createSelectWrapper(t){const e=[this.createSelect(t)];if(!this.multiple)if(this.$scopedSlots.arrowWrapper){const t=this.$scopedSlots.arrowWrapper({className:this.getElementCssClass("arrowWrapper"),variant:this.variant,value:this.localValue});e.push(t)}else e.push(this.createArrow(t));return t("div",{ref:"selectWrapper",class:this.getElementCssClass("wrapper")},e)},createArrow(t){const e=[];return this.$scopedSlots.arrow?e.push(this.$scopedSlots.arrow({className:this.getElementCssClass("arrow"),variant:this.variant,value:this.localValue})):e.push(t("svg",{attrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},class:this.getElementCssClass("arrow")},[t("path",{attrs:{"clip-rule":"evenodd","fill-rule":"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z"}})])),t("span",{ref:"arrow",class:this.getElementCssClass("arrowWrapper")},e)},createSelect(t){return t("select",{ref:"select",attrs:{id:this.id,autofocus:this.autofocus,disabled:this.disabled,name:this.name,required:this.required,multiple:this.multiple},class:this.wrapped?this.getElementCssClass("input"):this.getElementCssClass(),on:this.getListeners({blur:this.blurHandler,focus:this.focusHandler,input:this.inputHandler})},this.createOptions(t,this.value))},createOptions(t,e){return this.normalizedOptionsWithPlaceholder.map((option=>option.children?this.createOptgroup(t,option,e):this.createOption(t,option,e)))},createOptgroup(t,option,e){var n;return t("optgroup",{domProps:{label:U(option,this.textAttribute)}},null===(n=option.children)||void 0===n?void 0:n.map((n=>this.createOption(t,n,e))))},createOption(t,option,e){const n=Array.isArray(e)?e.includes(option.value):e===option.value;return t("option",{domProps:{value:option.value,selected:n,disabled:option.disabled}},option.text)},inputHandler(t){const e=t.target;let n;n=this.multiple?Array.from(e.selectedOptions).map((t=>t.value)):e.value,this.localValue=n},blurHandler(t){this.$emit("blur",t)},focusHandler(t){this.$emit("focus",t)},blur(){this.$refs.select.blur()},focus(t){this.$refs.select.focus(t)}}}),Y=D.extend({name:"TButton",props:{value:{type:[String,Number],default:null},text:{type:String,default:void 0},tagName:{type:String,default:"button",validator:t=>-1!==["button","a"].indexOf(t)},type:{type:String,default:void 0},href:{type:String,default:null},to:{type:[String,Object],default:void 0},append:{type:Boolean,default:!1},activeClass:{type:String,default:"router-link-active"},exact:{type:Boolean,default:!1},exactActiveClass:{type:String,default:"router-link-exact-active"},event:{type:[String,Array],default:"click"},data:{type:Object,default:()=>({})},method:{type:String,default:"get"},replace:{type:Boolean,default:!1},preserveScroll:{type:Boolean,default:!1},preserveState:{type:Boolean,default:!1},only:{type:Array,default:()=>[]},native:{type:Boolean,default:!1},classes:{type:[String,Array,Object],default:"block px-4 py-2 text-white transition duration-100 ease-in-out bg-blue-500 border border-transparent rounded shadow-sm hover:bg-blue-600 focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed"}},computed:{isInertiaLinkComponentAvailable(){return!(!this.$options.components||!this.$options.components.InertiaLink)},isRouterLinkComponentAvailable(){return!(!this.$options.components||!this.$options.components.RouterLink&&!this.$options.components.NuxtLink)},isARouterLink(){return void 0!==this.to&&this.isRouterLinkComponentAvailable&&!this.native},isAnIntertiaLink(){return null!==this.href&&"a"===this.tagName&&this.isInertiaLinkComponentAvailable&&!this.native},componentToRender(){var t;return this.isARouterLink&&this.$options.components?this.$options.components.NuxtLink||this.$options.components.RouterLink:this.isAnIntertiaLink?null===(t=this.$options.components)||void 0===t?void 0:t.InertiaLink:this.href?"a":this.tagName}},render(t){return(0,this.render)(t)},methods:{blurHandler(t){this.$emit("blur",t)},focusHandler(t){this.$emit("focus",t)},clickHandler(t){this.$emit("click",t)},keydownHandler(t){this.$emit("keydown",t)},mousedownHandler(t){this.$emit("mousedown",t)},blur(){this.$el.blur()},focus(){this.$el.focus()},inertiaLinkAttributes(){return{data:this.data,href:this.href,method:this.method,replace:this.replace,preserveScroll:this.preserveScroll,preserveState:this.preserveState,only:this.only,id:this.id,value:this.value,autofocus:this.autofocus,disabled:this.disabled,name:this.name,type:this.type}},routerLinkAttributes(){return{to:this.to,replace:this.replace,append:this.append,tag:this.tagName,activeClass:this.activeClass,exact:this.exact,event:this.event,exactActiveClass:this.exactActiveClass,id:this.id,value:this.value,autofocus:this.autofocus,disabled:this.disabled,name:this.name,type:this.type}},getAttributes(){return this.isAnIntertiaLink?this.inertiaLinkAttributes():this.isARouterLink?this.routerLinkAttributes():{id:this.id,value:this.value,autofocus:this.autofocus,disabled:this.disabled,name:this.name,href:this.href,type:this.type}},render(t){return t(this.componentToRender,{attrs:this.getAttributes(),class:this.componentClass,on:this.getListeners({click:this.clickHandler,focus:this.focusHandler,blur:this.blurHandler,keydown:this.keydownHandler,mousedown:this.mousedownHandler})},void 0===this.text?this.$slots.default:this.text)}}});class J{constructor(t,component){this.createElement=t,this.component=component}render(){return this.createWrapper()}createWrapper(){return this.createElement("div",{ref:"wrapper",class:this.component.getElementCssClass("wrapper")},[this.createSelectButtonWrapper(),this.createDropdown()])}createSelectButtonWrapper(){const t=[this.createSelectButton()],e=this.component.multiple?this.component.selectedOptions.filter((t=>!t.disabled)).length>0:!(!this.component.selectedOption||this.component.selectedOption.disabled);return this.component.clearable&&e&&!this.component.disabled&&t.push(this.createSelectButtonClearButton()),this.createElement("div",{ref:"buttonWrapper",class:this.component.getElementCssClass("buttonWrapper")},t)}createSelectButton(){const t=[];this.component.multiple&&this.component.selectedOptions.length?this.component.$scopedSlots.label?t.push(this.component.$scopedSlots.label({query:this.component.query,options:this.component.selectedOptions,className:this.component.getElementCssClass("selectButtonLabel")})):t.push(this.createSelectButtonLabel()):!this.component.multiple&&this.component.selectedOption?this.component.$scopedSlots.label?t.push(this.component.$scopedSlots.label({query:this.component.query,option:this.component.selectedOption,className:this.component.getElementCssClass("selectButtonLabel")})):t.push(this.createSelectButtonLabel()):t.push(this.createSelectButtonPlaceholder());const e=this.component.multiple?this.component.selectedOptions.length>0:!!this.component.selectedOption;if(this.component.clearable&&e||this.component.disabled||t.push(...this.createSelectButtonIcon()),this.component.multiple){const e=this.component.selectedOptions.map((option=>this.createElement("input",{attrs:{type:"hidden",value:option.value,name:this.component.name}})));return this.createElement("div",{ref:"tagsContainer",attrs:{tabindex:this.component.tabindex||0},class:this.component.getElementCssClass("selectButton"),on:{click:this.component.clickHandler,focus:this.component.focusHandler,keydown:t=>{t.keyCode===j.DOWN?this.component.arrowDownHandler(t):t.keyCode===j.UP?this.component.arrowUpHandler(t):t.keyCode===j.ENTER?this.component.enterHandler(t):t.keyCode===j.ESC&&this.component.escapeHandler(t)},blur:this.component.blurHandler,mousedown:t=>{t.preventDefault()}}},t.concat(e))}return this.createElement("button",{ref:"selectButton",attrs:{type:"button",value:this.component.localValue,id:this.component.id,autofocus:this.component.autofocus,disabled:this.component.disabled,name:this.component.name},class:this.component.getElementCssClass("selectButton"),on:{click:this.component.clickHandler,focus:this.component.focusHandler,keydown:t=>{t.keyCode===j.DOWN?this.component.arrowDownHandler(t):t.keyCode===j.UP?this.component.arrowUpHandler(t):t.keyCode===j.ENTER?this.component.enterHandler(t):t.keyCode===j.ESC&&this.component.escapeHandler(t)},blur:this.component.blurHandler,mousedown:t=>{t.preventDefault()}}},t)}createSelectButtonLabel(){return this.component.multiple?this.createElement("div",{class:this.component.getElementCssClass("selectButtonTagWrapper")},this.component.selectedOptions.map(((t,e)=>this.createElement("button",{class:this.component.getElementCssClass("selectButtonTag"),attrs:{tabindex:this.component.tagsAreFocusable&&!t.disabled?"0":"-1",type:"button",disabled:!!t.disabled||void 0},on:{click:e=>{e.stopPropagation(),t.disabled||this.component.selectTag(e.currentTarget)},blur:t=>{this.component.unselectTag(t.currentTarget)},focus:t=>{this.component.selectTag(t.currentTarget)},keydown:t=>{t.keyCode===j.BACKSPACE&&this.component.unselectOptionAtIndex(e)}}},[this.createElement("span",{class:this.component.getElementCssClass("selectButtonTagText")},t?t.text:""),[t.disabled?null:this.createElement("span",{class:this.component.getElementCssClass("selectButtonTagDeleteButton"),attrs:{tabindex:-1},on:{click:t=>{t.stopPropagation(),this.component.unselectOptionAtIndex(e)}}},[this.createElement("svg",{class:this.component.getElementCssClass("selectButtonTagDeleteButtonIcon"),attrs:{fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"}},[this.createElement("path",{attrs:{"fill-rule":"evenodd",evenodd:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"}})])])]])))):this.createElement("span",{ref:"selectButtonLabel",class:this.component.getElementCssClass("selectButtonLabel")},this.component.selectedOption?this.component.selectedOption.text:"")}createSelectButtonPlaceholder(){const t={};return this.component.placeholder||(t.innerHTML=" "),this.createElement("span",{ref:"selectButtonPlaceholder",class:this.component.getElementCssClass("selectButtonPlaceholder"),domProps:t},this.component.placeholder||void 0)}createSelectButtonIcon(){return this.component.$scopedSlots.arrow?this.component.$scopedSlots.arrow({className:this.component.getElementCssClass("selectButtonIcon"),variant:this.component.variant,value:this.component.localValue}):[this.createElement("svg",{ref:"selectButtonIcon",attrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},class:this.component.getElementCssClass("selectButtonIcon")},[this.createElement("path",{attrs:{"clip-rule":"evenodd","fill-rule":"evenodd",d:"M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z"}})])]}createSelectButtonClearButton(){return this.createElement("button",{ref:"selectButtonClearButton",class:this.component.getElementCssClass("selectButtonClearButton"),attrs:{type:"button",tabindex:-1},on:{click:this.component.clearButtonClickHandler}},[this.createElement("svg",{attrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},class:this.component.getElementCssClass("selectButtonClearIcon")},[this.createElement("polygon",{attrs:{points:"10 8.58578644 2.92893219 1.51471863 1.51471863 2.92893219 8.58578644 10 1.51471863 17.0710678 2.92893219 18.4852814 10 11.4142136 17.0710678 18.4852814 18.4852814 17.0710678 11.4142136 10 18.4852814 2.92893219 17.0710678 1.51471863 10 8.58578644"}})])])}createSearchBoxWrapper(){return this.createElement("div",{ref:"searchWrapper",class:this.component.getElementCssClass("searchWrapper")},[this.createSearchBox()])}createSearchBox(){return this.createElement("input",{ref:"searchBox",class:this.component.getElementCssClass("searchBox"),domProps:{value:this.component.query},attrs:{placeholder:this.component.searchBoxPlaceholder},on:{keydown:t=>{t.keyCode===j.DOWN?this.component.arrowDownHandler(t):t.keyCode===j.UP?this.component.arrowUpHandler(t):t.keyCode===j.ENTER?this.component.enterHandler(t):t.keyCode===j.ESC&&this.component.escapeHandler(t)},blur:this.component.blurHandler,input:this.component.searchInputHandler}})}getMinimumInputLengthText(){return"function"==typeof this.component.minimumInputLengthText?this.component.minimumInputLengthText(this.component.minimumInputLength,this.component.query):this.component.minimumInputLengthText}createDropdown(){const t=[];if(this.component.shouldShowSearchbox&&t.push(this.createSearchBoxWrapper()),this.component.$scopedSlots.dropdownUp&&t.push(this.component.$scopedSlots.dropdownUp({query:this.component.query,selectedOption:this.component.selectedOption,options:this.component.filteredOptions})),this.component.searching&&!this.component.nextPage)this.component.$scopedSlots.searchingText?t.push(this.component.$scopedSlots.searchingText({text:this.component.searchingText,query:this.component.query,className:this.component.getElementCssClass("dropdownFeedback")})):t.push(this.createDropdownFeedback(this.component.searchingText));else if(void 0!==this.component.minimumInputLength&&this.component.query.lengthoption.children?[option,...option.children]:option)).flat().map((option=>option.children?this.createOptgroup(option):(e+=1,this.createOption(option,e))))}createOptgroup(optgroup){return this.createElement("li",{attrs:{"data-type":"optgroup"},class:this.component.getElementCssClass("optgroup")},U(optgroup,this.component.textAttribute))}createOption(option,t){const e=this.component.optionHasValue(option,this.component.localValue),n=this.component.highlighted===t;let r;r=option.disabled?this.component.getElementCssClass("disabledOption"):n&&e?this.component.getElementCssClass("selectedHighlightedOption"):n?this.component.getElementCssClass("highlightedOption"):e?this.component.getElementCssClass("selectedOption"):this.component.getElementCssClass("option");const o=[];return this.component.$scopedSlots.option?o.push(this.component.$scopedSlots.option({index:t,isHighlighted:n,isSelected:e,option:option,query:this.component.query,className:this.component.getElementCssClass("optionContent")})):o.push(this.createOptionContent(option,e)),this.createElement("li",{ref:"option",class:r,attrs:{"data-type":"option"},on:{mouseover:()=>{this.component.highlighted=t},mouseleave:()=>{this.component.highlighted=null},mousedown:t=>{t.preventDefault()},click:t=>{t.preventDefault(),option.disabled||this.component.selectOption(option)}}},o)}createOptionContent(option,t){const e=[this.createOptionLabel(option)];return t&&e.push(this.createOptionSelectedIcon()),this.createElement("div",{ref:"optionContent",class:this.component.getElementCssClass("optionContent")},e)}createOptionLabel(option){return this.createElement("span",{ref:"optionLabel",class:this.component.getElementCssClass("optionLabel")},option.text)}createOptionSelectedIcon(){return this.createElement("svg",{ref:"selectedIcon",attrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},class:this.component.getElementCssClass("selectedIcon")},[this.createElement("polygon",{attrs:{points:"0 11 2 9 7 14 18 3 20 5 7 18"}})])}}const Q=K.extend({name:"TRichSelect",render(t){return(0,this.createSelect)(t)},props:{delay:{type:Number,default:250},fetchOptions:{type:Function,default:void 0},minimumResultsForSearch:{type:Number,default:void 0},minimumInputLength:{type:Number,default:void 0},minimumInputLengthText:{type:[Function,String],default:(t,e)=>`Please enter ${t} or more characters`},hideSearchBox:{type:Boolean,default:!1},openOnFocus:{type:Boolean,default:!0},closeOnSelect:{type:Boolean,default:!0},selectOnClose:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},placeholder:{type:String,default:void 0},searchBoxPlaceholder:{type:String,default:"Search..."},noResultsText:{type:String,default:"No results found"},searchingText:{type:String,default:"Searching..."},loadingMoreResultsText:{type:String,default:"Loading more results..."},maxHeight:{type:[String,Number],default:300},fixedClasses:{type:Object,default:()=>({wrapper:"relative",buttonWrapper:"inline-block relative w-full",selectButton:"w-full flex text-left justify-between items-center",selectButtonLabel:"block truncate",selectButtonTagWrapper:"flex flex-wrap overflow-hidden",selectButtonTag:"bg-blue-500 block disabled:cursor-not-allowed disabled:opacity-50 duration-100 ease-in-out focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50 rounded shadow-sm text-sm text-white transition whitespace-nowrap m-0.5 max-w-full overflow-hidden h-8 flex items-center",selectButtonTagText:"px-3",selectButtonTagDeleteButton:"-ml-1.5 h-full hover:bg-blue-600 hover:shadow-sm inline-flex items-center px-2 transition",selectButtonTagDeleteButtonIcon:"w-3 h-3",selectButtonPlaceholder:"block truncate",selectButtonIcon:"fill-current flex-shrink-0 ml-1 h-4 w-4",selectButtonClearButton:"flex flex-shrink-0 items-center justify-center absolute right-0 top-0 m-2 h-6 w-6",selectButtonClearIcon:"fill-current h-3 w-3",dropdown:"absolute w-full z-10",dropdownFeedback:"",loadingMoreResults:"",optionsList:"overflow-auto",searchWrapper:"inline-block w-full",searchBox:"inline-block w-full",optgroup:"",option:"cursor-pointer",disabledOption:"opacity-50 cursor-not-allowed",highlightedOption:"cursor-pointer",selectedOption:"cursor-pointer",selectedHighlightedOption:"cursor-pointer",optionContent:"",optionLabel:"truncate block",selectedIcon:"fill-current h-4 w-4",enterClass:"",enterActiveClass:"",enterToClass:"",leaveClass:"",leaveActiveClass:"",leaveToClass:""})},classes:{type:Object,default:()=>({wrapper:"",buttonWrapper:"",selectButton:"px-3 py-2 text-black transition duration-100 ease-in-out bg-white border border-gray-300 rounded shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed",selectButtonLabel:"",selectButtonTagWrapper:"-mx-2 -my-2.5 py-1 pr-8",selectButtonTag:"bg-blue-500 block disabled:cursor-not-allowed disabled:opacity-50 duration-100 ease-in-out focus:border-blue-500 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-opacity-50 rounded shadow-sm text-sm text-white transition whitespace-nowrap m-0.5 max-w-full overflow-hidden h-8 flex items-center",selectButtonTagText:"px-3",selectButtonTagDeleteButton:"-ml-1.5 h-full hover:bg-blue-600 hover:shadow-sm inline-flex items-center px-2 transition",selectButtonTagDeleteButtonIcon:"",selectButtonPlaceholder:"text-gray-400",selectButtonIcon:"text-gray-600",selectButtonClearButton:"hover:bg-blue-100 text-gray-600 rounded transition duration-100 ease-in-out",selectButtonClearIcon:"",dropdown:"-mt-1 bg-white border-b border-gray-300 border-l border-r rounded-b shadow-sm",dropdownFeedback:"pb-2 px-3 text-gray-400 text-sm",loadingMoreResults:"pb-2 px-3 text-gray-400 text-sm",optionsList:"",searchWrapper:"p-2 placeholder-gray-400",searchBox:"px-3 py-2 bg-gray-50 text-sm rounded border focus:outline-none focus:shadow-outline border-gray-300",optgroup:"text-gray-400 uppercase text-xs py-1 px-2 font-semibold",option:"",disabledOption:"",highlightedOption:"bg-blue-100",selectedOption:"font-semibold bg-gray-100 bg-blue-500 font-semibold text-white",selectedHighlightedOption:"font-semibold bg-gray-100 bg-blue-600 font-semibold text-white",optionContent:"flex justify-between items-center px-3 py-2",optionLabel:"",selectedIcon:"",enterClass:"opacity-0",enterActiveClass:"transition ease-out duration-100",enterToClass:"opacity-100",leaveClass:"opacity-100",leaveActiveClass:"transition ease-in duration-75",leaveToClass:"opacity-0"})}},data(){return{hasFocus:!1,show:!1,localValue:this.value,highlighted:null,query:"",filteredOptions:[],selectedOption:void 0,selectedOptions:[],searching:!1,delayTimeout:void 0,nextPage:void 0,tagsAreFocusable:!1}},created(){Array.isArray(this.value)?this.selectedOptions=this.value.map((t=>this.findOptionByValue(t))).filter((option=>!!option)):this.selectedOption&&this.selectedOption.value===this.value||(this.selectedOption=this.findOptionByValue(this.value))},updated(){(void 0===this.selectedOption||!Array.isArray(this.value)&&this.selectedOption.value!==this.value&&null!==this.value)&&(this.selectedOption=this.findOptionByValue(this.value))},watch:{normalizedOptions:{handler(){this.query="",this.filterOptions("")},immediate:!0},query(t){this.nextPage=void 0,this.filterOptions(t)},localValue(t){return R(this,void 0,void 0,(function*(){Array.isArray(t)?this.selectedOptions=t.map((t=>this.findOptionByValue(t))).filter((option=>!!option)):this.selectedOption&&this.selectedOption.value===t||(this.selectedOption=this.findOptionByValue(t)),this.$emit("input",t),yield this.$nextTick(),this.$emit("change",t),this.closeOnSelect&&this.hideOptions()}))},value(t){this.localValue=t},highlighted(t){return R(this,void 0,void 0,(function*(){null!==t&&(yield this.$nextTick(),this.scrollToHighlightedOption())}))},show(t){if(t){if(this.shouldShowSearchbox&&this.focusSearchBox(),!this.atLeastOneValidOptionExists)return void(this.highlighted=null);this.highlighted=void 0!==this.selectedOptionIndex?this.selectedOptionIndex:this.findNextOptionIndex()}},shouldShowSearchbox(t){t&&this.show&&this.focusSearchBox()}},computed:{usesAjax(){return!!this.fetchOptions},shouldShowSearchbox(){const t=!this.hideSearchBox,e=!!this.query,n=void 0===this.minimumResultsForSearch||e||(this.usesAjax?this.filteredflattenedOptions.length>=this.minimumResultsForSearch:this.normalizedOptions.length>=this.minimumResultsForSearch);return t&&n},hasMinimumInputLength(){return void 0===this.minimumInputLength||this.query.length>=this.minimumInputLength},flattenedOptions(){return this.normalizedOptions.map((option=>option.children?option.children:option)).flat()},filteredflattenedOptions(){return this.filteredOptions.map((option=>option.children?option.children:option)).flat()},atLeastOneValidOptionExists(){return this.filteredflattenedOptions.some((option=>!option.disabled))},normalizedHeight(){return/^\d+$/.test(String(this.maxHeight))?`${this.maxHeight}px`:String(this.maxHeight)},selectedOptionIndex(){let t;if(t=this.multiple?this.selectedOptions.length>=1?this.selectedOptions[this.selectedOptions.length-1]:void 0:this.selectedOption,!t)return;const e=this.filteredflattenedOptions.findIndex((option=>this.optionHasValue(option,t.value)));return e>=0?e:void 0},highlightedOption(){if("number"==typeof this.highlighted)return this.filteredflattenedOptions[this.highlighted]}},methods:{findOptionByValue(t){return this.usesAjax?[...this.filteredflattenedOptions,...this.selectedOptions].find((option=>this.optionHasValue(option,t))):this.flattenedOptions.find((option=>this.optionHasValue(option,t)))},optionHasValue:(option,t)=>Array.isArray(t)?t.includes(option.value):t===option.value,createSelect(t){return new J(t,this).render()},filterOptions(t){return R(this,void 0,void 0,(function*(){if(this.hasMinimumInputLength){if(!this.fetchOptions){const t=T.default(this.normalizedOptions);return this.filteredOptions=this.queryFilter(t),void(this.filteredOptions.length?this.highlighted=0:this.highlighted=null)}this.searching=!0,this.delayTimeout&&clearTimeout(this.delayTimeout),this.delayTimeout=setTimeout((()=>R(this,void 0,void 0,(function*(){try{const{results:e,hasMorePages:n}=yield this.getFilterPromise(t);if(this.nextPage){const t=this.filteredOptions.length;this.filteredOptions=this.filteredOptions.concat(this.normalizeOptions(e)),this.highlighted===t-1&&(this.highlighted=t)}else this.filteredOptions=this.normalizeOptions(e),this.filteredOptions.length?this.highlighted=0:this.highlighted=null;this.nextPage=n?void 0===this.nextPage?2:this.nextPage+1:void 0}catch(t){this.$emit("fetch-error",t),this.filteredOptions=[]}this.searching=!1,this.delayTimeout=void 0}))),this.delay)}else this.filteredOptions=[]}))},getFilterPromise(t){return Promise.resolve(this.fetchOptions(t,this.nextPage))},listEndReached(){this.nextPage&&!this.searching&&this.filterOptions(this.query)},queryFilter(t){return this.query?t.map((option=>option.children?Object.assign(Object.assign({},option),{children:this.queryFilter(option.children)}):option)).filter((option=>{const t=String(option.text).toUpperCase().trim().includes(this.query.toUpperCase().trim());return option.children&&option.children.length>0||t})):t},hideOptions(){this.show=!1,this.selectOnClose&&this.highlightedOption&&this.selectOption(this.highlightedOption,!1)},showOptions(){this.show=!0},toggleOptions(){this.show?this.hideOptions():this.showOptions()},focusSearchBox(){return R(this,void 0,void 0,(function*(){yield this.$nextTick();const t=this.getSearchBox();t.focus(),t.select()}))},blurHandler(t){let e=!0;const n=t.relatedTarget;if(n){const t=this.$refs.wrapper.contains(n);let r=!1;this.multiple&&(r=this.$refs.tagsContainer.contains(n)),t&&!r&&(e=!1)}n===this.$refs.selectButton||e||!this.getSearchBox()?(e&&this.hideOptions(),this.$emit("blur",t),this.hasFocus=!1):this.focusSearchBox()},focusHandler(t){this.hasFocus=!0,this.openOnFocus&&this.showOptions(),this.$emit("focus",t)},clickHandler(t){this.show||this.hasFocus?this.toggleOptions():(this.multiple?this.getTagsContainer().focus():this.getButton().focus(),this.openOnFocus||this.showOptions()),this.$emit("click",t)},findNextOptionIndex(t=null){const e=null!==t&&t+1>=this.filteredflattenedOptions.length;let n;n=null===t||e?0:t+1;const r=this.filteredflattenedOptions[n];return!r||r.disabled?this.findNextOptionIndex(n):n},findPrevOptionIndex(t){let e;e=null===t||null===t||t-1<0?this.filteredflattenedOptions.length-1:t-1;const n=this.filteredflattenedOptions[e];return!n||n.disabled?this.findPrevOptionIndex(e):e},arrowUpHandler(t){return R(this,void 0,void 0,(function*(){t.preventDefault(),this.show?this.atLeastOneValidOptionExists?this.highlighted=this.findPrevOptionIndex(this.highlighted):this.highlighted=null:this.showOptions()}))},arrowDownHandler(t){if(t.preventDefault(),!this.show)return void this.showOptions();if(!this.atLeastOneValidOptionExists)return void(this.highlighted=null);const e=this.findNextOptionIndex(this.highlighted);e>=this.filteredflattenedOptions.length&&this.usesAjax&&this.nextPage?this.listEndReached():this.highlighted=e},listScrollHandler(t){const e=t.target;e.scrollTop===e.scrollHeight-e.offsetHeight&&this.listEndReached()},scrollToHighlightedOption(t="auto"){if(this.$refs.optionsList&&"number"==typeof this.highlighted){const li=this.$refs.optionsList.querySelectorAll("li[data-type=option]")[this.highlighted];li.scrollIntoView&&li.scrollIntoView({block:"nearest",behavior:t})}},escapeHandler(t){t.preventDefault(),this.hideOptions()},enterHandler(t){this.show&&null!==this.highlighted&&(t.preventDefault(),this.selectOption(this.highlightedOption))},searchInputHandler(t){const e=t.target;this.query=e.value},getButton(){return this.$refs.selectButton},getTagsContainer(){return this.$refs.tagsContainer},getSearchBox(){return this.$refs.searchBox},selectOption(option,t=!0){return R(this,void 0,void 0,(function*(){const e=option.value;if(this.multiple)if(Array.isArray(this.localValue)){const t=this.localValue.findIndex((t=>C.default(t,e)));if(t>=0){this.localValue.splice(t,1);const n=this.selectedOptions.findIndex((t=>t.value===e));n>=0&&(this.unselectOptionAtIndex(n),this.selectedOptions.splice(n,1))}else this.localValue.push(e),this.selectedOptions.push(option)}else this.localValue=[e],this.selectedOptions.push(option);else this.localValue!==e&&(this.localValue=e),this.selectedOption=option;yield this.$nextTick(),t&&(!this.closeOnSelect&&this.shouldShowSearchbox?this.getSearchBox().focus():(this.multiple?this.getTagsContainer().focus():this.getButton().focus(),this.closeOnSelect&&this.show&&this.hideOptions()))}))},unselectOptionAtIndex(t){const e=this.selectedOptions[t],n=this.localValue.findIndex((t=>C.default(t,e.value)));n>=0&&this.localValue.splice(n,1)},clearButtonClickHandler(t){t.preventDefault(),t.stopPropagation(),this.multiple?this.localValue=this.selectedOptions.filter((t=>!!t.disabled)).map((t=>t.value)):this.localValue=null,this.query=""},blur(){(this.hideSearchBox?this.$refs.selectButton:this.$refs.searchBox).blur()},focus(t){this.$refs.selectButton.focus(t)},selectTag(t){return R(this,void 0,void 0,(function*(){this.tagsAreFocusable=!0,yield this.$nextTick(),t.focus()}))},unselectTag(){return R(this,void 0,void 0,(function*(){this.tagsAreFocusable=!1}))}}}),X=I.extend({name:"TInputGroup",props:{inputName:{type:String,default:void 0},label:{type:String,default:void 0},description:{type:String,default:void 0},feedback:{type:String,default:void 0},sortedElements:{type:Array,default:()=>["label","default","feedback","description"],validator(t){const e=["default","description","feedback","label"];return t.length===S.default(t,e).length}},fixedClasses:{type:Object,default:()=>({})},classes:{type:Object,default:()=>({wrapper:"",label:"block",body:"",feedback:"text-gray-400 text-sm",description:"text-gray-400 text-sm"})}},render(t){return(0,this.render)(t)},computed:{elementsToRender(){const t=this.$props,e=this.$slots;return this.sortedElements.filter((n=>"default"===n||!!t[n]||!!e[n]))}},methods:{render(t){return t("div",{ref:"wrapper",class:this.getElementCssClass("wrapper")},this.elementsToRender.map((e=>t(this.getTagName(e),{ref:e,class:this.getElementCssClass("default"===e?"body":e),attrs:{for:"label"===e?this.inputName:void 0},slot:e},this.$slots[e]||this.$props[e]))))},getTagName:t=>"label"===t?"label":"div"}}),Z=I.extend({name:"TCard",props:{tagName:{type:String,default:"div"},header:{type:String,default:void 0},footer:{type:String,default:void 0},noBody:{type:Boolean,default:!1},classes:{type:Object,default:()=>({wrapper:"border rounded shadow-sm bg-white border-gray-100",body:"p-3",header:"border-b border-gray-100 p-3 rounded-t",footer:"border-gray-100 border-t p-3 rounded-b"})}},render(t){return(0,this.render)(t)},methods:{render(t){return t(this.tagName,{class:this.getElementCssClass("wrapper")},this.renderChilds(t))},renderChilds(t){if(this.noBody)return this.$slots.default;const e=[];return(this.$slots.header||void 0!==this.header)&&e.push(t("div",{ref:"header",class:this.getElementCssClass("header")},this.$slots.header||this.header)),e.push(t("div",{ref:"body",class:this.getElementCssClass("body")},this.$slots.default)),(this.$slots.footer||void 0!==this.footer)&&e.push(t("div",{ref:"footer",class:this.getElementCssClass("footer")},this.$slots.footer||this.footer)),e}}}),tt=I.extend({name:"TAlert",props:{tagName:{type:String,default:"div"},bodyTagName:{type:String,default:"div"},dismissible:{type:Boolean,default:!0},show:{type:Boolean,default:!1},timeout:{type:Number,default:void 0},classes:{type:Object,default:()=>({wrapper:"relative flex items-center p-4 bg-blue-50 border-l-4 border-blue-500 rounded shadow-sm",body:"flex-grow",close:"absolute relative flex items-center justify-center flex-shrink-0 w-6 h-6 ml-4 text-blue-500 transition duration-100 ease-in-out rounded hover:bg-blue-200 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50",closeIcon:"fill-current h-4 w-4"})}},data(){return{localShow:this.show}},render(t){return(0,this.render)(t)},watch:{show(t){this.localShow=t},localShow(t){this.$emit("update:show",t),this.localShow?(this.$emit("shown"),this.timeout&&this.initTimeout()):this.$emit("hidden")}},mounted(){this.localShow&&this.timeout&&this.initTimeout()},methods:{render(t){return this.localShow?t(this.tagName,{class:this.getElementCssClass("wrapper")},this.dismissible?[t(this.bodyTagName,{ref:"body",class:this.getElementCssClass("body")},this.$slots.default),t("button",{ref:"close",class:this.getElementCssClass("close"),attrs:{type:"button"},on:{click:this.hide}},this.$slots.close||[t("svg",{attrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},class:this.getElementCssClass("closeIcon")},[t("path",{attrs:{"clip-rule":"evenodd","fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"}})])])]:[t(this.bodyTagName,{ref:"body",class:this.getElementCssClass("body")},this.$slots.default)]):t()},initTimeout(){setTimeout((()=>{this.hide()}),this.timeout)},hide(){this.localShow=!1}}}),et=I.extend({name:"TModal",props:{name:{type:String,default:void 0},value:{type:Boolean,default:!1},header:{type:String,default:void 0},footer:{type:String,default:void 0},clickToClose:{type:Boolean,default:!0},escToClose:{type:Boolean,default:!0},noBody:{type:Boolean,default:!1},hideCloseButton:{type:Boolean,default:!1},disableBodyScroll:{type:Boolean,default:!0},bodyScrollLockOptions:{type:Object,default:()=>({})},focusOnOpen:{type:Boolean,default:!0},fixedClasses:{type:Object,default:()=>({overlay:"overflow-auto scrolling-touch left-0 top-0 bottom-0 right-0 w-full h-full fixed",wrapper:"relative mx-auto",modal:"overflow-visible relative ",close:"flex items-center justify-center"})},classes:{type:Object,default:()=>({overlay:"z-40 bg-black bg-opacity-50",wrapper:"z-50 max-w-lg px-3 py-12",modal:"bg-white shadow rounded",body:"p-3",header:"border-b border-gray-100 p-3 rounded-t",footer:"bg-gray-100 p-3 rounded-b",close:"bg-gray-100 text-gray-600 rounded-full absolute right-0 top-0 -m-3 h-8 w-8 transition duration-100 ease-in-out hover:bg-gray-200 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50",closeIcon:"fill-current h-4 w-4",overlayEnterClass:"opacity-0",overlayEnterActiveClass:"transition ease-out duration-100",overlayEnterToClass:"opacity-100",overlayLeaveClass:"opacity-100",overlayLeaveActiveClass:"transition ease-in duration-75",overlayLeaveToClass:"opacity-0",enterClass:"",enterActiveClass:"",enterToClass:"",leaveClass:"",leaveActiveClass:"",leaveToClass:""})}},data(){return{overlayShow:this.value,modalShow:this.value,params:void 0,preventAction:!1}},watch:{value(t){t?this.show():this.hide()},overlayShow(t){return R(this,void 0,void 0,(function*(){this.$emit("input",t),this.$emit("change",t),yield this.$nextTick(),t?this.modalShow=!0:this.closed()}))},modalShow(t){return R(this,void 0,void 0,(function*(){yield this.$nextTick(),t?this.opened():this.overlayShow=!1}))}},created(){this.name&&this.$modal&&(this.$modal.$on(`show-${this.name}`,(t=>{this.show(t)})),this.$modal.$on(`hide-${this.name}`,(()=>{this.hide()})))},mounted(){this.overlayShow&&this.prepareDomForModal()},beforeDestroy(){const t=this.getOverlay();this.disableBodyScroll&&t&&(t.focus(),c.enableBodyScroll(t))},render(t){return(0,this.render)(t)},methods:{render(t){return t("transition",{props:{enterClass:this.getElementCssClass("overlayEnterClass"),enterActiveClass:this.getElementCssClass("overlayEnterActiveClass"),enterToClass:this.getElementCssClass("overlayEnterToClass"),leaveClass:this.getElementCssClass("overlayLeaveClass"),leaveActiveClass:this.getElementCssClass("overlayLeaveActiveClass"),leaveToClass:this.getElementCssClass("overlayLeaveToClass")}},this.overlayShow?[t("div",{ref:"overlay",attrs:{tabindex:0},class:this.getElementCssClass("overlay"),on:{keyup:this.keyupHandler,click:this.clickHandler}},[this.renderWrapper(t)])]:void 0)},renderWrapper(t){return t("div",{ref:"wrapper",class:this.getElementCssClass("wrapper")},[this.renderModal(t)])},renderModal(t){return t("transition",{props:{enterClass:this.getElementCssClass("enterClass"),enterActiveClass:this.getElementCssClass("enterActiveClass"),enterToClass:this.getElementCssClass("enterToClass"),leaveClass:this.getElementCssClass("leaveClass"),leaveActiveClass:this.getElementCssClass("leaveActiveClass"),leaveToClass:this.getElementCssClass("leaveToClass")}},this.modalShow?[t("div",{ref:"modal",class:this.getElementCssClass("modal")},this.renderChilds(t))]:void 0)},renderChilds(t){if(this.noBody)return this.$slots.default;const e=[];return this.hideCloseButton||e.push(t("button",{ref:"close",class:this.getElementCssClass("close"),attrs:{type:"button"},on:{click:this.hide}},this.$slots.button||[t("svg",{attrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},class:this.getElementCssClass("closeIcon")},[t("path",{attrs:{"clip-rule":"evenodd","fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"}})])])),(this.$slots.header||void 0!==this.header)&&e.push(t("div",{ref:"header",class:this.getElementCssClass("header")},this.$slots.header||this.header)),e.push(t("div",{ref:"body",class:this.getElementCssClass("body")},this.$slots.default)),(this.$slots.footer||void 0!==this.footer)&&e.push(t("div",{ref:"footer",class:this.getElementCssClass("footer")},this.$slots.footer||this.footer)),e},clickHandler(t){t.target===this.$refs.overlay&&this.outsideClick()},keyupHandler(t){t.keyCode===j.ESC&&this.escToClose&&this.hide()},beforeOpen(){this.$emit("before-open",{params:this.params,cancel:this.cancel})},opened(){this.$emit("opened",{params:this.params}),this.prepareDomForModal()},beforeClose(){if(this.disableBodyScroll){const t=this.getOverlay();t&&(t.focus(),c.enableBodyScroll(t))}this.$emit("before-close",{cancel:this.cancel})},closed(){this.$emit("closed")},prepareDomForModal(){const t=this.getOverlay();t&&(this.disableBodyScroll&&c.disableBodyScroll(t,this.bodyScrollLockOptions),this.focusOnOpen&&t.focus())},hide(){this.beforeClose(),this.preventAction?this.preventAction=!1:this.modalShow=!1},show(t){this.params=t,this.beforeOpen(),this.preventAction?this.preventAction=!1:this.overlayShow=!0},cancel(){this.preventAction=!0},outsideClick(){this.clickToClose&&this.hide()},getOverlay(){return this.$refs.overlay}}}),nt=I.extend({name:"TDropdown",props:{text:{type:String,default:""},disabled:{type:Boolean,default:void 0},tagName:{type:String,default:"div"},dropdownWrapperTagName:{type:String,default:"div"},dropdownTagName:{type:String,default:"div"},toggleOnFocus:{type:Boolean,default:!1},toggleOnClick:{type:Boolean,default:!0},toggleOnHover:{type:Boolean,default:!1},hideOnLeaveTimeout:{type:Number,default:250},show:{type:Boolean,default:!1},classes:{type:Object,default:()=>({button:"block px-4 py-2 text-white transition duration-100 ease-in-out bg-blue-500 border border-transparent rounded shadow-sm hover:bg-blue-600 focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed",wrapper:"inline-flex flex-col",dropdownWrapper:"relative z-10",dropdown:"origin-top-left absolute left-0 w-56 rounded shadow bg-white mt-1",enterClass:"opacity-0 scale-95",enterActiveClass:"transition transform ease-out duration-100",enterToClass:"opacity-100 scale-100",leaveClass:"opacity-100 scale-100",leaveActiveClass:"transition transform ease-in duration-75",leaveToClass:"opacity-0 scale-95"})}},data(){return{localShow:this.show,hasFocus:!1,hideOnLeaveTimeoutHolder:null}},render(t){return(0,this.render)(t)},watch:{show(t){this.localShow=t},localShow(t){this.$emit("update:show",t),t?this.$emit("shown"):this.$emit("hidden")}},methods:{render(t){const e=this.$scopedSlots.default?this.$scopedSlots.default({hide:this.doHide,show:this.doShow,toggle:this.doToggle,blurHandler:this.blurHandler}):null,n=[this.$scopedSlots.trigger?this.$scopedSlots.trigger({isShown:this.localShow,hide:this.doHide,hideIfFocusOutside:this.hideIfFocusOutside,show:this.doShow,toggle:this.doToggle,mousedownHandler:this.mousedownHandler,focusHandler:this.focusHandler,blurHandler:this.blurHandler,keydownHandler:this.keydownHandler,disabled:this.disabled}):t("button",{ref:"button",attrs:{type:"button",disabled:this.disabled},class:this.getElementCssClass("button"),on:{keydown:this.keydownHandler,mousedown:this.mousedownHandler,focus:this.focusHandler,blur:this.blurHandler}},this.$slots.button||this.text),t("transition",{props:{enterClass:this.getElementCssClass("enterClass"),enterActiveClass:this.getElementCssClass("enterActiveClass"),enterToClass:this.getElementCssClass("enterToClass"),leaveClass:this.getElementCssClass("leaveClass"),leaveActiveClass:this.getElementCssClass("leaveActiveClass"),leaveToClass:this.getElementCssClass("leaveToClass")}},this.localShow?[t(this.dropdownWrapperTagName,{ref:"dropdownWrapper",class:this.getElementCssClass("dropdownWrapper"),attrs:{tabindex:-1},on:{focus:this.focusHandler,blur:this.blurHandler}},[t(this.dropdownTagName,{ref:"dropdown",class:this.getElementCssClass("dropdown")},e)])]:void 0)];return t(this.tagName,{ref:"wrapper",class:this.getElementCssClass("wrapper"),on:{mouseover:this.mouseoverHandler,mouseleave:this.mouseleaveHandler}},n)},blurEventTargetIsChild(t){const e=t.relatedTarget;return!!e&&this.$refs.wrapper.contains(e)},focusEventTargetIsChild(t){const e=t.target;return!!e&&this.$refs.wrapper.contains(e)},escapeHandler(){this.doHide()},mousedownHandler(){this.toggleOnClick&&this.doToggle()},focusHandler(t){!this.hasFocus&&this.focusEventTargetIsChild(t)&&(this.hasFocus=!0,this.$emit("focus",t)),this.toggleOnFocus&&this.doShow()},blurHandler(t){this.hasFocus&&!this.blurEventTargetIsChild(t)&&(this.hasFocus=!1,this.$emit("blur",t)),(this.toggleOnFocus||this.toggleOnClick)&&this.hideIfFocusOutside(t)},keydownHandler(t){[j.ENTER,j.SPACE].includes(t.keyCode)?this.mousedownHandler():t.keyCode===j.ESC&&this.escapeHandler(),this.$emit("keydown",t)},mouseleaveHandler(){this.toggleOnHover&&(this.hideOnLeaveTimeout?this.hideOnLeaveTimeoutHolder=setTimeout((()=>{this.doHide(),this.hideOnLeaveTimeoutHolder=null}),this.hideOnLeaveTimeout):this.doHide())},mouseoverHandler(){this.toggleOnHover&&(this.hideOnLeaveTimeout&&this.hideOnLeaveTimeoutHolder&&(clearTimeout(this.hideOnLeaveTimeoutHolder),this.hideOnLeaveTimeoutHolder=null),this.doShow())},doHide(){this.localShow=!1},hideIfFocusOutside(t){if(!(t instanceof Event))throw new Error("the method hideIfFocusOutside expects an instance of `Event` as parameter");this.blurEventTargetIsChild(t)||this.doHide()},doShow(){this.localShow=!0},doToggle(){this.localShow?this.doHide():this.doShow()},blur(){this.$refs.button.blur()},focus(t){this.$refs.button.focus(t)}}}),it=I.extend({name:"TPagination",props:{value:{type:Number,default:null},tagName:{type:String,default:"ul"},elementTagName:{type:String,default:"li"},disabled:{type:Boolean,default:!1},perPage:{type:Number,default:20,validator:t=>t>0},totalItems:{type:Number,default:0,validator:t=>t>=0},limit:{type:Number,default:5,validator:t=>t>=0},prevLabel:{type:String,default:"‹"},nextLabel:{type:String,default:"›"},firstLabel:{type:String,default:"«"},lastLabel:{type:String,default:"»"},ellipsisLabel:{type:String,default:"…"},hideFirstLastControls:{type:Boolean,default:!1},hidePrevNextControls:{type:Boolean,default:!1},hideEllipsis:{type:Boolean,default:!1},classes:{type:Object,default:()=>({wrapper:"table border-collapse text-center bg-white mx-auto shadow-sm",element:"w-8 h-8 border border-gray-200 table-cell hover:border-blue-100",activeElement:"w-8 h-8 border border-blue-500 table-cell hover:border-blue-600",disabledElement:"w-8 h-8 border border-gray-200 table-cell",ellipsisElement:"w-8 h-8 border border-gray-200 hidden md:table-cell",activeButton:"bg-blue-500 w-full h-full text-white hover:bg-blue-600 transition duration-100 ease-in-out focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50",disabledButton:"opacity-25 w-full h-full cursor-not-allowed transition duration-100 ease-in-out",button:"hover:bg-blue-100 w-full h-full transition duration-100 ease-in-out focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50",ellipsis:""})}},render(t){return(0,this.createComponent)(t)},data(){return{currentPage:this.value}},computed:{totalPages(){return this.perPage<=0?0:Math.ceil(this.totalItems/this.perPage)},pageButtons(){const t=Number(this.currentPage)-Math.round(this.limit/2)+1,e=this.totalPages+1-this.limit,n=Math.max(Math.min(t,e),1),r=Math.min(n+this.limit-1,this.totalPages);return k.default(n,r+1).map((t=>!this.hideEllipsis&&t===n&&n>1?"less":!this.hideEllipsis&&t===r&&r=this.totalPages}},watch:{value(t){this.currentPage=t},currentPage(t){this.$emit("input",t),this.$emit("change",t)}},methods:{createComponent(t){const e=[];return this.hideFirstLastControls||e.push(this.createControl(t,this.firstLabel,this.prevIsDisabled,!1,this.goToFirstPage)),this.hidePrevNextControls||e.push(this.createControl(t,this.prevLabel,this.prevIsDisabled,!1,this.goToPrevPage)),this.pageButtons.forEach((n=>{"less"===n||"more"===n?e.push(this.createControl(t,this.ellipsisLabel)):e.push(this.createControl(t,n,!1,this.isPageActive(Number(n)),(()=>this.selectPage(Number(n)))))})),this.hidePrevNextControls||e.push(this.createControl(t,this.nextLabel,this.nextIsDisabled,!1,this.goToNextPage)),this.hideFirstLastControls||e.push(this.createControl(t,this.lastLabel,this.nextIsDisabled,!1,this.goToLastPage)),t(this.tagName,{class:this.getElementCssClass("wrapper")},e)},createControl(t,text,e=!1,n=!1,r){let o="";return o=r?e?this.getElementCssClass("disabledElement"):n?this.getElementCssClass("activeElement"):this.getElementCssClass("element"):this.getElementCssClass("ellipsisElement"),t(this.elementTagName,{class:o},[this.createControlButton(t,text,e,n,r)])},createControlButton(t,text,e=!1,n=!1,r){if(!r)return t("span",{class:this.getElementCssClass("ellipsis"),domProps:{innerHTML:text}});let o="";const l={};return e?(o=this.getElementCssClass("disabledButton"),l.disabled=!0):o=n?this.getElementCssClass("activeButton"):this.getElementCssClass("button"),t("button",{class:o,on:{click:r},attrs:l,domProps:{disabled:!!e||void 0,innerHTML:text}})},selectPage(t){this.currentPage=t},goToPrevPage(){this.currentPage=null===this.currentPage?1:Math.max(this.currentPage-1,1)},goToNextPage(){this.currentPage=null===this.currentPage?this.totalPages:Math.min(this.currentPage+1,this.totalPages)},goToFirstPage(){this.currentPage=1},goToLastPage(){this.currentPage=this.totalPages},isPageActive(t){return t===this.currentPage}}}),st=I.extend({name:"TTag",props:{text:{type:String,default:void 0},tagName:{type:String,default:"div"}},render(t){return(0,this.render)(t)},methods:{render(t){return t(this.tagName,{class:this.componentClass},void 0===this.text?this.$slots.default:this.text)}}}),ot=z.extend({name:"TRadioGroup",props:{groupWrapperTag:{type:String,default:"div"},wrapperTag:{type:String,default:"label"},inputWrapperTag:{type:String,default:"span"},labelTag:{type:String,default:"span"},fixedClasses:{type:Object,default:()=>({})},classes:{type:Object,default:()=>({groupWrapper:"flex flex-col",label:"",input:"text-blue-500 transition duration-100 ease-in-out border-gray-300 shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 focus:ring-offset-0 disabled:opacity-50 disabled:cursor-not-allowed",inputWrapper:"inline-flex",wrapper:"inline-flex items-center space-x-2"})}},data(){return{localValue:this.value}},watch:{localValue(t){this.$emit("input",t),this.$emit("change",t)},value(t){this.localValue=t}},render(t){return(0,this.createRadioGroup)(t)},methods:{createRadioGroup(t){return t(this.groupWrapperTag,{ref:"wrapper",class:this.getElementCssClass("groupWrapper")},this.createRadioOptions(t))},createRadioOptions(t){return this.normalizedOptions.map(((option,e)=>this.createRadioOption(t,option,e)))},createRadioOption(t,option,e){return t($,{props:{id:this.buildId(option,e),name:this.name,tabindex:this.tabindex,disabled:this.disabled,autofocus:this.autofocus,required:this.required,model:this.localValue,label:option.text,wrapped:!0,value:option.value,checked:this.value===option.value,variant:this.variant,classes:this.classes,fixedClasses:this.fixedClasses,variants:this.variants,wrapperTag:this.wrapperTag,inputWrapperTag:this.inputWrapperTag,labelTag:this.labelTag},scopedSlots:{default:this.$scopedSlots.default},on:{blur:this.blurHandler,focus:this.focusHandler,input:t=>{C.default(t,option.value)&&this.inputHandler(option.value)}}})},buildId(option,t){const e=[];return this.id?e.push(this.id):this.name&&e.push(this.name),["string","number"].includes(typeof option.value)?e.push(E.default(String(option.value))):e.push(t),e.join("-")},inputHandler(t){this.$emit("input",t)},blurHandler(t){this.$emit("blur",t)},focusHandler(t){this.$emit("focus",t)}}}),at=z.extend({name:"TCheckboxGroup",props:{groupWrapperTag:{type:String,default:"div"},wrapperTag:{type:String,default:"label"},inputWrapperTag:{type:String,default:"span"},labelTag:{type:String,default:"span"},value:{type:Array,default:()=>[]},fixedClasses:{type:Object,default:()=>({})},classes:{type:Object,default:()=>({groupWrapper:"flex flex-col",label:"",input:"text-blue-500 transition duration-100 ease-in-out border-gray-300 rounded shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 focus:ring-offset-0 disabled:opacity-50 disabled:cursor-not-allowed",inputWrapper:"inline-flex",wrapper:"inline-flex items-center space-x-2"})}},data(){return{localValue:this.value}},watch:{localValue(t){this.$emit("input",t),this.$emit("change",t)},value(t){this.localValue=t}},render(t){return(0,this.createRadioGroup)(t)},methods:{createRadioGroup(t){return t(this.groupWrapperTag,{ref:"wrapper",class:this.getElementCssClass("groupWrapper")},this.createRadioOptions(t))},createRadioOptions(t){return this.normalizedOptions.map(((option,e)=>this.createRadioOption(t,option,e)))},createRadioOption(t,option,e){return t(P,{props:{id:this.buildId(option,e),name:this.name,tabindex:this.tabindex,disabled:this.disabled,autofocus:this.autofocus,required:this.required,model:this.localValue,label:option.text,wrapped:!0,value:option.value,checked:this.value===option.value,variant:this.variant,classes:this.classes,fixedClasses:this.fixedClasses,variants:this.variants,wrapperTag:this.wrapperTag,inputWrapperTag:this.inputWrapperTag,labelTag:this.labelTag},scopedSlots:{default:this.$scopedSlots.default},on:{blur:this.blurHandler,focus:this.focusHandler,input:this.inputHandler}})},buildId(option,t){const e=[];return this.id?e.push(this.id):this.name&&e.push(this.name),["string","number"].includes(typeof option.value)?e.push(E.default(String(option.value))):e.push(t),e.join("-")},inputHandler(t){this.localValue=t},blurHandler(t){this.$emit("blur",t)},focusHandler(t){this.$emit("focus",t)}}}),lt=I.extend({name:"TTable",props:{data:{type:Array,default:()=>[]},headers:{type:Array,default:()=>[]},footerData:{type:Array,default:()=>[]},hideHeader:{type:Boolean,default:!1},showFooter:{type:Boolean,default:!1},responsive:{type:Boolean,default:!1},responsiveBreakpoint:{type:Number,default:768},classes:{type:Object,default:()=>({table:"min-w-full divide-y divide-gray-100 shadow-sm border-gray-200 border",thead:"",theadTr:"",theadTh:"px-3 py-2 font-semibold text-left bg-gray-100 border-b",tbody:"bg-white divide-y divide-gray-100",tr:"",td:"px-3 py-2 whitespace-no-wrap",tfoot:"",tfootTr:"",tfootTd:""})}},data(){return{ready:!this.responsive,windowWidth:null}},computed:{renderResponsive(){const{windowWidth:t}=this;return this.responsive&&t&&t"string"==typeof header?{text:header}:header))},normalizedFooterData(){return this.footerData.map((footer=>"string"==typeof footer?{text:footer}:footer))},headersValues(){return this.headers.filter((t=>t.value)).map((t=>t.value))},showHeader(){return!this.hideHeader}},mounted(){this.responsive&&(this.windowWidth=window.innerWidth,this.ready=!0,window.addEventListener("resize",this.resizeListener))},beforeDestroy(){this.responsive&&window.removeEventListener("resize",this.resizeListener)},render(t){return(0,this.renderTable)(t)},methods:{resizeListener(){this.windowWidth=window.innerWidth},renderTable(t){if(!this.ready)return t();const e=[];return this.renderResponsive||e.push(this.renderThead(t)),e.push(this.renderTbody(t)),(this.showFooter||this.$scopedSlots.tfoot)&&e.push(this.renderTfoot(t)),t("table",{ref:"table",class:this.getElementCssClass("table")},e)},renderThead(t){const e=this.getElementCssClass("theadTr"),n=this.getElementCssClass("theadTh"),r=this.getElementCssClass("thead");if(this.$scopedSlots.thead){const thead=this.$scopedSlots.thead({theadClass:r,trClass:e,thClass:n,data:this.normalizedHeaders});if(thead)return thead}if(!this.showHeader)return t();const o=this.normalizedHeaders.map((header=>t("th",{attrs:{id:header.id},class:header.className?[n,header.className]:n},header.text)));return t("thead",{class:r},[t("tr",{class:e},o)])},renderTfoot(t){const e=this.getElementCssClass("tfootTr"),n=this.getElementCssClass("tfootTd"),r=this.getElementCssClass("tfoot");if(this.$scopedSlots.tfoot){const tfoot=this.$scopedSlots.tfoot({tfootClass:r,trClass:e,tdClass:n,data:this.normalizedFooterData,headers:this.normalizedHeaders,renderResponsive:this.renderResponsive});if(tfoot)return tfoot}const o=this.normalizedFooterData.map((footer=>t("td",{attrs:{id:footer.id},class:footer.className?[n,footer.className]:n},footer.text)));return t("tfoot",{class:r},[t("tr",{class:e},o)])},renderTbody(t){if(this.$scopedSlots.tbody){const tbody=this.$scopedSlots.tbody({tbodyClass:this.getElementCssClass("tbody"),trClass:this.getElementCssClass("tr"),tdClass:this.getElementCssClass("td"),data:this.data,headers:this.normalizedHeaders,renderResponsive:this.renderResponsive});if(tbody)return tbody}return t("tbody",{class:this.getElementCssClass("tbody")},this.renderRows(t))},renderRows(t){return this.data.map(((e,n)=>{if(this.$scopedSlots.row){const t=this.$scopedSlots.row({rowIndex:n,row:e,trClass:this.getElementCssClass("tr"),tdClass:this.getElementCssClass("td")});if(t)return t}return t("tr",{class:this.getElementCssClass("tr")},this.renderCols(t,e,n))}))},renderCols(t,e,n){const r=this.getRowColumns(e);return"object"==typeof r?Object.keys(r).map((e=>{const text=r[e];return this.renderCol(t,text,n,e)})):r.map(((text,e)=>this.renderCol(t,text,n,e)))},renderCol(t,text,e,n){if(this.$scopedSlots.column){const t=this.$scopedSlots.column({rowIndex:e,columnIndex:n,text:text,tdClass:this.getElementCssClass("td")});if(t)return t}return t("td",{class:this.getElementCssClass("td")},text)},getRowColumns(t){return this.headersValues.length?"object"==typeof t?_.default(t,this.headersValues):{}:t}}}),ut={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:t=>{const s=t%100;if(s>3&&s<21)return"th";switch(s%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time24hr:!1,timeLabel:"Time",okLabel:"Ok"},ct=(t,e=2)=>`000${t}`.slice(-1*e),ht=t=>!0===t?1:0,pt=()=>{},ft=(t,e,n)=>n.months[e?"shorthand":"longhand"][t],mt={D:pt,F(t,e,n){t.setMonth(n.months.longhand.indexOf(e))},G:(t,e)=>{t.setHours(parseFloat(e))},H:(t,e)=>{t.setHours(parseFloat(e))},J:(t,e)=>{t.setDate(parseFloat(e))},K:(t,e,n)=>{t.setHours(t.getHours()%12+12*ht(new RegExp(n.amPM[1],"i").test(e)))},M(t,e,n){t.setMonth(n.months.shorthand.indexOf(e))},S:(t,e)=>{t.setSeconds(parseFloat(e))},U:(t,e)=>new Date(1e3*parseFloat(e)),W(t,e,n){const r=parseInt(e,10),o=new Date(t.getFullYear(),0,2+7*(r-1),0,0,0,0);return o.setDate(o.getDate()-o.getDay()+n.firstDayOfWeek),o},Y:(t,e)=>{t.setFullYear(parseFloat(e))},Z:(t,e)=>new Date(e),d:(t,e)=>{t.setDate(parseFloat(e))},h:(t,e)=>{t.setHours(parseFloat(e))},i:(t,e)=>{t.setMinutes(parseFloat(e))},j:(t,e)=>{t.setDate(parseFloat(e))},l:pt,m:(t,e)=>{t.setMonth(parseFloat(e)-1)},n:(t,e)=>{t.setMonth(parseFloat(e)-1)},s:(t,e)=>{t.setSeconds(parseFloat(e))},u:(t,e)=>new Date(parseFloat(e)),w:pt,y:(t,e)=>{t.setFullYear(2e3+parseFloat(e))}},gt={D:"(\\w+)",F:"(\\w+)",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"(\\w+)",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"(\\w+)",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},yt={Z:t=>t.toISOString(),D:(t,e)=>e.weekdays.shorthand[yt.w(t,e)],F:(t,e)=>ft(yt.n(t,e)-1,!1,e),G:(t,e)=>ct(yt.h(t,e)),H:t=>ct(t.getHours()),J:(t,e)=>void 0!==e.ordinal?t.getDate()+e.ordinal(t.getDate()):t.getDate(),K:(t,e)=>e.amPM[ht(t.getHours()>11)],M:(t,e)=>ft(t.getMonth(),!0,e),S:t=>ct(t.getSeconds()),U:t=>t.getTime()/1e3,W(t){const e=new Date(t.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);const n=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},Y:t=>ct(t.getFullYear(),4),d:t=>ct(t.getDate()),h:t=>t.getHours()%12?t.getHours()%12:12,i:t=>ct(t.getMinutes()),j:t=>t.getDate(),l:(t,e)=>e.weekdays.longhand[t.getDay()],m:t=>ct(t.getMonth()+1),n:t=>t.getMonth()+1,s:t=>t.getSeconds(),u:t=>t.getTime(),w:t=>t.getDay(),y:t=>String(t.getFullYear()).substring(2)},vt=(t,e,n)=>{if(!t)return"";const r=n||ut;return e.split("").map(((e,i,n)=>yt[e]&&"\\"!==n[i-1]?yt[e](t,r):"\\"!==e?e:"")).join("")},bt=(t,e="Y-m-d H:i:S",n,r)=>{if(0!==t&&!t)return;const o=r||ut,l=Object.assign({},gt);let c;l.K=`(${o.amPM[0]}|${o.amPM[1]}|${o.amPM[0].toLowerCase()}|${o.amPM[1].toLowerCase()})`;const h=t;if(t instanceof Date)c=new Date(t.getTime());else if("string"!=typeof t&&void 0!==t.toFixed)c=new Date(t);else if("string"==typeof t){const r=String(t).trim();if("today"===r)c=new Date,n=!0;else if(/Z$/.test(r)||/GMT$/.test(r))c=new Date(t);else{let n;c=new Date((new Date).getFullYear(),0,1,0,0,0,0);const r=[];for(let i=0,h=0,d="";i{const{fn:e}=t,{val:n}=t;c=e(c,String(n),o)||c}))}c=n?c:void 0}}if(!(c instanceof Date)||isNaN(c.getTime()))throw new Error(`Invalid date provided: ${h}`);return!0===n&&c.setHours(0,0,0,0),c};function wt(t,e,n=!0){return!1!==n?new Date(t.getTime()).setHours(0,0,0,0)-new Date(e.getTime()).setHours(0,0,0,0):t.getTime()-e.getTime()}const Ct=(t,e,n)=>{const r=Object.keys(e).find((e=>e===t)),o=r&&e[r]?e[r]:n;return A.default(T.default(ut),o)},xt=(t,e)=>(n,r="Y-m-d H:i:S",o)=>e?e(n,r,o,t):bt(n,r,o,t),Tt=(t,e)=>(n,r="Y-m-d H:i:S")=>e?e(n,r,t):vt(n,r,t);function St(t,e){return!!t&&!!e&&t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()}function kt(t,e){return St(t,e)&&(null==t?void 0:t.getDate())===(null==e?void 0:e.getDate())}function Et(t,e,n,r){return!!t&&("function"==typeof e?e(t):"string"==typeof e||e instanceof String?kt(n(e,r),t):e instanceof Date?kt(e,t):!!Array.isArray(e)&&e.some((e=>Et(t,e,n,r))))}function _t(t,e,n,r=null,o=null){let l,c;if("string"==typeof e||e instanceof String){if(!r)throw new Error("strings needs a date parser");if(!o)throw new Error("strings needs a date format");l=r(e,o)}else l=e;if("string"==typeof n||n instanceof String){if(!r)throw new Error("strings needs a date parser");if(!o)throw new Error("strings needs a date format");c=r(n,o)}else c=n;const time=t.getTime();return l&&c?timec.getTime():l?timec.getTime()}function At(t,e=1){const n=new Date(t);return n.setDate(n.getDate()+e),n}function Ot(t,e=1){let n=new Date(t.valueOf());return n.setMonth(t.getMonth()+e),n.getDate()!==t.getDate()&&(n=new Date(n.getFullYear(),n.getMonth(),0)),n}function It(t,e=1){let n=new Date(t.valueOf());return n.setFullYear(t.getFullYear()+e),n.getDate()!==t.getDate()&&(n=new Date(n.getFullYear(),n.getMonth(),0)),n}function Dt(t){return new Date(t.getFullYear(),t.getMonth()+1,0)}const Nt=(t,e)=>{const n=t.getFullYear(),r=n-Math.floor(n%e);return[r,r+e-1]};var jt;!function(t){t.Day="day",t.Month="month",t.Year="year"}(jt||(jt={}));const Pt=v.default.extend({name:"TDatepickerNavigator",props:{getElementCssClass:{type:Function,required:!0},value:{type:Date,default:null},showSelector:{type:Boolean,default:!0},currentView:{type:String,default:jt.Day,validator:t=>[jt.Day,jt.Month,jt.Year].includes(t)},parse:{type:Function,required:!0},formatNative:{type:Function,required:!0},dateFormat:{type:String,required:!0},yearsPerView:{type:Number,required:!0},maxDate:{type:[Date,String],default:void 0},minDate:{type:[Date,String],default:void 0},locale:{type:Object,required:!0}},data(){return{localValue:new Date(this.value.valueOf())}},computed:{isDayView(){return this.currentView===jt.Day},isYearView(){return this.currentView===jt.Year},isMonthView(){return this.currentView===jt.Month},nextDate(){return this.getNextDate()},prevDate(){return this.getPrevDate()},prevButtonIsDisabled(){return!this.prevDate},nextButtonIsDisabled(){return!this.nextDate},nextButtonAriaLabel(){return this.isDayView,`Next ${this.locale.yearAriaLabel}`},prevButtonAriaLabel(){return this.isDayView,`Prev ${this.locale.yearAriaLabel}`}},watch:{value(t){this.localValue=new Date(t.valueOf())}},methods:{getNextDate(){let t;return this.currentView===jt.Day?t=this.getNextMonth():this.currentView===jt.Month?t=this.getNextYear():this.currentView===jt.Year&&(t=this.getNextYearGroup()),t},getPrevDate(){let t;return this.currentView===jt.Day?t=this.getPrevMonth():this.currentView===jt.Month?t=this.getPrevYear():this.currentView===jt.Year&&(t=this.getPrevYearGroup()),t},inputHandler(t){this.$emit("input",t)},clickHandler(){this.currentView===jt.Day?this.$emit("update-view",jt.Month):this.currentView===jt.Month?this.$emit("update-view",jt.Year):this.currentView===jt.Year&&this.$emit("update-view",jt.Day)},next(){this.nextDate&&this.inputHandler(this.nextDate)},prev(){this.prevDate&&this.inputHandler(this.prevDate)},getPrevMonth(){const t=Ot(this.localValue,-1),e=this.parse;if(!_t(t,this.minDate,this.maxDate,e,this.dateFormat))return t;let n,r=t.getDate(),o=t;r=t.getDate();const l=Dt(t).getDate();do{o=At(o,1),r+=1,_t(o,this.minDate,this.maxDate,e,this.dateFormat)||(n=o)}while(r<=l&&!n);if(!n){r=t.getDate();do{o=At(o,-1),r-=1,_t(o,this.minDate,this.maxDate,e,this.dateFormat)||(n=o)}while(r>=1&&!n)}return n},getNextMonth(){const t=Ot(this.localValue,1),e=this.parse;if(!_t(t,this.minDate,this.maxDate,e,this.dateFormat))return t;let n,r=t.getDate(),o=t;do{o=At(o,-1),r-=1,_t(o,this.minDate,this.maxDate,e,this.dateFormat)||(n=o)}while(r>=1&&!n);if(!n){r=t.getDate();const l=Dt(t).getDate();do{o=At(o,1),r+=1,_t(o,this.minDate,this.maxDate,e,this.dateFormat)||(n=o)}while(r<=l&&!n)}return n},getPrevYear(){const t=It(this.localValue,-1),e=this.parse;if(!_t(t,this.minDate,this.maxDate,e,this.dateFormat))return t;let n,r=t;const o=t.getFullYear();do{r=At(r,1),_t(r,this.minDate,this.maxDate,e,this.dateFormat)||(n=r)}while(r.getFullYear()===o&&!n);if(!n)do{r=At(r,-1),_t(r,this.minDate,this.maxDate,e,this.dateFormat)||(n=r)}while(r.getFullYear()===o&&!n);return n},getNextYear(){const t=It(this.localValue,1),e=this.parse;if(!_t(t,this.minDate,this.maxDate,e,this.dateFormat))return t;let n,r=t;const o=t.getFullYear();do{r=At(r,-1),_t(r,this.minDate,this.maxDate,e,this.dateFormat)||(n=r)}while(r.getFullYear()===o&&!n);if(!n)do{r=At(r,1),_t(r,this.minDate,this.maxDate,e,this.dateFormat)||(n=r)}while(r.getFullYear()===o&&!n);return n},getPrevYearGroup(){const t=It(this.localValue,-this.yearsPerView),e=this.parse;if(!_t(t,this.minDate,this.maxDate,e,this.dateFormat))return t;let n,r=t;const o=t.getFullYear();do{r=At(r,this.yearsPerView),_t(r,this.minDate,this.maxDate,e,this.dateFormat)||(n=r)}while(r.getFullYear()===o&&!n);if(!n)do{r=At(r,-this.yearsPerView),_t(r,this.minDate,this.maxDate,e,this.dateFormat)||(n=r)}while(r.getFullYear()===o&&!n);return n},getNextYearGroup(){const t=It(this.localValue,this.yearsPerView),e=this.parse;if(!_t(t,this.minDate,this.maxDate,e,this.dateFormat))return t;let n,r=t;const o=t.getFullYear();do{r=At(r,-this.yearsPerView),_t(r,this.minDate,this.maxDate,e,this.dateFormat)||(n=r)}while(r.getFullYear()===o&&!n);if(!n)do{r=At(r,this.yearsPerView),_t(r,this.minDate,this.maxDate,e,this.dateFormat)||(n=r)}while(r.getFullYear()===o&&!n);return n}},render(t){const e=[];if(this.showSelector){const n=[];this.currentView===jt.Day&&n.push(t("span",{class:this.getElementCssClass("navigatorViewButtonMonthName")},this.formatNative(this.localValue,"F"))),this.currentView!==jt.Month&&this.currentView!==jt.Day||n.push(t("span",{class:this.getElementCssClass("navigatorViewButtonYear")},this.formatNative(this.localValue,"Y"))),this.currentView!==jt.Year?n.push(t("svg",{attrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},class:this.getElementCssClass("navigatorViewButtonIcon")},[t("polygon",{attrs:{points:"12.9497475 10.7071068 13.6568542 10 8 4.34314575 6.58578644 5.75735931 10.8284271 10 6.58578644 14.2426407 8 15.6568542 12.9497475 10.7071068"}})])):(n.push(t("svg",{attrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},class:this.getElementCssClass("navigatorViewButtonBackIcon")},[t("polygon",{attrs:{points:"7.05025253 9.29289322 6.34314575 10 12 15.6568542 13.4142136 14.2426407 9.17157288 10 13.4142136 5.75735931 12 4.34314575"}})])),n.push(t("span",{class:this.getElementCssClass("navigatorViewButtonYearRange")},Nt(this.localValue,this.yearsPerView).join(" - ")))),e.push(t("button",{attrs:{type:"button",class:this.getElementCssClass("navigatorViewButton"),tabindex:-1},on:{click:this.clickHandler}},n))}else e.push(t("span",{attrs:{class:this.getElementCssClass("navigatorLabel")}},[t("span",{class:this.getElementCssClass("navigatorLabelMonth")},this.formatNative(this.localValue,"F")),t("span",{class:this.getElementCssClass("navigatorLabelYear")},this.formatNative(this.localValue,"Y"))]));return this.showSelector&&(e.push(t("button",{ref:"prev",attrs:{"aria-label":this.prevButtonAriaLabel,type:"button",class:this.getElementCssClass("navigatorPrevButton"),tabindex:-1,disabled:!!this.prevButtonIsDisabled||void 0},on:{click:this.prev}},[t("svg",{attrs:{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},class:this.getElementCssClass("navigatorPrevButtonIcon")},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":2,d:"M15 19l-7-7 7-7"}})])])),e.push(t("button",{ref:"next",attrs:{"aria-label":this.nextButtonAriaLabel,type:"button",class:this.getElementCssClass("navigatorNextButton"),tabindex:-1,disabled:!!this.nextButtonIsDisabled||void 0},on:{click:this.next}},[t("svg",{attrs:{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},class:this.getElementCssClass("navigatorNextButtonIcon")},[t("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":2,d:"M9 5l7 7-7 7"}})])]))),t("div",{class:this.getElementCssClass("navigator")},e)}}),Rt=v.default.extend({name:"TDatepickerTrigger",props:{id:{type:String,default:void 0},name:{type:String,default:void 0},disabled:{type:Boolean,default:void 0},readonly:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},required:{type:Boolean,default:void 0},tabindex:{type:[String,Number],default:void 0},inputName:{type:String,default:void 0},placeholder:{type:String,default:void 0},show:{type:Function,default:void 0},hideIfFocusOutside:{type:Function,default:void 0},conjunction:{type:String,required:!0},multiple:{type:Boolean,required:!0},range:{type:Boolean,required:!0},clearable:{type:Boolean,required:!0},locale:{type:Object,required:!0},userFormatedDate:{type:[String,Array],required:!0},formatedDate:{type:[String,Array],required:!0},value:{type:[Date,Array],default:null},activeDate:{type:Date,required:!0},getElementCssClass:{type:Function,required:!0},hasFocus:{type:Boolean,required:!0}},computed:{hasValue(){return Array.isArray(this.value)?this.value.length>0:!!this.value}},methods:{clearButtonClickHandler(t){this.$emit("clear",t)}},render(t){const e=this.formatedDate;let n="";if(Array.isArray(this.userFormatedDate)){const t=this.range?this.locale.rangeSeparator:this.conjunction;n=this.userFormatedDate.join(t)}else n=this.userFormatedDate;const r=[t("input",{ref:"input",class:this.getElementCssClass("input"),attrs:{readonly:!!this.hasFocus||this.readonly,inputmode:"none",id:this.id,name:this.name,disabled:this.disabled,autocomplete:"off",autofocus:this.autofocus,type:"text",required:this.required,placeholder:this.placeholder,tabindex:this.tabindex,value:n},on:{click:t=>{this.show&&this.show(),this.$emit("click",t)},input:t=>{this.$emit("input",t)},keydown:t=>{this.$emit("keydown",t)},blur:t=>{this.hideIfFocusOutside&&this.hideIfFocusOutside(t),this.$emit("blur",t)},focus:t=>{this.show&&this.show(),this.$emit("focus",t)}}})];if(this.clearable&&this.hasValue){const e=this.$scopedSlots.clearButton?this.$scopedSlots.clearButton({className:this.getElementCssClass("clearButtonIcon"),formatedDate:this.formatedDate,userFormatedDate:this.userFormatedDate,value:this.value,activeDate:this.activeDate}):[t("svg",{attrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},class:this.getElementCssClass("clearButtonIcon")},[t("polygon",{attrs:{points:"10 8.58578644 2.92893219 1.51471863 1.51471863 2.92893219 8.58578644 10 1.51471863 17.0710678 2.92893219 18.4852814 10 11.4142136 17.0710678 18.4852814 18.4852814 17.0710678 11.4142136 10 18.4852814 2.92893219 17.0710678 1.51471863 10 8.58578644"}})])];r.push(t("button",{ref:"clearButton",class:this.getElementCssClass("clearButton"),attrs:{type:"button",tabindex:-1},on:{click:this.clearButtonClickHandler}},e))}if(this.multiple){const n=(Array.isArray(e)?e:[e]).map((e=>t("input",{attrs:{type:"hidden",value:e,name:this.name,disabled:this.disabled,readonly:this.readonly,required:this.required}})));r.push(...n)}else r.push(t("input",{attrs:{type:"hidden",value:Array.isArray(e)?e.join(this.conjunction):e,name:this.name,disabled:this.disabled,readonly:this.readonly,required:this.required}}));return t("div",{class:this.getElementCssClass("inputWrapper")},r)}}),Lt=v.default.extend({name:"TDatepickerViewsViewCalendarDaysDay",props:{day:{type:Date,required:!0},value:{type:[Date,Array],default:null},activeDate:{type:Date,required:!0},activeMonth:{type:Date,required:!0},getElementCssClass:{type:Function,required:!0},parse:{type:Function,required:!0},format:{type:Function,required:!0},formatNative:{type:Function,required:!0},dateFormat:{type:String,required:!0},userFormat:{type:String,required:!0},showDaysForOtherMonth:{type:Boolean,required:!0},showActiveDate:{type:Boolean,required:!0},disabledDates:{type:[Date,Array,Function,String],default:void 0},highlightDates:{type:[Date,Array,Function,String],default:void 0},maxDate:{type:[Date,String],default:void 0},minDate:{type:[Date,String],default:void 0},range:{type:Boolean,required:!0},dateWithoutTime:{type:Date,default:null}},data(){return{localActiveDate:new Date(this.activeDate.valueOf()),localActiveMonth:new Date(this.activeMonth.valueOf())}},computed:{isSelected(){const t=this.getDay(),e=this.getSelectedDay();return e instanceof Date?kt(t,e):!!Array.isArray(e)&&e.some((e=>kt(e,t)))},isActive(){return kt(this.getDay(),this.localActiveDate)},isToday(){return kt(this.getDay(),new Date)},isDisabled(){const t=this.getDay(),e=this.disabledDates,n=this.parse;return _t(t,this.minDate,this.maxDate,n,this.dateFormat)||Et(t,e,n,this.dateFormat)},isHighlighted(){return Et(this.getDay(),this.highlightDates,this.parse,this.dateFormat)},isForAnotherMonth(){const t=this.localActiveMonth,e=this.getDay();return t.getFullYear()!==e.getFullYear()||t.getMonth()!==e.getMonth()},isInRange(){if(!this.range||!Array.isArray(this.value))return!1;const[t,e]=this.value;return!(!t||!e||_t(this.getDay(),At(t,1),At(e,-1)))},isFirstDayOfRange(){if(!this.range||!Array.isArray(this.value))return!1;const[t]=this.value;return t&&kt(t,this.getDay())},isLastDayOfRange(){if(!this.range||!Array.isArray(this.value))return!1;const[,t]=this.value;return t&&kt(t,this.getDay())},dayFormatted(){return this.formatNative(this.getDay(),"j")},ariaLabel(){return this.format(this.getDay(),this.userFormat)},dateFormatted(){return this.format(this.getDay(),"Y-m-d")}},watch:{activeDate(t){this.localActiveDate=new Date(t.valueOf())},activeMonth(t){this.localActiveMonth=new Date(t.valueOf())}},methods:{getClass(){return this.isForAnotherMonth?this.getElementCssClass("otherMonthDay"):this.isFirstDayOfRange?this.getElementCssClass("inRangeFirstDay"):this.isLastDayOfRange?this.getElementCssClass("inRangeLastDay"):this.isInRange?this.getElementCssClass("inRangeDay"):this.isSelected?this.getElementCssClass("selectedDay"):this.isActive&&this.showActiveDate?this.getElementCssClass("activeDay"):this.isHighlighted?this.getElementCssClass("highlightedDay"):this.isToday?this.getElementCssClass("today"):this.getElementCssClass("day")},getDay(){return this.day},getSelectedDay(){return null!==this.dateWithoutTime?this.dateWithoutTime:this.value}},render(t){if(this.isForAnotherMonth&&!this.showDaysForOtherMonth)return t("span",{class:this.getElementCssClass("emptyDay")},"");const e=this.$scopedSlots.day?this.$scopedSlots.day({dayFormatted:this.dayFormatted,isForAnotherMonth:this.isForAnotherMonth,isFirstDayOfRange:this.isFirstDayOfRange,isLastDayOfRange:this.isLastDayOfRange,isInRange:this.isInRange,isSelected:this.isSelected,isActive:this.isActive,isHighlighted:this.isHighlighted,isToday:this.isToday,day:this.getDay(),activeDate:this.activeDate,value:this.value}):this.dayFormatted;return t("button",{class:this.getClass(),attrs:{"aria-label":this.ariaLabel,"aria-current":this.isToday?"date":void 0,"data-date":this.dateFormatted,type:"button",tabindex:-1,disabled:!!this.isDisabled||void 0},on:{click:t=>this.$emit("click",t)}},e)}}),$t=v.default.extend({name:"TDatepickerViewsViewCalendarDays",props:{value:{type:[Date,Array],default:null},activeDate:{type:Date,required:!0},activeMonth:{type:Date,required:!0},weekStart:{type:Number,required:!0},getElementCssClass:{type:Function,required:!0},parse:{type:Function,required:!0},format:{type:Function,required:!0},formatNative:{type:Function,required:!0},userFormat:{type:String,required:!0},dateFormat:{type:String,required:!0},showDaysForOtherMonth:{type:Boolean,required:!0},showActiveDate:{type:Boolean,required:!0},disabledDates:{type:[Date,Array,Function,String],default:void 0},highlightDates:{type:[Date,Array,Function,String],default:void 0},maxDate:{type:[Date,String],default:void 0},minDate:{type:[Date,String],default:void 0},range:{type:Boolean,required:!0},timepicker:{type:Boolean,required:!0},dateWithoutTime:{type:Date,default:null}},data(){return{localActiveDate:new Date(this.activeDate.valueOf()),localActiveMonth:new Date(this.activeMonth.valueOf())}},computed:{firstDayOfMonth(){const t=new Date(this.localActiveMonth.valueOf());return t.setDate(1),t},lastDayOfMonth(){return Dt(this.localActiveMonth)},firstDayOfPrevMonth(){return new Date(this.localActiveMonth.getFullYear(),this.localActiveMonth.getMonth()-1,1)},lastDayOfPrevMonth(){const t=new Date(this.localActiveMonth.valueOf());return t.setDate(0),t},firstDayOfNextMonth(){const t=new Date(this.localActiveMonth.valueOf());return t.setDate(1),t.setMonth(this.localActiveMonth.getMonth()+1),t},monthDays(){return Array.from({length:this.lastDayOfMonth.getDate()},((t,i)=>i+1)).map((t=>this.getDay(this.localActiveMonth,t)))},prevMonthDays(){let t=this.firstDayOfMonth.getDay()-this.weekStart;return t<0&&(t=7+t),Array.from({length:t},((t,i)=>this.lastDayOfPrevMonth.getDate()-i)).reverse().map((t=>this.getDay(this.firstDayOfPrevMonth,t)))},nextMonthDays(){const t=7-this.monthDays.concat(this.prevMonthDays).length%7;return 7===t?[]:Array.from({length:t},((t,i)=>i+1)).map((t=>this.getDay(this.firstDayOfNextMonth,t)))},days(){const{prevMonthDays:t}=this,{monthDays:e}=this,{nextMonthDays:n}=this;return t.concat(e,n)}},watch:{activeDate(t){this.localActiveDate=new Date(t.valueOf())},activeMonth(t){this.localActiveMonth=new Date(t.valueOf())}},methods:{getDay(t,e){const n=new Date(t.valueOf());return n.setDate(e),n}},render(t){return t("div",{class:this.getElementCssClass("calendarDaysWrapper")},this.days.map((e=>t("span",{class:this.getElementCssClass("calendarDaysDayWrapper")},[t(Lt,{props:{day:e,value:this.value,activeDate:this.localActiveDate,activeMonth:this.localActiveMonth,getElementCssClass:this.getElementCssClass,parse:this.parse,format:this.format,formatNative:this.formatNative,dateFormat:this.dateFormat,userFormat:this.userFormat,showDaysForOtherMonth:this.showDaysForOtherMonth,showActiveDate:this.showActiveDate,disabledDates:this.disabledDates,highlightDates:this.highlightDates,minDate:this.minDate,maxDate:this.maxDate,range:this.range,dateWithoutTime:this.dateWithoutTime},scopedSlots:this.$scopedSlots,on:{click:()=>{this.timepicker?this.$emit("input-date",e):this.$emit("input",e)}}})]))))}}),Mt=v.default.extend({name:"TDatepickerViewsViewCalendarHeaders",props:{weekStart:{type:Number,required:!0},getElementCssClass:{type:Function,required:!0},formatNative:{type:Function,required:!0}},computed:{weekDays(){return Array.from({length:7},((t,i)=>{const e=this.weekStart+i;return e>=7?e-7:e})).map(this.getWeekDayName)}},methods:{getWeekDayName(t){const e=new Date;return e.setDate((e.getDate()+(7+t-e.getDay()))%7),this.formatNative(e,"D")}},render(t){return t("div",{class:this.getElementCssClass("calendarHeaderWrapper")},this.weekDays.map((e=>t("span",{class:this.getElementCssClass("calendarHeaderWeekDay")},e))))}}),Ft=v.default.extend({name:"TDatepickerViewsViewCalendar",props:{value:{type:[Date,Array],default:null},activeDate:{type:Date,required:!0},activeMonth:{type:Date,required:!0},weekStart:{type:Number,required:!0},getElementCssClass:{type:Function,required:!0},parse:{type:Function,required:!0},format:{type:Function,required:!0},formatNative:{type:Function,required:!0},dateFormat:{type:String,required:!0},userFormat:{type:String,required:!0},monthsPerView:{type:Number,required:!0},showActiveDate:{type:Boolean,required:!0},disabledDates:{type:[Date,Array,Function,String],default:void 0},highlightDates:{type:[Date,Array,Function,String],default:void 0},maxDate:{type:[Date,String],default:void 0},minDate:{type:[Date,String],default:void 0},range:{type:Boolean,required:!0},showDaysForOtherMonth:{type:Boolean,required:!0},timepicker:{type:Boolean,required:!0},dateWithoutTime:{type:Date,default:null}},data(){return{localActiveDate:new Date(this.activeDate.valueOf()),localActiveMonth:new Date(this.activeMonth.valueOf())}},watch:{activeDate(t){this.localActiveDate=new Date(t.valueOf())},activeMonth(t){this.localActiveMonth=new Date(t.valueOf())}},render(t){return t("div",{class:this.getElementCssClass("calendarWrapper")},[t(Mt,{props:{weekStart:this.weekStart,getElementCssClass:this.getElementCssClass,formatNative:this.formatNative}}),t($t,{ref:"days",props:{value:this.value,activeDate:this.localActiveDate,activeMonth:this.localActiveMonth,weekStart:this.weekStart,getElementCssClass:this.getElementCssClass,parse:this.parse,format:this.format,formatNative:this.formatNative,userFormat:this.userFormat,dateFormat:this.dateFormat,showDaysForOtherMonth:!(this.monthsPerView>1)&&this.showDaysForOtherMonth,showActiveDate:this.showActiveDate,disabledDates:this.disabledDates,highlightDates:this.highlightDates,minDate:this.minDate,maxDate:this.maxDate,range:this.range,timepicker:this.timepicker,dateWithoutTime:this.dateWithoutTime},scopedSlots:this.$scopedSlots,on:{input:t=>this.$emit("input",t),"input-date":t=>this.$emit("input-date",t)}})])}}),Bt=v.default.extend({name:"TDatepickerViewsViewMonthsMonth",props:{month:{type:Date,required:!0},value:{type:[Date,Array],default:null},activeDate:{type:Date,required:!0},getElementCssClass:{type:Function,required:!0},formatNative:{type:Function,required:!0},showActiveDate:{type:Boolean,required:!0}},computed:{isSelected(){const t=this.getMonth(),e=this.value;return e instanceof Date?St(t,e):!!Array.isArray(e)&&e.some((e=>St(e,t)))},isActive(){return St(this.getMonth(),this.activeDate)},monthFormatted(){return this.formatNative(this.getMonth(),"M")}},methods:{getClass(){return this.isSelected?this.getElementCssClass("selectedMonth"):this.isActive&&this.showActiveDate?this.getElementCssClass("activeMonth"):this.getElementCssClass("month")},getMonth(){return this.month}},render(t){const e=this.$scopedSlots.month?this.$scopedSlots.month({monthFormatted:this.monthFormatted,isSelected:this.isSelected,isActive:this.isActive,month:this.getMonth(),activeDate:this.activeDate,value:this.value}):this.monthFormatted;return t("button",{class:this.getClass(),attrs:{"aria-label":this.formatNative(this.getMonth(),"F, Y"),"data-date":this.formatNative(this.getMonth(),"Y-m"),type:"button",tabindex:-1},on:{click:t=>this.$emit("click",t)}},e)}}),Vt=v.default.extend({name:"TDatepickerViewsViewMonths",props:{value:{type:[Date,Array],default:null},activeDate:{type:Date,required:!0},getElementCssClass:{type:Function,required:!0},showActiveDate:{type:Boolean,required:!0},formatNative:{type:Function,required:!0}},data(){return{localActiveDate:new Date(this.activeDate.valueOf())}},computed:{months(){return Array.from({length:12},((t,i)=>i)).map((t=>this.getMonth(t)))}},watch:{activeDate(t){this.localActiveDate=new Date(t.valueOf())}},methods:{getMonth(t){let e=new Date(this.localActiveDate.valueOf());return e.setMonth(t),e.getDate()!==this.localActiveDate.getDate()&&(e=new Date(e.getFullYear(),e.getMonth(),0)),e}},render(t){return t("div",{class:this.getElementCssClass("monthWrapper")},this.months.map((e=>t(Bt,{props:{month:e,value:this.value,activeDate:this.localActiveDate,getElementCssClass:this.getElementCssClass,showActiveDate:this.showActiveDate,formatNative:this.formatNative},scopedSlots:this.$scopedSlots,on:{click:()=>this.$emit("input",e)}}))))}}),qt=v.default.extend({name:"TDatepickerViewsViewYearsYear",props:{year:{type:Date,required:!0},activeDate:{type:Date,required:!0},value:{type:[Date,Array],default:null},getElementCssClass:{type:Function,required:!0},showActiveDate:{type:Boolean,required:!0},formatNative:{type:Function,required:!0}},data(){return{localActiveDate:new Date(this.activeDate.valueOf())}},computed:{isSelected(){const t=this.getYear(),e=this.value;return e instanceof Date?t.getFullYear()===e.getFullYear():!!Array.isArray(e)&&e.some((e=>e.getFullYear()===t.getFullYear()))},isActive(){const t=this.getYear(),e=this.activeDate;return e&&t.getFullYear()===e.getFullYear()},yearFormatted(){return this.formatNative(this.getYear(),"Y")}},watch:{activeDate(t){this.localActiveDate=new Date(t.valueOf())}},methods:{getClass(){return this.isSelected?this.getElementCssClass("selectedYear"):this.isActive&&this.showActiveDate?this.getElementCssClass("activeYear"):this.getElementCssClass("year")},getYear(){return this.year}},render(t){const e=this.$scopedSlots.year?this.$scopedSlots.year({yearFormatted:this.yearFormatted,isSelected:this.isSelected,isActive:this.isActive,year:this.getYear(),activeDate:this.activeDate,value:this.value}):this.yearFormatted;return t("button",{class:this.getClass(),attrs:{"aria-label":this.yearFormatted,"data-date":this.yearFormatted,type:"button",tabindex:-1},on:{click:t=>this.$emit("click",t)}},e)}}),Ut=v.default.extend({name:"TDatepickerViewsViewYears",props:{value:{type:[Date,Array],default:null},activeDate:{type:Date,required:!0},getElementCssClass:{type:Function,required:!0},yearsPerView:{type:Number,required:!0},showActiveDate:{type:Boolean,required:!0},formatNative:{type:Function,required:!0}},data(){return{localActiveDate:new Date(this.activeDate.valueOf())}},computed:{years(){const[t]=Nt(this.localActiveDate,this.yearsPerView);return Array.from({length:this.yearsPerView},((t,i)=>i)).map((e=>this.getYear(t+e)))}},watch:{activeDate(t){this.localActiveDate=new Date(t.valueOf())}},methods:{getYear(t){let e=new Date(this.localActiveDate.valueOf());return e.setFullYear(t),e.getDate()!==this.localActiveDate.getDate()&&(e=new Date(e.getFullYear(),e.getMonth(),0)),e}},render(t){return t("div",{class:this.getElementCssClass("yearWrapper")},this.years.map((e=>t(qt,{props:{year:e,activeDate:this.localActiveDate,value:this.value,getElementCssClass:this.getElementCssClass,showActiveDate:this.showActiveDate,formatNative:this.formatNative},scopedSlots:this.$scopedSlots,on:{click:()=>this.$emit("input",e)}}))))}}),Ht=v.default.extend({name:"TDatepickerViewsView",props:{value:{type:[Date,Array],default:null},activeMonth:{type:Date,required:!0},activeDate:{type:Date,required:!0},weekStart:{type:Number,required:!0},lang:{type:String,required:!0},getElementCssClass:{type:Function,required:!0},formatNative:{type:Function,required:!0},parse:{type:Function,required:!0},format:{type:Function,required:!0},userFormat:{type:String,required:!0},dateFormat:{type:String,required:!0},monthsPerView:{type:Number,required:!0},monthIndex:{type:Number,required:!0},currentView:{type:String,required:!0},yearsPerView:{type:Number,required:!0},showActiveDate:{type:Boolean,required:!0},showDaysForOtherMonth:{type:Boolean,required:!0},disabledDates:{type:[Date,Array,Function,String],default:void 0},highlightDates:{type:[Date,Array,Function,String],default:void 0},maxDate:{type:[Date,String],default:void 0},minDate:{type:[Date,String],default:void 0},range:{type:Boolean,required:!0},locale:{type:Object,required:!0},timepicker:{type:Boolean,required:!0},dateWithoutTime:{type:Date,default:null}},data(){return{localActiveDate:new Date(this.activeDate.valueOf()),localActiveMonth:new Date(this.activeMonth.valueOf())}},computed:{isFirstMonth(){return 0===this.monthIndex},isLastMonth(){return this.monthIndex===this.monthsPerView-1},showMonthName(){return this.monthsPerView>1}},watch:{activeDate(t){this.localActiveDate=new Date(t.valueOf())},activeMonth(t){this.localActiveMonth=new Date(t.valueOf())}},methods:{inputHandler(t){this.resetView(),this.$emit("input",t)},inputDateHandler(t){this.$emit("input-date",t)},viewInputActiveDateHandler(t){this.resetView(),this.inputActiveDateHandler(t)},inputActiveDateHandler(t){this.$emit("input-active-date",t),this.resetFocus()},resetFocus(){this.$emit("reset-focus")},resetView(){this.$emit("reset-view")}},render(t){const e=[];return e.push(t(Pt,{ref:"navigator",props:{value:this.localActiveMonth,getElementCssClass:this.getElementCssClass,showSelector:this.isFirstMonth,currentView:this.currentView,parse:this.parse,formatNative:this.formatNative,dateFormat:this.dateFormat,yearsPerView:this.yearsPerView,minDate:this.minDate,maxDate:this.maxDate,locale:this.locale},on:{input:this.inputActiveDateHandler,"update-view":t=>{this.$emit("update-view",t)}}})),this.currentView===jt.Day?e.push(t(Ft,{ref:"calendar",props:{value:this.value,activeMonth:this.localActiveMonth,activeDate:this.localActiveDate,weekStart:this.weekStart,getElementCssClass:this.getElementCssClass,showDaysForOtherMonth:this.showDaysForOtherMonth,parse:this.parse,format:this.format,formatNative:this.formatNative,dateFormat:this.dateFormat,userFormat:this.userFormat,monthsPerView:this.monthsPerView,showActiveDate:this.showActiveDate,disabledDates:this.disabledDates,highlightDates:this.highlightDates,minDate:this.minDate,maxDate:this.maxDate,range:this.range,timepicker:this.timepicker,dateWithoutTime:this.dateWithoutTime},scopedSlots:this.$scopedSlots,on:{input:this.inputHandler,"input-date":this.inputDateHandler}})):this.currentView===jt.Month?e.push(t(Vt,{ref:"months",props:{value:this.value,activeDate:this.localActiveDate,getElementCssClass:this.getElementCssClass,showActiveDate:this.showActiveDate,formatNative:this.formatNative},scopedSlots:this.$scopedSlots,on:{input:this.viewInputActiveDateHandler}})):this.currentView===jt.Year&&e.push(t(Ut,{ref:"years",props:{value:this.value,activeDate:this.localActiveDate,getElementCssClass:this.getElementCssClass,yearsPerView:this.yearsPerView,showActiveDate:this.showActiveDate,formatNative:this.formatNative},scopedSlots:this.$scopedSlots,on:{input:this.viewInputActiveDateHandler}})),t("div",{class:this.getElementCssClass("view")},e)}}),Wt=v.default.extend({name:"TDatepickerViews",props:{value:{type:[Date,Array],default:null},activeDate:{type:Date,required:!0},weekStart:{type:Number,required:!0},monthsPerView:{type:Number,required:!0},lang:{type:String,required:!0},getElementCssClass:{type:Function,required:!0},parse:{type:Function,required:!0},format:{type:Function,required:!0},formatNative:{type:Function,required:!0},dateFormat:{type:String,required:!0},userFormat:{type:String,required:!0},initialView:{type:String,required:!0},currentView:{type:String,required:!0},yearsPerView:{type:Number,required:!0},showActiveDate:{type:Boolean,required:!0},showDaysForOtherMonth:{type:Boolean,required:!0},disabledDates:{type:[Date,Array,Function,String],default:void 0},highlightDates:{type:[Date,Array,Function,String],default:void 0},maxDate:{type:[Date,String],default:void 0},minDate:{type:[Date,String],default:void 0},range:{type:Boolean,required:!0},locale:{type:Object,required:!0},timepicker:{type:Boolean,required:!0},dateWithoutTime:{type:Date,default:null}},data(){return{localActiveDate:new Date(this.activeDate.valueOf())}},computed:{activeMonths(){return Array.from({length:this.monthsPerView},((t,i)=>i)).map((i=>Ot(this.localActiveDate,i)))}},watch:{activeDate(t){this.localActiveDate=new Date(t.valueOf())}},render(t){const e=this.activeMonths.map(((e,n)=>t(Ht,{ref:"view",props:{value:this.value,activeMonth:e,activeDate:this.localActiveDate,weekStart:this.weekStart,lang:this.lang,getElementCssClass:this.getElementCssClass,parse:this.parse,format:this.format,dateFormat:this.dateFormat,userFormat:this.userFormat,formatNative:this.formatNative,monthsPerView:this.monthsPerView,monthIndex:n,currentView:0===n?this.currentView:this.initialView,yearsPerView:this.yearsPerView,showActiveDate:this.showActiveDate,disabledDates:this.disabledDates,highlightDates:this.highlightDates,minDate:this.minDate,maxDate:this.maxDate,range:this.range,showDaysForOtherMonth:this.showDaysForOtherMonth,locale:this.locale,timepicker:this.timepicker,dateWithoutTime:this.dateWithoutTime},scopedSlots:this.$scopedSlots,on:{input:t=>{this.$emit("input",t)},"input-date":t=>{this.$emit("input-date",t)},"input-time":t=>{this.$emit("input-time",t)},"input-active-date":t=>{this.$emit("input-active-date",t)},"update-view":t=>{this.$emit("update-view",t)},"reset-view":()=>{this.$emit("reset-view")},"reset-focus":()=>{this.$emit("reset-focus")}}})));return t("div",{class:this.getElementCssClass("viewGroup")},e)}}),zt=(t,e)=>Array.isArray(t)?t.indexOf(e)>=0:t===e,Kt=D.extend({name:"TToggle",props:{value:{type:[String,Object,Number,Boolean,Array],default:!0},uncheckedValue:{type:[String,Object,Number,Boolean,Array],default:!1},model:{type:[String,Object,Number,Boolean,Array],default:void 0},checked:{type:Boolean,default:void 0},tabindex:{type:[String,Number],default:0},uncheckedPlaceholder:{type:String,default:void 0},checkedPlaceholder:{type:String,default:void 0},uncheckedLabel:{type:String,default:void 0},checkedLabel:{type:String,default:void 0},classes:{type:Object,default:()=>({wrapper:"bg-gray-100 rounded-full border-2 border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50",wrapperChecked:"bg-blue-500 rounded-full border-2 border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50",wrapperDisabled:"bg-gray-100 rounded-full border-2 border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50",wrapperCheckedDisabled:"bg-blue-500 rounded-full border-2 border-transparent focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50",button:"h-5 w-5 rounded-full bg-white shadow flex items-center justify-center text-gray-400 text-xs",buttonChecked:"h-5 w-5 rounded-full bg-white shadow flex items-center justify-center text-blue-500 text-xs",checkedPlaceholder:"rounded-full w-5 h-5 flex items-center justify-center text-gray-400 text-xs",uncheckedPlaceholder:"rounded-full w-5 h-5 flex items-center justify-center text-gray-400 text-xs"})},fixedClasses:{type:[String,Array,Object],default:()=>({wrapper:"relative inline-flex flex-shrink-0 cursor-pointer transition-colors ease-in-out duration-200",wrapperChecked:"relative inline-flex flex-shrink-0 cursor-pointer transition-colors ease-in-out duration-200",wrapperDisabled:"relative inline-flex flex-shrink-0 cursor-pointer transition-colors ease-in-out duration-200 opacity-50 cursor-not-allowed",wrapperCheckedDisabled:"relative inline-flex flex-shrink-0 cursor-pointer transition-colors ease-in-out duration-200 opacity-50 cursor-not-allowed",button:"inline-block absolute transform translate-x-0 transition ease-in-out duration-200",buttonChecked:"inline-block absolute transform translate-x-full transition ease-in-out duration-200",checkedPlaceholder:"inline-block",uncheckedPlaceholder:"inline-block"})}},model:{prop:"model",event:"input"},data(){return{isChecked:"boolean"==typeof this.checked&&void 0===this.model?this.checked:zt(this.model,this.value)}},computed:{isDisabled(){return this.disabled||this.readonly},currentValue(){return this.isChecked?this.value:this.uncheckedValue}},watch:{model(t){this.isChecked=zt(t,this.value)},isChecked(t){let e;if(Array.isArray(this.model)){e=[...this.model];const n=e.indexOf(this.value);t&&n<0?e.push(this.value):!t&&n>=0&&e.splice(n,1)}else e=this.currentValue;this.$emit("input",e),this.$emit("change",e),this.$emit("update:checked",t)}},methods:{blurHandler(t){this.$emit("blur",t)},focusHandler(t){this.$emit("focus",t)},getElement(){return this.$el},blur(){this.getElement().blur()},click(){this.getElement().click()},spaceHandler(t){t.preventDefault(),this.toggleValue()},clickHandler(){this.toggleValue()},toggleValue(){this.isDisabled||(this.isChecked=!this.isChecked)},setChecked(t){this.isChecked=t},focus(t){this.getElement().focus(t)}},render(t){let e;e=this.isDisabled?this.isChecked?this.getElementCssClass("wrapperCheckedDisabled"):this.getElementCssClass("wrapperDisabled"):this.isChecked?this.getElementCssClass("wrapperChecked"):this.getElementCssClass("wrapper");let n=this.$scopedSlots.default?this.$scopedSlots.default({value:this.currentValue,uncheckedValue:this.uncheckedValue,isChecked:this.isChecked}):null;n||(n=this.isChecked?this.checkedLabel:this.uncheckedLabel);let r=this.$scopedSlots.checked?this.$scopedSlots.checked({value:this.currentValue,uncheckedValue:this.uncheckedValue,isChecked:this.isChecked}):null;this.checkedPlaceholder&&!r&&(r=this.checkedPlaceholder);let o=this.$scopedSlots.unchecked?this.$scopedSlots.unchecked({value:this.currentValue,uncheckedValue:this.uncheckedValue,isChecked:this.isChecked}):null;return this.uncheckedPlaceholder&&!o&&(o=this.uncheckedPlaceholder),t("span",{class:e,attrs:{role:"checkbox",id:this.id,tabindex:this.tabindex,autofocus:this.autofocus,"aria-checked":this.isChecked?"true":"false"},on:{blur:this.blurHandler,focus:this.focusHandler,click:t=>{this.clickHandler(),this.$emit("click",t)},keydown:t=>{t.keyCode===j.SPACE&&this.spaceHandler(t),this.$emit("keydown",t)}}},[t("input",{ref:"input",attrs:{value:this.currentValue,type:"hidden",name:this.name,disabled:this.disabled,readonly:this.readonly,required:this.required}}),t("span",{class:this.getElementCssClass("checkedPlaceholder"),attrs:{"aria-hidden":"true"}},r),t("span",{class:this.getElementCssClass("uncheckedPlaceholder"),attrs:{"aria-hidden":"true"}},o),t("span",{ref:"button",class:this.isChecked?this.getElementCssClass("buttonChecked"):this.getElementCssClass("button"),attrs:{"aria-hidden":"true"}},n)])}}),Gt=t=>/^\d+$/.test(String(t)),Yt=v.default.extend({name:"TDatepickerTimeSelector",props:{parse:{type:Function,required:!0},format:{type:Function,required:!0},amPm:{type:Boolean,required:!0},showSeconds:{type:Boolean,required:!0},activeDate:{type:Date,required:!0},locale:{type:Object,required:!0},getElementCssClass:{type:Function,required:!0}},data(){return{localActiveDate:new Date(this.activeDate.valueOf()),alreadyTriedAnInvalidValue:!1,lastValidValue:"",timeInputKeys:[]}},computed:{amPmFormatted(){return this.amPm?this.format(this.localActiveDate,"K"):null},minutesFormatted(){return this.format(this.localActiveDate,"i")},hoursFormatted(){return this.amPm?this.format(this.localActiveDate,"G"):this.format(this.localActiveDate,"H")},secondsFormatted(){return this.format(this.localActiveDate,"S")}},watch:{timeInputKeys(t){const e=t.join("").substr(this.showSeconds?-6:-4),n=this.$refs.minutes,r=this.$refs.hours,o=e.padStart(this.showSeconds?6:4," ").substr(this.showSeconds?-6:-4);this.showSeconds?(this.$refs.seconds.value=o.substr(4,2).trim(),n.value=o.substr(2,2).trim(),r.value=o.substr(0,2).trim()):(n.value=o.substr(2,2).trim(),r.value=o.substr(0,2).trim())},activeDate(t){this.localActiveDate=new Date(t.valueOf()),this.lastValidValue="",this.alreadyTriedAnInvalidValue=!1,this.timeInputKeys=[]}},methods:{handleFullTimeBlur(t){if(this.$emit("blur",t),!this.timeInputKeys.length)return;const e=this.timeInputKeys.filter((t=>Gt(t))).join("").substr(this.showSeconds?-6:-4).padStart(this.showSeconds?6:4,"0").substr(this.showSeconds?-6:-4);let time;if(this.showSeconds)if(this.amPm&&Number(e.substr(0,2))<=12){const t=`${e.substr(0,2)}:${e.substr(2,2)}:${e.substr(4,2)} ${this.amPmFormatted}`;time=this.parse(t,"H:i:S K")}else{const t=`${e.substr(0,2)}:${e.substr(2,2)}:${e.substr(4,2)}`;time=this.parse(t,"G:i:S")}else if(this.amPm&&Number(e.substr(0,2))<=12){const t=`${e.substr(0,2)}:${e.substr(2,2)} ${this.amPmFormatted}`;time=this.parse(t,"H:i K")}else{const t=`${e.substr(0,2)}:${e.substr(2,2)}`;time=this.parse(t,"G:i")}time instanceof Date&&!Number.isNaN(time)&&(this.setHours(time.getHours()),this.setMinutes(time.getMinutes()),this.setSeconds(time.getSeconds()),this.$emit("input",this.localActiveDate),this.$nextTick((()=>{this.updateSecondsInput(),this.updateMinutesInput(),this.updateHoursInput()}))),this.focusNextElementFullTimeSelector()},focusNextElementFullTimeSelector(){this.amPm?this.$refs.amPm.focus():this.focusOkButton()},focusOkButton(){this.$refs.okButton.focus()},handleTimeInputFocus(t){const input=t.target;input.focus(),setTimeout((()=>{input.setSelectionRange(0,2)}),1)},handleTimeInput(t,e,n,r){const input=t.target,{value:o}=input;if(""===o)return;const l=Number(o),c=Number(t.data);if(Gt(l))if(l>e||l{const e=this.amPm?12:23,n=this.amPm?1:0;this.handleTimeInput(t,e,n,(t=>{this.amPm?12===t?this.setHours(this.amPmFormatted===this.locale.amPM[1]?t:0):this.setHours(this.amPmFormatted===this.locale.amPM[1]?t+12:t):this.setHours(t)}))},blur:t=>{this.$emit("blur",t),this.$emit("input",this.localActiveDate),this.$nextTick((()=>{this.updateHoursInput()}))},focus:t=>{this.handleTimeInputFocus(t)}}}),t("span",{class:this.getElementCssClass("timepickerTimeSeparator"),attrs:{contenteditable:!1}},":"),t("input",{ref:"minutes",class:this.getElementCssClass("timepickerInput"),domProps:{value:this.minutesFormatted},attrs:{inputmode:"numeric",type:"text",contenteditable:!1},on:{input:t=>{const e=59,n=0;this.handleTimeInput(t,e,n,this.setMinutes)},blur:t=>{this.$emit("blur",t),this.$emit("input",this.localActiveDate),this.$nextTick((()=>{this.updateMinutesInput()}))},focus:t=>{this.handleTimeInputFocus(t)}}})];this.showSeconds&&(n.push(t("span",{class:this.getElementCssClass("timepickerTimeSeparator"),attrs:{contenteditable:!1}},":")),n.push(t("input",{ref:"seconds",class:this.getElementCssClass("timepickerInput"),domProps:{value:this.secondsFormatted},attrs:{inputmode:"numeric",type:"text",contenteditable:!1},on:{input:t=>{const e=59,n=0;this.handleTimeInput(t,e,n,this.setSeconds)},blur:t=>{this.$emit("blur",t),this.$emit("input",this.localActiveDate),this.$nextTick((()=>{this.updateSecondsInput()}))},focus:t=>{this.handleTimeInputFocus(t)}}})));const r=[t("div",{ref:"timeInput",class:this.getElementCssClass("timepickerTimeFieldsWrapper"),style:{caretColor:"transparent"},attrs:{tabindex:0,inputmode:"numeric",contenteditable:!0},on:{keydown:t=>{if(t.target!==this.$refs.timeInput)return;t.preventDefault();const{key:e}=t;"Enter"===e?this.focusNextElementFullTimeSelector():"Backspace"===e&&this.timeInputKeys.pop(),Gt(e)&&this.timeInputKeys.push(e)},blur:this.handleFullTimeBlur}},n)];this.amPm&&r.push(t(Kt,{ref:"amPm",props:{model:this.amPmFormatted,value:this.locale.amPM[1],uncheckedValue:this.locale.amPM[0],checkedPlaceholder:this.locale.amPM[0],uncheckedPlaceholder:this.locale.amPM[1],checkedLabel:this.locale.amPM[1],uncheckedLabel:this.locale.amPM[0],fixedClasses:{wrapper:"",wrapperChecked:"",wrapperDisabled:"",wrapperCheckedDisabled:"",button:"",buttonChecked:"",checkedPlaceholder:"",uncheckedPlaceholder:""},classes:{wrapper:this.getElementCssClass("timepickerAmPmWrapper"),wrapperChecked:this.getElementCssClass("timepickerAmPmWrapperChecked"),wrapperDisabled:this.getElementCssClass("timepickerAmPmWrapperDisabled"),wrapperCheckedDisabled:this.getElementCssClass("timepickerAmPmWrapperCheckedDisabled"),button:this.getElementCssClass("timepickerAmPmButton"),buttonChecked:this.getElementCssClass("timepickerAmPmButtonChecked"),checkedPlaceholder:this.getElementCssClass("timepickerAmPmCheckedPlaceholder"),uncheckedPlaceholder:this.getElementCssClass("timepickerAmPmUncheckedPlaceholder")}},on:{blur:t=>this.$emit("blur",t),input:t=>{const e=this.format(new Date(this.localActiveDate.valueOf()),"Y-m-d G:i:S"),n=this.parse(`${e} ${t}`,"Y-m-d G:i:S K");this.$emit("input",n)},keydown:t=>{const{key:e}=t;"Enter"===e&&this.focusOkButton()}}})),r.push(t("a",{ref:"okButton",attrs:{href:"#"},class:this.getElementCssClass("timepickerOkButton"),on:{blur:t=>this.$emit("blur",t),click:t=>{t.preventDefault(),this.$emit("submit",this.localActiveDate)}}},this.locale.okLabel));const o=t("div",{class:this.getElementCssClass("timepickerTimeWrapper")},r);return e.push(label),e.push(o),t("div",{class:this.getElementCssClass("timepickerWrapper")},e)}}),Jt=(t,e,n,r,o,l)=>{if(Array.isArray(t)&&t.length)return t[t.length-1];if(t instanceof Date)return t;const c=r(e,n)||new Date;if(l){const t=r(l,o?"G:i:S K":"H:i:S");t&&(c.setHours(t.getHours()),c.setMinutes(t.getMinutes()),c.setSeconds(t.getSeconds()))}return c},Qt=D.extend({name:"TDatepicker",props:{value:{type:[Date,String,Number,Array],default:null},placeholder:{type:String,default:void 0},inputName:{type:String,default:void 0},weekStart:{type:Number,default:0},monthsPerView:{type:Number,default:1,validator:t=>t>=1},lang:{type:String,default:"en"},locale:{type:Object,default:()=>ut},locales:{type:Object,default:()=>({})},dateFormat:{type:String,default:"Y-m-d"},userFormat:{type:String,default:"F j, Y"},dateFormatter:{type:Function,default:void 0},dateParser:{type:Function,default:void 0},closeOnSelect:{type:Boolean,default:!0},showDaysForOtherMonth:{type:Boolean,default:!0},show:{type:Boolean,default:!1},inline:{type:Boolean,default:!1},initialView:{type:String,default:jt.Day,validator:t=>[jt.Day,jt.Month,jt.Year].includes(t)},yearsPerView:{type:Number,default:12},disabledDates:{type:[Date,Array,Function,String],default:void 0},highlightDates:{type:[Date,Array,Function,String],default:void 0},maxDate:{type:[Date,String],default:void 0},minDate:{type:[Date,String],default:void 0},initialDate:{type:[Date,String],default:void 0},initialTime:{type:String,default:void 0},conjunction:{type:String,default:","},multiple:{type:Boolean,default:!1},range:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},datepicker:{type:Boolean,default:!0},timepicker:{type:Boolean,default:!1},amPm:{type:Boolean,default:!1},showSeconds:{type:Boolean,default:!1},classes:{type:Object,default:()=>({wrapper:"flex flex-col",dropdownWrapper:"relative z-10",dropdown:"origin-top-left absolute rounded shadow bg-white overflow-hidden mt-1",enterClass:"opacity-0 scale-95",enterActiveClass:"transition transform ease-out duration-100",enterToClass:"opacity-100 scale-100",leaveClass:"opacity-100 scale-100",leaveActiveClass:"transition transform ease-in duration-75",leaveToClass:"opacity-0 scale-95",inlineWrapper:"",inlineViews:"rounded bg-white border mt-1 inline-flex flex-col",inputWrapper:"",input:"block w-full px-3 py-2 text-black placeholder-gray-400 transition duration-100 ease-in-out bg-white border border-gray-300 rounded shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed",clearButton:"hover:bg-gray-100 rounded transition duration-100 ease-in-out text-gray-600",clearButtonIcon:"",viewGroup:"",view:"",navigator:"pt-2 px-3",navigatorViewButton:"transition ease-in-out duration-100 inline-flex cursor-pointer rounded-full px-2 py-1 -ml-1 hover:bg-gray-100",navigatorViewButtonIcon:"fill-current text-gray-400",navigatorViewButtonBackIcon:"fill-current text-gray-400",navigatorViewButtonMonth:"text-gray-700 font-semibold",navigatorViewButtonYear:"text-gray-500 ml-1",navigatorViewButtonYearRange:"text-gray-500 ml-1",navigatorLabel:"py-1",navigatorLabelMonth:"text-gray-700 font-semibold",navigatorLabelYear:"text-gray-500 ml-1",navigatorPrevButton:"transition ease-in-out duration-100 inline-flex cursor-pointer hover:bg-gray-100 rounded-full p-1 ml-2 ml-auto disabled:opacity-50 disabled:cursor-not-allowed",navigatorNextButton:"transition ease-in-out duration-100 inline-flex cursor-pointer hover:bg-gray-100 rounded-full p-1 -mr-1 disabled:opacity-50 disabled:cursor-not-allowed",navigatorPrevButtonIcon:"text-gray-400",navigatorNextButtonIcon:"text-gray-400",calendarWrapper:"px-3 py-2",calendarHeaderWrapper:"",calendarHeaderWeekDay:"uppercase text-xs text-gray-500 w-8 h-8 flex items-center justify-center",calendarDaysWrapper:"",calendarDaysDayWrapper:"w-full h-8 flex flex-shrink-0 items-center",otherMonthDay:"text-sm rounded-full w-8 h-8 mx-auto hover:bg-blue-100 text-gray-400 disabled:opacity-50 disabled:cursor-not-allowed",emptyDay:"",inRangeFirstDay:"text-sm bg-blue-500 text-white w-full h-8 rounded-l-full",inRangeLastDay:"text-sm bg-blue-500 text-white w-full h-8 rounded-r-full",inRangeDay:"text-sm bg-blue-200 w-full h-8 disabled:opacity-50 disabled:cursor-not-allowed",selectedDay:"text-sm rounded-full w-8 h-8 mx-auto bg-blue-500 text-white disabled:opacity-50 disabled:cursor-not-allowed",activeDay:"text-sm rounded-full bg-blue-100 w-8 h-8 mx-auto disabled:opacity-50 disabled:cursor-not-allowed",highlightedDay:"text-sm rounded-full bg-blue-200 w-8 h-8 mx-auto disabled:opacity-50 disabled:cursor-not-allowed",day:"text-sm rounded-full w-8 h-8 mx-auto hover:bg-blue-100 disabled:opacity-50 disabled:cursor-not-allowed",today:"text-sm rounded-full w-8 h-8 mx-auto hover:bg-blue-100 disabled:opacity-50 disabled:cursor-not-allowed border border-blue-500",monthWrapper:"px-3 py-2",selectedMonth:"text-sm rounded w-full h-12 mx-auto bg-blue-500 text-white",activeMonth:"text-sm rounded w-full h-12 mx-auto bg-blue-100",month:"text-sm rounded w-full h-12 mx-auto hover:bg-blue-100",yearWrapper:"px-3 py-2",year:"text-sm rounded w-full h-12 mx-auto hover:bg-blue-100",selectedYear:"text-sm rounded w-full h-12 mx-auto bg-blue-500 text-white",activeYear:"text-sm rounded w-full h-12 mx-auto bg-blue-100",timepickerWrapper:"flex items-center px-4 py-2 space-x-2",timepickerTimeWrapper:"flex items-center space-x-2",timepickerTimeFieldsWrapper:"bg-gray-100 rounded-md w-full text-right flex items-center border border-gray-100 focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50",timepickerOkButton:"text-blue-600 text-sm uppercase font-semibold transition duration-100 ease-in-out border border-transparent focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 rounded cursor-pointer",timepickerInput:"text-center w-8 border-transparent bg-transparent p-0 h-6 text-sm transition duration-100 ease-in-out border border-transparent focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 rounded",timepickerTimeLabel:"flex-grow text-sm text-gray-500",timepickerAmPmWrapper:"relative inline-flex flex-shrink-0 transition duration-200 ease-in-out bg-gray-100 border border-transparent rounded cursor-pointer focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50",timepickerAmPmWrapperChecked:"relative inline-flex flex-shrink-0 transition duration-200 ease-in-out bg-gray-100 border border-transparent rounded cursor-pointer focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50",timepickerAmPmWrapperDisabled:"relative inline-flex flex-shrink-0 transition duration-200 ease-in-out opacity-50 cursor-not-allowed",timepickerAmPmWrapperCheckedDisabled:"relative inline-flex flex-shrink-0 transition duration-200 ease-in-out opacity-50 cursor-not-allowed",timepickerAmPmButton:"absolute flex items-center justify-center w-6 h-6 text-xs text-gray-800 transition duration-200 ease-in-out transform translate-x-0 bg-white rounded shadow",timepickerAmPmButtonChecked:"absolute flex items-center justify-center w-6 h-6 text-xs text-gray-800 transition duration-200 ease-in-out transform translate-x-full bg-white rounded shadow",timepickerAmPmCheckedPlaceholder:"flex items-center justify-center w-6 h-6 text-xs text-gray-500 rounded-sm",timepickerAmPmUncheckedPlaceholder:"flex items-center justify-center w-6 h-6 text-xs text-gray-500 rounded-sm"})},fixedClasses:{type:Object,default:()=>({navigator:"flex",navigatorViewButton:"flex items-center",navigatorViewButtonIcon:"flex-shrink-0 h-5 w-5",navigatorViewButtonBackIcon:"flex-shrink-0 h-5 w-5",navigatorLabel:"flex items-center py-1",navigatorPrevButtonIcon:"h-6 w-6 inline-flex",navigatorNextButtonIcon:"h-6 w-6 inline-flex",inputWrapper:"relative",viewGroup:"inline-flex flex-wrap",view:"w-64",calendarDaysWrapper:"grid grid-cols-7",calendarHeaderWrapper:"grid grid-cols-7",monthWrapper:"grid grid-cols-4",yearWrapper:"grid grid-cols-4",clearButton:"flex flex-shrink-0 items-center justify-center absolute right-0 top-0 m-2 h-6 w-6",clearButtonIcon:"fill-current h-3 w-3"})}},data(){const t=Ct(this.lang,this.locales,this.locale),e=this.dateFormatter,n=xt(t,this.dateParser),r=Tt(t,e),o=e?Tt(t):r;let l=this.multiple||this.range?[]:null;l=Array.isArray(this.value)?this.value.map((t=>n(t,this.dateFormat)||null)).filter((t=>!!t)):n(this.value,this.dateFormat)||l;const c=Array.isArray(l)?l.map((t=>r(t,this.dateFormat))):r(l,this.dateFormat),h=Array.isArray(l)?l.map((t=>r(t,this.userFormat))):r(l,this.userFormat),d=Jt(l,this.initialDate,this.dateFormat,n,this.amPm,this.initialTime),f=this.initialView;let m=null;return this.timepicker&&(m=Array.isArray(l)?l[0]:l),{localValue:l,formatedDate:c,userFormatedDate:h,activeDate:d,shown:this.show,showActiveDate:!1,currentView:f,parse:n,format:r,formatNative:o,currentLocale:t,hasFocus:!1,dateWithoutTime:m,timeWithoutDate:null}},computed:{visibleRange(){const t=new Date(this.activeDate.valueOf()),e=new Date(this.activeDate.valueOf());return t.setDate(1),e.setMonth(e.getMonth()+this.monthsPerView,0),[t,e]},latestDate(){return Array.isArray(this.localValue)?this.localValue.length&&this.localValue[this.localValue.length-1]||null:this.localValue},currentValueIsInTheView(){if(this.latestDate){const[t,e]=this.visibleRange;return wt(e,this.latestDate)>=0&&wt(this.latestDate,t)>=0}return!0}},watch:{shown(t){this.$emit("update:show",t)},activeDate(t){this.$emit("active-change",t)},formatedDate(t){this.$emit("input",t),this.$emit("change",t)},userFormatedDate(t){this.$emit("user-date-changed",t)},localValue(t){1!==this.monthsPerView&&this.currentValueIsInTheView||this.resetActiveDate(t),this.refreshFormattedDate()},value(t){if(Array.isArray(t)){const e=t.map((t=>this.parse(t,this.dateFormat)||null)).filter((t=>!!t));C.default(e,this.localValue)||(this.localValue=e)}else this.localValue=this.parse(t,this.dateFormat)||(this.multiple||this.range?[]:null)},dateParser(){this.refreshParser()},dateFormatter(){this.refreshFormatter()},lang(){this.refreshCurrentLocale()},locale(){this.refreshCurrentLocale()},locales:{handler(){this.refreshCurrentLocale()},deep:!0}},methods:{refreshFormattedDate(){const t=Array.isArray(this.localValue)?this.localValue.map((t=>this.format(t,this.dateFormat))):this.format(this.localValue,this.dateFormat),e=Array.isArray(this.localValue)?this.localValue.map((t=>this.format(t,this.userFormat))):this.format(this.localValue,this.userFormat);this.formatedDate=t,this.userFormatedDate=e},refreshCurrentLocale(){this.currentLocale=Ct(this.lang,this.locales,this.locale),this.refreshParser(),this.refreshFormatter(),this.refreshFormattedDate()},refreshParser(){const t=xt(this.currentLocale,this.dateParser);this.parse=t},refreshFormatter(){const t=this.dateFormatter,e=Tt(this.currentLocale,t),n=t?Tt(this.currentLocale):e;this.format=e,this.formatNative=n},focus(t){const input=this.$el.querySelector("input[type=text]");if(!input)throw new Error("Input not found");input.focus(t)},doHide(){const t=this.getDropdown();t&&t.doHide()},doShow(){const t=this.getDropdown();t&&t.doShow()},toggle(){const t=this.getDropdown();t&&t.doToggle()},arrowKeyHandler(t){if(t.preventDefault(),this.showActiveDate=!0,!this.inline&&!this.shown)return void this.doShow();let e;this.currentView===jt.Day?t.keyCode===j.DOWN?e=At(this.activeDate,7):t.keyCode===j.LEFT?e=At(this.activeDate,-1):t.keyCode===j.UP?e=At(this.activeDate,-7):t.keyCode===j.RIGHT&&(e=At(this.activeDate,1)):this.currentView===jt.Month?t.keyCode===j.DOWN?e=Ot(this.activeDate,4):t.keyCode===j.LEFT?e=Ot(this.activeDate,-1):t.keyCode===j.UP?e=Ot(this.activeDate,-4):t.keyCode===j.RIGHT&&(e=Ot(this.activeDate,1)):this.currentView===jt.Year&&(t.keyCode===j.DOWN?e=It(this.activeDate,4):t.keyCode===j.LEFT?e=It(this.activeDate,-1):t.keyCode===j.UP?e=It(this.activeDate,-4):t.keyCode===j.RIGHT&&(e=It(this.activeDate,1))),e&&!_t(e,this.minDate,this.maxDate,this.parse,this.dateFormat)&&(this.activeDate=e)},focusTimePicker(){this.$refs.timePicker.focus()},inputDateHandler(t){this.dateWithoutTime=t,this.dateTimeInputHandler()},inputTimeHandler(t){this.timeWithoutDate=t,this.datepicker?this.dateTimeInputHandler():this.inputHandler(t)},dateTimeInputHandler(){if(null===this.dateWithoutTime||null===this.timeWithoutDate)return void(null===this.timeWithoutDate?this.focusTimePicker():null===this.dateWithoutTime&&this.focus());const{dateWithoutTime:t,timeWithoutDate:e}=this,n=new Date(t.getFullYear(),t.getMonth(),t.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());this.inputHandler(n)},inputHandler(t){const e=new Date(t.valueOf()),n=this.disabledDates;if(!Et(e,n,this.parse,this.dateFormat)&&!_t(e,this.minDate,this.maxDate,this.parse,this.dateFormat)){if(this.range){let t=[];!this.localValue||!Array.isArray(this.localValue)||Array.isArray(this.localValue)&&(0===this.localValue.length||2===this.localValue.length)||Array.isArray(this.localValue)&&1===this.localValue.length&&this.localValue[0]&&this.localValue[0].getTime()>e.getTime()?t=[e]:1===this.localValue.length&&(t=[this.localValue[0],e]),this.localValue=t,!this.inline&&2===this.localValue.length&&this.closeOnSelect&&this.doHide()}else if(Array.isArray(this.localValue)){const t=this.localValue.findIndex((t=>kt(t,e)));t>=0?this.localValue.splice(t,1):this.localValue.push(e)}else this.focus(),this.localValue=e;this.inline||!this.closeOnSelect||Array.isArray(this.localValue)||this.doHide()}},inputActiveDateHandler(t){this.activeDate=new Date(t.valueOf())},setView(t){this.currentView=t,this.focus()},resetView(){this.currentView===jt.Month?this.setView(jt.Day):this.currentView===jt.Year?this.setView(jt.Month):this.setView(jt.Day)},enterHandler(t){t.preventDefault(),this.inline||this.shown?this.showActiveDate&&(this.currentView===jt.Day?this.timepicker?this.inputDateHandler(new Date(this.activeDate.valueOf())):this.inputHandler(new Date(this.activeDate.valueOf())):this.resetView()):this.doShow()},escapeHandler(t){t.preventDefault();const e=this.getDropdown();e&&e.escapeHandler(t)},spaceHandler(t){t.preventDefault(),this.toggle()},getDropdown(){return this.$refs.dropdown},resetInitialState(){this.shown=!1,this.currentView=this.initialView,this.showActiveDate=!1,this.timepicker?this.dateWithoutTime=Array.isArray(this.localValue)?this.localValue[0]:this.localValue:this.dateWithoutTime=null,this.timeWithoutDate=null,this.resetActiveDate(this.localValue)},resetActiveDate(t){this.activeDate=Jt(t,this.initialDate,this.dateFormat,this.parse,this.amPm,this.initialTime)},clearHandler(){this.multiple||this.range?this.localValue=[]:this.localValue=null,this.resetActiveDate(this.localValue)},focusHandler(t){this.hasFocus=!0,this.$emit("focus",t)},blurHandler(t){this.hasFocus=!1,this.$emit("blur",t)},hideIfFocusOutside(t){const e=this.getDropdown();e&&e.hideIfFocusOutside(t)}},render(t){const e=[];this.datepicker&&e.push(t(Wt,{ref:"views",props:{value:this.localValue,activeDate:this.activeDate,weekStart:this.weekStart,monthsPerView:this.monthsPerView,lang:this.lang,locale:this.currentLocale,getElementCssClass:this.getElementCssClass,parse:this.parse,format:this.format,formatNative:this.formatNative,dateFormat:this.dateFormat,userFormat:this.userFormat,initialView:this.initialView,currentView:this.currentView,yearsPerView:this.yearsPerView,showActiveDate:this.showActiveDate,disabledDates:this.disabledDates,highlightDates:this.highlightDates,minDate:this.minDate,maxDate:this.maxDate,range:this.range,showDaysForOtherMonth:this.showDaysForOtherMonth,datepicker:this.datepicker,timepicker:this.timepicker,dateWithoutTime:this.dateWithoutTime},scopedSlots:this.$scopedSlots,on:{input:this.inputHandler,"input-date":this.inputDateHandler,"input-time":this.inputTimeHandler,"input-active-date":this.inputActiveDateHandler,"update-view":this.setView,"reset-view":this.resetView,"reset-focus":this.focus}})),this.timepicker&&this.currentView===jt.Day&&e.push(t(Yt,{ref:"timePicker",props:{parse:this.parse,format:this.format,amPm:this.amPm,showSeconds:this.showSeconds,activeDate:this.activeDate,locale:this.currentLocale,getElementCssClass:this.getElementCssClass},on:{input:this.inputActiveDateHandler,submit:this.inputTimeHandler,blur:this.hideIfFocusOutside}}));const n={ref:"trigger",props:{id:this.id,name:this.name,inputName:this.inputName,disabled:this.disabled,readonly:this.readonly,autofocus:this.autofocus,required:this.required,placeholder:this.placeholder,tabindex:this.tabindex,userFormatedDate:this.userFormatedDate,formatedDate:this.formatedDate,conjunction:this.conjunction,multiple:this.multiple,range:this.range,clearable:this.clearable,locale:this.currentLocale,value:this.localValue,activeDate:this.activeDate,hasFocus:this.hasFocus,getElementCssClass:this.getElementCssClass},scopedSlots:this.$scopedSlots,on:{clear:this.clearHandler,focus:this.focusHandler,blur:this.blurHandler,keydown:t=>{[j.LEFT,j.UP,j.RIGHT,j.DOWN].includes(t.keyCode)&&this.datepicker?this.arrowKeyHandler(t):t.keyCode===j.ENTER?this.enterHandler(t):t.keyCode===j.ESC?this.escapeHandler(t):t.keyCode===j.SPACE&&this.spaceHandler(t),Gt(t.key)&&this.focusTimePicker(),this.$emit("keydown",t)}}};return this.inline?t("div",{class:this.getElementCssClass("inlineWrapper")},[t(Rt,n),t("div",{class:this.getElementCssClass("inlineViews")},e)]):t(nt,{ref:"dropdown",props:{fixedClasses:void 0,classes:{wrapper:this.getElementCssClass("wrapper"),dropdownWrapper:this.getElementCssClass("dropdownWrapper"),dropdown:this.getElementCssClass("dropdown"),enterClass:this.getElementCssClass("enterClass"),enterActiveClass:this.getElementCssClass("enterActiveClass"),enterToClass:this.getElementCssClass("enterToClass"),leaveClass:this.getElementCssClass("leaveClass"),leaveActiveClass:this.getElementCssClass("leaveActiveClass"),leaveToClass:this.getElementCssClass("leaveToClass")},show:this.show},on:{hidden:()=>{this.$emit("hidden"),this.resetInitialState()},shown:()=>{this.$emit("shown"),this.shown=!0,this.timepicker&&!this.datepicker&&this.$nextTick((()=>{this.focusTimePicker()}))}},scopedSlots:{trigger:e=>{const r=T.default(n);return r.props=Object.assign(Object.assign({},r.props),{hideIfFocusOutside:e.hideIfFocusOutside,show:e.show}),[t(Rt,r)]}}},e)}});var Xt,Zt;(function(t){t.Outside="outside",t.Close="close",t.Esc="esc",t.Cancel="cancel",t.Ok="ok",t.Method="method",t.Value="value"})(Xt||(Xt={})),function(t){t.Alert="alert",t.Confirm="confirm",t.Prompt="prompt"}(Zt||(Zt={}));const te=()=>Math.random().toString(36).substring(7),ee=v.default.extend({name:"TDialogOverlayWrapperTransitionDialogContentInput",props:{getElementCssClass:{type:Function,required:!0},inputAttributes:{type:Object,default:void 0},inputType:{type:String,required:!0},inputValue:{type:[String,Array],default:void 0},inputPlaceholder:{type:String,default:void 0},inputOptions:{type:[Array,Object],default:void 0}},data:()=>({errorMessage:null}),mounted(){this.inputHandler()},methods:{getInputValue(){const input=this.$refs.input;if(!input)return;const t=input.name;if("radio"===input.type){const e=this.$refs.inputWrapper.querySelector(`input[name="${t}"]:checked`);return e?e.value:null}if("checkbox"===input.type){if(this.inputOptions){const e=this.$refs.inputWrapper.querySelectorAll(`input[name="${t}"]:checked`);return Array.from(e).map((t=>t.value))}return input.checked?input.value:null}return input.value},inputHandler(){this.errorMessage=null;const t=this.getInputValue();this.$emit("input",t)}},render(t){let input;if("select"===this.inputType){const e=W(this.inputOptions||[]).map((option=>{const e=this.inputValue===option.value;return t("option",{domProps:{value:option.value,selected:e}},String(option.text))}));input=t("select",{class:this.getElementCssClass("select"),ref:"input",attrs:Object.assign({name:"input"},this.inputAttributes),on:{change:this.inputHandler}},e)}else if("radio"===this.inputType)input=W(this.inputOptions||[]).map((option=>{const e=this.inputValue===option.value;return t("label",{class:this.getElementCssClass("radioWrapper"),attrs:{for:`input-${String(option.value)}`}},[t("input",{class:this.getElementCssClass("radio"),ref:"input",attrs:Object.assign({type:"radio",name:"input",id:`input-${String(option.value)}`,value:option.value,checked:e},this.inputAttributes),on:{change:this.inputHandler}}),t("span",{class:this.getElementCssClass("radioText")},String(option.text))])}));else if("checkbox"===this.inputType)if(this.inputOptions)input=W(this.inputOptions||[]).map((option=>{const e=Array.isArray(this.inputValue)?this.inputValue.includes(option.value):this.inputValue===option.value;return t("label",{class:this.getElementCssClass("checkboxWrapper"),attrs:{for:`input-${String(option.value)}`}},[t("input",{class:this.getElementCssClass("checkbox"),ref:"input",attrs:Object.assign({type:"checkbox",name:"input[]",id:`input-${String(option.value)}`,value:option.value,checked:e},this.inputAttributes),on:{change:this.inputHandler}}),t("span",{class:this.getElementCssClass("checkboxText")},String(option.text))])}));else{const e=te();input=t("label",{class:this.getElementCssClass("checkboxWrapper"),attrs:{for:`input-${e}`}},[t("input",{class:this.getElementCssClass("checkbox"),ref:"input",attrs:Object.assign({type:"checkbox",name:"input",id:`input-${e}`,value:this.inputValue},this.inputAttributes),on:{change:this.inputHandler}}),t("span",{class:this.getElementCssClass("checkboxText")},this.inputPlaceholder?String(this.inputPlaceholder):"")])}else input=t("input",{class:this.getElementCssClass("input"),ref:"input",domProps:{value:this.inputValue},attrs:Object.assign({name:"input",type:this.inputType,placeholder:this.inputPlaceholder},this.inputAttributes),on:{input:this.inputHandler}});return t("div",{ref:"inputWrapper",class:this.getElementCssClass("inputWrapper")},Array.isArray(input)?input:[input])}}),ne=v.default.extend({name:"TDialogOverlayWrapperTransitionDialogContent",props:{getElementCssClass:{type:Function,required:!0},titleTag:{type:String,required:!0},title:{type:String,default:void 0},textTag:{type:String,required:!0},text:{type:String,default:void 0},type:{type:String,required:!0},inputAttributes:{type:Object,default:void 0},inputType:{type:String,required:!0},inputValue:{type:[String,Array],default:void 0},inputPlaceholder:{type:String,default:void 0},inputOptions:{type:[Array,Object],default:void 0},errorMessage:{type:String,required:!0}},render(t){const e=[];return(this.title||this.$scopedSlots.title)&&(this.$scopedSlots.title?e.push(t("div",{class:this.getElementCssClass("titleWrapper")},[this.$scopedSlots.title({class:this.getElementCssClass("title")})])):e.push(t("div",{class:this.getElementCssClass("titleWrapper")},[t(this.titleTag,{class:this.getElementCssClass("title")},this.title||"")]))),this.$slots.default?e.push(t("div",{class:this.getElementCssClass("textWrapper")},this.$slots.default)):this.text&&e.push(t("div",{class:this.getElementCssClass("textWrapper")},this.text?[t(this.textTag,{class:this.getElementCssClass("text")},this.text)]:void 0)),this.type===Zt.Prompt&&e.push(t(ee,{props:{getElementCssClass:this.getElementCssClass,inputAttributes:this.inputAttributes,inputType:this.inputType,inputValue:this.inputValue,inputOptions:this.inputOptions,inputPlaceholder:this.inputPlaceholder},on:{input:t=>this.$emit("input",t)}})),this.errorMessage&&"string"==typeof this.errorMessage&&e.push(t("div",{class:this.getElementCssClass("errorMessage")},this.errorMessage)),t("div",{class:this.getElementCssClass("content")},e)}});var re;function ie(t){if(!t)return;const e={};return e[re.Success]='',e[re.Error]='',e[re.Warning]='',e[re.Info]='',e[re.Question]='',e[t]}!function(t){t.Success="success",t.Error="error",t.Warning="warning",t.Info="info",t.Question="question"}(re||(re={}));const se=v.default.extend({name:"TDialogOverlayWrapperTransitionDialogIcon",props:{getElementCssClass:{type:Function,required:!0},icon:{type:String,default:void 0}},render(t){if(this.$scopedSlots.icon)return t("div",{class:this.getElementCssClass("iconWrapper")},[this.$scopedSlots.icon({})]);const e=ie(this.icon);return e?t("div",{class:this.getElementCssClass("iconWrapper")},[t("svg",{class:this.getElementCssClass("icon"),attrs:{fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},domProps:{innerHTML:e}})]):t()}}),oe=v.default.extend({name:"TDialogOverlayWrapperTransitionDialogClose",props:{getElementCssClass:{type:Function,required:!0},showCloseButton:{type:Boolean,required:!0}},render(t){return this.showCloseButton?this.$scopedSlots.closeButton?t("button",{class:this.getElementCssClass("close"),attrs:{type:"button"},on:{click:t=>this.$emit("dismiss",t)}},[this.$scopedSlots.closeButton({})]):t("button",{class:this.getElementCssClass("close"),attrs:{type:"button"},on:{click:t=>this.$emit("dismiss",t)}},[t("svg",{attrs:{fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},class:this.getElementCssClass("closeIcon")},[t("path",{attrs:{"clip-rule":"evenodd","fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"}})])]):t()}}),ae=v.default.extend({name:"TDialogOverlayWrapperTransitionDialogLoader",props:{getElementCssClass:{type:Function,required:!0},busy:{type:Boolean,required:!0}},render(t){return this.busy?this.$scopedSlots.loader?t("div",{class:this.getElementCssClass("busyWrapper")},[this.$scopedSlots.loader({})]):t("div",{class:this.getElementCssClass("busyWrapper")},[t("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:32,height:32,viewBox:"0 0 32 32"},class:this.getElementCssClass("busyIcon")},[t("g",{attrs:{transform:"scale(0.03125 0.03125)"}},[t("path",{attrs:{d:"M512 1024c-136.76 0-265.334-53.258-362.040-149.96-96.702-96.706-149.96-225.28-149.96-362.040 0-96.838 27.182-191.134 78.606-272.692 50-79.296 120.664-143.372 204.356-185.3l43 85.832c-68.038 34.084-125.492 86.186-166.15 150.67-41.746 66.208-63.812 142.798-63.812 221.49 0 229.382 186.618 416 416 416s416-186.618 416-416c0-78.692-22.066-155.282-63.81-221.49-40.66-64.484-98.114-116.584-166.15-150.67l43-85.832c83.692 41.928 154.358 106.004 204.356 185.3 51.422 81.558 78.604 175.854 78.604 272.692 0 136.76-53.258 265.334-149.96 362.040-96.706 96.702-225.28 149.96-362.040 149.96z"}})])])]):t()}}),le=v.default.extend({name:"TDialogOverlayWrapperTransitionDialogButtons",props:{getElementCssClass:{type:Function,required:!0},cancelButtonText:{type:String,required:!0},cancelButtonAriaLabel:{type:String,default:void 0},okButtonText:{type:String,required:!0},okButtonAriaLabel:{type:String,default:void 0},type:{type:String,required:!0}},methods:{cancel(t){this.$emit("cancel",t)},ok(t){this.$emit("submit",t)}},render(t){const e=this.type;if(this.$scopedSlots.buttons)return t("div",{class:this.getElementCssClass("buttons")},[this.$scopedSlots.buttons({cancelButtonAriaLabel:this.cancelButtonAriaLabel,okButtonAriaLabel:this.okButtonAriaLabel,cancelButtonText:this.cancelButtonText,okButtonText:this.okButtonText,okButtonClass:this.getElementCssClass("okButton"),cancelButtonClass:this.getElementCssClass("cancelButton"),dialogType:e,cancel:this.cancel,ok:this.ok})]);const n=[],r={cancel:t("button",{attrs:{type:"button","aria-label":this.cancelButtonAriaLabel},class:this.getElementCssClass("cancelButton"),on:{click:this.cancel}},this.cancelButtonText),ok:t("button",{attrs:{type:"button","aria-label":this.okButtonAriaLabel},class:this.getElementCssClass("okButton"),on:{click:this.ok}},this.okButtonText)};return e===Zt.Alert?n.push(r.ok):e!==Zt.Confirm&&e!==Zt.Prompt||(n.push(r.cancel),n.push(r.ok)),t("div",{class:this.getElementCssClass("buttons")},n)}}),ue=v.default.extend({name:"TDialogOverlayWrapperTransitionDialog",props:{getElementCssClass:{type:Function,required:!0},dialogShow:{type:Boolean,required:!0},titleTag:{type:String,required:!0},title:{type:String,default:void 0},icon:{type:String,default:void 0},textTag:{type:String,required:!0},text:{type:String,default:void 0},cancelButtonText:{type:String,required:!0},cancelButtonAriaLabel:{type:String,default:void 0},okButtonText:{type:String,required:!0},okButtonAriaLabel:{type:String,default:void 0},showCloseButton:{type:Boolean,required:!0},preConfirm:{type:Function,default:void 0},inputAttributes:{type:Object,default:void 0},inputType:{type:String,required:!0},inputValidator:{type:Function,default:void 0},inputValue:{type:[String,Array],default:void 0},inputOptions:{type:[Array,Object],default:void 0},inputPlaceholder:{type:String,default:void 0},type:{type:String,required:!0}},data:()=>({currentValue:null,errorMessage:"",busy:!1}),methods:{submitHandler(t){return this.resolveParam(this.inputValidator,this.currentValue).then((e=>{e&&"string"==typeof e?this.errorMessage=String(e):this.resolveParam(this.preConfirm,this.currentValue).then((e=>{this.$emit("submit",t,this.currentValue,e)})).catch((e=>{this.$emit("submit-error",t,this.currentValue,e)})).then((()=>{this.busy=!1}))})).catch((t=>{this.errorMessage=String(t)}))},inputHandler(input){this.errorMessage="",this.currentValue=input},resolveParam(t,input){if("function"==typeof t){const e=t(input);return e instanceof Promise?(this.busy=!0,e):new Promise((t=>{t(e)}))}return new Promise((t=>t()))}},render(t){return this.dialogShow?t("div",{ref:"dialog",class:this.getElementCssClass("dialog")},[t(ae,{props:{getElementCssClass:this.getElementCssClass,busy:this.busy},scopedSlots:{loader:this.$scopedSlots.loader}}),t(oe,{props:{getElementCssClass:this.getElementCssClass,showCloseButton:this.showCloseButton},on:{dismiss:t=>this.$emit("dismiss",t)},scopedSlots:{closeButton:this.$scopedSlots.closeButton}}),t("div",{ref:"body",class:this.getElementCssClass("body")},[t(se,{props:{getElementCssClass:this.getElementCssClass,icon:this.icon},scopedSlots:{icon:this.$scopedSlots.icon}}),t(ne,{props:{getElementCssClass:this.getElementCssClass,titleTag:this.titleTag,title:this.title,textTag:this.textTag,text:this.text,type:this.type,inputAttributes:this.inputAttributes,inputType:this.inputType,inputValue:this.inputValue,inputOptions:this.inputOptions,inputPlaceholder:this.inputPlaceholder,errorMessage:this.errorMessage},on:{input:this.inputHandler},scopedSlots:{title:this.$scopedSlots.title}},this.$slots.default)]),t(le,{props:{getElementCssClass:this.getElementCssClass,type:this.type,cancelButtonText:this.cancelButtonText,cancelButtonAriaLabel:this.cancelButtonAriaLabel,okButtonText:this.okButtonText,okButtonAriaLabel:this.okButtonAriaLabel},on:{cancel:t=>this.$emit("cancel",t),submit:this.submitHandler},scopedSlots:{buttons:this.$scopedSlots.buttons}})]):t()}}),ce=v.default.extend({name:"TDialogOverlayWrapperTransition",props:{getElementCssClass:{type:Function,required:!0},dialogShow:{type:Boolean,required:!0},titleTag:{type:String,required:!0},title:{type:String,default:void 0},icon:{type:String,default:void 0},textTag:{type:String,required:!0},text:{type:String,default:void 0},cancelButtonText:{type:String,required:!0},cancelButtonAriaLabel:{type:String,default:void 0},okButtonText:{type:String,required:!0},okButtonAriaLabel:{type:String,default:void 0},showCloseButton:{type:Boolean,required:!0},preConfirm:{type:Function,default:void 0},inputAttributes:{type:Object,default:void 0},inputType:{type:String,required:!0},inputValidator:{type:Function,default:void 0},inputValue:{type:[String,Array],default:void 0},inputOptions:{type:[Array,Object],default:void 0},inputPlaceholder:{type:String,default:void 0},type:{type:String,required:!0}},render(t){return t("transition",{props:{enterClass:this.getElementCssClass("enterClass"),enterActiveClass:this.getElementCssClass("enterActiveClass"),enterToClass:this.getElementCssClass("enterToClass"),leaveClass:this.getElementCssClass("leaveClass"),leaveActiveClass:this.getElementCssClass("leaveActiveClass"),leaveToClass:this.getElementCssClass("leaveToClass")}},[t(ue,{props:{getElementCssClass:this.getElementCssClass,dialogShow:this.dialogShow,titleTag:this.titleTag,title:this.title,icon:this.icon,textTag:this.textTag,text:this.text,cancelButtonText:this.cancelButtonText,cancelButtonAriaLabel:this.cancelButtonAriaLabel,okButtonText:this.okButtonText,okButtonAriaLabel:this.okButtonAriaLabel,showCloseButton:this.showCloseButton,preConfirm:this.preConfirm,inputAttributes:this.inputAttributes,inputType:this.inputType,inputValidator:this.inputValidator,inputValue:this.inputValue,inputOptions:this.inputOptions,inputPlaceholder:this.inputPlaceholder,type:this.type},scopedSlots:this.$scopedSlots,on:{dismiss:t=>this.$emit("dismiss",t),cancel:t=>this.$emit("cancel",t),submit:(t,input,e)=>this.$emit("submit",t,input,e),"submit-error":(t,input,e)=>this.$emit("submit-error",t,input,e)}},this.$slots.default)])}}),he=v.default.extend({name:"TDialogOverlayWrapper",props:{getElementCssClass:{type:Function,required:!0},dialogShow:{type:Boolean,required:!0},titleTag:{type:String,required:!0},title:{type:String,default:void 0},icon:{type:String,default:void 0},textTag:{type:String,required:!0},text:{type:String,default:void 0},cancelButtonText:{type:String,required:!0},cancelButtonAriaLabel:{type:String,default:void 0},okButtonText:{type:String,required:!0},okButtonAriaLabel:{type:String,default:void 0},showCloseButton:{type:Boolean,required:!0},preConfirm:{type:Function,default:void 0},inputAttributes:{type:Object,default:void 0},inputType:{type:String,required:!0},inputValidator:{type:Function,default:void 0},inputValue:{type:[String,Array],default:void 0},inputOptions:{type:[Array,Object],default:void 0},inputPlaceholder:{type:String,default:void 0},type:{type:String,required:!0}},render(t){return t("div",{ref:"wrapper",class:this.getElementCssClass("wrapper")},[t(ce,{props:{type:this.type,dialogShow:this.dialogShow,getElementCssClass:this.getElementCssClass,titleTag:this.titleTag,title:this.title,icon:this.icon,textTag:this.textTag,text:this.text,cancelButtonText:this.cancelButtonText,cancelButtonAriaLabel:this.cancelButtonAriaLabel,okButtonText:this.okButtonText,okButtonAriaLabel:this.okButtonAriaLabel,showCloseButton:this.showCloseButton,preConfirm:this.preConfirm,inputAttributes:this.inputAttributes,inputType:this.inputType,inputValidator:this.inputValidator,inputValue:this.inputValue,inputOptions:this.inputOptions,inputPlaceholder:this.inputPlaceholder},scopedSlots:this.$scopedSlots,on:{dismiss:t=>this.$emit("dismiss",t),cancel:t=>this.$emit("cancel",t),submit:(t,input,e)=>this.$emit("submit",t,input,e),"submit-error":(t,input,e)=>this.$emit("submit-error",t,input,e)}},this.$slots.default)])}}),de=v.default.extend({name:"TDialogOverlay",props:{getElementCssClass:{type:Function,required:!0},overlayShow:{type:Boolean,required:!0},dialogShow:{type:Boolean,required:!0},titleTag:{type:String,required:!0},title:{type:String,default:void 0},textTag:{type:String,required:!0},text:{type:String,default:void 0},icon:{type:String,default:void 0},cancelButtonText:{type:String,required:!0},cancelButtonAriaLabel:{type:String,default:void 0},okButtonText:{type:String,required:!0},okButtonAriaLabel:{type:String,default:void 0},showCloseButton:{type:Boolean,required:!0},preConfirm:{type:Function,default:void 0},inputAttributes:{type:Object,default:void 0},inputType:{type:String,required:!0},inputValidator:{type:Function,default:void 0},inputValue:{type:[String,Array],default:void 0},inputOptions:{type:[Array,Object],default:void 0},inputPlaceholder:{type:String,default:void 0},type:{type:String,default:null}},methods:{clickHandler(t){t.target===this.$el&&this.$emit("outside-click",t)},keyupHandler(t){this.$emit("keyup",t)},focus(){const t=this.$el;t&&t.focus&&t.focus()},enableBodyScroll(){const t=this.$el;c.enableBodyScroll(t)},disableBodyScroll(){const t=this.$el;c.disableBodyScroll(t,{reserveScrollBarGap:!0})}},render(t){return this.overlayShow?t("div",{attrs:{tabindex:0},class:this.getElementCssClass("overlay"),on:{keyup:this.keyupHandler,click:this.clickHandler}},[t(he,{props:{type:this.type,getElementCssClass:this.getElementCssClass,dialogShow:this.dialogShow,titleTag:this.titleTag,title:this.title,icon:this.icon,textTag:this.textTag,text:this.text,cancelButtonText:this.cancelButtonText,cancelButtonAriaLabel:this.cancelButtonAriaLabel,okButtonText:this.okButtonText,okButtonAriaLabel:this.okButtonAriaLabel,showCloseButton:this.showCloseButton,preConfirm:this.preConfirm,inputAttributes:this.inputAttributes,inputType:this.inputType,inputValidator:this.inputValidator,inputValue:this.inputValue,inputOptions:this.inputOptions,inputPlaceholder:this.inputPlaceholder},scopedSlots:this.$scopedSlots,on:{dismiss:t=>this.$emit("dismiss",t),cancel:t=>this.$emit("cancel",t),submit:(t,input,e)=>this.$emit("submit",t,input,e),"submit-error":(t,input,e)=>this.$emit("submit-error",t,input,e)}},this.$slots.default)]):t()}}),pe=t=>({overlayShow:t.value,dialogShow:t.value,params:void 0,preventAction:!1,hideReason:void 0,input:void 0,resolve:null,reject:null,preConfirmResponse:void 0,preConfirmError:void 0}),fe=I.extend({name:"TDialog",props:{value:{type:Boolean,default:!1},name:{type:String,default:void 0},titleTag:{type:String,default:"h3"},title:{type:String,default:void 0},icon:{type:String,default:void 0},textTag:{type:String,default:"p"},text:{type:String,default:void 0},clickToClose:{type:Boolean,default:!0},escToClose:{type:Boolean,default:!0},cancelButtonText:{type:String,default:"Cancel"},cancelButtonAriaLabel:{type:String,default:void 0},okButtonText:{type:String,default:"OK"},okButtonAriaLabel:{type:String,default:void 0},showCloseButton:{type:Boolean,default:!1},disableBodyScroll:{type:Boolean,default:!0},focusOnOpen:{type:Boolean,default:!0},preConfirm:{type:Function,default:void 0},inputAttributes:{type:Object,default:void 0},inputType:{type:String,default:"text"},inputValidator:{type:Function,default:void 0},inputValue:{type:[String,Array],default:void 0},inputOptions:{type:[Array,Object],default:void 0},inputPlaceholder:{type:String,default:void 0},type:{type:String,default:Zt.Alert},fixedClasses:{type:Object,default:()=>({overlay:"overflow-auto scrolling-touch left-0 top-0 bottom-0 right-0 w-full h-full fixed",wrapper:"relative mx-auto",modal:"overflow-visible relative ",close:"flex items-center justify-center",dialog:"overflow-visible relative"})},classes:{type:Object,default:()=>({close:"bg-gray-100 text-gray-600 rounded-full absolute right-0 top-0 -m-3 h-8 w-8 transition duration-100 ease-in-out hover:bg-gray-200 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50",closeIcon:"fill-current h-4 w-4",overlay:"z-40 bg-black bg-opacity-50",wrapper:"z-50 max-w-lg px-3 py-12",dialog:"bg-white shadow rounded text-left",body:"p-3 space-y-3",buttons:"p-3 flex space-x-4 justify-center bg-gray-100 rounded-b",iconWrapper:"bg-gray-100 flex flex-shrink-0 h-12 items-center justify-center rounded-full w-12 mx-auto",icon:"w-6 h-6 text-gray-500",content:"w-full flex justify-center flex-col",titleWrapper:"",title:"text-lg font-semibold text-center",textWrapper:"text-left w-full",text:"",cancelButton:"block px-4 py-2 transition duration-100 ease-in-out bg-white border border-gray-300 rounded shadow-sm hover:bg-gray-100 focus:border-gray-100 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed w-full max-w-xs",okButton:"block px-4 py-2 text-white transition duration-100 ease-in-out bg-blue-500 border border-transparent rounded shadow-sm hover:bg-blue-600 focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed w-full max-w-xs",inputWrapper:"mt-3 flex items-center space-x-3",input:"block w-full px-3 py-2 text-black placeholder-gray-400 transition duration-100 ease-in-out bg-white border border-gray-300 rounded shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed w-full",select:"block w-full px-3 py-2 text-black placeholder-gray-400 transition duration-100 ease-in-out bg-white border border-gray-300 rounded shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 disabled:opacity-50 disabled:cursor-not-allowed w-full",radioWrapper:"flex items-center space-x-2",radio:"text-blue-500 transition duration-100 ease-in-out border-gray-300 shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 focus:ring-offset-0 disabled:opacity-50 disabled:cursor-not-allowed",radioText:"",checkboxWrapper:"flex items-center space-x-2",checkbox:"text-blue-500 transition duration-100 ease-in-out border-gray-300 rounded shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500 focus:outline-none focus:ring-opacity-50 focus:ring-offset-0 disabled:opacity-50 disabled:cursor-not-allowed",checkboxText:"",errorMessage:"text-red-500 block text-sm",busyWrapper:"absolute bg-opacity-50 bg-white flex h-full items-center justify-center left-0 top-0 w-full",busyIcon:"animate-spin h-6 w-6 fill-current text-gray-500",overlayEnterClass:"opacity-0",overlayEnterActiveClass:"transition ease-out duration-100",overlayEnterToClass:"opacity-100",overlayLeaveClass:"opacity-100",overlayLeaveActiveClass:"transition ease-in duration-75",overlayLeaveToClass:"opacity-0",enterClass:"",enterActiveClass:"",enterToClass:"",leaveClass:"",leaveActiveClass:"",leaveToClass:""})}},data(){return pe(this)},watch:{value(t){t?this.show():(this.hideReason=Xt.Value,this.close())},overlayShow(t){return R(this,void 0,void 0,(function*(){t?(this.$emit("input",t),this.$emit("change",t),yield this.$nextTick(),this.dialogShow=!0):this.closed()}))},dialogShow(t){return R(this,void 0,void 0,(function*(){t?this.opened():(this.$emit("input",t),this.$emit("change",t),yield this.$nextTick(),this.overlayShow=!1)}))}},beforeDestroy(){const t=this.getOverlay();this.disableBodyScroll&&t&&(t.focus(),t.enableBodyScroll())},created(){this.name&&(this.$dialog.$on(`show-${this.name}`,((t,e,n)=>{this.resolve=t,this.reject=e,this.show(n)})),this.$dialog.$on(`hide-${this.name}`,(()=>{this.hideReason=Xt.Method,this.close()})))},render(t){return t("transition",{props:{enterClass:this.getElementCssClass("overlayEnterClass"),enterActiveClass:this.getElementCssClass("overlayEnterActiveClass"),enterToClass:this.getElementCssClass("overlayEnterToClass"),leaveClass:this.getElementCssClass("overlayLeaveClass"),leaveActiveClass:this.getElementCssClass("overlayLeaveActiveClass"),leaveToClass:this.getElementCssClass("overlayLeaveToClass")}},[t(de,{ref:"overlay",props:{type:this.type,overlayShow:this.overlayShow,dialogShow:this.dialogShow,titleTag:this.titleTag,title:this.title,icon:this.icon,textTag:this.textTag,text:this.text,cancelButtonText:this.cancelButtonText,cancelButtonAriaLabel:this.cancelButtonAriaLabel,okButtonText:this.okButtonText,okButtonAriaLabel:this.okButtonAriaLabel,showCloseButton:this.showCloseButton,preConfirm:this.preConfirm,inputAttributes:this.inputAttributes,inputType:this.inputType,inputValidator:this.inputValidator,inputValue:this.inputValue,inputOptions:this.inputOptions,inputPlaceholder:this.inputPlaceholder,getElementCssClass:this.getElementCssClass},scopedSlots:this.$scopedSlots,on:{"outside-click":this.outsideClick,keyup:this.keyupHandler,dismiss:t=>this.dismiss(t),cancel:t=>this.cancel(t),submit:(t,input,e)=>this.submit(t,input,e),"submit-error":(t,input,e)=>this.submitError(t,input,e)}},this.$slots.default)])},methods:{getOverlay(){return this.$refs.overlay},keyupHandler(t){t.keyCode===j.ESC&&this.escToClose&&this.esc(t)},beforeOpen(){this.$emit("before-open",{params:this.params,cancel:this.closeCancel})},opened(){this.$emit("opened",{params:this.params}),this.prepareDomForDialog()},beforeClose(t){if(this.disableBodyScroll){const t=this.getOverlay();t&&(t.focus(),t.enableBodyScroll())}const e={cancel:this.closeCancel,event:t,reason:this.hideReason};void 0!==this.input&&(e.input=this.input),void 0!==this.preConfirmResponse&&(e.response=this.preConfirmResponse),this.$emit("before-close",e)},closed(){const t={hideReason:this.hideReason,isOk:this.hideReason===Xt.Ok,isCancel:this.hideReason===Xt.Cancel,isDismissed:"string"==typeof this.hideReason&&[Xt.Close,Xt.Esc,Xt.Outside].includes(this.hideReason)};this.type===Zt.Prompt&&this.hideReason===Xt.Ok&&void 0!==this.input&&(t.input=this.input),void 0!==this.preConfirmResponse?t.response=this.preConfirmResponse:void 0!==this.preConfirmError&&(t.response=this.preConfirmError),this.$emit("closed",t),this.reject&&void 0!==this.preConfirmError?this.reject(this.preConfirmError):this.resolve&&this.resolve(t),this.reset()},prepareDomForDialog(){const t=this.getOverlay();t&&(this.disableBodyScroll&&t.disableBodyScroll(),this.focusOnOpen&&t.focus())},dismiss(t){this.hideReason=Xt.Close,this.close(t)},esc(t){this.hideReason=Xt.Esc,this.close(t)},cancel(t){this.hideReason=Xt.Cancel,this.close(t)},hide(t){this.hideReason=Xt.Method,this.close(t)},submit(t,input,e){this.hideReason=Xt.Ok,this.input=input,this.preConfirmResponse=e,this.close(t)},submitError(t,input,e){this.hideReason=Xt.Ok,this.input=input,this.preConfirmError=e,this.close(t)},close(t){this.beforeClose(t),this.preventAction?this.preventAction=!1:this.dialogShow=!1},show(t){this.params=t,this.beforeOpen(),this.preventAction?this.preventAction=!1:this.overlayShow=!0},closeCancel(){this.preventAction=!0},reset(){Object.assign(this.$data,pe(this))},outsideClick(t){this.clickToClose&&(this.hideReason=Xt.Outside,this.close(t))}}});t.TAlert=tt,t.TButton=Y,t.TCard=Z,t.TCheckbox=P,t.TCheckboxGroup=at,t.TDatepicker=Qt,t.TDialog=fe,t.TDropdown=nt,t.TInput=B,t.TInputGroup=X,t.TModal=et,t.TPagination=it,t.TRadio=$,t.TRadioGroup=ot,t.TRichSelect=Q,t.TSelect=G,t.TTable=lt,t.TTag=st,t.TTextarea=F,t.TToggle=Kt,Object.defineProperty(t,"__esModule",{value:!0})}(e,n(2),n(181),n(246),n(183),n(247),n(248),n(182),n(249),n(250),n(251),n(252))},191:function(t,e,n){"use strict";var r=n(10),o=(n(44),n(19),n(53),n(2)),l=n(3),c=window.__NUXT__;function h(){if(!this._hydrated)return this.$fetch()}function d(){if((t=this).$vnode&&t.$vnode.elm&&t.$vnode.elm.dataset&&t.$vnode.elm.dataset.fetchKey){var t;this._hydrated=!0,this._fetchKey=this.$vnode.elm.dataset.fetchKey;var data=c.fetch[this._fetchKey];if(data&&data._error)this.$fetchState.error=data._error;else for(var e in data)o.default.set(this.$data,e,data[e])}}function f(){var t=this;return this._fetchPromise||(this._fetchPromise=m.call(this).then((function(){delete t._fetchPromise}))),this._fetchPromise}function m(){return y.apply(this,arguments)}function y(){return(y=Object(r.a)(regeneratorRuntime.mark((function t(){var e,n,r,o=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.$nuxt.nbFetching++,this.$fetchState.pending=!0,this.$fetchState.error=null,this._hydrated=!1,e=null,n=Date.now(),t.prev=6,t.next=9,this.$options.fetch.call(this);case 9:t.next=15;break;case 11:t.prev=11,t.t0=t.catch(6),e=Object(l.p)(t.t0);case 15:if(!((r=this._fetchDelay-(Date.now()-n))>0)){t.next=19;break}return t.next=19,new Promise((function(t){return setTimeout(t,r)}));case 19:this.$fetchState.error=e,this.$fetchState.pending=!1,this.$fetchState.timestamp=Date.now(),this.$nextTick((function(){return o.$nuxt.nbFetching--}));case 23:case"end":return t.stop()}}),t,this,[[6,11]])})))).apply(this,arguments)}e.a={beforeCreate:function(){Object(l.l)(this)&&(this._fetchDelay="number"==typeof this.$options.fetchDelay?this.$options.fetchDelay:200,o.default.util.defineReactive(this,"$fetchState",{pending:!1,error:null,timestamp:Date.now()}),this.$fetch=f.bind(this),Object(l.a)(this,"created",d),Object(l.a)(this,"beforeMount",h))}}},199:function(t,e,n){(function(t){t.installComponents=function(component,t){var n="function"==typeof component.exports?component.exports.extendOptions:component.options;for(var i in"function"==typeof component.exports&&(n.components=component.exports.options.components),n.components=n.components||{},t)n.components[i]=n.components[i]||t[i];n.functional&&function(component,t){if(component.exports[e])return;component.exports[e]=!0;var n=component.exports.render;component.exports.render=function(e,r){return n(e,Object.assign({},r,{_c:function(e,a,b){return r._c(t[e]||e,a,b)}}))}}(component,n.components)};var e="_functionalComponents"}).call(this,n(13))},200:function(t,e,n){"use strict";n.r(e),function(t){n(55),n(60),n(41),n(62),n(63);var e=n(43),r=n(10),o=(n(125),n(210),n(220),n(221),n(44),n(46),n(19),n(47),n(45),n(64),n(52),n(69),n(132),n(65),n(32),n(33),n(34),n(53),n(2)),l=n(184),c=n(136),h=n(3),d=n(36),f=n(191),m=n(109);function y(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return v(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return v(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i2?e-2:0),r=2;r>>0),y=0;function v(a,b,t){return a.call.apply(a.bind,arguments)}function w(a,b,t){if(!a)throw Error();if(2b?1:0}t:{var P=h.navigator;if(P){var R=P.userAgent;if(R){I=R;break t}}I=""}function L(a,b,t){for(const e in a)b.call(t,a[e],e,a)}function $(a){const b={};for(const t in a)b[t]=a[t];return b}var M="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function F(a,b){let t,e;for(let n=1;nparseFloat(J)){V=String(X);break t}}V=J}var Z,tt={};function et(){return function(a){var b=tt;return Object.prototype.hasOwnProperty.call(b,9)?b[9]:b[9]=a(9)}((function(){let a=0;const b=D(String(V)).split("."),t=D("9").split("."),e=Math.max(b.length,t.length);for(let o=0;0==a&&o>>0);function At(a){return"function"==typeof a?a:(a[_t]||(a[_t]=function(b){return a.handleEvent(b)}),a[_t])}function Ot(){T.call(this),this.i=new ft(this),this.P=this,this.I=null}function It(a,b){var t,e=a.I;if(e)for(t=[];e;e=e.I)t.push(e);if(a=a.P,e=b.type||b,"string"==typeof b)b=new ot(b,a);else if(b instanceof ot)b.target=b.target||a;else{var n=b;F(b=new ot(e,a),n)}if(n=!0,t)for(var r=t.length-1;0<=r;r--){var o=b.g=t[r];n=Dt(o,e,!0,b)&&n}if(n=Dt(o=b.g=a,e,!0,b)&&n,n=Dt(o,e,!1,b)&&n,t)for(r=0;rnew Lt),(a=>a.reset()));class Lt{constructor(){this.next=this.g=this.h=null}set(a,b){this.h=a,this.g=b,this.next=null}reset(){this.next=this.g=this.h=null}}function $t(a){h.setTimeout((()=>{throw a}),0)}function Mt(a,b){Pt||function(){var a=h.Promise.resolve(void 0);Pt=function(){a.then(Vt)}}(),Ft||(Pt(),Ft=!0),Bt.add(a,b)}var Ft=!1,Bt=new class{constructor(){this.h=this.g=null}add(a,b){const t=Rt.get();t.set(a,b),this.h?this.h.next=t:this.g=t,this.h=t}};function Vt(){for(var a;a=jt();){try{a.h.call(a.g)}catch(t){$t(t)}var b=Rt;b.j(a),100>b.h&&(b.h++,a.next=b.g,b.g=a)}Ft=!1}function qt(a,b){Ot.call(this),this.h=a||1,this.g=b||h,this.j=q(this.kb,this),this.l=Date.now()}function Ut(a){a.da=!1,a.S&&(a.g.clearTimeout(a.S),a.S=null)}function Ht(a,b,t){if("function"==typeof a)t&&(a=q(a,t));else{if(!a||"function"!=typeof a.handleEvent)throw Error("Invalid listener argument");a=q(a.handleEvent,a)}return 2147483647{a.g=null,a.i&&(a.i=!1,Wt(a))}),a.j);const b=a.h;a.h=null,a.m.apply(null,b)}x(qt,Ot),(r=qt.prototype).da=!1,r.S=null,r.kb=function(){if(this.da){var a=Date.now()-this.l;0e.length)){var n=e[1];if(Array.isArray(n)&&!(1>n.length)){var r=n[0];if("noop"!=r&&"stop"!=r&&"close"!=r)for(var o=1;ob.length?xe:(b=b.substr(e,t),a.C=e+t,b))}function Ae(a){a.Y=Date.now()+a.P,Oe(a,a.P)}function Oe(a,b){if(null!=a.B)throw Error("WatchDog timer not null");a.B=ae(q(a.eb,a),b)}function Ie(a){a.B&&(h.clearTimeout(a.B),a.B=null)}function De(a){0==a.l.G||a.I||Zn(a.l,a)}function Ne(a){Ie(a);var b=a.L;b&&"function"==typeof b.na&&b.na(),a.L=null,Ut(a.W),Jt(a.V),a.g&&(b=a.g,a.g=null,b.abort(),b.na())}function je(a,b){try{var t=a.l;if(0!=t.G&&(t.g==a||hn(t.i,a)))if(t.I=a.N,!a.J&&hn(t.i,a)&&3==t.G){try{var e=t.Ca.g.parse(b)}catch(t){e=null}if(Array.isArray(e)&&3==e.length){var n=e;if(0==n[0]){t:if(!t.u){if(t.g){if(!(t.g.F+3e3n[2]&&t.N&&0==t.A&&!t.v&&(t.v=ae(q(t.ab,t),6e3));if(1>=cn(t.i)&&t.ka){try{t.ka()}catch(t){}t.ka=void 0}}else nr(t,11)}else if((a.J||t.g==a)&&Xn(t),!O(b))for(n=t.Ca.g.parse(b),b=0;bd)&&(3!=d||z||this.g&&(this.h.h||this.g.ga()||Ln(this.g)))){this.I||4!=d||7==b||re(8==b||0>=f?3:2),Ie(this);var t=this.g.ba();this.N=t;e:if(ke(this)){var e=Ln(this.g);a="";var n=e.length,r=4==Rn(this.g);if(!this.h.i){if("undefined"==typeof TextDecoder){Ne(this),De(this);var o="";break e}this.h.i=new h.TextDecoder}for(b=0;bb)throw Error("Bad port number "+b);a.m=b}else a.m=null}function He(a,b,t){b instanceof en?(a.h=b,function(a,b){b&&!a.j&&(nn(a),a.i=null,a.g.forEach((function(t,e){var n=e.toLowerCase();e!=n&&(dd(this,e),sn(this,n,t))}),a)),a.j=b}(a.h,a.g)):(t||(b=Ge(b,Ze)),a.h=new en(b,a.g))}function We(a,b,t){a.h.set(b,t)}function ze(a){return We(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),a}function Ke(a,b){return a?b?decodeURI(a.replace(/%25/g,"%2525")):decodeURIComponent(a):""}function Ge(a,b,t){return"string"==typeof a?(a=encodeURI(a).replace(b,Ye),t&&(a=a.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),a):null}function Ye(a){return"%"+((a=a.charCodeAt(0))>>4&15).toString(16)+(15&a).toString(16)}Fe.prototype.toString=function(){var a=[],b=this.j;b&&a.push(Ge(b,Je,!0),":");var t=this.i;return(t||"file"==b)&&(a.push("//"),(b=this.s)&&a.push(Ge(b,Je,!0),"@"),a.push(encodeURIComponent(String(t)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),null!=(t=this.m)&&a.push(":",String(t))),(t=this.l)&&(this.i&&"/"!=t.charAt(0)&&a.push("/"),a.push(Ge(t,"/"==t.charAt(0)?Xe:Qe,!0))),(t=this.h.toString())&&a.push("?",t),(t=this.o)&&a.push("#",Ge(t,tn)),a.join("")};var Je=/[#\/\?@]/g,Qe=/[#\?:]/g,Xe=/[#\?]/g,Ze=/[#\?@]/g,tn=/#/g;function en(a,b){this.h=this.g=null,this.i=a||null,this.j=!!b}function nn(a){a.g||(a.g=new Re,a.h=0,a.i&&function(a,b){if(a){a=a.split("&");for(var t=0;t2*a.i&&Le(a)))}function rn(a,b){return nn(a),b=on(a,b),$e(a.g.h,b)}function sn(a,b,t){dd(a,b),0=a.j}function cn(a){return a.h?1:a.g?a.g.size:0}function hn(a,b){return a.h?a.h==b:!!a.g&&a.g.has(b)}function dn(a,b){a.g?a.g.add(b):a.h=b}function pn(a,b){a.h&&a.h==b?a.h=null:a.g&&a.g.has(b)&&a.g.delete(b)}function fn(a){if(null!=a.h)return a.i.concat(a.h.D);if(null!=a.g&&0!==a.g.size){let b=a.i;for(const t of a.g.values())b=b.concat(t.D);return b}return A(a.i)}function mn(){}function gn(){this.g=new mn}function yn(a,b,t){const e=t||"";try{Pe(a,(function(t,n){let r=t;p(t)&&(r=Nt(t)),b.push(e+n+"="+encodeURIComponent(r))}))}catch(t){throw b.push(e+"type="+encodeURIComponent("_badmap")),t}}function vn(a,b,t,e,n){try{b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null,n(e)}catch(t){}}function bn(a){this.l=a.$b||null,this.j=a.ib||!1}function wn(a,b){Ot.call(this),this.D=a,this.u=b,this.m=void 0,this.readyState=Cn,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}an.prototype.cancel=function(){if(this.i=fn(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&0!==this.g.size){for(const a of this.g.values())a.cancel();this.g.clear()}},mn.prototype.stringify=function(a){return h.JSON.stringify(a,void 0)},mn.prototype.parse=function(a){return h.JSON.parse(a,void 0)},x(bn,ce),bn.prototype.g=function(){return new wn(this.l,this.j)},bn.prototype.i=function(a){return function(){return a}}({}),x(wn,Ot);var Cn=0;function xn(a){a.j.read().then(a.Sa.bind(a)).catch(a.ha.bind(a))}function td(a){a.readyState=4,a.l=null,a.j=null,a.A=null,Tn(a)}function Tn(a){a.onreadystatechange&&a.onreadystatechange.call(a)}(r=wn.prototype).open=function(a,b){if(this.readyState!=Cn)throw this.abort(),Error("Error reopening a connection");this.C=a,this.B=b,this.readyState=1,Tn(this)},r.send=function(a){if(1!=this.readyState)throw this.abort(),Error("need to call open() first. ");this.g=!0;const b={headers:this.v,method:this.C,credentials:this.m,cache:void 0};a&&(b.body=a),(this.D||h).fetch(new Request(this.B,b)).then(this.Va.bind(this),this.ha.bind(this))},r.abort=function(){this.response=this.responseText="",this.v=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted."),1<=this.readyState&&this.g&&4!=this.readyState&&(this.g=!1,td(this)),this.readyState=Cn},r.Va=function(a){if(this.g&&(this.l=a,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=a.headers,this.readyState=2,Tn(this)),this.g&&(this.readyState=3,Tn(this),this.g)))if("arraybuffer"===this.responseType)a.arrayBuffer().then(this.Ta.bind(this),this.ha.bind(this));else if(void 0!==h.ReadableStream&&"body"in a){if(this.j=a.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;xn(this)}else a.text().then(this.Ua.bind(this),this.ha.bind(this))},r.Sa=function(a){if(this.g){if(this.u&&a.value)this.response.push(a.value);else if(!this.u){var b=a.value?a.value:new Uint8Array(0);(b=this.A.decode(b,{stream:!a.done}))&&(this.response=this.responseText+=b)}a.done?td(this):Tn(this),3==this.readyState&&xn(this)}},r.Ua=function(a){this.g&&(this.response=this.responseText=a,td(this))},r.Ta=function(a){this.g&&(this.response=a,td(this))},r.ha=function(){this.g&&td(this)},r.setRequestHeader=function(a,b){this.v.append(a,b)},r.getResponseHeader=function(a){return this.h&&this.h.get(a.toLowerCase())||""},r.getAllResponseHeaders=function(){if(!this.h)return"";const a=[],b=this.h.entries();for(var t=b.next();!t.done;)t=t.value,a.push(t[0]+": "+t[1]),t=b.next();return a.join("\r\n")},Object.defineProperty(wn.prototype,"withCredentials",{get:function(){return"include"===this.m},set:function(a){this.m=a?"include":"same-origin"}});var Sn=h.JSON.parse;function kn(a){Ot.call(this),this.headers=new Re,this.u=a||null,this.h=!1,this.C=this.g=null,this.H="",this.m=0,this.j="",this.l=this.F=this.v=this.D=!1,this.B=0,this.A=null,this.J=En,this.K=this.L=!1}x(kn,Ot);var En="",_n=/^https?$/i,An=["POST","PUT"];function On(a){return"content-type"==a.toLowerCase()}function In(a,b){a.h=!1,a.g&&(a.l=!0,a.g.abort(),a.l=!1),a.j=b,a.m=5,Dn(a),jn(a)}function Dn(a){a.D||(a.D=!0,It(a,"complete"),It(a,"error"))}function Nn(a){if(a.h&&void 0!==c&&(!a.C[1]||4!=Rn(a)||2!=a.ba()))if(a.v&&4==Rn(a))Ht(a.Fa,0,a);else if(It(a,"readystatechange"),4==Rn(a)){a.h=!1;try{const l=a.ba();t:switch(l){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var b=!0;break t;default:b=!1}var t;if(!(t=b)){var e;if(e=0===l){var n=String(a.H).match(Me)[1]||null;if(!n&&h.self&&h.self.location){var r=h.self.location.protocol;n=r.substr(0,r.length-1)}e=!_n.test(n?n.toLowerCase():"")}t=e}if(t)It(a,"complete"),It(a,"success");else{a.m=6;try{var o=2t)r=Math.max(0,n[u].h-100),l=!1;else try{yn(c,o,"req"+t+"_")}catch(t){e&&e(c)}}if(l){e=o.join("&");break t}}}return a=a.l.splice(0,t),b.D=a,e}function Gn(a){a.g||a.u||(a.Y=1,Mt(a.Ga,a),a.A=0)}function Yn(a){return!(a.g||a.u||3<=a.A)&&(a.Y++,a.u=ae(q(a.Ga,a),er(a,a.A)),a.A++,!0)}function Jn(a){null!=a.B&&(h.clearTimeout(a.B),a.B=null)}function Qn(a){a.g=new ve(a,a.h,"rpc",a.Y),null===a.o&&(a.g.H=a.s),a.g.O=0;var b=Be(a.oa);We(b,"RID","rpc"),We(b,"SID",a.J),We(b,"CI",a.N?"0":"1"),We(b,"AID",a.U),zn(a,b),We(b,"TYPE","xmlhttp"),a.o&&a.s&&$n(b,a.o,a.s),a.K&&a.g.setTimeout(a.K);var t=a.g;a=a.la,t.K=1,t.v=ze(Be(b)),t.s=null,t.U=!0,Se(t,a)}function Xn(a){null!=a.v&&(h.clearTimeout(a.v),a.v=null)}function Zn(a,b){var t=null;if(a.g==b){Xn(a),Jn(a),a.g=null;var e=2}else{if(!hn(a.i,b))return;t=b.D,pn(a.i,b),e=1}if(a.I=b.N,0!=a.G)if(b.i)if(1==e){t=b.s?b.s.length:0,b=Date.now()-b.F;var n=a.C;It(e=ee(),new oe(e,t,b,n)),Hn(a)}else Gn(a);else if(3==(n=b.o)||0==n&&0=a.i.j-(a.m?1:0)||(a.m?(a.l=b.D.concat(a.l),0):1==a.G||2==a.G||a.C>=(a.Xa?0:a.Ya)||(a.m=ae(q(a.Ha,a,b),er(a,a.C)),a.C++,0)))}(a,b)||2==e&&Yn(a)))switch(t&&0b?null:"string"==typeof a?a.charAt(b):a[b]}(n.T()),t=h.FormData&&a instanceof h.FormData,!(0<=k(An,b))||e||t||n.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8"),n.forEach((function(t,e){this.g.setRequestHeader(e,t)}),this),this.J&&(this.g.responseType=this.J),"withCredentials"in this.g&&this.g.withCredentials!==this.L&&(this.g.withCredentials=this.L);try{Pn(this),0=this.O)){var a=2*this.O;this.h.info("BP detection timer enabled: "+a),this.B=ae(q(this.bb,this),a)}},r.bb=function(){this.B&&(this.B=null,this.h.info("BP detection timeout reached."),this.h.info("Buffering proxy detected and switch to long-polling!"),this.N=!1,this.L=!0,se(10),Vn(this),Qn(this))},r.ab=function(){null!=this.v&&(this.v=null,Vn(this),Yn(this),se(19))},r.jb=function(a){a?(this.h.info("Successfully pinged google.com"),se(2)):(this.h.info("Failed to ping google.com"),se(1))},(r=or.prototype).xa=function(){},r.wa=function(){},r.va=function(){},r.ua=function(){},r.Oa=function(){},ar.prototype.g=function(a,b){return new lr(a,b)},x(lr,Ot),lr.prototype.m=function(){this.g.j=this.j,this.A&&(this.g.H=!0);var a=this.g,b=this.l,t=this.h||void 0;a.Wa&&(a.h.info("Origin Trials enabled."),Mt(q(a.hb,a,b))),se(0),a.W=b,a.aa=t||{},a.N=a.X,a.F=ir(a,null,a.W),Hn(a)},lr.prototype.close=function(){Bn(this.g)},lr.prototype.u=function(a){if("string"==typeof a){var b={};b.__data__=a,Un(this.g,b)}else this.v?((b={}).__data__=Nt(a),Un(this.g,b)):Un(this.g,a)},lr.prototype.M=function(){this.g.j=null,delete this.j,Bn(this.g),delete this.g,lr.Z.M.call(this)},x(ur,me),x(cr,ge),x(dr,or),dr.prototype.xa=function(){It(this.g,"a")},dr.prototype.wa=function(a){It(this.g,new ur(a))},dr.prototype.va=function(a){It(this.g,new cr(a))},dr.prototype.ua=function(){It(this.g,"b")},ar.prototype.createWebChannel=ar.prototype.g,lr.prototype.send=lr.prototype.u,lr.prototype.open=lr.prototype.m,lr.prototype.close=lr.prototype.close,le.NO_ERROR=0,le.TIMEOUT=8,le.HTTP_ERROR=6,ue.COMPLETE="complete",de.EventType=fe,fe.OPEN="a",fe.CLOSE="b",fe.ERROR="c",fe.MESSAGE="d",Ot.prototype.listen=Ot.prototype.N,kn.prototype.listenOnce=kn.prototype.O,kn.prototype.getLastError=kn.prototype.La,kn.prototype.getLastErrorCode=kn.prototype.Da,kn.prototype.getStatus=kn.prototype.ba,kn.prototype.getResponseJson=kn.prototype.Qa,kn.prototype.getResponseText=kn.prototype.ga,kn.prototype.send=kn.prototype.ea;var pr=l.createWebChannelTransport=function(){return new ar},fr=l.getStatEventTarget=function(){return ee()},mr=l.ErrorCode=le,gr=l.EventType=ue,yr=l.Event=Zt,vr=l.Stat={rb:0,ub:1,vb:2,Ob:3,Tb:4,Qb:5,Rb:6,Pb:7,Nb:8,Sb:9,PROXY:10,NOPROXY:11,Lb:12,Hb:13,Ib:14,Gb:15,Jb:16,Kb:17,nb:18,mb:19,ob:20},wr=l.FetchXmlHttpFactory=bn,Cr=l.WebChannel=de,xr=l.XhrIo=kn}).call(this,n(13))},238:function(t,e,n){"use strict";n(178)},239:function(t,e,n){var r=n(110)((function(i){return i[1]}));r.push([t.i,".__nuxt-error-page{padding:1rem;background:#f7f8fb;color:#47494e;text-align:center;display:flex;justify-content:center;align-items:center;flex-direction:column;font-family:sans-serif;font-weight:100!important;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-webkit-font-smoothing:antialiased;position:absolute;top:0;left:0;right:0;bottom:0}.__nuxt-error-page .error{max-width:450px}.__nuxt-error-page .title{font-size:1.5rem;margin-top:15px;color:#47494e;margin-bottom:8px}.__nuxt-error-page .description{color:#7f828b;line-height:21px;margin-bottom:10px}.__nuxt-error-page a{color:#7f828b!important;text-decoration:none}.__nuxt-error-page .logo{position:fixed;left:12px;bottom:12px}",""]),r.locals={},t.exports=r},240:function(t,e,n){"use strict";n(179)},241:function(t,e,n){var r=n(110)((function(i){return i[1]}));r.push([t.i,".nuxt-progress{position:fixed;top:0;left:0;right:0;height:2px;width:0;opacity:1;transition:width .1s,opacity .4s;background-color:#000;z-index:999999}.nuxt-progress.nuxt-progress-notransition{transition:none}.nuxt-progress-failed{background-color:red}",""]),r.locals={},t.exports=r},242:function(t,e,n){var content=n(243);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(111).default)("65b97e00",content,!0,{sourceMap:!1})},243:function(t,e,n){var r=n(110)((function(i){return i[1]}));r.push([t.i,"/*! tailwindcss v2.2.19 | MIT License | https://tailwindcss.com*//*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */\n\n/*\nDocument\n========\n*/\n\n/**\nUse a better box model (opinionated).\n*/\n\n*,\n::before,\n::after {\n\tbox-sizing: border-box;\n}\n\n/**\nUse a more readable tab size (opinionated).\n*/\n\nhtml {\n\t-moz-tab-size: 4;\n\t-o-tab-size: 4;\n\t tab-size: 4;\n}\n\n/**\n1. Correct the line height in all browsers.\n2. Prevent adjustments of font size after orientation changes in iOS.\n*/\n\nhtml {\n\tline-height: 1.15; /* 1 */\n\t-webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/*\nSections\n========\n*/\n\n/**\nRemove the margin in all browsers.\n*/\n\nbody {\n\tmargin: 0;\n}\n\n/**\nImprove consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)\n*/\n\nbody {\n\tfont-family:\n\t\tsystem-ui,\n\t\t-apple-system, /* Firefox supports this but not yet `system-ui` */\n\t\t'Segoe UI',\n\t\tRoboto,\n\t\tHelvetica,\n\t\tArial,\n\t\tsans-serif,\n\t\t'Apple Color Emoji',\n\t\t'Segoe UI Emoji';\n}\n\n/*\nGrouping content\n================\n*/\n\n/**\n1. Add the correct height in Firefox.\n2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)\n*/\n\nhr {\n\theight: 0; /* 1 */\n\tcolor: inherit; /* 2 */\n}\n\n/*\nText-level semantics\n====================\n*/\n\n/**\nAdd the correct text decoration in Chrome, Edge, and Safari.\n*/\n\nabbr[title] {\n\t-webkit-text-decoration: underline dotted;\n\t text-decoration: underline dotted;\n}\n\n/**\nAdd the correct font weight in Edge and Safari.\n*/\n\nb,\nstrong {\n\tfont-weight: bolder;\n}\n\n/**\n1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)\n2. Correct the odd 'em' font sizing in all browsers.\n*/\n\ncode,\nkbd,\nsamp,\npre {\n\tfont-family:\n\t\tui-monospace,\n\t\tSFMono-Regular,\n\t\tConsolas,\n\t\t'Liberation Mono',\n\t\tMenlo,\n\t\tmonospace; /* 1 */\n\tfont-size: 1em; /* 2 */\n}\n\n/**\nAdd the correct font size in all browsers.\n*/\n\nsmall {\n\tfont-size: 80%;\n}\n\n/**\nPrevent 'sub' and 'sup' elements from affecting the line height in all browsers.\n*/\n\nsub,\nsup {\n\tfont-size: 75%;\n\tline-height: 0;\n\tposition: relative;\n\tvertical-align: baseline;\n}\n\nsub {\n\tbottom: -0.25em;\n}\n\nsup {\n\ttop: -0.5em;\n}\n\n/*\nTabular data\n============\n*/\n\n/**\n1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)\n2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)\n*/\n\ntable {\n\ttext-indent: 0; /* 1 */\n\tborder-color: inherit; /* 2 */\n}\n\n/*\nForms\n=====\n*/\n\n/**\n1. Change the font styles in all browsers.\n2. Remove the margin in Firefox and Safari.\n*/\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n\tfont-family: inherit; /* 1 */\n\tfont-size: 100%; /* 1 */\n\tline-height: 1.15; /* 1 */\n\tmargin: 0; /* 2 */\n}\n\n/**\nRemove the inheritance of text transform in Edge and Firefox.\n1. Remove the inheritance of text transform in Firefox.\n*/\n\nbutton,\nselect { /* 1 */\n\ttext-transform: none;\n}\n\n/**\nCorrect the inability to style clickable types in iOS and Safari.\n*/\n\nbutton,\n[type='button'],\n[type='reset'],\n[type='submit'] {\n\t-webkit-appearance: button;\n}\n\n/**\nRemove the inner border and padding in Firefox.\n*/\n\n::-moz-focus-inner {\n\tborder-style: none;\n\tpadding: 0;\n}\n\n/**\nRestore the focus styles unset by the previous rule.\n*/\n\n:-moz-focusring {\n\toutline: 1px dotted ButtonText;\n}\n\n/**\nRemove the additional ':invalid' styles in Firefox.\nSee: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737\n*/\n\n:-moz-ui-invalid {\n\tbox-shadow: none;\n}\n\n/**\nRemove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers.\n*/\n\nlegend {\n\tpadding: 0;\n}\n\n/**\nAdd the correct vertical alignment in Chrome and Firefox.\n*/\n\nprogress {\n\tvertical-align: baseline;\n}\n\n/**\nCorrect the cursor style of increment and decrement buttons in Safari.\n*/\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n\theight: auto;\n}\n\n/**\n1. Correct the odd appearance in Chrome and Safari.\n2. Correct the outline style in Safari.\n*/\n\n[type='search'] {\n\t-webkit-appearance: textfield; /* 1 */\n\toutline-offset: -2px; /* 2 */\n}\n\n/**\nRemove the inner padding in Chrome and Safari on macOS.\n*/\n\n::-webkit-search-decoration {\n\t-webkit-appearance: none;\n}\n\n/**\n1. Correct the inability to style clickable types in iOS and Safari.\n2. Change font properties to 'inherit' in Safari.\n*/\n\n::-webkit-file-upload-button {\n\t-webkit-appearance: button; /* 1 */\n\tfont: inherit; /* 2 */\n}\n\n/*\nInteractive\n===========\n*/\n\n/*\nAdd the correct display in Chrome and Safari.\n*/\n\nsummary {\n\tdisplay: list-item;\n}/**\n * Manually forked from SUIT CSS Base: https://github.com/suitcss/base\n * A thin layer on top of normalize.css that provides a starting point more\n * suitable for web applications.\n */\n\n/**\n * Removes the default spacing and border for appropriate elements.\n */\n\nblockquote,\ndl,\ndd,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6,\nhr,\nfigure,\np,\npre {\n margin: 0;\n}\n\nbutton {\n background-color: transparent;\n background-image: none;\n}\n\nfieldset {\n margin: 0;\n padding: 0;\n}\n\nol,\nul {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n/**\n * Tailwind custom reset styles\n */\n\n/**\n * 1. Use the user's configured `sans` font-family (with Tailwind's default\n * sans-serif font stack as a fallback) as a sane default.\n * 2. Use Tailwind's default \"normal\" line-height so the user isn't forced\n * to override it to ensure consistency even when using the default theme.\n */\n\nhtml {\n font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\", \"Noto Color Emoji\"; /* 1 */\n line-height: 1.5; /* 2 */\n}\n\n\n/**\n * Inherit font-family and line-height from `html` so users can set them as\n * a class directly on the `html` element.\n */\n\nbody {\n font-family: inherit;\n line-height: inherit;\n}\n\n/**\n * 1. Prevent padding and border from affecting element width.\n *\n * We used to set this in the html element and inherit from\n * the parent element for everything else. This caused issues\n * in shadow-dom-enhanced elements like
where the content\n * is wrapped by a div with box-sizing set to `content-box`.\n *\n * https://github.com/mozdevs/cssremedy/issues/4\n *\n *\n * 2. Allow adding a border to an element by just adding a border-width.\n *\n * By default, the way the browser specifies that an element should have no\n * border is by setting it's border-style to `none` in the user-agent\n * stylesheet.\n *\n * In order to easily add borders to elements by just setting the `border-width`\n * property, we change the default border-style for all elements to `solid`, and\n * use border-width to hide them instead. This way our `border` utilities only\n * need to set the `border-width` property instead of the entire `border`\n * shorthand, making our border utilities much more straightforward to compose.\n *\n * https://github.com/tailwindcss/tailwindcss/pull/116\n */\n\n*,\n::before,\n::after {\n box-sizing: border-box; /* 1 */\n border-width: 0; /* 2 */\n border-style: solid; /* 2 */\n border-color: currentColor; /* 2 */\n}\n\n/*\n * Ensure horizontal rules are visible by default\n */\n\nhr {\n border-top-width: 1px;\n}\n\n/**\n * Undo the `border-style: none` reset that Normalize applies to images so that\n * our `border-{width}` utilities have the expected effect.\n *\n * The Normalize reset is unnecessary for us since we default the border-width\n * to 0 on all elements.\n *\n * https://github.com/tailwindcss/tailwindcss/issues/362\n */\n\nimg {\n border-style: solid;\n}\n\ntextarea {\n resize: vertical;\n}\n\ninput::-moz-placeholder, textarea::-moz-placeholder {\n opacity: 1;\n color: #9ca3af;\n}\n\ninput:-ms-input-placeholder, textarea:-ms-input-placeholder {\n opacity: 1;\n color: #9ca3af;\n}\n\ninput::placeholder,\ntextarea::placeholder {\n opacity: 1;\n color: #9ca3af;\n}\n\nbutton,\n[role=\"button\"] {\n cursor: pointer;\n}\n\n/**\n * Override legacy focus reset from Normalize with modern Firefox focus styles.\n *\n * This is actually an improvement over the new defaults in Firefox in our testing,\n * as it triggers the better focus styles even for links, which still use a dotted\n * outline in Firefox by default.\n */\n \n:-moz-focusring {\n\toutline: auto;\n}\n\ntable {\n border-collapse: collapse;\n}\n\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n font-size: inherit;\n font-weight: inherit;\n}\n\n/**\n * Reset links to optimize for opt-in styling instead of\n * opt-out.\n */\n\na {\n color: inherit;\n text-decoration: inherit;\n}\n\n/**\n * Reset form element properties that are easy to forget to\n * style explicitly so you don't inadvertently introduce\n * styles that deviate from your design system. These styles\n * supplement a partial reset that is already applied by\n * normalize.css.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n padding: 0;\n line-height: inherit;\n color: inherit;\n}\n\n/**\n * Use the configured 'mono' font family for elements that\n * are expected to be rendered with a monospace font, falling\n * back to the system monospace stack if there is no configured\n * 'mono' font family.\n */\n\npre,\ncode,\nkbd,\nsamp {\n font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n}\n\n/**\n * 1. Make replaced elements `display: block` by default as that's\n * the behavior you want almost all of the time. Inspired by\n * CSS Remedy, with `svg` added as well.\n *\n * https://github.com/mozdevs/cssremedy/issues/14\n * \n * 2. Add `vertical-align: middle` to align replaced elements more\n * sensibly by default when overriding `display` by adding a\n * utility like `inline`.\n *\n * This can trigger a poorly considered linting error in some\n * tools but is included by design.\n * \n * https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210\n */\n\nimg,\nsvg,\nvideo,\ncanvas,\naudio,\niframe,\nembed,\nobject {\n display: block; /* 1 */\n vertical-align: middle; /* 2 */\n}\n\n/**\n * Constrain images and videos to the parent width and preserve\n * their intrinsic aspect ratio.\n *\n * https://github.com/mozdevs/cssremedy/issues/14\n */\n\nimg,\nvideo {\n max-width: 100%;\n height: auto;\n}\n\n/**\n * Ensure the default browser behavior of the `hidden` attribute.\n */\n\n[hidden] {\n display: none;\n}*, ::before, ::after{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-transform:translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));--tw-border-opacity:1;border-color:rgba(229, 231, 235, var(--tw-border-opacity));--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-ring-inset:var(--tw-empty,/*!*/ /*!*/);--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59, 130, 246, 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-blur:var(--tw-empty,/*!*/ /*!*/);--tw-brightness:var(--tw-empty,/*!*/ /*!*/);--tw-contrast:var(--tw-empty,/*!*/ /*!*/);--tw-grayscale:var(--tw-empty,/*!*/ /*!*/);--tw-hue-rotate:var(--tw-empty,/*!*/ /*!*/);--tw-invert:var(--tw-empty,/*!*/ /*!*/);--tw-saturate:var(--tw-empty,/*!*/ /*!*/);--tw-sepia:var(--tw-empty,/*!*/ /*!*/);--tw-drop-shadow:var(--tw-empty,/*!*/ /*!*/);--tw-filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);}.container{width:100%;}@media (min-width: 640px){.container{max-width:640px;}}@media (min-width: 768px){.container{max-width:768px;}}@media (min-width: 1024px){.container{max-width:1024px;}}@media (min-width: 1280px){.container{max-width:1280px;}}@media (min-width: 1536px){.container{max-width:1536px;}}.pointer-events-none{pointer-events:none;}.static{position:static;}.fixed{position:fixed;}.absolute{position:absolute;}.relative{position:relative;}.inset-y-0{top:0px;bottom:0px;}.-top-24{top:-6rem;}.-top-48{top:-12rem;}.-top-8{top:-2rem;}.right-1\\/2{right:50%;}.left-0{left:0px;}.top-0{top:0px;}.bottom-0{bottom:0px;}.right-0{right:0px;}.z-40{z-index:40;}.z-50{z-index:50;}.-m-3{margin:-0.75rem;}.mx-auto{margin-left:auto;margin-right:auto;}.my-4{margin-top:1rem;margin-bottom:1rem;}.my-2{margin-top:0.5rem;margin-bottom:0.5rem;}.-mx-4{margin-left:-1rem;margin-right:-1rem;}.my-20{margin-top:5rem;margin-bottom:5rem;}.mt-20{margin-top:5rem;}.-mt-8{margin-top:-2rem;}.mb-6{margin-bottom:1.5rem;}.mt-4{margin-top:1rem;}.mb-2{margin-bottom:0.5rem;}.ml-6{margin-left:1.5rem;}.mr-8{margin-right:2rem;}.mt-6{margin-top:1.5rem;}.ml-2{margin-left:0.5rem;}.mb-12{margin-bottom:3rem;}.mb-4{margin-bottom:1rem;}.mb-8{margin-bottom:2rem;}.mt-10{margin-top:2.5rem;}.-ml-4{margin-left:-1rem;}.ml-4{margin-left:1rem;}.mb-10{margin-bottom:2.5rem;}.mt-2{margin-top:0.5rem;}.mr-4{margin-right:1rem;}.mr-1{margin-right:0.25rem;}.mt-8{margin-top:2rem;}.mt-1{margin-top:0.25rem;}.ml-auto{margin-left:auto;}.block{display:block;}.inline-block{display:inline-block;}.flex{display:flex;}.inline-flex{display:inline-flex;}.grid{display:grid;}.hidden{display:none;}.h-full{height:100%;}.h-8{height:2rem;}.h-16{height:4rem;}.h-screen{height:100vh;}.h-2\\/3{height:66.666667%;}.h-20{height:5rem;}.h-28{height:7rem;}.h-4{height:1rem;}.h-10{height:2.5rem;}.h-12{height:3rem;}.h-5{height:1.25rem;}.w-24{width:6rem;}.w-full{width:100%;}.w-8{width:2rem;}.w-16{width:4rem;}.w-20{width:5rem;}.w-44{width:11rem;}.w-28{width:7rem;}.w-10{width:2.5rem;}.w-12{width:3rem;}.w-5{width:1.25rem;}.w-2\\/3{width:66.666667%;}.w-4{width:1rem;}.max-w-sm{max-width:24rem;}.max-w-7xl{max-width:80rem;}.max-w-screen-xl{max-width:1280px;}.max-w-screen-md{max-width:768px;}.max-w-xs{max-width:20rem;}.max-w-xl{max-width:36rem;}.max-w-2xl{max-width:42rem;}.max-w-lg{max-width:32rem;}.flex-1{flex:1 1 0%;}.flex-shrink-0{flex-shrink:0;}.flex-grow{flex-grow:1;}.-translate-y-1\\/2{--tw-translate-y:-50%;transform:var(--tw-transform);}.-translate-x-1\\/4{--tw-translate-x:-25%;transform:var(--tw-transform);}.translate-x-1\\/2{--tw-translate-x:50%;transform:var(--tw-transform);}.scale-50{--tw-scale-x:.5;--tw-scale-y:.5;transform:var(--tw-transform);}.transform{transform:var(--tw-transform);}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none;}.grid-cols-1{grid-template-columns:repeat(1, minmax(0, 1fr));}.flex-col{flex-direction:column;}.flex-col-reverse{flex-direction:column-reverse;}.flex-wrap{flex-wrap:wrap;}.items-start{align-items:flex-start;}.items-center{align-items:center;}.justify-center{justify-content:center;}.gap-6{gap:1.5rem;}.gap-y-4{row-gap:1rem;}.gap-y-6{row-gap:1.5rem;}.space-x-4 > :not([hidden]) ~ :not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)));}.space-y-12 > :not([hidden]) ~ :not([hidden]){--tw-space-y-reverse:0;margin-top:calc(3rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(3rem * var(--tw-space-y-reverse));}.space-x-6 > :not([hidden]) ~ :not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.5rem * var(--tw-space-x-reverse));margin-left:calc(1.5rem * calc(1 - var(--tw-space-x-reverse)));}.-space-x-2 > :not([hidden]) ~ :not([hidden]){--tw-space-x-reverse:0;margin-right:calc(-0.5rem * var(--tw-space-x-reverse));margin-left:calc(-0.5rem * calc(1 - var(--tw-space-x-reverse)));}.space-y-6 > :not([hidden]) ~ :not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse));}.space-y-8 > :not([hidden]) ~ :not([hidden]){--tw-space-y-reverse:0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse));}.self-center{align-self:center;}.overflow-auto{overflow:auto;}.overflow-hidden{overflow:hidden;}.overflow-visible{overflow:visible;}.rounded-lg{border-radius:0.5rem;}.rounded-full{border-radius:9999px;}.rounded{border-radius:0.25rem;}.rounded-xl{border-radius:0.75rem;}.rounded-l-md{border-top-left-radius:0.375rem;border-bottom-left-radius:0.375rem;}.rounded-r-lg{border-top-right-radius:0.5rem;border-bottom-right-radius:0.5rem;}.rounded-t{border-top-left-radius:0.25rem;border-top-right-radius:0.25rem;}.rounded-b{border-bottom-right-radius:0.25rem;border-bottom-left-radius:0.25rem;}.border{border-width:1px;}.border-2{border-width:2px;}.border-t{border-top-width:1px;}.border-l{border-left-width:1px;}.border-b{border-bottom-width:1px;}.border-gray-300{--tw-border-opacity:1;border-color:rgba(209, 213, 219, var(--tw-border-opacity));}.border-gray-50{--tw-border-opacity:1;border-color:rgba(249, 250, 251, var(--tw-border-opacity));}.border-gray-100{--tw-border-opacity:1;border-color:rgba(243, 244, 246, var(--tw-border-opacity));}.bg-white{--tw-bg-opacity:1;background-color:rgba(255, 255, 255, var(--tw-bg-opacity));}.bg-indigo-600{--tw-bg-opacity:1;background-color:rgba(79, 70, 229, var(--tw-bg-opacity));}.bg-\\[\\#3678e5\\]{--tw-bg-opacity:1;background-color:rgba(54, 120, 229, var(--tw-bg-opacity));}.bg-blue-50{--tw-bg-opacity:1;background-color:rgba(239, 246, 255, var(--tw-bg-opacity));}.bg-gray-200{--tw-bg-opacity:1;background-color:rgba(229, 231, 235, var(--tw-bg-opacity));}.bg-indigo-200{--tw-bg-opacity:1;background-color:rgba(199, 210, 254, var(--tw-bg-opacity));}.bg-green-500{--tw-bg-opacity:1;background-color:rgba(16, 185, 129, var(--tw-bg-opacity));}.bg-gray-50{--tw-bg-opacity:1;background-color:rgba(249, 250, 251, var(--tw-bg-opacity));}.bg-black{--tw-bg-opacity:1;background-color:rgba(0, 0, 0, var(--tw-bg-opacity));}.bg-gray-100{--tw-bg-opacity:1;background-color:rgba(243, 244, 246, var(--tw-bg-opacity));}.bg-opacity-50{--tw-bg-opacity:0.5;}.fill-current{fill:currentColor;}.object-cover{-o-object-fit:cover;object-fit:cover;}.object-center{-o-object-position:center;object-position:center;}.p-3{padding:0.75rem;}.p-4{padding:1rem;}.p-2\\.5{padding:0.625rem;}.p-2{padding:0.5rem;}.p-0{padding:0px;}.px-2{padding-left:0.5rem;padding-right:0.5rem;}.px-4{padding-left:1rem;padding-right:1rem;}.py-12{padding-top:3rem;padding-bottom:3rem;}.px-3{padding-left:0.75rem;padding-right:0.75rem;}.py-3{padding-top:0.75rem;padding-bottom:0.75rem;}.py-4{padding-top:1rem;padding-bottom:1rem;}.px-8{padding-left:2rem;padding-right:2rem;}.px-10{padding-left:2.5rem;padding-right:2.5rem;}.py-8{padding-top:2rem;padding-bottom:2rem;}.py-1{padding-top:0.25rem;padding-bottom:0.25rem;}.py-2{padding-top:0.5rem;padding-bottom:0.5rem;}.py-16{padding-top:4rem;padding-bottom:4rem;}.pl-4{padding-left:1rem;}.pt-0{padding-top:0px;}.pt-20{padding-top:5rem;}.pt-8{padding-top:2rem;}.pt-10{padding-top:2.5rem;}.pt-16{padding-top:4rem;}.pb-6{padding-bottom:1.5rem;}.pb-2{padding-bottom:0.5rem;}.pt-6{padding-top:1.5rem;}.pb-4{padding-bottom:1rem;}.pl-3{padding-left:0.75rem;}.pl-1{padding-left:0.25rem;}.pl-10{padding-left:2.5rem;}.text-center{text-align:center;}.text-right{text-align:right;}.text-4xl{font-size:2.25rem;line-height:2.5rem;}.text-3xl{font-size:1.875rem;line-height:2.25rem;}.text-lg{font-size:1.125rem;line-height:1.75rem;}.text-sm{font-size:0.875rem;line-height:1.25rem;}.text-base{font-size:1rem;line-height:1.5rem;}.text-xs{font-size:0.75rem;line-height:1rem;}.text-xl{font-size:1.25rem;line-height:1.75rem;}.text-2xl{font-size:1.5rem;line-height:2rem;}.font-semibold{font-weight:600;}.font-bold{font-weight:700;}.font-light{font-weight:300;}.font-normal{font-weight:400;}.font-extrabold{font-weight:800;}.font-thin{font-weight:100;}.font-medium{font-weight:500;}.italic{font-style:italic;}.leading-normal{line-height:1.5;}.tracking-tight{letter-spacing:-0.025em;}.text-gray-700{--tw-text-opacity:1;color:rgba(55, 65, 81, var(--tw-text-opacity));}.text-gray-900{--tw-text-opacity:1;color:rgba(17, 24, 39, var(--tw-text-opacity));}.text-gray-600{--tw-text-opacity:1;color:rgba(75, 85, 99, var(--tw-text-opacity));}.text-gray-500{--tw-text-opacity:1;color:rgba(107, 114, 128, var(--tw-text-opacity));}.text-white{--tw-text-opacity:1;color:rgba(255, 255, 255, var(--tw-text-opacity));}.text-indigo-800{--tw-text-opacity:1;color:rgba(55, 48, 163, var(--tw-text-opacity));}.text-blue-600{--tw-text-opacity:1;color:rgba(37, 99, 235, var(--tw-text-opacity));}.text-gray-200{--tw-text-opacity:1;color:rgba(229, 231, 235, var(--tw-text-opacity));}.text-gray-400{--tw-text-opacity:1;color:rgba(156, 163, 175, var(--tw-text-opacity));}.text-gray-800{--tw-text-opacity:1;color:rgba(31, 41, 55, var(--tw-text-opacity));}.placeholder-gray-400::-moz-placeholder{--tw-placeholder-opacity:1;color:rgba(156, 163, 175, var(--tw-placeholder-opacity));}.placeholder-gray-400:-ms-input-placeholder{--tw-placeholder-opacity:1;color:rgba(156, 163, 175, var(--tw-placeholder-opacity));}.placeholder-gray-400::placeholder{--tw-placeholder-opacity:1;color:rgba(156, 163, 175, var(--tw-placeholder-opacity));}.opacity-50{opacity:0.5;}.opacity-0{opacity:0;}.opacity-100{opacity:1;}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0, 0, 0, 0.05);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);}.shadow{--tw-shadow:0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);}.ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);}.ring-white{--tw-ring-opacity:1;--tw-ring-color:rgba(255, 255, 255, var(--tw-ring-opacity));}.filter{filter:var(--tw-filter);}.transition{transition-property:background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;transition-property:background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;transition-property:background-color, border-color, color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}.transition-colors{transition-property:background-color, border-color, color, fill, stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}.duration-200{transition-duration:200ms;}.duration-100{transition-duration:100ms;}.duration-75{transition-duration:75ms;}.ease-in{transition-timing-function:cubic-bezier(0.4, 0, 1, 1);}.ease-in-out{transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);}.ease-out{transition-timing-function:cubic-bezier(0, 0, 0.2, 1);}.hover\\:bg-indigo-700:hover{--tw-bg-opacity:1;background-color:rgba(67, 56, 202, var(--tw-bg-opacity));}.hover\\:bg-\\[\\#3b5998\\]:hover{--tw-bg-opacity:1;background-color:rgba(59, 89, 152, var(--tw-bg-opacity));}.hover\\:bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgba(229, 231, 235, var(--tw-bg-opacity));}.hover\\:bg-\\[\\#80808040\\]:hover{background-color:#80808040;}.hover\\:text-gray-700:hover{--tw-text-opacity:1;color:rgba(55, 65, 81, var(--tw-text-opacity));}.hover\\:text-gray-800:hover{--tw-text-opacity:1;color:rgba(31, 41, 55, var(--tw-text-opacity));}.focus\\:border-transparent:focus{border-color:transparent;}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px;}.focus\\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);}.focus\\:ring-purple-600:focus{--tw-ring-opacity:1;--tw-ring-color:rgba(124, 58, 237, var(--tw-ring-opacity));}.focus\\:ring-indigo-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgba(99, 102, 241, var(--tw-ring-opacity));}.focus\\:ring-blue-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgba(59, 130, 246, var(--tw-ring-opacity));}.focus\\:ring-gray-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgba(107, 114, 128, var(--tw-ring-opacity));}.focus\\:ring-indigo-600:focus{--tw-ring-opacity:1;--tw-ring-color:rgba(79, 70, 229, var(--tw-ring-opacity));}.focus\\:ring-opacity-50:focus{--tw-ring-opacity:0.5;}.focus\\:ring-offset-2:focus{--tw-ring-offset-width:2px;}.focus\\:ring-offset-indigo-200:focus{--tw-ring-offset-color:#c7d2fe;}.focus\\:ring-offset-blue-200:focus{--tw-ring-offset-color:#bfdbfe;}.focus\\:ring-offset-gray-200:focus{--tw-ring-offset-color:#e5e7eb;}.disabled\\:bg-gray-300:disabled{--tw-bg-opacity:1;background-color:rgba(209, 213, 219, var(--tw-bg-opacity));}@media (min-width: 640px){.sm\\:block{display:block;}.sm\\:w-44{width:11rem;}.sm\\:max-w-xl{max-width:36rem;}.sm\\:grid-cols-2{grid-template-columns:repeat(2, minmax(0, 1fr));}.sm\\:gap-y-6{row-gap:1.5rem;}.sm\\:space-x-6 > :not([hidden]) ~ :not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.5rem * var(--tw-space-x-reverse));margin-left:calc(1.5rem * calc(1 - var(--tw-space-x-reverse)));}.sm\\:p-6{padding:1.5rem;}.sm\\:px-0{padding-left:0px;padding-right:0px;}.sm\\:px-6{padding-left:1.5rem;padding-right:1.5rem;}.sm\\:pt-10{padding-top:2.5rem;}.sm\\:text-center{text-align:center;}.sm\\:text-4xl{font-size:2.25rem;line-height:2.5rem;}.sm\\:text-xl{font-size:1.25rem;line-height:1.75rem;}.sm\\:text-5xl{font-size:3rem;line-height:1;}}@media (min-width: 768px){.md\\:-top-40{top:-10rem;}.md\\:top-1\\/2{top:50%;}.md\\:mx-auto{margin-left:auto;margin-right:auto;}.md\\:mb-12{margin-bottom:3rem;}.md\\:mb-10{margin-bottom:2.5rem;}.md\\:mt-4{margin-top:1rem;}.md\\:inline-flex{display:inline-flex;}.md\\:hidden{display:none;}.md\\:h-full{height:100%;}.md\\:h-32{height:8rem;}.md\\:h-20{height:5rem;}.md\\:w-1\\/3{width:33.333333%;}.md\\:w-1\\/2{width:50%;}.md\\:w-32{width:8rem;}.md\\:w-96{width:24rem;}.md\\:w-20{width:5rem;}.md\\:w-3\\/4{width:75%;}.md\\:w-2\\/3{width:66.666667%;}.md\\:max-w-full{max-width:100%;}.md\\:translate-x-0{--tw-translate-x:0px;transform:var(--tw-transform);}.md\\:scale-75{--tw-scale-x:.75;--tw-scale-y:.75;transform:var(--tw-transform);}.md\\:flex-row{flex-direction:row;}.md\\:space-y-0 > :not([hidden]) ~ :not([hidden]){--tw-space-y-reverse:0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse));}.md\\:overflow-hidden{overflow:hidden;}.md\\:rounded-lg{border-radius:0.5rem;}.md\\:border{border-width:1px;}.md\\:px-8{padding-left:2rem;padding-right:2rem;}.md\\:px-24{padding-left:6rem;padding-right:6rem;}.md\\:text-lg{font-size:1.125rem;line-height:1.75rem;}.md\\:text-sm{font-size:0.875rem;line-height:1.25rem;}}@media (min-width: 1024px){.lg\\:mb-0{margin-bottom:0px;}.lg\\:h-40{height:10rem;}.lg\\:w-1\\/2{width:50%;}.lg\\:w-40{width:10rem;}.lg\\:max-w-screen-xl{max-width:1280px;}.lg\\:max-w-2xl{max-width:42rem;}.lg\\:max-w-screen-lg{max-width:1024px;}.lg\\:scale-90{--tw-scale-x:.9;--tw-scale-y:.9;transform:var(--tw-transform);}.lg\\:grid-cols-3{grid-template-columns:repeat(3, minmax(0, 1fr));}.lg\\:gap-y-8{row-gap:2rem;}.lg\\:space-x-8 > :not([hidden]) ~ :not([hidden]){--tw-space-x-reverse:0;margin-right:calc(2rem * var(--tw-space-x-reverse));margin-left:calc(2rem * calc(1 - var(--tw-space-x-reverse)));}.lg\\:whitespace-nowrap{white-space:nowrap;}.lg\\:p-8{padding:2rem;}.lg\\:px-10{padding-left:2.5rem;padding-right:2.5rem;}.lg\\:px-8{padding-left:2rem;padding-right:2rem;}.lg\\:py-24{padding-top:6rem;padding-bottom:6rem;}.lg\\:pr-40{padding-right:10rem;}.lg\\:text-4xl{font-size:2.25rem;line-height:2.5rem;}}@media (min-width: 1280px){.xl\\:scale-100{--tw-scale-x:1;--tw-scale-y:1;transform:var(--tw-transform);}}",""]),r.locals={},t.exports=r},246:function(t,e,n){(function(t,n){var r="__lodash_hash_undefined__",o=9007199254740991,l="[object Arguments]",c="[object Array]",h="[object Boolean]",d="[object Date]",f="[object Error]",m="[object Function]",y="[object Map]",v="[object Number]",w="[object Object]",C="[object Promise]",x="[object RegExp]",T="[object Set]",S="[object String]",k="[object Symbol]",E="[object WeakMap]",_="[object ArrayBuffer]",A="[object DataView]",O=/^\[object .+?Constructor\]$/,I=/^(?:0|[1-9]\d*)$/,D={};D["[object Float32Array]"]=D["[object Float64Array]"]=D["[object Int8Array]"]=D["[object Int16Array]"]=D["[object Int32Array]"]=D["[object Uint8Array]"]=D["[object Uint8ClampedArray]"]=D["[object Uint16Array]"]=D["[object Uint32Array]"]=!0,D[l]=D[c]=D[_]=D[h]=D[A]=D[d]=D[f]=D[m]=D[y]=D[v]=D[w]=D[x]=D[T]=D[S]=D[E]=!1;var N="object"==typeof t&&t&&t.Object===Object&&t,j="object"==typeof self&&self&&self.Object===Object&&self,P=N||j||Function("return this")(),R=e&&!e.nodeType&&e,L=R&&"object"==typeof n&&n&&!n.nodeType&&n,$=L&&L.exports===R,M=$&&N.process,F=function(){try{return M&&M.binding&&M.binding("util")}catch(t){}}(),B=F&&F.isTypedArray;function V(t,e){for(var n=-1,r=null==t?0:t.length;++nh))return!1;var f=l.get(t);if(f&&l.get(e))return f==e;var m=-1,y=!0,v=2&n?new It:void 0;for(l.set(t,e),l.set(e,t);++m-1},At.prototype.set=function(t,e){var data=this.__data__,n=jt(data,t);return n<0?(++this.size,data.push([t,e])):data[n][1]=e,this},Ot.prototype.clear=function(){this.size=0,this.__data__={hash:new _t,map:new(mt||At),string:new _t}},Ot.prototype.delete=function(t){var e=Vt(this,t).delete(t);return this.size-=e?1:0,e},Ot.prototype.get=function(t){return Vt(this,t).get(t)},Ot.prototype.has=function(t){return Vt(this,t).has(t)},Ot.prototype.set=function(t,e){var data=Vt(this,t),n=data.size;return data.set(t,e),this.size+=data.size==n?0:1,this},It.prototype.add=It.prototype.push=function(t){return this.__data__.set(t,r),this},It.prototype.has=function(t){return this.__data__.has(t)},Dt.prototype.clear=function(){this.__data__=new At,this.size=0},Dt.prototype.delete=function(t){var data=this.__data__,e=data.delete(t);return this.size=data.size,e},Dt.prototype.get=function(t){return this.__data__.get(t)},Dt.prototype.has=function(t){return this.__data__.has(t)},Dt.prototype.set=function(t,e){var data=this.__data__;if(data instanceof At){var n=data.__data__;if(!mt||n.length<199)return n.push([t,e]),this.size=++data.size,this;data=this.__data__=new Ot(n)}return data.set(t,e),this.size=data.size,this};var Ut=ct?function(object){return null==object?[]:(object=Object(object),function(t,e){for(var n=-1,r=null==t?0:t.length,o=0,l=[];++n-1&&t%1==0&&t-1&&t%1==0&&t<=o}function Zt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function te(t){return null!=t&&"object"==typeof t}var ee=B?function(t){return function(e){return t(e)}}(B):function(t){return te(t)&&Xt(t.length)&&!!D[Pt(t)]};function ne(object){return null!=(t=object)&&Xt(t.length)&&!Qt(t)?Nt(object):Mt(object);var t}n.exports=function(t,e){return Lt(t,e)}}).call(this,n(13),n(105)(t))},247:function(t,e,n){(function(t,n){var r="__lodash_hash_undefined__",o=9007199254740991,l="[object Arguments]",c="[object Boolean]",h="[object Date]",d="[object Function]",f="[object GeneratorFunction]",m="[object Map]",y="[object Number]",v="[object Object]",w="[object Promise]",C="[object RegExp]",x="[object Set]",T="[object String]",S="[object Symbol]",k="[object WeakMap]",E="[object ArrayBuffer]",_="[object DataView]",A="[object Float32Array]",O="[object Float64Array]",I="[object Int8Array]",D="[object Int16Array]",N="[object Int32Array]",j="[object Uint8Array]",P="[object Uint8ClampedArray]",R="[object Uint16Array]",L="[object Uint32Array]",$=/\w*$/,M=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,B={};B[l]=B["[object Array]"]=B[E]=B[_]=B[c]=B[h]=B[A]=B[O]=B[I]=B[D]=B[N]=B[m]=B[y]=B[v]=B[C]=B[x]=B[T]=B[S]=B[j]=B[P]=B[R]=B[L]=!0,B["[object Error]"]=B[d]=B[k]=!1;var V="object"==typeof t&&t&&t.Object===Object&&t,U="object"==typeof self&&self&&self.Object===Object&&self,H=V||U||Function("return this")(),W=e&&!e.nodeType&&e,z=W&&"object"==typeof n&&n&&!n.nodeType&&n,K=z&&z.exports===W;function G(map,t){return map.set(t[0],t[1]),map}function Y(t,e){return t.add(e),t}function J(t,e,n,r){var o=-1,l=t?t.length:0;for(r&&l&&(n=t[++o]);++o-1},$t.prototype.set=function(t,e){var data=this.__data__,n=qt(data,t);return n<0?data.push([t,e]):data[n][1]=e,this},Mt.prototype.clear=function(){this.__data__={hash:new Lt,map:new(St||$t),string:new Lt}},Mt.prototype.delete=function(t){return Kt(this,t).delete(t)},Mt.prototype.get=function(t){return Kt(this,t).get(t)},Mt.prototype.has=function(t){return Kt(this,t).has(t)},Mt.prototype.set=function(t,e){return Kt(this,t).set(t,e),this},Ft.prototype.clear=function(){this.__data__=new $t},Ft.prototype.delete=function(t){return this.__data__.delete(t)},Ft.prototype.get=function(t){return this.__data__.get(t)},Ft.prototype.has=function(t){return this.__data__.has(t)},Ft.prototype.set=function(t,e){var n=this.__data__;if(n instanceof $t){var r=n.__data__;if(!St||r.length<199)return r.push([t,e]),this;n=this.__data__=new Mt(r)}return n.set(t,e),this};var Yt=wt?Z(wt,Object):function(){return[]},Jt=function(t){return ct.call(t)};function Qt(t,e){return!!(e=null==e?o:e)&&("number"==typeof t||F.test(t))&&t>-1&&t%1==0&&t-1&&t%1==0&&t<=o}(t.length)&&!ie(t)}var re=Ct||function(){return!1};function ie(t){var e=se(t)?ct.call(t):"";return e==d||e==f}function se(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function oe(object){return ne(object)?Bt(object):function(object){if(!Xt(object))return xt(object);var t=[];for(var e in Object(object))ut.call(object,e)&&"constructor"!=e&&t.push(e);return t}(object)}n.exports=function(t){return Ut(t,!0,!0)}}).call(this,n(13),n(105)(t))},248:function(t,e,n){(function(e){var n="__lodash_hash_undefined__",r=9007199254740991,o=/^\[object .+?Constructor\]$/,l="object"==typeof e&&e&&e.Object===Object&&e,c="object"==typeof self&&self&&self.Object===Object&&self,h=l||c||Function("return this")();function d(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function f(t,e){return!!(t?t.length:0)&&function(t,e,n){if(e!=e)return function(t,e,n,r){var o=t.length,l=n+(r?1:-1);for(;r?l--:++l-1}function m(t,e,n){for(var r=-1,o=t?t.length:0;++r-1&&t%1==0&&t<=r}(t.length)&&!J(t)}(t)}(t)?t:[]}function W(map,t){var e,n,data=map.__data__;return("string"==(n=typeof(e=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==e:null===e)?data["string"==typeof t?"string":"hash"]:data.map}function z(object,t){var e=function(object,t){return null==object?void 0:object[t]}(object,t);return U(e)?e:void 0}$.prototype.clear=function(){this.__data__=L?L(null):{}},$.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},$.prototype.get=function(t){var data=this.__data__;if(L){var e=data[t];return e===n?void 0:e}return O.call(data,t)?data[t]:void 0},$.prototype.has=function(t){var data=this.__data__;return L?void 0!==data[t]:O.call(data,t)},$.prototype.set=function(t,e){return this.__data__[t]=L&&void 0===e?n:e,this},M.prototype.clear=function(){this.__data__=[]},M.prototype.delete=function(t){var data=this.__data__,e=V(data,t);return!(e<0)&&(e==data.length-1?data.pop():N.call(data,e,1),!0)},M.prototype.get=function(t){var data=this.__data__,e=V(data,t);return e<0?void 0:data[e][1]},M.prototype.has=function(t){return V(this.__data__,t)>-1},M.prototype.set=function(t,e){var data=this.__data__,n=V(data,t);return n<0?data.push([t,e]):data[n][1]=e,this},F.prototype.clear=function(){this.__data__={hash:new $,map:new(R||M),string:new $}},F.prototype.delete=function(t){return W(this,t).delete(t)},F.prototype.get=function(t){return W(this,t).get(t)},F.prototype.has=function(t){return W(this,t).has(t)},F.prototype.set=function(t,e){return W(this,t).set(t,e),this},B.prototype.add=B.prototype.push=function(t){return this.__data__.set(t,n),this},B.prototype.has=function(t){return this.__data__.has(t)};var K,G,Y=(K=function(t){var e=y(t,H);return e.length&&e[0]===t[0]?function(t,e,n){for(var r=n?m:f,o=t[0].length,l=t.length,c=l,h=Array(l),d=1/0,v=[];c--;){var x=t[c];c&&e&&(x=y(x,w(e))),d=P(x.length,d),h[c]=!n&&(e||o>=120&&x.length>=120)?new B(c&&x):void 0}x=t[0];var T=-1,S=h[0];t:for(;++T-1&&t%1==0&&t<=r}(t.length)&&!function(t){var e=T(t)?w.call(t):"";return e==l||e==c}(t)}(object)&&function(t,e){return!!(e=null==e?r:e)&&("number"==typeof t||y.test(t))&&t>-1&&t%1==0&&t0&&n(h)?e>1?E(h,e-1,n,r,o):y(o,h):r||(o[o.length]=h)}return o}function _(t){return O(t)||function(t){return function(t){return I(t)&&function(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=n}(t.length)&&!function(t){var e=function(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}(t)?C.call(t):"";return e==o||e==l}(t)}(t)}(t)&&w.call(t,"callee")&&(!T.call(t,"callee")||C.call(t)==r)}(t)||!!(S&&t&&t[S])}function A(t){if("string"==typeof t||function(t){return"symbol"==typeof t||I(t)&&C.call(t)==c}(t))return t;var e=t+"";return"0"==e&&1/t==-Infinity?"-0":e}var O=Array.isArray;function I(t){return!!t&&"object"==typeof t}var D,N,j=(D=function(object,t){return null==object?{}:function(object,t){return function(object,t,e){for(var n=-1,r=t.length,o={};++n-1},ot.prototype.set=function(t,e){var data=this.__data__,n=pt(data,t);return n<0?(++this.size,data.push([t,e])):data[n][1]=e,this},at.prototype.clear=function(){this.size=0,this.__data__={hash:new st,map:new(et||ot),string:new st}},at.prototype.delete=function(t){var e=St(this,t).delete(t);return this.size-=e?1:0,e},at.prototype.get=function(t){return St(this,t).get(t)},at.prototype.has=function(t){return St(this,t).has(t)},at.prototype.set=function(t,e){var data=St(this,t),n=data.size;return data.set(t,e),this.size+=data.size==n?0:1,this},lt.prototype.clear=function(){this.__data__=new ot,this.size=0},lt.prototype.delete=function(t){var data=this.__data__,e=data.delete(t);return this.size=data.size,e},lt.prototype.get=function(t){return this.__data__.get(t)},lt.prototype.has=function(t){return this.__data__.has(t)},lt.prototype.set=function(t,e){var data=this.__data__;if(data instanceof ot){var n=data.__data__;if(!et||n.length<199)return n.push([t,e]),this.size=++data.size,this;data=this.__data__=new at(n)}return data.set(t,e),this.size=data.size,this};var mt,gt=function(object,t,e){for(var n=-1,r=Object(object),o=e(object),l=o.length;l--;){var c=o[mt?l:++n];if(!1===t(r[c],c,r))break}return object};function yt(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":J&&J in Object(t)?function(t){var e=L.call(t,J),n=t[J];try{t[J]=void 0;var r=!0}catch(t){}var o=M.call(t);r&&(e?t[J]=n:delete t[J]);return o}(t):function(t){return M.call(t)}(t)}function vt(t){return Mt(t)&&yt(t)==l}function bt(t){return!(!$t(t)||function(t){return!!$&&$ in t}(t))&&(Rt(t)?B:d).test(function(t){if(null!=t){try{return R.call(t)}catch(t){}try{return t+""}catch(t){}}return""}(t))}function wt(object){if(!$t(object))return function(object){var t=[];if(null!=object)for(var e in Object(object))t.push(e);return t}(object);var t=_t(object),e=[];for(var n in object)("constructor"!=n||!t&&L.call(object,n))&&e.push(n);return e}function Ct(object,source,t,e,n){object!==source&>(source,(function(r,o){if(n||(n=new lt),$t(r))!function(object,source,t,e,n,r,o){var l=At(object,t),c=At(source,t),d=o.get(c);if(d)return void ct(object,t,d);var f=r?r(l,c,t+"",object,source,o):void 0,m=void 0===f;if(m){var y=Nt(c),v=!y&&Pt(c),w=!y&&!v&&Ft(c);f=c,y||v||w?Nt(l)?f=l:Mt(k=l)&&jt(k)?f=function(source,t){var e=-1,n=source.length;t||(t=Array(n));for(;++e-1&&t%1==0&&t0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}(Tt);function It(t,e){return t===e||t!=t&&e!=e}var Dt=vt(function(){return arguments}())?vt:function(t){return Mt(t)&&L.call(t,"callee")&&!G.call(t,"callee")},Nt=Array.isArray;function jt(t){return null!=t&&Lt(t.length)&&!Rt(t)}var Pt=X||function(){return!1};function Rt(t){if(!$t(t))return!1;var e=yt(t);return e==c||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Lt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=o}function $t(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Mt(t){return null!=t&&"object"==typeof t}var Ft=E?function(t){return function(e){return t(e)}}(E):function(t){return Mt(t)&&Lt(t.length)&&!!m[yt(t)]};function Bt(object){return jt(object)?ut(object,!0):wt(object)}var Vt,qt=(Vt=function(object,source,t){Ct(object,source,t)},xt((function(object,t){var e=-1,n=t.length,r=n>1?t[n-1]:void 0,o=n>2?t[2]:void 0;for(r=Vt.length>3&&"function"==typeof r?(n--,r):void 0,o&&function(t,e,object){if(!$t(object))return!1;var n=typeof e;return!!("number"==n?jt(object)&&Et(e,object.length):"string"==n&&e in object)&&It(object[e],t)}(t[0],t[1],o)&&(r=n<3?void 0:r,n=1),object=Object(object);++e=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i1&&void 0!==arguments[1]?arguments[1]:[],r=t.$children||[],o=y(r);try{for(o.s();!(e=o.n()).done;){var l=e.value;l.$fetch?n.push(l):l.$children&&T(l,n)}}catch(t){o.e(t)}finally{o.f()}return n}function S(t,e){if(e||!t.options.__hasNuxtData){var n=t.options._originDataFn||t.options.data||function(){return{}};t.options._originDataFn=n,t.options.data=function(){var data=n.call(this,this);return this.$ssrContext&&(e=this.$ssrContext.asyncData[t.cid]),m(m({},data),e)},t.options.__hasNuxtData=!0,t._Ctor&&t._Ctor.options&&(t._Ctor.options.data=t.options.data)}}function k(t){return t.options&&t._Ctor===t||(t.options?(t._Ctor=t,t.extendOptions=t.options):(t=h.default.extend(t))._Ctor=t,!t.options.name&&t.options.__file&&(t.options.name=t.options.__file)),t}function E(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"components";return Array.prototype.concat.apply([],t.matched.map((function(t,r){return Object.keys(t[n]).map((function(o){return e&&e.push(r),t[n][o]}))})))}function _(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return E(t,e,"instances")}function A(t,e){return Array.prototype.concat.apply([],t.matched.map((function(t,n){return Object.keys(t.components).reduce((function(r,o){return t.components[o]?r.push(e(t.components[o],t.instances[o],t,o,n)):delete t.components[o],r}),[])})))}function O(t,e){return Promise.all(A(t,function(){var t=Object(o.a)(regeneratorRuntime.mark((function t(n,r,o,l){var c,h;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("function"!=typeof n||n.options){t.next=11;break}return t.prev=1,t.next=4,n();case 4:n=t.sent,t.next=11;break;case 7:throw t.prev=7,t.t0=t.catch(1),t.t0&&"ChunkLoadError"===t.t0.name&&"undefined"!=typeof window&&window.sessionStorage&&(c=Date.now(),(!(h=parseInt(window.sessionStorage.getItem("nuxt-reload")))||h+6e41&&void 0!==arguments[1]?arguments[1]:E,n=arguments.length>2?arguments[2]:void 0;return r.call(this,t,e,n)};var o=n.resolve.bind(n);return n.resolve=function(t,e,n){return"string"==typeof t&&(t=Object(C.c)(t)),o(t,e,n)},n}var O={name:"NuxtChild",functional:!0,props:{nuxtChildKey:{type:String,default:""},keepAlive:Boolean,keepAliveProps:{type:Object,default:void 0}},render:function(t,e){var n=e.parent,data=e.data,r=e.props,o=n.$createElement;data.nuxtChild=!0;for(var l=n,c=n.$nuxt.nuxt.transitions,h=n.$nuxt.nuxt.defaultTransition,d=0;n;)n.$vnode&&n.$vnode.data.nuxtChild&&d++,n=n.$parent;data.nuxtChildDepth=d;var f=c[d]||h,m={};I.forEach((function(t){void 0!==f[t]&&(m[t]=f[t])}));var y={};D.forEach((function(t){"function"==typeof f[t]&&(y[t]=f[t].bind(l))}));var v=y.beforeEnter;if(y.beforeEnter=function(t){if(window.$nuxt.$nextTick((function(){window.$nuxt.$emit("triggerScroll")})),v)return v.call(l,t)},!1===f.css){var w=y.leave;(!w||w.length<2)&&(y.leave=function(t,e){w&&w.call(l,t),l.$nextTick(e)})}var C=o("routerView",data);return r.keepAlive&&(C=o("keep-alive",{props:r.keepAliveProps},[C])),o("transition",{props:m,on:y},[C])}},I=["name","mode","appear","css","type","duration","enterClass","leaveClass","appearClass","enterActiveClass","enterActiveClass","leaveActiveClass","appearActiveClass","enterToClass","leaveToClass","appearToClass"],D=["beforeEnter","enter","afterEnter","enterCancelled","beforeLeave","leave","afterLeave","leaveCancelled","beforeAppear","appear","afterAppear","appearCancelled"],N={name:"NuxtError",props:{error:{type:Object,default:null}},computed:{statusCode:function(){return this.error&&this.error.statusCode||500},message:function(){return this.error.message||"Error"}},head:function(){return{title:this.message,meta:[{name:"viewport",content:"width=device-width,initial-scale=1.0,minimum-scale=1.0"}]}}},j=(n(238),n(51)),P=Object(j.a)(N,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"__nuxt-error-page"},[n("div",{staticClass:"error"},[n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"90",height:"90",fill:"#DBE1EC",viewBox:"0 0 48 48"}},[n("path",{attrs:{d:"M22 30h4v4h-4zm0-16h4v12h-4zm1.99-10C12.94 4 4 12.95 4 24s8.94 20 19.99 20S44 35.05 44 24 35.04 4 23.99 4zM24 40c-8.84 0-16-7.16-16-16S15.16 8 24 8s16 7.16 16 16-7.16 16-16 16z"}})]),t._v(" "),n("div",{staticClass:"title"},[t._v(t._s(t.message))]),t._v(" "),404===t.statusCode?n("p",{staticClass:"description"},[void 0===t.$route?n("a",{staticClass:"error-link",attrs:{href:"/"}}):n("NuxtLink",{staticClass:"error-link",attrs:{to:"/"}},[t._v("Back to the home page")])],1):t._e(),t._v(" "),t._m(0)])])}),[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"logo"},[n("a",{attrs:{href:"https://nuxtjs.org",target:"_blank",rel:"noopener"}},[t._v("Nuxt")])])}],!1,null,null,null).exports,R=n(27),L=(n(113),{name:"Nuxt",components:{NuxtChild:O,NuxtError:P},props:{nuxtChildKey:{type:String,default:void 0},keepAlive:Boolean,keepAliveProps:{type:Object,default:void 0},name:{type:String,default:"default"}},errorCaptured:function(t){this.displayingNuxtError&&(this.errorFromNuxtError=t,this.$forceUpdate())},computed:{routerViewKey:function(){if(void 0!==this.nuxtChildKey||this.$route.matched.length>1)return this.nuxtChildKey||Object(x.c)(this.$route.matched[0].path)(this.$route.params);var t=Object(R.a)(this.$route.matched,1)[0];if(!t)return this.$route.path;var e=t.components.default;if(e&&e.options){var n=e.options;if(n.key)return"function"==typeof n.key?n.key(this.$route):n.key}return/\/$/.test(t.path)?this.$route.path:this.$route.path.replace(/\/$/,"")}},beforeCreate:function(){c.default.util.defineReactive(this,"nuxt",this.$root.$options.nuxt)},render:function(t){var e=this;return this.nuxt.err?this.errorFromNuxtError?(this.$nextTick((function(){return e.errorFromNuxtError=!1})),t("div",{},[t("h2","An error occurred while showing the error page"),t("p","Unfortunately an error occurred and while showing the error page another error occurred"),t("p","Error details: ".concat(this.errorFromNuxtError.toString())),t("nuxt-link",{props:{to:"/"}},"Go back to home")])):(this.displayingNuxtError=!0,this.$nextTick((function(){return e.displayingNuxtError=!1})),t(P,{props:{error:this.nuxt.err}})):t("NuxtChild",{key:this.routerViewKey,props:this.$props})}}),$=(n(55),n(60),n(62),n(63),n(53),{name:"NuxtLoading",data:function(){return{percent:0,show:!1,canSucceed:!0,reversed:!1,skipTimerCount:0,rtl:!1,throttle:200,duration:5e3,continuous:!1}},computed:{left:function(){return!(!this.continuous&&!this.rtl)&&(this.rtl?this.reversed?"0px":"auto":this.reversed?"auto":"0px")}},beforeDestroy:function(){this.clear()},methods:{clear:function(){clearInterval(this._timer),clearTimeout(this._throttle),this._timer=null},start:function(){var t=this;return this.clear(),this.percent=0,this.reversed=!1,this.skipTimerCount=0,this.canSucceed=!0,this.throttle?this._throttle=setTimeout((function(){return t.startTimer()}),this.throttle):this.startTimer(),this},set:function(t){return this.show=!0,this.canSucceed=!0,this.percent=Math.min(100,Math.max(0,Math.floor(t))),this},get:function(){return this.percent},increase:function(t){return this.percent=Math.min(100,Math.floor(this.percent+t)),this},decrease:function(t){return this.percent=Math.max(0,Math.floor(this.percent-t)),this},pause:function(){return clearInterval(this._timer),this},resume:function(){return this.startTimer(),this},finish:function(){return this.percent=this.reversed?0:100,this.hide(),this},hide:function(){var t=this;return this.clear(),setTimeout((function(){t.show=!1,t.$nextTick((function(){t.percent=0,t.reversed=!1}))}),500),this},fail:function(t){return this.canSucceed=!1,this},startTimer:function(){var t=this;this.show||(this.show=!0),void 0===this._cut&&(this._cut=1e4/Math.floor(this.duration)),this._timer=setInterval((function(){t.skipTimerCount>0?t.skipTimerCount--:(t.reversed?t.decrease(t._cut):t.increase(t._cut),t.continuous&&(t.percent>=100||t.percent<=0)&&(t.skipTimerCount=1,t.reversed=!t.reversed))}),100)}},render:function(t){var e=t(!1);return this.show&&(e=t("div",{staticClass:"nuxt-progress",class:{"nuxt-progress-notransition":this.skipTimerCount>0,"nuxt-progress-failed":!this.canSucceed},style:{width:this.percent+"%",left:this.left}})),e}}),M=(n(240),Object(j.a)($,undefined,undefined,!1,null,null,null).exports),F=(n(242),n(192));function B(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return V(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return V(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function V(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i0},isPreview:function(){return Boolean(this.$options.previewData)}},methods:{refreshOnlineStatus:function(){void 0===window.navigator.onLine?this.isOnline=!0:this.isOnline=window.navigator.onLine},refresh:function(){var t=this;return Object(o.a)(regeneratorRuntime.mark((function e(){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((n=Object(x.h)(t.$route)).length){e.next=3;break}return e.abrupt("return");case 3:return t.$loading.start(),r=n.map((function(e){var p=[];if(e.$options.fetch&&e.$options.fetch.length&&p.push(Object(x.q)(e.$options.fetch,t.context)),e.$fetch)p.push(e.$fetch());else{var n,r=B(Object(x.e)(e.$vnode.componentInstance));try{for(r.s();!(n=r.n()).done;){var component=n.value;p.push(component.$fetch())}}catch(t){r.e(t)}finally{r.f()}}return e.$options.asyncData&&p.push(Object(x.q)(e.$options.asyncData,t.context).then((function(t){for(var n in t)c.default.set(e.$data,n,t[n])}))),Promise.all(p)})),e.prev=5,e.next=8,Promise.all(r);case 8:e.next=15;break;case 10:e.prev=10,e.t0=e.catch(5),t.$loading.fail(e.t0),Object(x.k)(e.t0),t.error(e.t0);case 15:t.$loading.finish();case 16:case"end":return e.stop()}}),e,null,[[5,10]])})))()},errorChanged:function(){if(this.nuxt.err){this.$loading&&(this.$loading.fail&&this.$loading.fail(this.nuxt.err),this.$loading.finish&&this.$loading.finish());var t=(P.options||P).layout;"function"==typeof t&&(t=t(this.context)),this.setLayout(t)}},setLayout:function(t){return t&&U["_"+t]||(t="default"),this.layoutName=t,this.layout=U["_"+t],this.layout},loadLayout:function(t){return t&&U["_"+t]||(t="default"),Promise.resolve(U["_"+t])}},components:{NuxtLoading:M}};n(144),n(52);function W(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return z(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return l=t.done,t},e:function(t){c=!0,o=t},f:function(){try{l||null==n.return||n.return()}finally{if(c)throw o}}}}function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i2&&void 0!==arguments[2]?arguments[2]:{},r=n.isProperty,o=void 0!==r&&r;if(!e.length||o&&1===e.length)return t;var l=e.shift();return t.modules[l]=t.modules[l]||{},t.modules[l].namespaced=!0,t.modules[l].modules=t.modules[l].modules||{},X(t.modules[l],e,{isProperty:o})}function Z(t,e,n){e&&("state"===n?t.state=e||t.state:t[n]=Object.assign({},t[n],e))}n(69);var tt=function(){return n.e(3).then(n.bind(null,261)).then((function(t){return st(t.default||t)}))},et=function(){return n.e(4).then(n.bind(null,262)).then((function(t){return st(t.default||t)}))},nt=function(){return n.e(5).then(n.bind(null,260)).then((function(t){return st(t.default||t)}))},it=function(){return n.e(6).then(n.bind(null,264)).then((function(t){return st(t.default||t)}))};function st(t){if(!t||!t.functional)return t;var e=Array.isArray(t.props)?t.props:Object.keys(t.props||{});return{render:function(n){var r={},o={};for(var l in this.$attrs)e.includes(l)?o[l]=this.$attrs[l]:r[l]=this.$attrs[l];return n(t,{on:this.$listeners,attrs:r,props:o,scopedSlots:this.$scopedSlots},this.$slots.default)}}}for(var ot in r)c.default.component(ot,r[ot]),c.default.component("Lazy"+ot,r[ot]);var at=n(12),lt=n(139),ut=n(79);function ct(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}function ht(t){for(var i=1;i has been deprecated and will be removed in Nuxt 3, please use instead")),v.a.render(t,e)}})),c.default.component(O.name,O),c.default.component("NChild",O),c.default.component(L.name,L),Object.defineProperty(c.default.prototype,"$nuxt",{get:function(){var t=this.$root.$options.$nuxt;return t||"undefined"==typeof window?t:window.$nuxt},configurable:!0}),c.default.use(d.a,{keyName:"head",attribute:"data-n-head",ssrAttribute:"data-n-head-ssr",tagIDKeyName:"hid"});var pt={name:"page",mode:"out-in",appear:!0,appearClass:"appear",appearActiveClass:"appear-active",appearToClass:"appear-to"};h.a.Store.prototype.registerModule;function ft(t){return mt.apply(this,arguments)}function mt(){return mt=Object(o.a)(regeneratorRuntime.mark((function t(e){var n,r,l,h,d,f,path,m,y=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return m=function(t,e){if(!t)throw new Error("inject(key, value) has no key provided");if(void 0===e)throw new Error("inject('".concat(t,"', value) has no value provided"));h[t="$"+t]=e,h.context[t]||(h.context[t]=e),l[t]=h[t];var n="__nuxt_"+t+"_installed__";c.default[n]||(c.default[n]=!0,c.default.use((function(){Object.prototype.hasOwnProperty.call(c.default.prototype,t)||Object.defineProperty(c.default.prototype,t,{get:function(){return this.$root.$options[t]}})})))},n=y.length>1&&void 0!==y[1]?y[1]:{},t.next=4,A(0,n);case 4:return r=t.sent,(l=Y(e)).$router=r,h=ht({head:{title:"Spúšťame zdieľanú poličku",htmlAttrs:{lang:"sk"},meta:[{charset:"utf-8"},{name:"viewport",content:"width=device-width, initial-scale=1"},{hid:"description",name:"description",content:""},{name:"format-detection",content:"telephone=no"}],link:[{rel:"icon",type:"image/x-icon",href:"/favicon.ico"}],script:[{src:"https://www.instagram.com/embed.js",body:!0}],style:[]},store:l,router:r,nuxt:{defaultTransition:pt,transitions:[pt],setTransitions:function(t){return Array.isArray(t)||(t=[t]),t=t.map((function(t){return t=t?"string"==typeof t?Object.assign({},pt,{name:t}):Object.assign({},pt,t):pt})),this.$options.nuxt.transitions=t,t},err:null,dateErr:null,error:function(t){t=t||null,h.context._errored=Boolean(t),t=t?Object(x.p)(t):null;var n=h.nuxt;return this&&(n=this.nuxt||this.$options.nuxt),n.dateErr=Date.now(),n.err=t,e&&(e.nuxt.error=t),t}}},H),l.app=h,d=e?e.next:function(t){return h.router.push(t)},e?f=r.resolve(e.url).route:(path=Object(x.f)(r.options.base,r.options.mode),f=r.resolve(path).route),t.next=13,Object(x.t)(h,{store:l,route:f,next:d,error:h.nuxt.error.bind(h),payload:e?e.payload:void 0,req:e?e.req:void 0,res:e?e.res:void 0,beforeRenderFns:e?e.beforeRenderFns:void 0,ssrContext:e});case 13:m("config",n),window.__NUXT__&&window.__NUXT__.state&&l.replaceState(window.__NUXT__.state),h.context.enablePreview=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};h.previewData=Object.assign({},t),m("preview",t)},t.next=19;break;case 19:if("function"!=typeof at.default){t.next=22;break}return t.next=22,Object(at.default)(h.context,m);case 22:if("function"!=typeof lt.default){t.next=25;break}return t.next=25,Object(lt.default)(h.context,m);case 25:if("function"!=typeof ut.a){t.next=28;break}return t.next=28,Object(ut.a)(h.context,m);case 28:return h.context.enablePreview=function(){console.warn("You cannot call enablePreview() outside a plugin.")},t.next=31,new Promise((function(t,e){if(!r.resolve(h.context.route.fullPath).route.matched.length)return t();r.replace(h.context.route.fullPath,t,(function(n){if(!n._isRouter)return e(n);if(2!==n.type)return t();var l=r.afterEach(function(){var e=Object(o.a)(regeneratorRuntime.mark((function e(n,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=3,Object(x.j)(n);case 3:h.context.route=e.sent,h.context.params=n.params||{},h.context.query=n.query||{},l(),t();case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}())}))}));case 31:return t.abrupt("return",{store:l,app:h,router:r});case 32:case"end":return t.stop()}}),t)}))),mt.apply(this,arguments)}},4:function(t,e,n){"use strict";n.d(e,"a",(function(){return A})),n.d(e,"b",(function(){return T})),n.d(e,"c",(function(){return x})),n.d(e,"d",(function(){return S})),n.d(e,"e",(function(){return I})),n.d(e,"f",(function(){return O})),n.d(e,"g",(function(){return D}));var r=n(18),o=n(15),l=n(0);class c{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map((t=>{if(function(t){const component=t.getComponent();return"VERSION"===(null==component?void 0:component.type)}(t)){const e=t.getImmediate();return`${e.library}/${e.version}`}return null})).filter((t=>t)).join(" ")}}const h="@firebase/app",d="0.7.14",f=new o.b("@firebase/app"),m="[DEFAULT]",y={[h]:"fire-core","@firebase/app-compat":"fire-core-compat","@firebase/analytics":"fire-analytics","@firebase/analytics-compat":"fire-analytics-compat","@firebase/app-check":"fire-app-check","@firebase/app-check-compat":"fire-app-check-compat","@firebase/auth":"fire-auth","@firebase/auth-compat":"fire-auth-compat","@firebase/database":"fire-rtdb","@firebase/database-compat":"fire-rtdb-compat","@firebase/functions":"fire-fn","@firebase/functions-compat":"fire-fn-compat","@firebase/installations":"fire-iid","@firebase/installations-compat":"fire-iid-compat","@firebase/messaging":"fire-fcm","@firebase/messaging-compat":"fire-fcm-compat","@firebase/performance":"fire-perf","@firebase/performance-compat":"fire-perf-compat","@firebase/remote-config":"fire-rc","@firebase/remote-config-compat":"fire-rc-compat","@firebase/storage":"fire-gcs","@firebase/storage-compat":"fire-gcs-compat","@firebase/firestore":"fire-fst","@firebase/firestore-compat":"fire-fst-compat","fire-js":"fire-js",firebase:"fire-js-all"},v=new Map,w=new Map;function C(t,component){try{t.container.addComponent(component)}catch(e){f.debug(`Component ${component.name} failed to register with FirebaseApp ${t.name}`,e)}}function x(component){const t=component.name;if(w.has(t))return f.debug(`There were multiple attempts to register component ${t}.`),!1;w.set(t,component);for(const t of v.values())C(t,component);return!0}function T(t,e){return t.container.getProvider(e)}function S(t,e,n="[DEFAULT]"){T(t,e).clearInstance(n)}const k={"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","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","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function."},E=new l.b("app","Firebase",k);class _{constructor(t,e,n){this._isDeleted=!1,this._options=Object.assign({},t),this._config=Object.assign({},e),this._name=e.name,this._automaticDataCollectionEnabled=e.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new r.a("app",(()=>this),"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}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(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw E.create("app-deleted",{appName:this._name})}}const A="9.6.4";function O(t,e={}){if("object"!=typeof e){e={name:e}}const n=Object.assign({name:m,automaticDataCollectionEnabled:!1},e),o=n.name;if("string"!=typeof o||!o)throw E.create("bad-app-name",{appName:String(o)});const c=v.get(o);if(c){if(Object(l.i)(t,c.options)&&Object(l.i)(n,c.config))return c;throw E.create("duplicate-app",{appName:o})}const h=new r.b(o);for(const component of w.values())h.addComponent(component);const d=new _(t,n,h);return v.set(o,d),d}function I(t="[DEFAULT]"){const e=v.get(t);if(!e)throw E.create("no-app",{appName:t});return e}function D(t,e,n){var o;let l=null!==(o=y[t])&&void 0!==o?o:t;n&&(l+=`-${n}`);const c=l.match(/\s|\//),h=e.match(/\s|\//);if(c||h){const t=[`Unable to register library "${l}" with version "${e}":`];return c&&t.push(`library name "${l}" contains illegal characters (whitespace or "/")`),c&&h&&t.push("and"),h&&t.push(`version name "${e}" contains illegal characters (whitespace or "/")`),void f.warn(t.join(" "))}x(new r.a(`${l}-version`,(()=>({library:l,version:e})),"VERSION"))}var N;N="",x(new r.a("platform-logger",(t=>new c(t)),"PRIVATE")),D(h,d,N),D(h,d,"esm2017"),D("fire-js","")},66:function(t,e,n){"use strict";n.d(e,"a",(function(){return Pt})),n.d(e,"b",(function(){return Rt})),n.d(e,"c",(function(){return dn})),n.d(e,"d",(function(){return Le})),n.d(e,"e",(function(){return Gt})),n.d(e,"f",(function(){return Kt})),n.d(e,"g",(function(){return Yt})),n.d(e,"h",(function(){return Re}));var r=n(0),o=n(4);function l(s,t){var e={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&t.indexOf(p)<0&&(e[p]=s[p]);if(null!=s&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(p=Object.getOwnPropertySymbols(s);it,"Short delay should be less than long delay!"),this.isMobile=Object(r.r)()||Object(r.s)()}get(){return"undefined"!=typeof navigator&&navigator&&"onLine"in navigator&&"boolean"==typeof navigator.onLine&&(D()||Object(r.m)()||"connection"in navigator)&&!navigator.onLine?Math.min(5e3,this.shortDelay):this.isMobile?this.longDelay:this.shortDelay}}function P(t,path){_(t.emulator,"Emulator should always be set here");const{url:e}=t.emulator;return path?`${e}${path.startsWith("/")?path.slice(1):path}`:e}class R{static initialize(t,e,n){this.fetchImpl=t,e&&(this.headersImpl=e),n&&(this.responseImpl=n)}static fetch(){return this.fetchImpl?this.fetchImpl:"undefined"!=typeof self&&"fetch"in self?self.fetch:void E("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 E("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 E("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const L={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:"internal-error",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_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"},$=new j(3e4,6e4);function M(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function F(t,e,path,n,o={}){return B(t,o,(async()=>{let body={},o={};n&&("GET"===e?o=n:body={body:JSON.stringify(n)});const l=Object(r.v)(Object.assign({key:t.config.apiKey},o)).slice(1),c=await t._getAdditionalHeaders();return c["Content-Type"]="application/json",t.languageCode&&(c["X-Firebase-Locale"]=t.languageCode),R.fetch()(U(t,t.config.apiHost,path,l),Object.assign({method:e,headers:c,referrerPolicy:"no-referrer"},body))}))}async function B(t,e,n){t._canInitEmulator=!1;const o=Object.assign(Object.assign({},L),e);try{const e=new H(t),r=await Promise.race([n(),e.promise]);e.clearNetworkTimeout();const l=await r.json();if("needConfirmation"in l)throw W(t,"account-exists-with-different-credential",l);if(r.ok&&!("errorMessage"in l))return l;{const e=r.ok?l.errorMessage:l.error.message,[n,c]=e.split(" : ");if("FEDERATED_USER_ID_ALREADY_LINKED"===n)throw W(t,"credential-already-in-use",l);if("EMAIL_EXISTS"===n)throw W(t,"email-already-in-use",l);const h=o[n]||n.toLowerCase().replace(/[_\s]+/g,"-");if(c)throw x(t,h,c);w(t,h)}}catch(e){if(e instanceof r.c)throw e;w(t,"network-request-failed")}}async function V(t,e,path,n,r={}){const o=await F(t,e,path,n,r);return"mfaPendingCredential"in o&&w(t,"multi-factor-auth-required",{_serverResponse:o}),o}function U(t,e,path,n){const base=`${e}${path}?${n}`;return t.config.emulator?P(t.config,base):`${t.config.apiScheme}://${base}`}class H{constructor(t){this.auth=t,this.timer=null,this.promise=new Promise(((t,e)=>{this.timer=setTimeout((()=>e(C(this.auth,"network-request-failed"))),$.get())}))}clearNetworkTimeout(){clearTimeout(this.timer)}}function W(t,code,e){const n={appName:t.name};e.email&&(n.email=e.email),e.phoneNumber&&(n.phoneNumber=e.phoneNumber);const r=C(t,code,n);return r.customData._tokenResponse=e,r}function z(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch(t){}}function K(t){return 1e3*Number(t)}function G(t){const[e,n,o]=t.split(".");if(void 0===e||void 0===n||void 0===o)return v("JWT malformed, contained fewer than 3 sections"),null;try{const t=Object(r.e)(n);return t?JSON.parse(t):(v("Failed to decode base64 JWT payload"),null)}catch(t){return v("Caught error parsing JWT payload as JSON",t),null}}async function Y(t,e,n=!1){if(n)return e;try{return await e}catch(e){throw e instanceof r.c&&function({code:code}){return"auth/user-disabled"===code||"auth/user-token-expired"===code}(e)&&t.auth.currentUser===t&&await t.auth.signOut(),e}}class J{constructor(t){this.user=t,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(t){var e;if(t){const t=this.errorBackoff;return this.errorBackoff=Math.min(2*this.errorBackoff,96e4),t}{this.errorBackoff=3e4;const t=(null!==(e=this.user.stsTokenManager.expirationTime)&&void 0!==e?e:0)-Date.now()-3e5;return Math.max(0,t)}}schedule(t=!1){if(!this.isRunning)return;const e=this.getInterval(t);this.timerId=setTimeout((async()=>{await this.iteration()}),e)}async iteration(){try{await this.user.getIdToken(!0)}catch(t){return void("auth/network-request-failed"===t.code&&this.schedule(!0))}this.schedule()}}class Q{constructor(t,e){this.createdAt=t,this.lastLoginAt=e,this._initializeTime()}_initializeTime(){this.lastSignInTime=z(this.lastLoginAt),this.creationTime=z(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function X(t){var e;const n=t.auth,r=await t.getIdToken(),o=await Y(t,async function(t,e){return F(t,"POST","/v1/accounts:lookup",e)}(n,{idToken:r}));k(null==o?void 0:o.users.length,n,"internal-error");const c=o.users[0];t._notifyReloadListener(c);const h=(null===(e=c.providerUserInfo)||void 0===e?void 0:e.length)?c.providerUserInfo.map((t=>{var{providerId:e}=t,n=l(t,["providerId"]);return{providerId:e,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})):[];const d=(f=t.providerData,m=h,[...f.filter((t=>!m.some((e=>e.providerId===t.providerId)))),...m]);var f,m;const y=t.isAnonymous,v=!(t.email&&c.passwordHash||(null==d?void 0:d.length)),w=!!y&&v,C={uid:c.localId,displayName:c.displayName||null,photoURL:c.photoUrl||null,email:c.email||null,emailVerified:c.emailVerified||!1,phoneNumber:c.phoneNumber||null,tenantId:c.tenantId||null,providerData:d,metadata:new Q(c.createdAt,c.lastLoginAt),isAnonymous:w};Object.assign(t,C)}class Z{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){k(t.idToken,"internal-error"),k(void 0!==t.idToken,"internal-error"),k(void 0!==t.refreshToken,"internal-error");const e="expiresIn"in t&&void 0!==t.expiresIn?Number(t.expiresIn):function(t){const e=G(t);return k(e,"internal-error"),k(void 0!==e.exp,"internal-error"),k(void 0!==e.iat,"internal-error"),Number(e.exp)-Number(e.iat)}(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,e)}async getToken(t,e=!1){return k(!this.accessToken||this.refreshToken,t,"user-token-expired"),e||!this.accessToken||this.isExpired?this.refreshToken?(await this.refresh(t,this.refreshToken),this.accessToken):null:this.accessToken}clearRefreshToken(){this.refreshToken=null}async refresh(t,e){const{accessToken:n,refreshToken:o,expiresIn:l}=await async function(t,e){const n=await B(t,{},(async()=>{const body=Object(r.v)({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:n,apiKey:o}=t.config,l=U(t,n,"/v1/token",`key=${o}`),c=await t._getAdditionalHeaders();return c["Content-Type"]="application/x-www-form-urlencoded",R.fetch()(l,{method:"POST",headers:c,body:body})}));return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}(t,e);this.updateTokensAndExpiration(n,o,Number(l))}updateTokensAndExpiration(t,e,n){this.refreshToken=e||null,this.accessToken=t||null,this.expirationTime=Date.now()+1e3*n}static fromJSON(t,object){const{refreshToken:e,accessToken:n,expirationTime:r}=object,o=new Z;return e&&(k("string"==typeof e,"internal-error",{appName:t}),o.refreshToken=e),n&&(k("string"==typeof n,"internal-error",{appName:t}),o.accessToken=n),r&&(k("number"==typeof r,"internal-error",{appName:t}),o.expirationTime=r),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new Z,this.toJSON())}_performRefresh(){return E("not implemented")}}function tt(t,e){k("string"==typeof t||void 0===t,"internal-error",{appName:e})}class et{constructor(t){var{uid:e,auth:n,stsTokenManager:r}=t,o=l(t,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.emailVerified=!1,this.isAnonymous=!1,this.tenantId=null,this.providerData=[],this.proactiveRefresh=new J(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=o.displayName||null,this.email=o.email||null,this.emailVerified=o.emailVerified||!1,this.phoneNumber=o.phoneNumber||null,this.photoURL=o.photoURL||null,this.isAnonymous=o.isAnonymous||!1,this.tenantId=o.tenantId||null,this.metadata=new Q(o.createdAt||void 0,o.lastLoginAt||void 0)}async getIdToken(t){const e=await Y(this,this.stsTokenManager.getToken(this.auth,t));return k(e,this.auth,"internal-error"),this.accessToken!==e&&(this.accessToken=e,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),e}getIdTokenResult(t){return async function(t,e=!1){const n=Object(r.k)(t),o=await n.getIdToken(e),l=G(o);k(l&&l.exp&&l.auth_time&&l.iat,n.auth,"internal-error");const c="object"==typeof l.firebase?l.firebase:void 0,h=null==c?void 0:c.sign_in_provider;return{claims:l,token:o,authTime:z(K(l.auth_time)),issuedAtTime:z(K(l.iat)),expirationTime:z(K(l.exp)),signInProvider:h||null,signInSecondFactor:(null==c?void 0:c.sign_in_second_factor)||null}}(this,t)}reload(){return async function(t){const e=Object(r.k)(t);await X(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}(this)}_assign(t){this!==t&&(k(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map((t=>Object.assign({},t))),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){return new et(Object.assign(Object.assign({},this),{auth:t,stsTokenManager:this.stsTokenManager._clone()}))}_onReload(t){k(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,e=!1){let n=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),n=!0),e&&await X(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){const t=await this.getIdToken();return await Y(this,async function(t,e){return F(t,"POST","/v1/accounts:delete",e)}(this.auth,{idToken:t})),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((t=>Object.assign({},t))),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(t,object){var e,n,r,o,l,c,h,d;const f=null!==(e=object.displayName)&&void 0!==e?e:void 0,m=null!==(n=object.email)&&void 0!==n?n:void 0,y=null!==(r=object.phoneNumber)&&void 0!==r?r:void 0,v=null!==(o=object.photoURL)&&void 0!==o?o:void 0,w=null!==(l=object.tenantId)&&void 0!==l?l:void 0,C=null!==(c=object._redirectEventId)&&void 0!==c?c:void 0,x=null!==(h=object.createdAt)&&void 0!==h?h:void 0,T=null!==(d=object.lastLoginAt)&&void 0!==d?d:void 0,{uid:S,emailVerified:E,isAnonymous:_,providerData:A,stsTokenManager:O}=object;k(S&&O,t,"internal-error");const I=Z.fromJSON(this.name,O);k("string"==typeof S,t,"internal-error"),tt(f,t.name),tt(m,t.name),k("boolean"==typeof E,t,"internal-error"),k("boolean"==typeof _,t,"internal-error"),tt(y,t.name),tt(v,t.name),tt(w,t.name),tt(C,t.name),tt(x,t.name),tt(T,t.name);const D=new et({uid:S,auth:t,email:m,emailVerified:E,displayName:f,isAnonymous:_,photoURL:v,phoneNumber:y,tenantId:w,stsTokenManager:I,createdAt:x,lastLoginAt:T});return A&&Array.isArray(A)&&(D.providerData=A.map((t=>Object.assign({},t)))),C&&(D._redirectEventId=C),D}static async _fromIdTokenResponse(t,e,n=!1){const r=new Z;r.updateFromServerResponse(e);const o=new et({uid:e.localId,auth:t,stsTokenManager:r,isAnonymous:n});return await X(o),o}}class nt{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,e){this.storage[t]=e}async _get(t){const e=this.storage[t];return void 0===e?null:e}async _remove(t){delete this.storage[t]}_addListener(t,e){}_removeListener(t,e){}}nt.type="NONE";const it=nt;function st(t,e,n){return`firebase:${t}:${e}:${n}`}class ot{constructor(t,e,n){this.persistence=t,this.auth=e,this.userKey=n;const{config:r,name:o}=this.auth;this.fullUserKey=st(this.userKey,r.apiKey,o),this.fullPersistenceKey=st("persistence",r.apiKey,o),this.boundEventHandler=e._onStorageEvent.bind(e),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(t){return this.persistence._set(this.fullUserKey,t.toJSON())}async getCurrentUser(){const t=await this.persistence._get(this.fullUserKey);return t?et._fromJSON(this.auth,t):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(t){if(this.persistence===t)return;const e=await this.getCurrentUser();return await this.removeCurrentUser(),this.persistence=t,e?this.setCurrentUser(e):void 0}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(t,e,n="authUser"){if(!e.length)return new ot(O(it),t,n);const r=(await Promise.all(e.map((async t=>{if(await t._isAvailable())return t})))).filter((t=>t));let o=r[0]||O(it);const l=st(n,t.config.apiKey,t.name);let c=null;for(const n of e)try{const e=await n._get(l);if(e){const r=et._fromJSON(t,e);n!==o&&(c=r),o=n;break}}catch(t){}const h=r.filter((p=>p._shouldAllowMigration));return o._shouldAllowMigration&&h.length?(o=h[0],c&&await o._set(l,c.toJSON()),await Promise.all(e.map((async t=>{if(t!==o)try{await t._remove(l)}catch(t){}}))),new ot(o,t,n)):new ot(o,t,n)}}function at(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(ht(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(lt(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(ft(e))return"Blackberry";if(mt(e))return"Webos";if(ut(e))return"Safari";if((e.includes("chrome/")||ct(e))&&!e.includes("edge/"))return"Chrome";if(pt(e))return"Android";{const e=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=t.match(e);if(2===(null==n?void 0:n.length))return n[1]}return"Other"}function lt(t=Object(r.l)()){return/firefox\//i.test(t)}function ut(t=Object(r.l)()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function ct(t=Object(r.l)()){return/crios\//i.test(t)}function ht(t=Object(r.l)()){return/iemobile/i.test(t)}function pt(t=Object(r.l)()){return/android/i.test(t)}function ft(t=Object(r.l)()){return/blackberry/i.test(t)}function mt(t=Object(r.l)()){return/webos/i.test(t)}function gt(t=Object(r.l)()){return/iphone|ipad|ipod/i.test(t)}function yt(t=Object(r.l)()){return gt(t)||pt(t)||mt(t)||ft(t)||/windows phone/i.test(t)||ht(t)}function vt(t,e=[]){let n;switch(t){case"Browser":n=at(Object(r.l)());break;case"Worker":n=`${at(Object(r.l)())}-${t}`;break;default:n=t}const l=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${o.a}/${l}`}class bt{constructor(t,e){this.app=t,this.config=e,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Ct(this),this.idTokenSubscription=new Ct(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=m,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=e.sdkClientVersion}_initializeWithPersistence(t,e){return e&&(this._popupRedirectResolver=O(e)),this._initializationPromise=this.queue((async()=>{var n,r;if(!this._deleted&&(this.persistenceManager=await ot.create(this,t),!this._deleted)){if(null===(n=this._popupRedirectResolver)||void 0===n?void 0:n._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch(t){}await this.initializeCurrentUser(e),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 t=await this.assertedPersistence.getCurrentUser();return this.currentUser||t?this.currentUser&&t&&this.currentUser.uid===t.uid?(this._currentUser._assign(t),void await this.currentUser.getIdToken()):void await this._updateCurrentUser(t):void 0}async initializeCurrentUser(t){var e;let n=await this.assertedPersistence.getCurrentUser();if(t&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const r=null===(e=this.redirectUser)||void 0===e?void 0:e._redirectEventId,o=null==n?void 0:n._redirectEventId,l=await this.tryRedirectSignIn(t);r&&r!==o||!(null==l?void 0:l.user)||(n=l.user)}return n?n._redirectEventId?(k(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===n._redirectEventId?this.directlySetCurrentUser(n):this.reloadAndSetCurrentUserOrClear(n)):this.reloadAndSetCurrentUserOrClear(n):this.directlySetCurrentUser(null)}async tryRedirectSignIn(t){let e=null;try{e=await this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch(t){await this._setRedirectUser(null)}return e}async reloadAndSetCurrentUserOrClear(t){try{await X(t)}catch(t){if("auth/network-request-failed"!==t.code)return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)}useDeviceLanguage(){this.languageCode=function(){if("undefined"==typeof navigator)return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}()}async _delete(){this._deleted=!0}async updateCurrentUser(t){const e=t?Object(r.k)(t):null;return e&&k(e.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(e&&e._clone(this))}async _updateCurrentUser(t){if(!this._deleted)return t&&k(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),this.queue((async()=>{await this.directlySetCurrentUser(t),this.notifyAuthListeners()}))}async signOut(){return(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null)}setPersistence(t){return this.queue((async()=>{await this.assertedPersistence.setPersistence(O(t))}))}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(t){this._errorFactory=new r.b("auth","Firebase",t())}onAuthStateChanged(t,e,n){return this.registerStateListener(this.authStateSubscription,t,e,n)}onIdTokenChanged(t,e,n){return this.registerStateListener(this.idTokenSubscription,t,e,n)}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:null===(t=this._currentUser)||void 0===t?void 0:t.toJSON()}}async _setRedirectUser(t,e){const n=await this.getOrInitRedirectPersistenceManager(e);return null===t?n.removeCurrentUser():n.setCurrentUser(t)}async getOrInitRedirectPersistenceManager(t){if(!this.redirectPersistenceManager){const e=t&&O(t)||this._popupRedirectResolver;k(e,this,"argument-error"),this.redirectPersistenceManager=await ot.create(this,[O(e._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(t){var e,n;return this._isInitialized&&await this.queue((async()=>{})),(null===(e=this._currentUser)||void 0===e?void 0:e._redirectEventId)===t?this._currentUser:(null===(n=this.redirectUser)||void 0===n?void 0:n._redirectEventId)===t?this.redirectUser:null}async _persistUserIfCurrent(t){if(t===this.currentUser)return this.queue((async()=>this.directlySetCurrentUser(t)))}_notifyListenersIfCurrent(t){t===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 t,e;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const n=null!==(e=null===(t=this.currentUser)||void 0===t?void 0:t.uid)&&void 0!==e?e:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,e,n,r){if(this._deleted)return()=>{};const o="function"==typeof e?e:e.next.bind(e),l=this._isInitialized?Promise.resolve():this._initializationPromise;return k(l,this,"internal-error"),l.then((()=>o(this.currentUser))),"function"==typeof e?t.addObserver(e,n,r):t.addObserver(e)}async directlySetCurrentUser(t){this.currentUser&&this.currentUser!==t&&(this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh()),this.currentUser=t,t?await this.assertedPersistence.setCurrentUser(t):await this.assertedPersistence.removeCurrentUser()}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return k(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){t&&!this.frameworks.includes(t)&&(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=vt(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){const t={"X-Client-Version":this.clientVersion};return this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId),t}}function wt(t){return Object(r.k)(t)}class Ct{constructor(t){this.auth=t,this.observer=null,this.addObserver=Object(r.h)((t=>this.observer=t))}get next(){return k(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}class xt{constructor(t,e){this.providerId=t,this.signInMethod=e}toJSON(){return E("not implemented")}_getIdTokenResponse(t){return E("not implemented")}_linkToIdToken(t,e){return E("not implemented")}_getReauthenticationResolver(t){return E("not implemented")}}async function Tt(t,e){return F(t,"POST","/v1/accounts:update",e)}async function St(t,e){return F(t,"POST","/v1/accounts:sendOobCode",M(t,e))}class kt extends xt{constructor(t,e,n,r=null){super("password",n),this._email=t,this._password=e,this._tenantId=r}static _fromEmailAndPassword(t,e){return new kt(t,e,"password")}static _fromEmailAndCode(t,e,n=null){return new kt(t,e,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(t){const e="string"==typeof t?JSON.parse(t):t;if((null==e?void 0:e.email)&&(null==e?void 0:e.password)){if("password"===e.signInMethod)return this._fromEmailAndPassword(e.email,e.password);if("emailLink"===e.signInMethod)return this._fromEmailAndCode(e.email,e.password,e.tenantId)}return null}async _getIdTokenResponse(t){switch(this.signInMethod){case"password":return async function(t,e){return V(t,"POST","/v1/accounts:signInWithPassword",M(t,e))}(t,{returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return async function(t,e){return V(t,"POST","/v1/accounts:signInWithEmailLink",M(t,e))}(t,{email:this._email,oobCode:this._password});default:w(t,"internal-error")}}async _linkToIdToken(t,e){switch(this.signInMethod){case"password":return Tt(t,{idToken:e,returnSecureToken:!0,email:this._email,password:this._password});case"emailLink":return async function(t,e){return V(t,"POST","/v1/accounts:signInWithEmailLink",M(t,e))}(t,{idToken:e,email:this._email,oobCode:this._password});default:w(t,"internal-error")}}_getReauthenticationResolver(t){return this._getIdTokenResponse(t)}}async function Et(t,e){return V(t,"POST","/v1/accounts:signInWithIdp",M(t,e))}class _t extends xt{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const e=new _t(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(e.idToken=t.idToken),t.accessToken&&(e.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(e.nonce=t.nonce),t.pendingToken&&(e.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(e.accessToken=t.oauthToken,e.secret=t.oauthTokenSecret):w("argument-error"),e}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const e="string"==typeof t?JSON.parse(t):t,{providerId:n,signInMethod:r}=e,o=l(e,["providerId","signInMethod"]);if(!n||!r)return null;const c=new _t(n,r);return c.idToken=o.idToken||void 0,c.accessToken=o.accessToken||void 0,c.secret=o.secret,c.nonce=o.nonce,c.pendingToken=o.pendingToken||null,c}_getIdTokenResponse(t){return Et(t,this.buildRequest())}_linkToIdToken(t,e){const n=this.buildRequest();return n.idToken=e,Et(t,n)}_getReauthenticationResolver(t){const e=this.buildRequest();return e.autoCreate=!1,Et(t,e)}buildRequest(){const t={requestUri:"http://localhost",returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const e={};this.idToken&&(e.id_token=this.idToken),this.accessToken&&(e.access_token=this.accessToken),this.secret&&(e.oauth_token_secret=this.secret),e.providerId=this.providerId,this.nonce&&!this.pendingToken&&(e.nonce=this.nonce),t.postBody=Object(r.v)(e)}return t}}const At={USER_NOT_FOUND:"user-not-found"};class Ot extends xt{constructor(t){super("phone","phone"),this.params=t}static _fromVerification(t,e){return new Ot({verificationId:t,verificationCode:e})}static _fromTokenResponse(t,e){return new Ot({phoneNumber:t,temporaryProof:e})}_getIdTokenResponse(t){return async function(t,e){return V(t,"POST","/v1/accounts:signInWithPhoneNumber",M(t,e))}(t,this._makeVerificationRequest())}_linkToIdToken(t,e){return async function(t,e){const n=await V(t,"POST","/v1/accounts:signInWithPhoneNumber",M(t,e));if(n.temporaryProof)throw W(t,"account-exists-with-different-credential",n);return n}(t,Object.assign({idToken:e},this._makeVerificationRequest()))}_getReauthenticationResolver(t){return async function(t,e){return V(t,"POST","/v1/accounts:signInWithPhoneNumber",M(t,Object.assign(Object.assign({},e),{operation:"REAUTH"})),At)}(t,this._makeVerificationRequest())}_makeVerificationRequest(){const{temporaryProof:t,phoneNumber:e,verificationId:n,verificationCode:r}=this.params;return t&&e?{temporaryProof:t,phoneNumber:e}:{sessionInfo:n,code:r}}toJSON(){const t={providerId:this.providerId};return this.params.phoneNumber&&(t.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(t.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(t.verificationCode=this.params.verificationCode),this.params.verificationId&&(t.verificationId=this.params.verificationId),t}static fromJSON(t){"string"==typeof t&&(t=JSON.parse(t));const{verificationId:e,verificationCode:n,phoneNumber:r,temporaryProof:o}=t;return n||e||r||o?new Ot({verificationId:e,verificationCode:n,phoneNumber:r,temporaryProof:o}):null}}class It{constructor(t){var e,n,o,l,c,h;const d=Object(r.w)(Object(r.j)(t)),f=null!==(e=d.apiKey)&&void 0!==e?e:null,code=null!==(n=d.oobCode)&&void 0!==n?n:null,m=function(t){switch(t){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}(null!==(o=d.mode)&&void 0!==o?o:null);k(f&&code&&m,"argument-error"),this.apiKey=f,this.operation=m,this.code=code,this.continueUrl=null!==(l=d.continueUrl)&&void 0!==l?l:null,this.languageCode=null!==(c=d.languageCode)&&void 0!==c?c:null,this.tenantId=null!==(h=d.tenantId)&&void 0!==h?h:null}static parseLink(link){const t=function(t){const link=Object(r.w)(Object(r.j)(t)).link,e=link?Object(r.w)(Object(r.j)(link)).deep_link_id:null,n=Object(r.w)(Object(r.j)(t)).deep_link_id;return(n?Object(r.w)(Object(r.j)(n)).link:null)||n||e||link||t}(link);try{return new It(t)}catch(t){return null}}}class Dt{constructor(){this.providerId=Dt.PROVIDER_ID}static credential(t,e){return kt._fromEmailAndPassword(t,e)}static credentialWithLink(t,e){const n=It.parseLink(e);return k(n,"argument-error"),kt._fromEmailAndCode(t,n.code,n.tenantId)}}Dt.PROVIDER_ID="password",Dt.EMAIL_PASSWORD_SIGN_IN_METHOD="password",Dt.EMAIL_LINK_SIGN_IN_METHOD="emailLink";class Nt{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}class jt extends Nt{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}class Pt extends jt{constructor(){super("facebook.com")}static credential(t){return _t._fromParams({providerId:Pt.PROVIDER_ID,signInMethod:Pt.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Pt.credentialFromTaggedObject(t)}static credentialFromError(t){return Pt.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return Pt.credential(t.oauthAccessToken)}catch(t){return null}}}Pt.FACEBOOK_SIGN_IN_METHOD="facebook.com",Pt.PROVIDER_ID="facebook.com";class Rt extends jt{constructor(){super("google.com"),this.addScope("profile")}static credential(t,e){return _t._fromParams({providerId:Rt.PROVIDER_ID,signInMethod:Rt.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:e})}static credentialFromResult(t){return Rt.credentialFromTaggedObject(t)}static credentialFromError(t){return Rt.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:e,oauthAccessToken:n}=t;if(!e&&!n)return null;try{return Rt.credential(e,n)}catch(t){return null}}}Rt.GOOGLE_SIGN_IN_METHOD="google.com",Rt.PROVIDER_ID="google.com";class Lt extends jt{constructor(){super("github.com")}static credential(t){return _t._fromParams({providerId:Lt.PROVIDER_ID,signInMethod:Lt.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Lt.credentialFromTaggedObject(t)}static credentialFromError(t){return Lt.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t))return null;if(!t.oauthAccessToken)return null;try{return Lt.credential(t.oauthAccessToken)}catch(t){return null}}}Lt.GITHUB_SIGN_IN_METHOD="github.com",Lt.PROVIDER_ID="github.com";class $t extends jt{constructor(){super("twitter.com")}static credential(t,e){return _t._fromParams({providerId:$t.PROVIDER_ID,signInMethod:$t.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:e})}static credentialFromResult(t){return $t.credentialFromTaggedObject(t)}static credentialFromError(t){return $t.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:e,oauthTokenSecret:n}=t;if(!e||!n)return null;try{return $t.credential(e,n)}catch(t){return null}}}$t.TWITTER_SIGN_IN_METHOD="twitter.com",$t.PROVIDER_ID="twitter.com";class Mt{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static async _fromIdTokenResponse(t,e,n,r=!1){const o=await et._fromIdTokenResponse(t,n,r),l=Ft(n);return new Mt({user:o,providerId:l,_tokenResponse:n,operationType:e})}static async _forOperation(t,e,n){await t._updateTokensIfNecessary(n,!0);const r=Ft(n);return new Mt({user:t,providerId:r,_tokenResponse:n,operationType:e})}}function Ft(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}class Bt extends r.c{constructor(t,e,n,r){var o;super(e.code,e.message),this.operationType=n,this.user=r,Object.setPrototypeOf(this,Bt.prototype),this.customData={appName:t.name,tenantId:null!==(o=t.tenantId)&&void 0!==o?o:void 0,_serverResponse:e.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(t,e,n,r){return new Bt(t,e,n,r)}}function Vt(t,e,n,r){return("reauthenticate"===e?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch((n=>{if("auth/multi-factor-auth-required"===n.code)throw Bt._fromErrorAndOperation(t,n,e,r);throw n}))}async function qt(t,e,n=!1){const r=await Y(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return Mt._forOperation(t,"link",r)}async function Ut(t,e,n=!1){const{auth:r}=t,o="reauthenticate";try{const l=await Y(t,Vt(r,o,e,t),n);k(l.idToken,r,"internal-error");const c=G(l.idToken);k(c,r,"internal-error");const{sub:h}=c;return k(t.uid===h,r,"user-mismatch"),Mt._forOperation(t,o,l)}catch(t){throw"auth/user-not-found"===(null==t?void 0:t.code)&&w(r,"user-mismatch"),t}}async function Ht(t,e,n=!1){const r="signIn",o=await Vt(t,r,e),l=await Mt._fromIdTokenResponse(t,r,o);return n||await t._updateCurrentUser(l.user),l}async function Wt(t,e){return Ht(wt(t),e)}function zt(t,e,n){var r;k((null===(r=n.url)||void 0===r?void 0:r.length)>0,t,"invalid-continue-uri"),k(void 0===n.dynamicLinkDomain||n.dynamicLinkDomain.length>0,t,"invalid-dynamic-link-domain"),e.continueUrl=n.url,e.dynamicLinkDomain=n.dynamicLinkDomain,e.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(k(n.iOS.bundleId.length>0,t,"missing-ios-bundle-id"),e.iOSBundleId=n.iOS.bundleId),n.android&&(k(n.android.packageName.length>0,t,"missing-android-pkg-name"),e.androidInstallApp=n.android.installApp,e.androidMinimumVersionCode=n.android.minimumVersion,e.androidPackageName=n.android.packageName)}async function Kt(t,e,n){const o=Object(r.k)(t),l={requestType:"EMAIL_SIGNIN",email:e};k(n.handleCodeInApp,o,"argument-error"),n&&zt(o,l,n),await async function(t,e){return St(t,e)}(o,l)}function Gt(t,e){const n=It.parseLink(e);return"EMAIL_SIGNIN"===(null==n?void 0:n.operation)}async function Yt(t,e,n){const o=Object(r.k)(t),l=Dt.credentialWithLink(e,n||I());return k(l._tenantId===(o.tenantId||null),o,"tenant-id-mismatch"),Wt(o,l)}new WeakMap;const Jt="__sak";class Qt{constructor(t,e){this.storageRetriever=t,this.type=e}_isAvailable(){try{return this.storage?(this.storage.setItem(Jt,"1"),this.storage.removeItem(Jt),Promise.resolve(!0)):Promise.resolve(!1)}catch(t){return Promise.resolve(!1)}}_set(t,e){return this.storage.setItem(t,JSON.stringify(e)),Promise.resolve()}_get(t){const e=this.storage.getItem(t);return Promise.resolve(e?JSON.parse(e):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}class Xt extends Qt{constructor(){super((()=>window.localStorage),"LOCAL"),this.boundEventHandler=(t,e)=>this.onStorageEvent(t,e),this.listeners={},this.localCache={},this.pollTimer=null,this.safariLocalStorageNotSynced=function(){const t=Object(r.l)();return ut(t)||gt(t)}()&&function(){try{return!(!window||window===window.top)}catch(t){return!1}}(),this.fallbackToPolling=yt(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const e of Object.keys(this.listeners)){const n=this.storage.getItem(e),r=this.localCache[e];n!==r&&t(e,r,n)}}onStorageEvent(t,e=!1){if(!t.key)return void this.forAllChangedKeys(((t,e,n)=>{this.notifyListeners(t,n)}));const n=t.key;if(e?this.detachListener():this.stopPolling(),this.safariLocalStorageNotSynced){const r=this.storage.getItem(n);if(t.newValue!==r)null!==t.newValue?this.storage.setItem(n,t.newValue):this.storage.removeItem(n);else if(this.localCache[n]===t.newValue&&!e)return}const o=()=>{const t=this.storage.getItem(n);(e||this.localCache[n]!==t)&&this.notifyListeners(n,t)},l=this.storage.getItem(n);Object(r.p)()&&10===document.documentMode&&l!==t.newValue&&t.newValue!==t.oldValue?setTimeout(o,10):o()}notifyListeners(t,e){this.localCache[t]=e;const n=this.listeners[t];if(n)for(const t of Array.from(n))t(e?JSON.parse(e):e)}startPolling(){this.stopPolling(),this.pollTimer=setInterval((()=>{this.forAllChangedKeys(((t,e,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:e,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(t,e){0===Object.keys(this.listeners).length&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(e)}_removeListener(t,e){this.listeners[t]&&(this.listeners[t].delete(e),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&(this.detachListener(),this.stopPolling())}async _set(t,e){await super._set(t,e),this.localCache[t]=JSON.stringify(e)}async _get(t){const e=await super._get(t);return this.localCache[t]=JSON.stringify(e),e}async _remove(t){await super._remove(t),delete this.localCache[t]}}Xt.type="LOCAL";const Zt=Xt;class te extends Qt{constructor(){super((()=>window.sessionStorage),"SESSION")}_addListener(t,e){}_removeListener(t,e){}}te.type="SESSION";const ee=te;class ne{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const e=this.receivers.find((e=>e.isListeningto(t)));if(e)return e;const n=new ne(t);return this.receivers.push(n),n}isListeningto(t){return this.eventTarget===t}async handleEvent(t){const e=t,{eventId:n,eventType:r,data:data}=e.data,o=this.handlersMap[r];if(!(null==o?void 0:o.size))return;e.ports[0].postMessage({status:"ack",eventId:n,eventType:r});const l=Array.from(o).map((async t=>t(e.origin,data))),c=await function(t){return Promise.all(t.map((async t=>{try{return{fulfilled:!0,value:await t}}catch(t){return{fulfilled:!1,reason:t}}})))}(l);e.ports[0].postMessage({status:"done",eventId:n,eventType:r,response:c})}_subscribe(t,e){0===Object.keys(this.handlersMap).length&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(e)}_unsubscribe(t,e){this.handlersMap[t]&&e&&this.handlersMap[t].delete(e),e&&0!==this.handlersMap[t].size||delete this.handlersMap[t],0===Object.keys(this.handlersMap).length&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}function re(t="",e=10){let n="";for(let i=0;i{const h=re("",20);n.port1.start();const d=setTimeout((()=>{c(new Error("unsupported_event"))}),e);o={messageChannel:n,onMessage(t){const e=t;if(e.data.eventId===h)switch(e.data.status){case"ack":clearTimeout(d),r=setTimeout((()=>{c(new Error("timeout"))}),3e3);break;case"done":clearTimeout(r),l(e.data.response);break;default:clearTimeout(d),clearTimeout(r),c(new Error("invalid_response"))}}},this.handlers.add(o),n.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:t,eventId:h,data:data},[n.port2])})).finally((()=>{o&&this.removeMessageHandler(o)}))}}function se(){return window}function oe(){return void 0!==se().WorkerGlobalScope&&"function"==typeof se().importScripts}const ae="firebaseLocalStorageDb",le="firebaseLocalStorage",ue="fbase_key";class ce{constructor(t){this.request=t}toPromise(){return new Promise(((t,e)=>{this.request.addEventListener("success",(()=>{t(this.request.result)})),this.request.addEventListener("error",(()=>{e(this.request.error)}))}))}}function he(t,e){return t.transaction([le],e?"readwrite":"readonly").objectStore(le)}function de(){const t=indexedDB.open(ae,1);return new Promise(((e,n)=>{t.addEventListener("error",(()=>{n(t.error)})),t.addEventListener("upgradeneeded",(()=>{const e=t.result;try{e.createObjectStore(le,{keyPath:ue})}catch(t){n(t)}})),t.addEventListener("success",(async()=>{const n=t.result;n.objectStoreNames.contains(le)?e(n):(n.close(),await function(){const t=indexedDB.deleteDatabase(ae);return new ce(t).toPromise()}(),e(await de()))}))}))}async function pe(t,e,n){const r=he(t,!0).put({[ue]:e,value:n});return new ce(r).toPromise()}function fe(t,e){const n=he(t,!0).delete(e);return new ce(n).toPromise()}class me{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 de()),this.db}async _withRetries(t){let e=0;for(;;)try{const e=await this._openDb();return await t(e)}catch(t){if(e++>3)throw t;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return oe()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=ne._getInstance(oe()?self:null),this.receiver._subscribe("keyChanged",(async(t,data)=>({keyProcessed:(await this._poll()).includes(data.key)}))),this.receiver._subscribe("ping",(async(t,e)=>["keyChanged"]))}async initializeSender(){var t,e;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(t){return null}}(),!this.activeServiceWorker)return;this.sender=new ie(this.activeServiceWorker);const n=await this.sender._send("ping",{},800);n&&(null===(t=n[0])||void 0===t?void 0:t.fulfilled)&&(null===(e=n[0])||void 0===e?void 0:e.value.includes("keyChanged"))&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(t){var e;if(this.sender&&this.activeServiceWorker&&((null===(e=null===navigator||void 0===navigator?void 0:navigator.serviceWorker)||void 0===e?void 0:e.controller)||null)===this.activeServiceWorker)try{await this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch(e){}}async _isAvailable(){try{if(!indexedDB)return!1;const t=await de();return await pe(t,Jt,"1"),await fe(t,Jt),!0}catch(t){}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,e){return this._withPendingWrite((async()=>(await this._withRetries((n=>pe(n,t,e))),this.localCache[t]=e,this.notifyServiceWorker(t))))}async _get(t){const e=await this._withRetries((e=>async function(t,e){const n=he(t,!1).get(e),data=await new ce(n).toPromise();return void 0===data?null:data.value}(e,t)));return this.localCache[t]=e,e}async _remove(t){return this._withPendingWrite((async()=>(await this._withRetries((e=>fe(e,t))),delete this.localCache[t],this.notifyServiceWorker(t))))}async _poll(){const t=await this._withRetries((t=>{const e=he(t,!1).getAll();return new ce(e).toPromise()}));if(!t)return[];if(0!==this.pendingWrites)return[];const e=[],n=new Set;for(const{fbase_key:r,value:o}of t)n.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(o)&&(this.notifyListeners(r,o),e.push(r));for(const t of Object.keys(this.localCache))this.localCache[t]&&!n.has(t)&&(this.notifyListeners(t,null),e.push(t));return e}notifyListeners(t,e){this.localCache[t]=e;const n=this.listeners[t];if(n)for(const t of Array.from(n))t(e)}startPolling(){this.stopPolling(),this.pollTimer=setInterval((async()=>this._poll()),800)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,e){0===Object.keys(this.listeners).length&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(e)}_removeListener(t,e){this.listeners[t]&&(this.listeners[t].delete(e),0===this.listeners[t].size&&delete this.listeners[t]),0===Object.keys(this.listeners).length&&this.stopPolling()}}me.type="LOCAL";const ge=me;function ye(t){return new Promise(((e,n)=>{const r=document.createElement("script");var o,l;r.setAttribute("src",t),r.onload=e,r.onerror=t=>{const e=C("internal-error");e.customData=t,n(e)},r.type="text/javascript",r.charset="UTF-8",(null!==(l=null===(o=document.getElementsByTagName("head"))||void 0===o?void 0:o[0])&&void 0!==l?l:document).appendChild(r)}))}function ve(t){return`__${t}${Math.floor(1e6*Math.random())}`}ve("rcb"),new j(3e4,6e4);const be="recaptcha";async function we(t,e,n){var r;const o=await n.verify();try{let l;if(k("string"==typeof o,t,"argument-error"),k(n.type===be,t,"argument-error"),l="string"==typeof e?{phoneNumber:e}:e,"session"in l){const e=l.session;if("phoneNumber"in l){k("enroll"===e.type,t,"internal-error");const n=await function(t,e){return F(t,"POST","/v2/accounts/mfaEnrollment:start",M(t,e))}(t,{idToken:e.credential,phoneEnrollmentInfo:{phoneNumber:l.phoneNumber,recaptchaToken:o}});return n.phoneSessionInfo.sessionInfo}{k("signin"===e.type,t,"internal-error");const n=(null===(r=l.multiFactorHint)||void 0===r?void 0:r.uid)||l.multiFactorUid;k(n,t,"missing-multi-factor-info");const c=await function(t,e){return F(t,"POST","/v2/accounts/mfaSignIn:start",M(t,e))}(t,{mfaPendingCredential:e.credential,mfaEnrollmentId:n,phoneSignInInfo:{recaptchaToken:o}});return c.phoneResponseInfo.sessionInfo}}{const{sessionInfo:e}=await async function(t,e){return F(t,"POST","/v1/accounts:sendVerificationCode",M(t,e))}(t,{phoneNumber:l.phoneNumber,recaptchaToken:o});return e}}finally{n._reset()}}class Ce{constructor(t){this.providerId=Ce.PROVIDER_ID,this.auth=wt(t)}verifyPhoneNumber(t,e){return we(this.auth,t,Object(r.k)(e))}static credential(t,e){return Ot._fromVerification(t,e)}static credentialFromResult(t){const e=t;return Ce.credentialFromTaggedObject(e)}static credentialFromError(t){return Ce.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{phoneNumber:e,temporaryProof:n}=t;return e&&n?Ot._fromTokenResponse(e,n):null}}function xe(t,e){return e?O(e):(k(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}Ce.PROVIDER_ID="phone",Ce.PHONE_SIGN_IN_METHOD="phone";class Te extends xt{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return Et(t,this._buildIdpRequest())}_linkToIdToken(t,e){return Et(t,this._buildIdpRequest(e))}_getReauthenticationResolver(t){return Et(t,this._buildIdpRequest())}_buildIdpRequest(t){const e={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 t&&(e.idToken=t),e}}function Se(t){return Ht(t.auth,new Te(t),t.bypassAuthState)}function ke(t){const{auth:e,user:n}=t;return k(n,e,"internal-error"),Ut(n,new Te(t),t.bypassAuthState)}async function Ee(t){const{auth:e,user:n}=t;return k(n,e,"internal-error"),qt(n,new Te(t),t.bypassAuthState)}class _e{constructor(t,filter,e,n,r=!1){this.auth=t,this.resolver=e,this.user=n,this.bypassAuthState=r,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(filter)?filter:[filter]}execute(){return new Promise((async(t,e)=>{this.pendingPromise={resolve:t,reject:e};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(t){this.reject(t)}}))}async onAuthEvent(t){const{urlResponse:e,sessionId:n,postBody:r,tenantId:o,error:l,type:c}=t;if(l)return void this.reject(l);const h={auth:this.auth,requestUri:e,sessionId:n,tenantId:o||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(c)(h))}catch(t){this.reject(t)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return Se;case"linkViaPopup":case"linkViaRedirect":return Ee;case"reauthViaPopup":case"reauthViaRedirect":return ke;default:w(this.auth,"internal-error")}}resolve(t){_(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){_(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const Ae=new j(2e3,1e4);class Oe extends _e{constructor(t,filter,e,n,r){super(t,filter,n,r),this.provider=e,this.authWindow=null,this.pollId=null,Oe.currentPopupAction&&Oe.currentPopupAction.cancel(),Oe.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return k(t,this.auth,"internal-error"),t}async onExecution(){_(1===this.filter.length,"Popup operations only handle one event");const t=re();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch((t=>{this.reject(t)})),this.resolver._isIframeWebStorageSupported(this.auth,(t=>{t||this.reject(C(this.auth,"web-storage-unsupported"))})),this.pollUserCancellation()}get eventId(){var t;return(null===(t=this.authWindow)||void 0===t?void 0:t.associatedEvent)||null}cancel(){this.reject(C(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Oe.currentPopupAction=null}pollUserCancellation(){const t=()=>{var e,n;(null===(n=null===(e=this.authWindow)||void 0===e?void 0:e.window)||void 0===n?void 0:n.closed)?this.pollId=window.setTimeout((()=>{this.pollId=null,this.reject(C(this.auth,"popup-closed-by-user"))}),2e3):this.pollId=window.setTimeout(t,Ae.get())};t()}}Oe.currentPopupAction=null;const Ie=new Map;class De extends _e{constructor(t,e,n=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],e,void 0,n),this.eventId=null}async execute(){let t=Ie.get(this.auth._key());if(!t){try{const e=await async function(t,e){const n=Pe(e),r=je(t);if(!await r._isAvailable())return!1;const o="true"===await r._get(n);return await r._remove(n),o}(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(e)}catch(e){t=()=>Promise.reject(e)}Ie.set(this.auth._key(),t)}return this.bypassAuthState||Ie.set(this.auth._key(),(()=>Promise.resolve(null))),t()}async onAuthEvent(t){if("signInViaRedirect"===t.type)return super.onAuthEvent(t);if("unknown"!==t.type){if(t.eventId){const e=await this.auth._redirectUserForId(t.eventId);if(e)return this.user=e,super.onAuthEvent(t);this.resolve(null)}}else this.resolve(null)}async onExecution(){}cleanUp(){}}async function Ne(t,e){return je(t)._set(Pe(e),"true")}function je(t){return O(t._redirectPersistence)}function Pe(t){return st("pendingRedirect",t.config.apiKey,t.name)}function Re(t,e,n){return async function(t,e,n){const r=wt(t);T(t,e,Nt);const o=xe(r,n);return await Ne(o,r),o._openRedirect(r,e,"signInViaRedirect")}(t,e,n)}async function Le(t,e){return await wt(t)._initializationPromise,$e(t,e,!1)}async function $e(t,e,n=!1){const r=wt(t),o=xe(r,e),l=new De(r,o,n),c=await l.execute();return c&&!n&&(delete c.user._redirectEventId,await r._persistUserIfCurrent(c.user),await r._setRedirectUser(null,e)),c}class Me{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let e=!1;return this.consumers.forEach((n=>{this.isEventForConsumer(t,n)&&(e=!0,this.sendToConsumer(t,n),this.saveEventToCache(t))})),this.hasHandledPotentialRedirect||!function(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Be(t);default:return!1}}(t)||(this.hasHandledPotentialRedirect=!0,e||(this.queuedRedirectEvent=t,e=!0)),e}sendToConsumer(t,e){var n;if(t.error&&!Be(t)){const code=(null===(n=t.error.code)||void 0===n?void 0:n.split("auth/")[1])||"internal-error";e.onError(C(this.auth,code))}else e.onAuthEvent(t)}isEventForConsumer(t,e){const n=null===e.eventId||!!t.eventId&&t.eventId===e.eventId;return e.filter.includes(t.type)&&n}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=6e5&&this.cachedEventUids.clear(),this.cachedEventUids.has(Fe(t))}saveEventToCache(t){this.cachedEventUids.add(Fe(t)),this.lastProcessedEventTime=Date.now()}}function Fe(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter((t=>t)).join("-")}function Be({type:t,error:e}){return"unknown"===t&&"auth/no-auth-event"===(null==e?void 0:e.code)}const Ve=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,qe=/^https?/;async function Ue(t){if(t.config.emulator)return;const{authorizedDomains:e}=await async function(t,e={}){return F(t,"GET","/v1/projects",e)}(t);for(const t of e)try{if(He(t))return}catch(t){}w(t,"unauthorized-domain")}function He(t){const e=I(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){const o=new URL(t);return""===o.hostname&&""===r?"chrome-extension:"===n&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):"chrome-extension:"===n&&o.hostname===r}if(!qe.test(n))return!1;if(Ve.test(t))return r===t;const o=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+o+"|"+o+")$","i").test(r)}const We=new j(3e4,6e4);function ze(){const t=se().___jsl;if(null==t?void 0:t.H)for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let i=0;i{var r,o,l;function c(){ze(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{ze(),n(C(t,"network-request-failed"))},timeout:We.get()})}if(null===(o=null===(r=se().gapi)||void 0===r?void 0:r.iframes)||void 0===o?void 0:o.Iframe)e(gapi.iframes.getContext());else{if(!(null===(l=se().gapi)||void 0===l?void 0:l.load)){const e=ve("iframefcb");return se()[e]=()=>{gapi.load?c():n(C(t,"network-request-failed"))},ye(`https://apis.google.com/js/api.js?onload=${e}`).catch((t=>n(t)))}c()}})).catch((t=>{throw Ke=null,t}))}(t),Ke}const Ye=new j(5e3,15e3),Je={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Qe=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Xe(t){const e=t.config;k(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?P(e,"emulator/auth/iframe"):`https://${t.config.authDomain}/__/auth/iframe`,l={apiKey:e.apiKey,appName:t.name,v:o.a},c=Qe.get(t.config.apiHost);c&&(l.eid=c);const h=t._getFrameworks();return h.length&&(l.fw=h.join(",")),`${n}?${Object(r.v)(l).slice(1)}`}const Ze={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"};class tn{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(t){}}}function en(t,e,n,o=500,l=600){const c=Math.max((window.screen.availHeight-l)/2,0).toString(),h=Math.max((window.screen.availWidth-o)/2,0).toString();let d="";const f=Object.assign(Object.assign({},Ze),{width:o.toString(),height:l.toString(),top:c,left:h}),m=Object(r.l)().toLowerCase();n&&(d=ct(m)?"_blank":n),lt(m)&&(e=e||"http://localhost",f.scrollbars="yes");const y=Object.entries(f).reduce(((t,[e,n])=>`${t}${e}=${n},`),"");if(function(t=Object(r.l)()){var e;return gt(t)&&!!(null===(e=window.navigator)||void 0===e?void 0:e.standalone)}(m)&&"_self"!==d)return function(t,e){const n=document.createElement("a");n.href=t,n.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}(e||"",d),new tn(null);const v=window.open(e||"",d,y);k(v,t,"popup-blocked");try{v.focus()}catch(t){}return new tn(v)}const nn="__/auth/handler",rn="emulator/auth/handler";function sn(t,e,n,l,c,h){k(t.config.authDomain,t,"auth-domain-config-required"),k(t.config.apiKey,t,"invalid-api-key");const d={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:l,v:o.a,eventId:c};if(e instanceof Nt){e.setDefaultLanguage(t.languageCode),d.providerId=e.providerId||"",Object(r.o)(e.getCustomParameters())||(d.customParameters=JSON.stringify(e.getCustomParameters()));for(const[t,e]of Object.entries(h||{}))d[t]=e}if(e instanceof jt){const t=e.getScopes().filter((t=>""!==t));t.length>0&&(d.scopes=t.join(","))}t.tenantId&&(d.tid=t.tenantId);const f=d;for(const t of Object.keys(f))void 0===f[t]&&delete f[t];return`${function({config:t}){if(!t.emulator)return`https://${t.authDomain}/${nn}`;return P(t,rn)}(t)}?${Object(r.v)(f).slice(1)}`}const on="webStorageSupport";const an=class{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=ee,this._completeRedirectFn=$e}async _openPopup(t,e,n,r){var o;_(null===(o=this.eventManagers[t._key()])||void 0===o?void 0:o.manager,"_initialize() not called before _openPopup()");return en(t,sn(t,e,n,I(),r),re())}async _openRedirect(t,e,n,r){var o;return await this._originValidation(t),o=sn(t,e,n,I(),r),se().location.href=o,new Promise((()=>{}))}_initialize(t){const e=t._key();if(this.eventManagers[e]){const{manager:t,promise:n}=this.eventManagers[e];return t?Promise.resolve(t):(_(n,"If manager is not set, promise should be"),n)}const n=this.initAndGetManager(t);return this.eventManagers[e]={promise:n},n.catch((()=>{delete this.eventManagers[e]})),n}async initAndGetManager(t){const iframe=await async function(t){const e=await Ge(t),n=se().gapi;return k(n,t,"internal-error"),e.open({where:document.body,url:Xe(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:Je,dontclear:!0},(iframe=>new Promise((async(e,n)=>{await iframe.restyle({setHideOnLeave:!1});const r=C(t,"network-request-failed"),o=se().setTimeout((()=>{n(r)}),Ye.get());function l(){se().clearTimeout(o),e(iframe)}iframe.ping(l).then(l,(()=>{n(r)}))}))))}(t),e=new Me(t);return iframe.register("authEvent",(n=>{k(null==n?void 0:n.authEvent,t,"invalid-auth-event");return{status:e.onEvent(n.authEvent)?"ACK":"ERROR"}}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:e},this.iframes[t._key()]=iframe,e}_isIframeWebStorageSupported(t,e){this.iframes[t._key()].send(on,{type:on},(n=>{var r;const o=null===(r=null==n?void 0:n[0])||void 0===r?void 0:r.webStorageSupport;void 0!==o&&e(!!o),w(t,"internal-error")}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const e=t._key();return this.originValidationPromises[e]||(this.originValidationPromises[e]=Ue(t)),this.originValidationPromises[e]}get _shouldInitProactively(){return yt()||ut()||gt()}};var ln,un="@firebase/auth",cn="0.19.6";class hn{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){var t;return this.assertAuthConfigured(),(null===(t=this.auth.currentUser)||void 0===t?void 0:t.uid)||null}async getToken(t){if(this.assertAuthConfigured(),await this.auth._initializationPromise,!this.auth.currentUser)return null;return{accessToken:await this.auth.currentUser.getIdToken(t)}}addAuthTokenListener(t){if(this.assertAuthConfigured(),this.internalListeners.has(t))return;const e=this.auth.onIdTokenChanged((e=>{var n;t((null===(n=e)||void 0===n?void 0:n.stsTokenManager.accessToken)||null)}));this.internalListeners.set(t,e),this.updateProactiveRefresh()}removeAuthTokenListener(t){this.assertAuthConfigured();const e=this.internalListeners.get(t);e&&(this.internalListeners.delete(t),e(),this.updateProactiveRefresh())}assertAuthConfigured(){k(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}function dn(t=Object(o.e)()){const e=Object(o.b)(t,"auth");return e.isInitialized()?e.getImmediate():function(t,e){const n=Object(o.b)(t,"auth");if(n.isInitialized()){const t=n.getImmediate(),o=n.getOptions();if(Object(r.i)(o,null!=e?e:{}))return t;w(t,"already-initialized")}return n.initialize({options:e})}(t,{popupRedirectResolver:an,persistence:[ge,Zt,ee]})}ln="Browser",Object(o.c)(new h.a("auth",((t,{options:e})=>{const n=t.getProvider("app").getImmediate(),{apiKey:r,authDomain:o}=n.options;return(t=>{k(r&&!r.includes(":"),"invalid-api-key",{appName:t.name}),k(!(null==o?void 0:o.includes(":")),"argument-error",{appName:t.name});const n={apiKey:r,authDomain:o,clientPlatform:ln,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:vt(ln)},l=new bt(t,n);return function(t,e){const n=(null==e?void 0:e.persistence)||[],r=(Array.isArray(n)?n:[n]).map(O);(null==e?void 0:e.errorMap)&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,null==e?void 0:e.popupRedirectResolver)}(l,e),l})(n)}),"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback(((t,e,n)=>{t.getProvider("auth-internal").initialize()}))),Object(o.c)(new h.a("auth-internal",(t=>(t=>new hn(t))(wt(t.getProvider("auth").getImmediate()))),"PRIVATE").setInstantiationMode("EXPLICIT")),Object(o.g)(un,cn,function(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";default:return}}(ln)),Object(o.g)(un,cn,"esm2017")},67:function(t,e,n){"use strict";var r={name:"NoSsr",functional:!0,props:{placeholder:String,placeholderTag:{type:String,default:"div"}},render:function(t,e){var n=e.parent,r=e.slots,o=e.props,l=r(),c=l.default;void 0===c&&(c=[]);var h=l.placeholder;return n._isMounted?c:(n.$once("hook:mounted",(function(){n.$forceUpdate()})),o.placeholderTag&&(o.placeholder||h)?t(o.placeholderTag,{class:["no-ssr-placeholder"]},o.placeholder||h):c.length>0?c.map((function(){return t(!1)})):t(!1))}};t.exports=r},80:function(t,e,n){"use strict";n.d(e,"a",(function(){return Dt})),n.d(e,"b",(function(){return Pt})),n.d(e,"c",(function(){return Nt})),n.d(e,"d",(function(){return jt}));var r=n(4),o=n(15),l=n(0),c=n(18),h=n(188);const d="@firebase/installations",f="0.5.5",m=1e4,y="w:0.5.5",v="FIS_v2",w=36e5,C={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."},x=new l.b("installations","Installations",C);function T(t){return t instanceof l.c&&t.code.includes("request-failed")}function S({projectId:t}){return`https://firebaseinstallations.googleapis.com/v1/projects/${t}/installations`}function k(t){return{token:t.token,requestStatus:2,expiresIn:(e=t.expiresIn,Number(e.replace("s","000"))),creationTime:Date.now()};var e}async function E(t,e){const n=(await e.json()).error;return x.create("request-failed",{requestName:t,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function _({apiKey:t}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function A(t,{refreshToken:e}){const n=_(t);return n.append("Authorization",function(t){return`FIS_v2 ${t}`}(e)),n}async function O(t){const e=await t();return e.status>=500&&e.status<600?t():e}function I(t){return new Promise((e=>{setTimeout(e,t)}))}const D=/^[cdef][\w-]{21}$/;function N(){try{const t=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(t),t[0]=112+t[0]%16;const e=function(t){return(e=t,btoa(String.fromCharCode(...e)).replace(/\+/g,"-").replace(/\//g,"_")).substr(0,22);var e}(t);return D.test(e)?e:""}catch(t){return""}}function j(t){return`${t.appName}!${t.appId}`}const P=new Map;function R(t,e){const n=j(t);L(n,e),function(t,e){const n=M();n&&n.postMessage({key:t,fid:e});F()}(n,e)}function L(t,e){const n=P.get(t);if(n)for(const t of n)t(e)}let $=null;function M(){return!$&&"BroadcastChannel"in self&&($=new BroadcastChannel("[Firebase] FID Change"),$.onmessage=t=>{L(t.data.key,t.data.fid)}),$}function F(){0===P.size&&$&&($.close(),$=null)}const B="firebase-installations-store";let V=null;function U(){return V||(V=Object(h.openDb)("firebase-installations-database",1,(t=>{if(0===t.oldVersion)t.createObjectStore(B)}))),V}async function H(t,e){const n=j(t),r=(await U()).transaction(B,"readwrite"),o=r.objectStore(B),l=await o.get(n);return await o.put(e,n),await r.complete,l&&l.fid===e.fid||R(t,e.fid),e}async function W(t){const e=j(t),n=(await U()).transaction(B,"readwrite");await n.objectStore(B).delete(e),await n.complete}async function z(t,e){const n=j(t),r=(await U()).transaction(B,"readwrite"),o=r.objectStore(B),l=await o.get(n),c=e(l);return void 0===c?await o.delete(n):await o.put(c,n),await r.complete,!c||l&&l.fid===c.fid||R(t,c.fid),c}async function K(t){let e;const n=await z(t,(n=>{const r=function(t){return J(t||{fid:N(),registrationStatus:0})}(n),o=function(t,e){if(0===e.registrationStatus){if(!navigator.onLine){return{installationEntry:e,registrationPromise:Promise.reject(x.create("app-offline"))}}const n={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},r=async function(t,e){try{const n=await async function(t,{fid:e}){const n=S(t),r=_(t),body={fid:e,authVersion:v,appId:t.appId,sdkVersion:y},o={method:"POST",headers:r,body:JSON.stringify(body)},l=await O((()=>fetch(n,o)));if(l.ok){const t=await l.json();return{fid:t.fid||e,registrationStatus:2,refreshToken:t.refreshToken,authToken:k(t.authToken)}}throw await E("Create Installation",l)}(t,e);return H(t,n)}catch(n){throw T(n)&&409===n.customData.serverCode?await W(t):await H(t,{fid:e.fid,registrationStatus:0}),n}}(t,n);return{installationEntry:n,registrationPromise:r}}return 1===e.registrationStatus?{installationEntry:e,registrationPromise:G(t)}:{installationEntry:e}}(t,r);return e=o.registrationPromise,o.installationEntry}));return""===n.fid?{installationEntry:await e}:{installationEntry:n,registrationPromise:e}}async function G(t){let e=await Y(t);for(;1===e.registrationStatus;)await I(100),e=await Y(t);if(0===e.registrationStatus){const{installationEntry:e,registrationPromise:n}=await K(t);return n||e}return e}function Y(t){return z(t,(t=>{if(!t)throw x.create("installation-not-found");return J(t)}))}function J(t){return 1===(e=t).registrationStatus&&e.registrationTime+mfetch(r,c)));if(h.ok){return k(await h.json())}throw await E("Generate Auth Token",h)}async function X(t,e=!1){let n;const r=await z(t.appConfig,(r=>{if(!tt(r))throw x.create("not-registered");const o=r.authToken;if(!e&&function(t){return 2===t.requestStatus&&!function(t){const e=Date.now();return e{if(!tt(t))throw x.create("not-registered");const e=t.authToken;return 1===(n=e).requestStatus&&n.requestTime+m{const e=t.getProvider("app").getImmediate(),n=function(t){if(!t||!t.options)throw nt("App Configuration");if(!t.name)throw nt("App Name");const e=["projectId","apiKey","appId"];for(const n of e)if(!t.options[n])throw nt(n);return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}(e);return{app:e,appConfig:n,platformLoggerProvider:Object(r.b)(e,"platform-logger"),_delete:()=>Promise.resolve()}},ot=t=>{const e=t.getProvider("app").getImmediate(),n=Object(r.b)(e,it).getImmediate();return{getId:()=>async function(t){const e=t,{installationEntry:n,registrationPromise:r}=await K(e.appConfig);return r?r.catch(console.error):X(e).catch(console.error),n.fid}(n),getToken:t=>et(n,t)}};Object(r.c)(new c.a(it,st,"PUBLIC")),Object(r.c)(new c.a("installations-internal",ot,"PRIVATE")),Object(r.g)(d,f),Object(r.g)(d,f,"esm2017");const at="analytics",lt="https://www.googletagmanager.com/gtag/js",ut=new o.b("@firebase/analytics");function ct(t){return Promise.all(t.map((t=>t.catch((t=>t)))))}function ht(t,e,n,r){return async function(o,l,c){try{"event"===o?await async function(t,e,n,r,o){try{let l=[];if(o&&o.send_to){let t=o.send_to;Array.isArray(t)||(t=[t]);const r=await ct(n);for(const n of t){const t=r.find((t=>t.measurementId===n)),o=t&&e[t.appId];if(!o){l=[];break}l.push(o)}}0===l.length&&(l=Object.values(e)),await Promise.all(l),t("event",r,o||{})}catch(t){ut.error(t)}}(t,e,n,l,c):"config"===o?await async function(t,e,n,r,o,l){const c=r[o];try{if(c)await e[c];else{const t=(await ct(n)).find((t=>t.measurementId===o));t&&await e[t.appId]}}catch(t){ut.error(t)}t("config",o,l)}(t,e,n,r,l,c):t("set",l)}catch(t){ut.error(t)}}}const pt={"already-exists":"A Firebase Analytics instance with the appId {$id} already exists. Only one Firebase Analytics instance can be created for each appId.","already-initialized":"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-intialized instance.","already-initialized-settings":"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.","interop-component-reg-failed":"Firebase Analytics Interop Component failed to instantiate: {$reason}","invalid-analytics-context":"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","indexeddb-unavailable":"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","fetch-throttle":"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.","config-fetch-failed":"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}","no-api-key":'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',"no-app-id":'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.'},ft=new l.b("analytics","Analytics",pt);const mt=new class{constructor(t={},e=1e3){this.throttleMetadata=t,this.intervalMillis=e}getThrottleMetadata(t){return this.throttleMetadata[t]}setThrottleMetadata(t,e){this.throttleMetadata[t]=e}deleteThrottleMetadata(t){delete this.throttleMetadata[t]}};function gt(t){return new Headers({Accept:"application/json","x-goog-api-key":t})}async function yt(t,e=mt,n){const{appId:r,apiKey:o,measurementId:l}=t.options;if(!r)throw ft.create("no-app-id");if(!o){if(l)return{measurementId:l,appId:r};throw ft.create("no-api-key")}const c=e.getThrottleMetadata(r)||{backoffCount:0,throttleEndTimeMillis:Date.now()},h=new bt;return setTimeout((async()=>{h.abort()}),void 0!==n?n:6e4),vt({appId:r,apiKey:o,measurementId:l},c,h,e)}async function vt(t,{throttleEndTimeMillis:e,backoffCount:n},r,o=mt){const{appId:c,measurementId:h}=t;try{await function(t,e){return new Promise(((n,r)=>{const o=Math.max(e-Date.now(),0),l=setTimeout(n,o);t.addEventListener((()=>{clearTimeout(l),r(ft.create("fetch-throttle",{throttleEndTimeMillis:e}))}))}))}(r,e)}catch(t){if(h)return ut.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${h} provided in the "measurementId" field in the local Firebase config. [${t.message}]`),{appId:c,measurementId:h};throw t}try{const e=await async function(t){var e;const{appId:n,apiKey:r}=t,o={method:"GET",headers:gt(r)},l="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig".replace("{app-id}",n),c=await fetch(l,o);if(200!==c.status&&304!==c.status){let t="";try{const n=await c.json();(null===(e=n.error)||void 0===e?void 0:e.message)&&(t=n.error.message)}catch(t){}throw ft.create("config-fetch-failed",{httpStatus:c.status,responseMessage:t})}return c.json()}(t);return o.deleteThrottleMetadata(c),e}catch(e){if(!function(t){if(!(t instanceof l.c&&t.customData))return!1;const e=Number(t.customData.httpStatus);return 429===e||500===e||503===e||504===e}(e)){if(o.deleteThrottleMetadata(c),h)return ut.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${h} provided in the "measurementId" field in the local Firebase config. [${e.message}]`),{appId:c,measurementId:h};throw e}const d=503===Number(e.customData.httpStatus)?Object(l.f)(n,o.intervalMillis,30):Object(l.f)(n,o.intervalMillis),f={throttleEndTimeMillis:Date.now()+d,backoffCount:n+1};return o.setThrottleMetadata(c,f),ut.debug(`Calling attemptFetch again in ${d} millis`),vt(t,f,r,o)}}class bt{constructor(){this.listeners=[]}addEventListener(t){this.listeners.push(t)}abort(){this.listeners.forEach((t=>t()))}}async function wt(t,e,n,r,o,c,h){var d;const f=yt(t);f.then((e=>{n[e.measurementId]=e.appId,t.options.measurementId&&e.measurementId!==t.options.measurementId&&ut.warn(`The measurement ID in the local Firebase config (${t.options.measurementId}) does not match the measurement ID fetched from the server (${e.measurementId}). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.`)})).catch((t=>ut.error(t))),e.push(f);const m=async function(){if(!Object(l.q)())return ut.warn(ft.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;try{await Object(l.x)()}catch(t){return ut.warn(ft.create("indexeddb-unavailable",{errorInfo:t}).message),!1}return!0}().then((t=>t?r.getId():void 0)),[y,v]=await Promise.all([f,m]);(function(){const t=window.document.getElementsByTagName("script");for(const e of Object.values(t))if(e.src&&e.src.includes(lt))return e;return null})()||function(t,e){const script=document.createElement("script");script.src=`${lt}?l=${t}&id=${e}`,script.async=!0,document.head.appendChild(script)}(c,y.measurementId),o("js",new Date);const w=null!==(d=null==h?void 0:h.config)&&void 0!==d?d:{};return w.origin="firebase",w.update=!0,null!=v&&(w.firebase_id=v),o("config",y.measurementId,w),y.measurementId}class Ct{constructor(t){this.app=t}_delete(){return delete xt[this.app.options.appId],Promise.resolve()}}let xt={},Tt=[];const St={};let kt,Et,_t="dataLayer",At="gtag",Ot=!1;function It(t,e,n){!function(){const t=[];if(Object(l.m)()&&t.push("This is a browser extension environment."),Object(l.d)()||t.push("Cookies are not available."),t.length>0){const details=t.map(((t,e)=>`(${e+1}) ${t}`)).join(" "),e=ft.create("invalid-analytics-context",{errorInfo:details});ut.warn(e.message)}}();const r=t.options.appId;if(!r)throw ft.create("no-app-id");if(!t.options.apiKey){if(!t.options.measurementId)throw ft.create("no-api-key");ut.warn(`The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ${t.options.measurementId} provided in the "measurementId" field in the local Firebase config.`)}if(null!=xt[r])throw ft.create("already-exists",{id:r});if(!Ot){!function(t){let e=[];Array.isArray(window[t])?e=window[t]:window[t]=e}(_t);const{wrappedGtag:t,gtagCore:e}=function(t,e,n,r,o){let l=function(...t){window[r].push(arguments)};return window[o]&&"function"==typeof window[o]&&(l=window[o]),window[o]=ht(l,t,e,n),{gtagCore:l,wrappedGtag:window[o]}}(xt,Tt,St,_t,At);Et=t,kt=e,Ot=!0}xt[r]=wt(t,Tt,St,e,kt,_t,n);return new Ct(t)}function Dt(t=Object(r.e)()){t=Object(l.k)(t);const e=Object(r.b)(t,at);return e.isInitialized()?e.getImmediate():function(t,e={}){const n=Object(r.b)(t,at);if(n.isInitialized()){const t=n.getImmediate();if(Object(l.i)(e,n.getOptions()))return t;throw ft.create("already-initialized")}return n.initialize({options:e})}(t)}function Nt(t,e,n){t=Object(l.k)(t),async function(t,e,n,r){if(r&&r.global)return t("set",{user_id:n}),Promise.resolve();t("config",await e,{update:!0,user_id:n})}(Et,xt[t.app.options.appId],e,n).catch((t=>ut.error(t)))}function jt(t,e,n){t=Object(l.k)(t),async function(t,e,n,r){if(r&&r.global){const e={};for(const t of Object.keys(n))e[`user_properties.${t}`]=n[t];return t("set",e),Promise.resolve()}t("config",await e,{update:!0,user_properties:n})}(Et,xt[t.app.options.appId],e,n).catch((t=>ut.error(t)))}function Pt(t,e,n,r){t=Object(l.k)(t),async function(t,e,n,r,o){if(o&&o.global)t("event",n,r);else{const o=await e;t("event",n,Object.assign(Object.assign({},r),{send_to:o}))}}(Et,xt[t.app.options.appId],e,n,r).catch((t=>ut.error(t)))}const Rt="@firebase/analytics",Lt="0.7.5";Object(r.c)(new c.a(at,((t,{options:e})=>It(t.getProvider("app").getImmediate(),t.getProvider("installations-internal").getImmediate(),e)),"PUBLIC")),Object(r.c)(new c.a("analytics-internal",(function(t){try{const e=t.getProvider(at).getImmediate();return{logEvent:(t,n,r)=>Pt(e,t,n,r)}}catch(t){throw ft.create("interop-component-reg-failed",{reason:t})}}),"PRIVATE")),Object(r.g)(Rt,Lt),Object(r.g)(Rt,Lt,"esm2017")}}]);