vendor: 1,291 bytes, lines 1-5
1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/AboutView--ScQy70s.js","assets/AboutView-CdynMu4O.css"])))=>i.map(i=>d[i]); 2function wy(t,e){for(var n=0;n<e.length;n++){const s=e[n];if(typeof s!="string"&&!Array.isArray(s)){for(const r in s)if(r!=="default"&&!(r in t)){const a=Object.getOwnPropertyDescriptor(s,r);a&&Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>s[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&s(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(r){if(r.ep)return;r.ep=!0;const a=n(r);fetch(r.href,a)}})();/** 3* @vue/shared v3.5.13 4* (c) 2018-present Yuxi (Evan) You and Vue contributors 5* @license MIT
6**//*! #__NO_SIDE_EFFECTS__ */function Wc(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const We={},ws=[],Tn=()=>{},by=()=>!1,Oa=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Vc=t=>t.startsWith("onUpdate:"),It=Object.assign,$c=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},Ey=Object.prototype.hasOwnProperty,Fe=(t,e)=>Ey.call(t,e),ae=Array.isArray,bs=t=>Xr(t)==="[object Map]",Na=t=>Xr(t)==="[object Set]",rd=t=>Xr(t)==="[object Date]",de=t=>typeof t=="function",at=t=>typeof t=="string",Sn=t=>typeof t=="symbol",Ge=t=>t!==null&&typeof t=="object",pp=t=>(Ge(t)||de(t))&&de(t.then)&&de(t.catch),_p=Object.prototype.toString,Xr=t=>_p.call(t),Ty=t=>Xr(t).slice(8,-1),mp=t=>Xr(t)==="[object Object]",jc=t=>at(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Tr=Wc(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ma=t=>{const e=Object.create(null);return n=>e[n]||(e[n]=t(n))},Cy=/-(\w)/g,vi=Ma(t=>t.replace(Cy,(e,n)=>n?n.toUpperCase():"")),Iy=/\B([A-Z])/g,Ji=Ma(t=>t.replace(Iy,"-$1").toLowerCase()),gp=Ma(t=>t.charAt(0).toUpperCase()+t.slice(1)),Ol=Ma(t=>t?`on${gp(t)}`:""),di=(t,e)=>!Object.is(t,e),Wo=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},vp=(t,e,n,s=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:s,value:n})},Jo=t=>{const e=parseFloat(t);return isNaN(e)?t:e};let od;const Da=()=>od||(od=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Zc(t){if(ae(t)){const e={};for(let n=0;n<t.length;n++){const s=t[n],r=at(s)?Ly(s):Zc(s);if(r)for(const a in r)e[a]=r[a]}return e}else if(at(t)||Ge(t))return t}const Sy=/;(?![^(]*\))/g,Py=/:([^]+)/,xy=/\/\*[^]*?\*\//g;function Ly(t){const e={};return t.replace(xy,"").split(Sy).forEach(n=>{if(n){const s=n.split(Py);s.length>1&&(e[s[0].trim()]=s[1].trim())}}),e}function Wt(t){let e="";if(at(t))e=t;else if(ae(t))for(let n=0;n<t.length;n++){const s=Wt(t[n]);s&&(e+=s+" ")}else if(Ge(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}const Ry="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Ay=Wc(Ry);function yp(t){return!!t||t===""}function ky(t,e){if(t.length!==e.length)return!1;let n=!0;for(let s=0;n&&s<t.length;s++)n=Fa(t[s],e[s]);return n}function Fa(t,e){if(t===e)return!0;let n=rd(t),s=rd(e);if(n||s)return n&&s?t.getTime()===e.getTime():!1;if(n=Sn(t),s=Sn(e),n||s)return t===e;if(n=ae(t),s=ae(e),n||s)return n&&s?ky(t,e):!1;if(n=Ge(t),s=Ge(e),n||s){if(!n||!s)return!1;const r=Object.keys(t).length,a=Object.keys(e).length;if(r!==a)return!1;for(const l in t){const u=t.hasOwnProperty(l),d=e.hasOwnProperty(l);if(u&&!d||!u&&d||!Fa(t[l],e[l]))return!1}}return String(t)===String(e)}function Oy(t,e){return t.findIndex(n=>Fa(n,e))}const wp=t=>!!(t&&t.__v_isRef===!0),Me=t=>at(t)?t:t==null?"":ae(t)||Ge(t)&&(t.toString===_p||!de(t.toString))?wp(t)?Me(t.value):JSON.stringify(t,bp,2):String(t),bp=(t,e)=>wp(e)?bp(t,e.value):bs(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[s,r],a)=>(n[Nl(s,a)+" =>"]=r,n),{})}:Na(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>Nl(n))}:Sn(e)?Nl(e):Ge(e)&&!ae(e)&&!mp(e)?String(e):e,Nl=(t,e="")=>{var n;return Sn(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};/** 7* @vue/reactivity v3.5.13 8* (c) 2018-present Yuxi (Evan) You and Vue contributors 9* @license MIT
vendor: 14,327 bytes, line 10
10**/let Ht;class Ny{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Ht,!e&&Ht&&(this.index=(Ht.scopes||(Ht.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].pause();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].resume();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].resume()}}run(e){if(this._active){const n=Ht;try{return Ht=this,e()}finally{Ht=n}}}on(){Ht=this}off(){Ht=this.parent}stop(e){if(this._active){this._active=!1;let n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,s=this.scopes.length;n<s;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function My(){return Ht}let Ze;const Ml=new WeakSet;class Ep{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ht&&Ht.active&&Ht.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ml.has(this)&&(Ml.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Cp(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ad(this),Ip(this);const e=Ze,n=ln;Ze=this,ln=!0;try{return this.fn()}finally{Sp(this),Ze=e,ln=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Kc(e);this.deps=this.depsTail=void 0,ad(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ml.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){oc(this)&&this.run()}get dirty(){return oc(this)}}let Tp=0,Cr,Ir;function Cp(t,e=!1){if(t.flags|=8,e){t.next=Ir,Ir=t;return}t.next=Cr,Cr=t}function qc(){Tp++}function Gc(){if(--Tp>0)return;if(Ir){let e=Ir;for(Ir=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;Cr;){let e=Cr;for(Cr=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(s){t||(t=s)}e=n}}if(t)throw t}function Ip(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function Sp(t){let e,n=t.depsTail,s=n;for(;s;){const r=s.prevDep;s.version===-1?(s===n&&(n=r),Kc(s),Dy(s)):e=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=r}t.deps=e,t.depsTail=n}function oc(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(Pp(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function Pp(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Fr))return;t.globalVersion=Fr;const e=t.dep;if(t.flags|=2,e.version>0&&!t.isSSR&&t.deps&&!oc(t)){t.flags&=-3;return}const n=Ze,s=ln;Ze=t,ln=!0;try{Ip(t);const r=t.fn(t._value);(e.version===0||di(r,t._value))&&(t._value=r,e.version++)}catch(r){throw e.version++,r}finally{Ze=n,ln=s,Sp(t),t.flags&=-3}}function Kc(t,e=!1){const{dep:n,prevSub:s,nextSub:r}=t;if(s&&(s.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=s,t.nextSub=void 0),n.subs===t&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let a=n.computed.deps;a;a=a.nextDep)Kc(a,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function Dy(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}let ln=!0;const xp=[];function bi(){xp.push(ln),ln=!1}function Ei(){const t=xp.pop();ln=t===void 0?!0:t}function ad(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=Ze;Ze=void 0;try{e()}finally{Ze=n}}}let Fr=0;class Fy{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Yc{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!Ze||!ln||Ze===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Ze)n=this.activeLink=new Fy(Ze,this),Ze.deps?(n.prevDep=Ze.depsTail,Ze.depsTail.nextDep=n,Ze.depsTail=n):Ze.deps=Ze.depsTail=n,Lp(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=Ze.depsTail,n.nextDep=void 0,Ze.depsTail.nextDep=n,Ze.depsTail=n,Ze.deps===n&&(Ze.deps=s)}return n}trigger(e){this.version++,Fr++,this.notify(e)}notify(e){qc();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Gc()}}}function Lp(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let s=e.deps;s;s=s.nextDep)Lp(s)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const ac=new WeakMap,Bi=Symbol(""),lc=Symbol(""),Br=Symbol("");function wt(t,e,n){if(ln&&Ze){let s=ac.get(t);s||ac.set(t,s=new Map);let r=s.get(n);r||(s.set(n,r=new Yc),r.map=s,r.key=n),r.track()}}function Mn(t,e,n,s,r,a){const l=ac.get(t);if(!l){Fr++;return}const u=d=>{d&&d.trigger()};if(qc(),e==="clear")l.forEach(u);else{const d=ae(t),f=d&&jc(n);if(d&&n==="length"){const m=Number(s);l.forEach((_,v)=>{(v==="length"||v===Br||!Sn(v)&&v>=m)&&u(_)})}else switch((n!==void 0||l.has(void 0))&&u(l.get(n)),f&&u(l.get(Br)),e){case"add":d?f&&u(l.get("length")):(u(l.get(Bi)),bs(t)&&u(l.get(lc)));break;case"delete":d||(u(l.get(Bi)),bs(t)&&u(l.get(lc)));break;case"set":bs(t)&&u(l.get(Bi));break}}Gc()}function fs(t){const e=De(t);return e===t?e:(wt(e,"iterate",Br),Xt(t)?e:e.map(bt))}function Ba(t){return wt(t=De(t),"iterate",Br),t}const By={__proto__:null,[Symbol.iterator](){return Dl(this,Symbol.iterator,bt)},concat(...t){return fs(this).concat(...t.map(e=>ae(e)?fs(e):e))},entries(){return Dl(this,"entries",t=>(t[1]=bt(t[1]),t))},every(t,e){return kn(this,"every",t,e,void 0,arguments)},filter(t,e){return kn(this,"filter",t,e,n=>n.map(bt),arguments)},find(t,e){return kn(this,"find",t,e,bt,arguments)},findIndex(t,e){return kn(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return kn(this,"findLast",t,e,bt,arguments)},findLastIndex(t,e){return kn(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return kn(this,"forEach",t,e,void 0,arguments)},includes(...t){return Fl(this,"includes",t)},indexOf(...t){return Fl(this,"indexOf",t)},join(t){return fs(this).join(t)},lastIndexOf(...t){return Fl(this,"lastIndexOf",t)},map(t,e){return kn(this,"map",t,e,void 0,arguments)},pop(){return dr(this,"pop")},push(...t){return dr(this,"push",t)},reduce(t,...e){return ld(this,"reduce",t,e)},reduceRight(t,...e){return ld(this,"reduceRight",t,e)},shift(){return dr(this,"shift")},some(t,e){return kn(this,"some",t,e,void 0,arguments)},splice(...t){return dr(this,"splice",t)},toReversed(){return fs(this).toReversed()},toSorted(t){return fs(this).toSorted(t)},toSpliced(...t){return fs(this).toSpliced(...t)},unshift(...t){return dr(this,"unshift",t)},values(){return Dl(this,"values",bt)}};function Dl(t,e,n){const s=Ba(t),r=s[e]();return s!==t&&!Xt(t)&&(r._next=r.next,r.next=()=>{const a=r._next();return a.value&&(a.value=n(a.value)),a}),r}const Uy=Array.prototype;function kn(t,e,n,s,r,a){const l=Ba(t),u=l!==t&&!Xt(t),d=l[e];if(d!==Uy[e]){const _=d.apply(t,a);return u?bt(_):_}let f=n;l!==t&&(u?f=function(_,v){return n.call(this,bt(_),v,t)}:n.length>2&&(f=function(_,v){return n.call(this,_,v,t)}));const m=d.call(l,f,s);return u&&r?r(m):m}function ld(t,e,n,s){const r=Ba(t);let a=n;return r!==t&&(Xt(t)?n.length>3&&(a=function(l,u,d){return n.call(this,l,u,d,t)}):a=function(l,u,d){return n.call(this,l,bt(u),d,t)}),r[e](a,...s)}function Fl(t,e,n){const s=De(t);wt(s,"iterate",Br);const r=s[e](...n);return(r===-1||r===!1)&&Xc(n[0])?(n[0]=De(n[0]),s[e](...n)):r}function dr(t,e,n=[]){bi(),qc();const s=De(t)[e].apply(t,n);return Gc(),Ei(),s}const zy=Wc("__proto__,__v_isRef,__isVue"),Rp=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Sn));function Hy(t){Sn(t)||(t=String(t));const e=De(this);return wt(e,"has",t),e.hasOwnProperty(t)}class Ap{constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,s){if(n==="__v_skip")return e.__v_skip;const r=this._isReadonly,a=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return a;if(n==="__v_raw")return s===(r?a?Jy:Mp:a?Np:Op).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(s)?e:void 0;const l=ae(e);if(!r){let d;if(l&&(d=By[n]))return d;if(n==="hasOwnProperty")return Hy}const u=Reflect.get(e,n,Ct(e)?e:s);return(Sn(n)?Rp.has(n):zy(n))||(r||wt(e,"get",n),a)?u:Ct(u)?l&&jc(n)?u:u.value:Ge(u)?r?Fp(u):Hi(u):u}}class kp extends Ap{constructor(e=!1){super(!1,e)}set(e,n,s,r){let a=e[n];if(!this._isShallow){const d=Wi(a);if(!Xt(s)&&!Wi(s)&&(a=De(a),s=De(s)),!ae(e)&&Ct(a)&&!Ct(s))return d?!1:(a.value=s,!0)}const l=ae(e)&&jc(n)?Number(n)<e.length:Fe(e,n),u=Reflect.set(e,n,s,Ct(e)?e:r);return e===De(r)&&(l?di(s,a)&&Mn(e,"set",n,s):Mn(e,"add",n,s)),u}deleteProperty(e,n){const s=Fe(e,n);e[n];const r=Reflect.deleteProperty(e,n);return r&&s&&Mn(e,"delete",n,void 0),r}has(e,n){const s=Reflect.has(e,n);return(!Sn(n)||!Rp.has(n))&&wt(e,"has",n),s}ownKeys(e){return wt(e,"iterate",ae(e)?"length":Bi),Reflect.ownKeys(e)}}class Wy extends Ap{constructor(e=!1){super(!0,e)}set(e,n){return!0}deleteProperty(e,n){return!0}}const Vy=new kp,$y=new Wy,jy=new kp(!0);const cc=t=>t,No=t=>Reflect.getPrototypeOf(t);function Zy(t,e,n){return function(...s){const r=this.__v_raw,a=De(r),l=bs(a),u=t==="entries"||t===Symbol.iterator&&l,d=t==="keys"&&l,f=r[t](...s),m=n?cc:e?uc:bt;return!e&&wt(a,"iterate",d?lc:Bi),{next(){const{value:_,done:v}=f.next();return v?{value:_,done:v}:{value:u?[m(_[0]),m(_[1])]:m(_),done:v}},[Symbol.iterator](){return this}}}}function Mo(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function qy(t,e){const n={get(r){const a=this.__v_raw,l=De(a),u=De(r);t||(di(r,u)&&wt(l,"get",r),wt(l,"get",u));const{has:d}=No(l),f=e?cc:t?uc:bt;if(d.call(l,r))return f(a.get(r));if(d.call(l,u))return f(a.get(u));a!==l&&a.get(r)},get size(){const r=this.__v_raw;return!t&&wt(De(r),"iterate",Bi),Reflect.get(r,"size",r)},has(r){const a=this.__v_raw,l=De(a),u=De(r);return t||(di(r,u)&&wt(l,"has",r),wt(l,"has",u)),r===u?a.has(r):a.has(r)||a.has(u)},forEach(r,a){const l=this,u=l.__v_raw,d=De(u),f=e?cc:t?uc:bt;return!t&&wt(d,"iterate",Bi),u.forEach((m,_)=>r.call(a,f(m),f(_),l))}};return It(n,t?{add:Mo("add"),set:Mo("set"),delete:Mo("delete"),clear:Mo("clear")}:{add(r){!e&&!Xt(r)&&!Wi(r)&&(r=De(r));const a=De(this);return No(a).has.call(a,r)||(a.add(r),Mn(a,"add",r,r)),this},set(r,a){!e&&!Xt(a)&&!Wi(a)&&(a=De(a));const l=De(this),{has:u,get:d}=No(l);let f=u.call(l,r);f||(r=De(r),f=u.call(l,r));const m=d.call(l,r);return l.set(r,a),f?di(a,m)&&Mn(l,"set",r,a):Mn(l,"add",r,a),this},delete(r){const a=De(this),{has:l,get:u}=No(a);let d=l.call(a,r);d||(r=De(r),d=l.call(a,r)),u&&u.call(a,r);const f=a.delete(r);return d&&Mn(a,"delete",r,void 0),f},clear(){const r=De(this),a=r.size!==0,l=r.clear();return a&&Mn(r,"clear",void 0,void 0),l}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=Zy(r,t,e)}),n}function Jc(t,e){const n=qy(t,e);return(s,r,a)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?s:Reflect.get(Fe(n,r)&&r in s?n:s,r,a)}const Gy={get:Jc(!1,!1)},Ky={get:Jc(!1,!0)},Yy={get:Jc(!0,!1)};const Op=new WeakMap,Np=new WeakMap,Mp=new WeakMap,Jy=new WeakMap;function Qy(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Xy(t){return t.__v_skip||!Object.isExtensible(t)?0:Qy(Ty(t))}function Hi(t){return Wi(t)?t:Qc(t,!1,Vy,Gy,Op)}function Dp(t){return Qc(t,!1,jy,Ky,Np)}function Fp(t){return Qc(t,!0,$y,Yy,Mp)}function Qc(t,e,n,s,r){if(!Ge(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const a=r.get(t);if(a)return a;const l=Xy(t);if(l===0)return t;const u=new Proxy(t,l===2?s:n);return r.set(t,u),u}function Es(t){return Wi(t)?Es(t.__v_raw):!!(t&&t.__v_isReactive)}function Wi(t){return!!(t&&t.__v_isReadonly)}function Xt(t){return!!(t&&t.__v_isShallow)}function Xc(t){return t?!!t.__v_raw:!1}function De(t){const e=t&&t.__v_raw;return e?De(e):t}function Qi(t){return!Fe(t,"__v_skip")&&Object.isExtensible(t)&&vp(t,"__v_skip",!0),t}const bt=t=>Ge(t)?Hi(t):t,uc=t=>Ge(t)?Fp(t):t;function Ct(t){return t?t.__v_isRef===!0:!1}function be(t){return Bp(t,!1)}function ew(t){return Bp(t,!0)}function Bp(t,e){return Ct(t)?t:new tw(t,e)}class tw{constructor(e,n){this.dep=new Yc,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:De(e),this._value=n?e:bt(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,s=this.__v_isShallow||Xt(e)||Wi(e);e=s?e:De(e),di(e,n)&&(this._rawValue=e,this._value=s?e:bt(e),this.dep.trigger())}}function _t(t){return Ct(t)?t.value:t}const nw={get:(t,e,n)=>e==="__v_raw"?t:_t(Reflect.get(t,e,n)),set:(t,e,n,s)=>{const r=t[e];return Ct(r)&&!Ct(n)?(r.value=n,!0):Reflect.set(t,e,n,s)}};function Up(t){return Es(t)?t:new Proxy(t,nw)}class iw{constructor(e,n,s){this.fn=e,this.setter=n,this._value=void 0,this.dep=new Yc(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Fr-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&Ze!==this)return Cp(this,!0),!0}get value(){const e=this.dep.track();return Pp(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function sw(t,e,n=!1){let s,r;return de(t)?s=t:(s=t.get,r=t.set),new iw(s,r,n)}const Do={},Qo=new WeakMap;let ki;function rw(t,e=!1,n=ki){if(n){let s=Qo.get(n);s||Qo.set(n,s=[]),s.push(t)}}function ow(t,e,n=We){const{immediate:s,deep:r,once:a,scheduler:l,augmentJob:u,call:d}=n,f=R=>r?R:Xt(R)||r===!1||r===0?Dn(R,1):Dn(R);let m,_,v,y,P=!1,T=!1;if(Ct(t)?(_=()=>t.value,P=Xt(t)):Es(t)?(_=()=>f(t),P=!0):ae(t)?(T=!0,P=t.some(R=>Es(R)||Xt(R)),_=()=>t.map(R=>{if(Ct(R))return R.value;if(Es(R))return f(R);
vendor: 1,363 bytes, lines 10-13
10if(de(R))return d?d(R,2):R()})):de(t)?e?_=d?()=>d(t,2):t:_=()=>{if(v){bi();try{v()}finally{Ei()}}const R=ki;ki=m;try{return d?d(t,3,[y]):t(y)}finally{ki=R}}:_=Tn,e&&r){const R=_,j=r===!0?1/0:r;_=()=>Dn(R(),j)}const O=My(),z=()=>{m.stop(),O&&O.active&&$c(O.effects,m)};if(a&&e){const R=e;e=(...j)=>{R(...j),z()}}let B=T?new Array(t.length).fill(Do):Do;const A=R=>{if(!(!(m.flags&1)||!m.dirty&&!R))if(e){const j=m.run();if(r||P||(T?j.some((J,Ae)=>di(J,B[Ae])):di(j,B))){v&&v();const J=ki;ki=m;try{const Ae=[j,B===Do?void 0:T&&B[0]===Do?[]:B,y];d?d(e,3,Ae):e(...Ae),B=j}finally{ki=J}}}else m.run()};return u&&u(A),m=new Ep(_),m.scheduler=l?()=>l(A,!1):A,y=R=>rw(R,!1,m),v=m.onStop=()=>{const R=Qo.get(m);if(R){if(d)d(R,4);else for(const j of R)j();Qo.delete(m)}},e?s?A(!0):B=m.run():l?l(A.bind(null,!0),!0):m.run(),z.pause=m.pause.bind(m),z.resume=m.resume.bind(m),z.stop=z,z}function Dn(t,e=1/0,n){if(e<=0||!Ge(t)||t.__v_skip||(n=n||new Set,n.has(t)))return t;if(n.add(t),e--,Ct(t))Dn(t.value,e,n);else if(ae(t))for(let s=0;s<t.length;s++)Dn(t[s],e,n);else if(Na(t)||bs(t))t.forEach(s=>{Dn(s,e,n)});else if(mp(t)){for(const s in t)Dn(t[s],e,n);for(const s of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,s)&&Dn(t[s],e,n)}return t}/** 11* @vue/runtime-core v3.5.13 12* (c) 2018-present Yuxi (Evan) You and Vue contributors 13* @license MIT
14**/function eo(t,e,n,s){try{return s?t(...s):t()}catch(r){Ua(r,e,n)}}function Pn(t,e,n,s){if(de(t)){const r=eo(t,e,n,s);return r&&pp(r)&&r.catch(a=>{Ua(a,e,n)}),r}if(ae(t)){const r=[];for(let a=0;a<t.length;a++)r.push(Pn(t[a],e,n,s));return r}}function Ua(t,e,n,s=!0){const r=e?e.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:l}=e&&e.appContext.config||We;if(e){let u=e.parent;const d=e.proxy,f=`https://vuejs.org/error-reference/#runtime-${n}`;for(;u;){const m=u.ec;if(m){for(let _=0;_<m.length;_++)if(m[_](t,d,f)===!1)return}u=u.parent}if(a){bi(),eo(a,null,10,[t,d,f]),Ei();return}}aw(t,n,r,s,l)}function aw(t,e,n,s=!0,r=!1){if(r)throw t;console.error(t)}const Rt=[];let wn=-1;const Ts=[];let si=null,_s=0;const zp=Promise.resolve();let Xo=null;function hn(t){const e=Xo||zp;return t?e.then(this?t.bind(this):t):e}function lw(t){let e=wn+1,n=Rt.length;for(;e<n;){const s=e+n>>>1,r=Rt[s],a=Ur(r);a<t||a===t&&r.flags&2?e=s+1:n=s}return e}function eu(t){if(!(t.flags&1)){const e=Ur(t),n=Rt[Rt.length-1];!n||!(t.flags&2)&&e>=Ur(n)?Rt.push(t):Rt.splice(lw(e),0,t),t.flags|=1,Hp()}}function Hp(){Xo||(Xo=zp.then(Vp))}function cw(t){ae(t)?Ts.push(...t):si&&t.id===-1?si.splice(_s+1,0,t):t.flags&1||(Ts.push(t),t.flags|=1),Hp()}function cd(t,e,n=wn+1){for(;n<Rt.length;n++){const s=Rt[n];if(s&&s.flags&2){if(t&&s.id!==t.uid)continue;Rt.splice(n,1),n--,s.flags&4&&(s.flags&=-2),s(),s.flags&4||(s.flags&=-2)}}}function Wp(t){if(Ts.length){const e=[...new Set(Ts)].sort((n,s)=>Ur(n)-Ur(s));if(Ts.length=0,si){si.push(...e);return}for(si=e,_s=0;_s<si.length;_s++){const n=si[_s];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}si=null,_s=0}}const Ur=t=>t.id==null?t.flags&2?-1:1/0:t.id;function Vp(t){try{for(wn=0;wn<Rt.length;wn++){const e=Rt[wn];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),eo(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;wn<Rt.length;wn++){const e=Rt[wn];e&&(e.flags&=-2)}wn=-1,Rt.length=0,Wp(),Xo=null,(Rt.length||Ts.length)&&Vp()}}let Qt=null,$p=null;function ea(t){const e=Qt;return Qt=t,$p=t&&t.type.__scopeId||null,e}function Fn(t,e=Qt,n){if(!e||t._n)return t;const s=(...r)=>{s._d&&vd(-1);const a=ea(e);let l;try{l=t(...r)}finally{ea(a),s._d&&vd(1)}return l};return s._n=!0,s._c=!0,s._d=!0,s}function se(t,e){if(Qt===null)return t;const n=$a(Qt),s=t.dirs||(t.dirs=[]);for(let r=0;r<e.length;r++){let[a,l,u,d=We]=e[r];a&&(de(a)&&(a={mounted:a,updated:a}),a.deep&&Dn(l),s.push({dir:a,instance:n,value:l,oldValue:void 0,arg:u,modifiers:d}))}return t}function Ri(t,e,n,s){const r=t.dirs,a=e&&e.dirs;for(let l=0;l<r.length;l++){const u=r[l];a&&(u.oldValue=a[l].value);let d=u.dir[s];d&&(bi(),Pn(d,n,8,[t.el,u,t,e]),Ei())}}const uw=Symbol("_vte"),hw=t=>t.__isTeleport;function tu(t,e){t.shapeFlag&6&&t.component?(t.transition=e,tu(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}/*! #__NO_SIDE_EFFECTS__ */function Bt(t,e){return de(t)?It({name:t.name},e,{setup:t}):t}function jp(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function ta(t,e,n,s,r=!1){if(ae(t)){t.forEach((P,T)=>ta(P,e&&(ae(e)?e[T]:e),n,s,r));return}if(Sr(s)&&!r){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&ta(t,e,n,s.component.subTree);return}const a=s.shapeFlag&4?$a(s.component):s.el,l=r?null:a,{i:u,r:d}=t,f=e&&e.r,m=u.refs===We?u.refs={}:u.refs,_=u.setupState,v=De(_),y=_===We?()=>!1:P=>Fe(v,P);if(f!=null&&f!==d&&(at(f)?(m[f]=null,y(f)&&(_[f]=null)):Ct(f)&&(f.value=null)),de(d))eo(d,u,12,[l,m]);else{const P=at(d),T=Ct(d);if(P||T){const O=()=>{if(t.f){const z=P?y(d)?_[d]:m[d]:d.value;r?ae(z)&&$c(z,a):ae(z)?z.includes(a)||z.push(a):P?(m[d]=[a],y(d)&&(_[d]=m[d])):(d.value=[a],t.k&&(m[t.k]=d.value))}else P?(m[d]=l,y(d)&&(_[d]=l)):T&&(d.value=l,t.k&&(m[t.k]=l))};l?(O.id=-1,zt(O,n)):O()}}}Da().requestIdleCallback;Da().cancelIdleCallback;const Sr=t=>!!t.type.__asyncLoader,Zp=t=>t.type.__isKeepAlive;function dw(t,e){qp(t,"a",e)}function fw(t,e){qp(t,"da",e)}function qp(t,e,n=At){const s=t.__wdc||(t.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return t()});if(za(e,s,n),n){let r=n.parent;for(;r&&r.parent;)Zp(r.parent.vnode)&&pw(s,e,n,r),r=r.parent}}function pw(t,e,n,s){const r=za(e,t,s,!0);to(()=>{$c(s[e],r)},n)}function za(t,e,n=At,s=!1){if(n){const r=n[t]||(n[t]=[]),a=e.__weh||(e.__weh=(...l)=>{bi();const u=no(n),d=Pn(e,n,t,l);return u(),Ei(),d});return s?r.unshift(a):r.push(a),a}}const Gn=t=>(e,n=At)=>{(!Hr||t==="sp")&&za(t,(...s)=>e(...s),n)},_w=Gn("bm"),fn=Gn("m"),mw=Gn("bu"),gw=Gn("u"),Ha=Gn("bum"),to=Gn("um"),vw=Gn("sp"),yw=Gn("rtg"),ww=Gn("rtc");function bw(t,e=At){za("ec",t,e)}const Ew=Symbol.for("v-ndc");function na(t,e,n,s){let r;const a=n,l=ae(t);if(l||at(t)){const u=l&&Es(t);let d=!1;u&&(d=!Xt(t),t=Ba(t)),r=new Array(t.length);for(let f=0,m=t.length;f<m;f++)r[f]=e(d?bt(t[f]):t[f],f,void 0,a)}else if(typeof t=="number"){r=new Array(t);for(let u=0;u<t;u++)r[u]=e(u+1,u,void 0,a)}else if(Ge(t))if(t[Symbol.iterator])r=Array.from(t,(u,d)=>e(u,d,void 0,a));else{const u=Object.keys(t);r=new Array(u.length);for(let d=0,f=u.length;d<f;d++){const m=u[d];r[d]=e(t[m],m,d,a)}}else r=[];return r}const hc=t=>t?__(t)?$a(t):hc(t.parent):null,Pr=It(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>hc(t.parent),$root:t=>hc(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>Kp(t),$forceUpdate:t=>
vendor: 4,630 bytes, line 14
14t.f||(t.f=()=>{eu(t.update)}),$nextTick:t=>t.n||(t.n=hn.bind(t.proxy)),$watch:t=>Vw.bind(t)}),Bl=(t,e)=>t!==We&&!t.__isScriptSetup&&Fe(t,e),Tw={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:s,data:r,props:a,accessCache:l,type:u,appContext:d}=t;let f;if(e[0]!=="$"){const y=l[e];if(y!==void 0)switch(y){case 1:return s[e];case 2:return r[e];case 4:return n[e];case 3:return a[e]}else{if(Bl(s,e))return l[e]=1,s[e];if(r!==We&&Fe(r,e))return l[e]=2,r[e];if((f=t.propsOptions[0])&&Fe(f,e))return l[e]=3,a[e];if(n!==We&&Fe(n,e))return l[e]=4,n[e];dc&&(l[e]=0)}}const m=Pr[e];let _,v;if(m)return e==="$attrs"&&wt(t.attrs,"get",""),m(t);if((_=u.__cssModules)&&(_=_[e]))return _;if(n!==We&&Fe(n,e))return l[e]=4,n[e];if(v=d.config.globalProperties,Fe(v,e))return v[e]},set({_:t},e,n){const{data:s,setupState:r,ctx:a}=t;return Bl(r,e)?(r[e]=n,!0):s!==We&&Fe(s,e)?(s[e]=n,!0):Fe(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(a[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:s,appContext:r,propsOptions:a}},l){let u;return!!n[l]||t!==We&&Fe(t,l)||Bl(e,l)||(u=a[0])&&Fe(u,l)||Fe(s,l)||Fe(Pr,l)||Fe(r.config.globalProperties,l)},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:Fe(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}};function ud(t){return ae(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}let dc=!0;function Cw(t){const e=Kp(t),n=t.proxy,s=t.ctx;dc=!1,e.beforeCreate&&hd(e.beforeCreate,t,"bc");const{data:r,computed:a,methods:l,watch:u,provide:d,inject:f,created:m,beforeMount:_,mounted:v,beforeUpdate:y,updated:P,activated:T,deactivated:O,beforeDestroy:z,beforeUnmount:B,destroyed:A,unmounted:R,render:j,renderTracked:J,renderTriggered:Ae,errorCaptured:et,serverPrefetch:ie,expose:we,inheritAttrs:$e,components:it,directives:jt,filters:St}=e;if(f&&Iw(f,s,null),l)for(const Te in l){const G=l[Te];de(G)&&(s[Te]=G.bind(n))}if(r){const Te=r.call(n,n);Ge(Te)&&(t.data=Hi(Te))}if(dc=!0,a)for(const Te in a){const G=a[Te],Zt=de(G)?G.bind(n,n):de(G.get)?G.get.bind(n,n):Tn,te=!de(G)&&de(G.set)?G.set.bind(n):Tn,Ce=gt({get:Zt,set:te});Object.defineProperty(s,Te,{enumerable:!0,configurable:!0,get:()=>Ce.value,set:Be=>Ce.value=Be})}if(u)for(const Te in u)Gp(u[Te],s,n,Te);if(d){const Te=de(d)?d.call(n):d;Reflect.ownKeys(Te).forEach(G=>{Vt(G,Te[G])})}m&&hd(m,t,"c");function Pe(Te,G){ae(G)?G.forEach(Zt=>Te(Zt.bind(n))):G&&Te(G.bind(n))}if(Pe(_w,_),Pe(fn,v),Pe(mw,y),Pe(gw,P),Pe(dw,T),Pe(fw,O),Pe(bw,et),Pe(ww,J),Pe(yw,Ae),Pe(Ha,B),Pe(to,R),Pe(vw,ie),ae(we))if(we.length){const Te=t.exposed||(t.exposed={});we.forEach(G=>{Object.defineProperty(Te,G,{get:()=>n[G],set:Zt=>n[G]=Zt})})}else t.exposed||(t.exposed={});j&&t.render===Tn&&(t.render=j),$e!=null&&(t.inheritAttrs=$e),it&&(t.components=it),jt&&(t.directives=jt),ie&&jp(t)}function Iw(t,e,n=Tn){ae(t)&&(t=fc(t));for(const s in t){const r=t[s];let a;Ge(r)?"default"in r?a=vt(r.from||s,r.default,!0):a=vt(r.from||s):a=vt(r),Ct(a)?Object.defineProperty(e,s,{enumerable:!0,configurable:!0,get:()=>a.value,set:l=>a.value=l}):e[s]=a}}function hd(t,e,n){Pn(ae(t)?t.map(s=>s.bind(e.proxy)):t.bind(e.proxy),e,n)}function Gp(t,e,n,s){let r=s.includes(".")?c_(n,s):()=>n[s];if(at(t)){const a=e[t];de(a)&&fi(r,a)}else if(de(t))fi(r,t.bind(n));else if(Ge(t))if(ae(t))t.forEach(a=>Gp(a,e,n,s));else{const a=de(t.handler)?t.handler.bind(n):e[t.handler];de(a)&&fi(r,a,t)}}function Kp(t){const e=t.type,{mixins:n,extends:s}=e,{mixins:r,optionsCache:a,config:{optionMergeStrategies:l}}=t.appContext,u=a.get(e);let d;return u?d=u:!r.length&&!n&&!s?d=e:(d={},r.length&&r.forEach(f=>ia(d,f,l,!0)),ia(d,e,l)),Ge(e)&&a.set(e,d),d}function ia(t,e,n,s=!1){const{mixins:r,extends:a}=e;a&&ia(t,a,n,!0),r&&r.forEach(l=>ia(t,l,n,!0));for(const l in e)if(!(s&&l==="expose")){const u=Sw[l]||n&&n[l];t[l]=u?u(t[l],e[l]):e[l]}return t}const Sw={data:dd,props:fd,emits:fd,methods:wr,computed:wr,beforeCreate:Lt,created:Lt,beforeMount:Lt,mounted:Lt,beforeUpdate:Lt,updated:Lt,beforeDestroy:Lt,beforeUnmount:Lt,destroyed:Lt,unmounted:Lt,activated:Lt,deactivated:Lt,errorCaptured:Lt,serverPrefetch:Lt,components:wr,directives:wr,watch:xw,provide:dd,inject:Pw};function dd(t,e){return e?t?function(){return It(de(t)?t.call(this,this):t,de(e)?e.call(this,this):e)}:e:t}function Pw(t,e){return wr(fc(t),fc(e))}function fc(t){if(ae(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function Lt(t,e){return t?[...new Set([].concat(t,e))]:e}function wr(t,e){return t?It(Object.create(null),t,e):e}function fd(t,e){return t?ae(t)&&ae(e)?[...new Set([...t,...e])]:It(Object.create(null),ud(t),ud(e??{})):e}function xw(t,e){if(!t)return e;if(!e)return t;
vendor: 23,354 bytes, line 14
14const n=It(Object.create(null),t);for(const s in e)n[s]=Lt(t[s],e[s]);return n}function Yp(){return{app:null,config:{isNativeTag:by,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Lw=0;function Rw(t,e){return function(s,r=null){de(s)||(s=It({},s)),r!=null&&!Ge(r)&&(r=null);const a=Yp(),l=new WeakSet,u=[];let d=!1;const f=a.app={_uid:Lw++,_component:s,_props:r,_container:null,_context:a,_instance:null,version:cb,get config(){return a.config},set config(m){},use(m,..._){return l.has(m)||(m&&de(m.install)?(l.add(m),m.install(f,..._)):de(m)&&(l.add(m),m(f,..._))),f},mixin(m){return a.mixins.includes(m)||a.mixins.push(m),f},component(m,_){return _?(a.components[m]=_,f):a.components[m]},directive(m,_){return _?(a.directives[m]=_,f):a.directives[m]},mount(m,_,v){if(!d){const y=f._ceVNode||Qe(s,r);return y.appContext=a,v===!0?v="svg":v===!1&&(v=void 0),t(y,m,v),d=!0,f._container=m,m.__vue_app__=f,$a(y.component)}},onUnmount(m){u.push(m)},unmount(){d&&(Pn(u,f._instance,16),t(null,f._container),delete f._container.__vue_app__)},provide(m,_){return a.provides[m]=_,f},runWithContext(m){const _=Cs;Cs=f;try{return m()}finally{Cs=_}}};return f}}let Cs=null;function Vt(t,e){if(At){let n=At.provides;const s=At.parent&&At.parent.provides;s===n&&(n=At.provides=Object.create(s)),n[t]=e}}function vt(t,e,n=!1){const s=At||Qt;if(s||Cs){const r=Cs?Cs._context.provides:s?s.parent==null?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(r&&t in r)return r[t];if(arguments.length>1)return n&&de(e)?e.call(s&&s.proxy):e}}const Jp={},Qp=()=>Object.create(Jp),Xp=t=>Object.getPrototypeOf(t)===Jp;function Aw(t,e,n,s=!1){const r={},a=Qp();t.propsDefaults=Object.create(null),e_(t,e,r,a);for(const l in t.propsOptions[0])l in r||(r[l]=void 0);n?t.props=s?r:Dp(r):t.type.props?t.props=r:t.props=a,t.attrs=a}function kw(t,e,n,s){const{props:r,attrs:a,vnode:{patchFlag:l}}=t,u=De(r),[d]=t.propsOptions;let f=!1;if((s||l>0)&&!(l&16)){if(l&8){const m=t.vnode.dynamicProps;for(let _=0;_<m.length;_++){let v=m[_];if(Wa(t.emitsOptions,v))continue;const y=e[v];if(d)if(Fe(a,v))y!==a[v]&&(a[v]=y,f=!0);else{const P=vi(v);r[P]=pc(d,u,P,y,t,!1)}else y!==a[v]&&(a[v]=y,f=!0)}}}else{e_(t,e,r,a)&&(f=!0);let m;for(const _ in u)(!e||!Fe(e,_)&&((m=Ji(_))===_||!Fe(e,m)))&&(d?n&&(n[_]!==void 0||n[m]!==void 0)&&(r[_]=pc(d,u,_,void 0,t,!0)):delete r[_]);if(a!==u)for(const _ in a)(!e||!Fe(e,_))&&(delete a[_],f=!0)}f&&Mn(t.attrs,"set","")}function e_(t,e,n,s){const[r,a]=t.propsOptions;let l=!1,u;if(e)for(let d in e){if(Tr(d))continue;const f=e[d];let m;r&&Fe(r,m=vi(d))?!a||!a.includes(m)?n[m]=f:(u||(u={}))[m]=f:Wa(t.emitsOptions,d)||(!(d in s)||f!==s[d])&&(s[d]=f,l=!0)}if(a){const d=De(n),f=u||We;for(let m=0;m<a.length;m++){const _=a[m];n[_]=pc(r,d,_,f[_],t,!Fe(f,_))}}return l}function pc(t,e,n,s,r,a){const l=t[n];if(l!=null){const u=Fe(l,"default");if(u&&s===void 0){const d=l.default;if(l.type!==Function&&!l.skipFactory&&de(d)){const{propsDefaults:f}=r;if(n in f)s=f[n];else{const m=no(r);s=f[n]=d.call(null,e),m()}}else s=d;r.ce&&r.ce._setProp(n,s)}l[0]&&(a&&!u?s=!1:l[1]&&(s===""||s===Ji(n))&&(s=!0))}return s}const Ow=new WeakMap;function t_(t,e,n=!1){const s=n?Ow:e.propsCache,r=s.get(t);if(r)return r;const a=t.props,l={},u=[];let d=!1;if(!de(t)){const m=_=>{d=!0;const[v,y]=t_(_,e,!0);It(l,v),y&&u.push(...y)};!n&&e.mixins.length&&e.mixins.forEach(m),t.extends&&m(t.extends),t.mixins&&t.mixins.forEach(m)}if(!a&&!d)return Ge(t)&&s.set(t,ws),ws;if(ae(a))for(let m=0;m<a.length;m++){const _=vi(a[m]);pd(_)&&(l[_]=We)}else if(a)for(const m in a){const _=vi(m);if(pd(_)){const v=a[m],y=l[_]=ae(v)||de(v)?{type:v}:It({},v),P=y.type;let T=!1,O=!0;if(ae(P))for(let z=0;z<P.length;++z){const B=P[z],A=de(B)&&B.name;if(A==="Boolean"){T=!0;break}else A==="String"&&(O=!1)}else T=de(P)&&P.name==="Boolean";y[0]=T,y[1]=O,(T||Fe(y,"default"))&&u.push(_)}}const f=[l,u];return Ge(t)&&s.set(t,f),f}function pd(t){return t[0]!=="$"&&!Tr(t)}const n_=t=>t[0]==="_"||t==="$stable",nu=t=>ae(t)?t.map(bn):[bn(t)],Nw=(t,e,n)=>{if(e._n)return e;const s=Fn((...r)=>nu(e(...r)),n);return s._c=!1,s},i_=(t,e,n)=>{const s=t._ctx;for(const r in t){if(n_(r))continue;const a=t[r];if(de(a))e[r]=Nw(r,a,s);else if(a!=null){const l=nu(a);e[r]=()=>l}}},s_=(t,e)=>{const n=nu(e);t.slots.default=()=>n},r_=(t,e,n)=>{for(const s in e)(n||s!=="_")&&(t[s]=e[s])},Mw=(t,e,n)=>{const s=t.slots=Qp();if(t.vnode.shapeFlag&32){const r=e._;r?(r_(s,e,n),n&&vp(s,"_",r,!0)):i_(e,s)}else e&&s_(t,e)},Dw=(t,e,n)=>{const{vnode:s,slots:r}=t;let a=!0,l=We;if(s.shapeFlag&32){const u=e._;u?n&&u===1?a=!1:r_(r,e,n):(a=!e.$stable,i_(e,r)),l=e}else e&&(s_(t,e),l={default:1});if(a)for(const u in r)!n_(u)&&l[u]==null&&delete r[u]},zt=Yw;function Fw(t){return Bw(t)}function Bw(t,e){const n=Da();n.__VUE__=!0;const{insert:s,remove:r,patchProp:a,createElement:l,createText:u,createComment:d,setText:f,setElementText:m,parentNode:_,nextSibling:v,setScopeId:y=Tn,insertStaticContent:P}=t,T=(w,b,I,N=null,D=null,M=null,$=void 0,V=null,W=!!b.dynamicChildren)=>{if(w===b)return;w&&!fr(w,b)&&(N=k(w),Be(w,D,M,!0),w=null),b.patchFlag===-2&&(W=!1,b.dynamicChildren=null);const{type:U,ref:ne,shapeFlag:K}=b;switch(U){case Va:O(w,b,I,N);break;case Vi:z(w,b,I,N);break;case zl:w==null&&B(b,I,N,$);break;case Et:it(w,b,I,N,D,M,$,V,W);break;default:K&1?j(w,b,I,N,D,M,$,V,W):K&6?jt(w,b,I,N,D,M,$,V,W):(K&64||K&128)&&U.process(w,b,I,N,D,M,$,V,W,Q)}ne!=null&&D&&ta(ne,w&&w.ref,M,b||w,!b)},O=(w,b,I,N)=>{if(w==null)s(b.el=u(b.children),I,N);else{const D=b.el=w.el;b.children!==w.children&&f(D,b.children)}},z=(w,b,I,N)=>{w==null?s(b.el=d(b.children||""),I,N):b.el=w.el},B=(w,b,I,N)=>{[w.el,w.anchor]=P(w.children,b,I,N,w.el,w.anchor)},A=({el:w,anchor:b},I,N)=>{let D;for(;w&&w!==b;)D=v(w),s(w,I,N),w=D;s(b,I,N)},R=({el:w,anchor:b})=>{let I;for(;w&&w!==b;)I=v(w),r(w),w=I;r(b)},j=(w,b,I,N,D,M,$,V,W)=>{b.type==="svg"?$="svg":b.type==="math"&&($="mathml"),w==null?J(b,I,N,D,M,$,V,W):ie(w,b,D,M,$,V,W)},J=(w,b,I,N,D,M,$,V)=>{let W,U;const{props:ne,shapeFlag:K,transition:ee,dirs:ce}=w;if(W=w.el=l(w.type,M,ne&&ne.is,ne),K&8?m(W,w.children):K&16&&et(w.children,W,null,N,D,Ul(w,M),$,V),ce&&Ri(w,null,N,"created"),Ae(W,w,w.scopeId,$,N),ne){for(const Ue in ne)Ue!=="value"&&!Tr(Ue)&&a(W,Ue,null,ne[Ue],M,N);"value"in ne&&a(W,"value",null,ne.value,M),(U=ne.onVnodeBeforeMount)&&yn(U,N,w)}ce&&Ri(w,null,N,"beforeMount");const me=Uw(D,ee);me&&ee.beforeEnter(W),s(W,b,I),((U=ne&&ne.onVnodeMounted)||me||ce)&&zt(()=>{U&&yn(U,N,w),me&&ee.enter(W),ce&&Ri(w,null,N,"mounted")},D)},Ae=(w,b,I,N,D)=>{if(I&&y(w,I),N)for(let M=0;M<N.length;M++)y(w,N[M]);if(D){let M=D.subTree;if(b===M||h_(M.type)&&(M.ssContent===b||M.ssFallback===b)){const $=D.vnode;Ae(w,$,$.scopeId,$.slotScopeIds,D.parent)}}},et=(w,b,I,N,D,M,$,V,W=0)=>{for(let U=W;U<w.length;U++){const ne=w[U]=V?ri(w[U]):bn(w[U]);T(null,ne,b,I,N,D,M,$,V)}},ie=(w,b,I,N,D,M,$)=>{const V=b.el=w.el;let{patchFlag:W,dynamicChildren:U,dirs:ne}=b;W|=w.patchFlag&16;const K=w.props||We,ee=b.props||We;let ce;if(I&&Ai(I,!1),(ce=ee.onVnodeBeforeUpdate)&&yn(ce,I,b,w),ne&&Ri(b,w,I,"beforeUpdate"),I&&Ai(I,!0),(K.innerHTML&&ee.innerHTML==null||K.textContent&&ee.textContent==null)&&m(V,""),U?we(w.dynamicChildren,U,V,I,N,Ul(b,D),M):$||G(w,b,V,null,I,N,Ul(b,D),M,!1),W>0){if(W&16)$e(V,K,ee,I,D);else if(W&2&&K.class!==ee.class&&a(V,"class",null,ee.class,D),W&4&&a(V,"style",K.style,ee.style,D),W&8){const me=b.dynamicProps;for(let Ue=0;Ue<me.length;Ue++){const xe=me[Ue],Pt=K[xe],ft=ee[xe];(ft!==Pt||xe==="value")&&a(V,xe,Pt,ft,D,I)}}W&1&&w.children!==b.children&&m(V,b.children)}else!$&&U==null&&$e(V,K,ee,I,D);((ce=ee.onVnodeUpdated)||ne)&&zt(()=>{ce&&yn(ce,I,b,w),ne&&Ri(b,w,I,"updated")},N)},we=(w,b,I,N,D,M,$)=>{for(let V=0;V<b.length;V++){const W=w[V],U=b[V],ne=W.el&&(W.type===Et||!fr(W,U)||W.shapeFlag&70)?_(W.el):I;T(W,U,ne,null,N,D,M,$,!0)}},$e=(w,b,I,N,D)=>{if(b!==I){if(b!==We)for(const M in b)!Tr(M)&&!(M in I)&&a(w,M,b[M],null,D,N);for(const M in I){if(Tr(M))continue;const $=I[M],V=b[M];$!==V&&M!=="value"&&a(w,M,V,$,D,N)}"value"in I&&a(w,"value",b.value,I.value,D)}},it=(w,b,I,N,D,M,$,V,W)=>{const U=b.el=w?w.el:u(""),ne=b.anchor=w?w.anchor:u("");let{patchFlag:K,dynamicChildren:ee,slotScopeIds:ce}=b;ce&&(V=V?V.concat(ce):ce),w==null?(s(U,I,N),s(ne,I,N),et(b.children||[],I,ne,D,M,$,V,W)):K>0&&K&64&&ee&&w.dynamicChildren?(we(w.dynamicChildren,ee,I,D,M,$,V),(b.key!=null||D&&b===D.subTree)&&o_(w,b,!0)):G(w,b,I,ne,D,M,$,V,W)},jt=(w,b,I,N,D,M,$,V,W)=>{b.slotScopeIds=V,w==null?b.shapeFlag&512?D.ctx.activate(b,I,N,$,W):St(b,I,N,D,M,$,W):Jn(w,b,W)},St=(w,b,I,N,D,M,$)=>{const V=w.component=ib(w,N,D);if(Zp(w)&&(V.ctx.renderer=Q),sb(V,!1,$),V.asyncDep){if(D&&D.registerDep(V,Pe,$),!w.el){const W=V.subTree=Qe(Vi);z(null,W,b,I)}}else Pe(V,w,b,I,D,M,$)},Jn=(w,b,I)=>{const N=b.component=w.component;if(Gw(w,b,I))if(N.asyncDep&&!N.asyncResolved){Te(N,b,I);return}else N.next=b,N.update();else b.el=w.el,N.vnode=b},Pe=(w,b,I,N,D,M,$)=>{const V=()=>{if(w.isMounted){let{next:K,bu:ee,u:ce,parent:me,vnode:Ue}=w;{const qt=a_(w);if(qt){K&&(K.el=Ue.el,Te(w,K,$)),qt.asyncDep.then(()=>{w.isUnmounted||V()});return}}let xe=K,Pt;Ai(w,!1),K?(K.el=Ue.el,Te(w,K,$)):K=Ue,ee&&Wo(ee),(Pt=K.props&&K.props.onVnodeBeforeUpdate)&&yn(Pt,me,K,Ue),Ai(w,!0);const ft=md(w),Ut=w.subTree;w.subTree=ft,T(Ut,ft,_(Ut.el),k(Ut),w,D,M),K.el=ft.el,xe===null&&Kw(w,ft.el),ce&&zt(ce,D),(Pt=K.props&&K.props.onVnodeUpdated)&&zt(()=>yn(Pt,me,K,Ue),D)}else{let K;const{el:ee,props:ce}=b,{bm:me,m:Ue,parent:xe,root:Pt,type:ft}=w,Ut=Sr(b);Ai(w,!1),me&&Wo(me),!Ut&&(K=ce&&ce.onVnodeBeforeMount)&&yn(K,xe,b),Ai(w,!0);{Pt.ce&&Pt.ce._injectChildStyle(ft);const qt=w.subTree=md(w);T(null,qt,I,N,w,D,M),b.el=qt.el}if(Ue&&zt(Ue,D),!Ut&&(K=ce&&ce.onVnodeMounted)){const qt=b;zt(()=>yn(K,xe,qt),D)}(b.shapeFlag&256||xe&&Sr(xe.vnode)&&xe.vnode.shapeFlag&256)&&w.a&&zt(w.a,D),w.isMounted=!0,b=I=N=null}};w.scope.on();const W=w.effect=new Ep(V);w.scope.off();const U=w.update=W.run.bind(W),ne=w.job=W.runIfDirty.bind(W);ne.i=w,ne.id=w.uid,W.scheduler=()=>eu(ne),Ai(w,!0),U()},Te=(w,b,I)=>{b.component=w;const N=w.vnode.props;w.vnode=b,w.next=null,kw(w,b.props,N,I),Dw(w,b.children,I),bi(),cd(w),Ei()},G=(w,b,I,N,D,M,$,V,W=!1)=>{const U=w&&w.children,ne=w?w.shapeFlag:0,K=b.children,{patchFlag:ee,shapeFlag:ce}=b;if(ee>0){if(ee&128){te(U,K,I,N,D,M,$,V,W);return}else if(ee&256){Zt(U,K,I,N,D,M,$,V,W);return}}ce&8?(ne&16&&le(U,D,M),K!==U&&m(I,K)):ne&16?ce&16?te(U,K,I,N,D,M,$,V,W):le(U,D,M,!0):(ne&8&&m(I,""),ce&16&&et(K,I,N,D,M,$,V,W))},Zt=(w,b,I,N,D,M,$,V,W)=>{w=w||ws,b=b||ws;const U=w.length,ne=b.length,K=Math.min(U,ne);let ee;for(ee=0;ee<K;ee++){const ce=b[ee]=W?ri(b[ee]):bn(b[ee]);T(w[ee],ce,I,null,D,M,$,V,W)}U>ne?le(w,D,M,!0,!1,K):et(b,I,N,D,M,$,V,W,K)},te=(w,b,I,N,D,M,$,V,W)=>{let U=0;const ne=b.length;let K=w.length-1,ee=ne-1;for(;U<=K&&U<=ee;){const ce=w[U],me=b[U]=W?ri(b[U]):bn(b[U]);if(fr(ce,me))T(ce,me,I,null,D,M,$,V,W);else break;U++}for(;U<=K&&U<=ee;){const ce=w[K],me=b[ee]=W?ri(b[ee]):bn(b[ee]);if(fr(ce,me))T(ce,me,I,null,D,M,$,V,W);else break;K--,ee--}if(U>K){if(U<=ee){const ce=ee+1,me=ce<ne?b[ce].el:N;for(;U<=ee;)T(null,b[U]=W?ri(b[U]):bn(b[U]),I,me,D,M,$,V,W),U++}}else if(U>ee)for(;U<=K;)Be(w[U],D,M,!0),U++;else{const ce=U,me=U,Ue=new Map;for(U=me;U<=ee;U++){const yt=b[U]=W?ri(b[U]):bn(b[U]);yt.key!=null&&Ue.set(yt.key,U)}let xe,Pt=0;const ft=ee-me+1;let Ut=!1,qt=0;const Qn=new Array(ft);for(U=0;U<ft;U++)Qn[U]=0;for(U=ce;U<=K;U++){const yt=w[U];if(Pt>=ft){Be(yt,D,M,!0);continue}let Gt;if(yt.key!=null)Gt=Ue.get(yt.key);else for(xe=me;xe<=ee;xe++)if(Qn[xe-me]===0&&fr(yt,b[xe])){Gt=xe;break}Gt===void 0?Be(yt,D,M,!0):(Qn[Gt-me]=U+1,Gt>=qt?qt=Gt:Ut=!0,T(yt,b[Gt],I,null,D,M,$,V,W),Pt++)}const is=Ut?zw(Qn):ws;for(xe=is.length-1,U=ft-1;U>=0;U--){const yt=me+U,Gt=b[yt],Xn=yt+1<ne?b[yt+1].el:N;Qn[U]===0?T(null,Gt,I,Xn,D,M,$,V,W):Ut&&(xe<0||U!==is[xe]?Ce(Gt,I,Xn,2):xe--)}}},Ce=(w,b,I,N,D=null)=>{const{el:M,type:$,transition:V,children:W,shapeFlag:U}=w;if(U&6){Ce(w.component.subTree,b,I,N);return}if(U&128){w.suspense.move(b,I,N);return}if(U&64){$.move(w,b,I,Q);return}if($===Et){s(M,b,I);for(let K=0;K<W.length;K++)Ce(W[K],b,I,N);s(w.anchor,b,I);return}if($===zl){A(w,b,I);return}if(N!==2&&U&1&&V)if(N===0)V.beforeEnter(M),s(M,b,I),zt(()=>V.enter(M),D);else{const{leave:K,delayLeave:ee,afterLeave:ce}=V,me=()=>s(M,b,I),Ue=()=>{K(M,()=>{me(),ce&&ce()})};ee?ee(M,me,Ue):Ue()}else s(M,b,I)},Be=(w,b,I,N=!1,D=!1)=>{const{type:M,props:$,ref:V,children:W,dynamicChildren:U,shapeFlag:ne,patchFlag:K,dirs:ee,cacheIndex:ce}=w;if(K===-2&&(D=!1),V!=null&&ta(V,null,I,w,!0),ce!=null&&(b.renderCache[ce]=void 0),ne&256){b.ctx.deactivate(w);return}const me=ne&1&&ee,Ue=!Sr(w);let xe;if(Ue&&(xe=$&&$.onVnodeBeforeUnmount)&&yn(xe,b,w),ne&6)Se(w.component,I,N);else{if(ne&128){w.suspense.unmount(I,N);return}me&&Ri(w,null,b,"beforeUnmount"),ne&64?w.type.remove(w,b,I,Q,N):U&&!U.hasOnce&&(M!==Et||K>0&&K&64)?le(U,b,I,!1,!0):(M===Et&&K&384||!D&&ne&16)&&le(W,b,I),N&&tt(w)}(Ue&&(xe=$&&$.onVnodeUnmounted)||me)&&zt(()=>{xe&&yn(xe,b,w),me&&Ri(w,null,b,"unmounted")},I)},tt=w=>{const{type:b,el:I,anchor:N,transition:D}=w;if(b===Et){He(I,N);return}if(b===zl){R(w);return}const M=()=>{r(I),D&&!D.persisted&&D.afterLeave&&D.afterLeave()};if(w.shapeFlag&1&&D&&!D.persisted){const{leave:$,delayLeave:V}=D,W=()=>$(I,M);V?V(w.el,M,W):W()}else M()},He=(w,b)=>{let I;for(;w!==b;)I=v(w),r(w),w=I;r(b)},Se=(w,b,I)=>{const{bum:N,scope:D,job:M,subTree:$,um:V,m:W,a:U}=w;_d(W),_d(U),N&&Wo(N),D.stop(),M&&(M.flags|=8,Be($,w,b,I)),V&&zt(V,b),zt(()=>{w.isUnmounted=!0},b),b&&b.pendingBranch&&!b.isUnmounted&&w.asyncDep&&!w.asyncResolved&&w.suspenseId===b.pendingId&&(b.deps--,b.deps===0&&b.resolve())},le=(w,b,I,N=!1,D=!1,M=0)=>{for(let $=M;$<w.length;$++)Be(w[$],b,I,N,D)},k=w=>{if(w.shapeFlag&6)return k(w.component.subTree);if(w.shapeFlag&128)return w.suspense.next();const b=v(w.anchor||w.el),I=b&&b[uw];return I?v(I):b};let Z=!1;const q=(w,b,I)=>{w==null?b._vnode&&Be(b._vnode,null,null,!0):T(b._vnode||null,w,b,null,null,null,I),b._vnode=w,Z||(Z=!0,cd(),Wp(),Z=!1)},Q={p:T,um:Be,m:Ce,r:tt,mt:St,mc:et,pc:G,pbc:we,n:k,o:t};return{render:q,hydrate:void 0,createApp:Rw(q)}}function Ul({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function Ai({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function Uw(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function o_(t,e,n=!1){const s=t.children,r=e.children;if(ae(s)&&ae(r))for(let a=0;a<s.length;a++){const l=s[a];let u=r[a];u.shapeFlag&1&&!u.dynamicChildren&&((u.patchFlag<=0||u.patchFlag===32)&&(u=r[a]=ri(r[a]),u.el=l.el),!n&&u.patchFlag!==-2&&o_(l,u)),u.type===Va&&(u.el=l.el)}}function zw(t){const e=t.slice(),n=[0];let s,r,a,l,u;const d=t.length;for(s=0;s<d;s++){const f=t[s];if(f!==0){if(r=n[n.length-1],t[r]<f){e[s]=r,n.push(s);continue}for(a=0,l=n.length-1;a<l;)u=a+l>>1,t[n[u]]<f?a=u+1:l=u;f<t[n[a]]&&(a>0&&(e[s]=n[a-1]),n[a]=s)}}for(a=n.length,l=n[a-1];a-- >0;)n[a]=l,l=e[l];return n}function a_(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:a_(e)}function _d(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}const Hw=Symbol.for("v-scx"),Ww=()=>vt(Hw);function fi(t,e,n){return l_(t,e,n)}function l_(t,e,n=We){const{immediate:s,deep:r,flush:a,once:l}=n,u=It({},n),d=e&&s||!e&&a!=="post";let f;if(Hr){if(a==="sync"){const y=Ww();f=y.__watcherHandles||(y.__watcherHandles=[])}else if(!d){const y=()=>{};return y.stop=Tn,y.resume=Tn,y.pause=Tn,y}}const m=At;u.call=(y,P,T)=>Pn(y,m,P,T);let _=!1;a==="post"?u.scheduler=y=>{zt(y,m&&m.suspense)}:a!=="sync"&&(_=!0,u.scheduler=(y,P)=>{P?y():eu(y)}),u.augmentJob=y=>{e&&(y.flags|=4),_&&(y.flags|=2,m&&(y.id=m.uid,y.i=m))};const v=ow(t,e,u);return Hr&&(f?f.push(v):d&&v()),v}function Vw(t,e,n){const s=this.proxy,r=at(t)?t.includes(".")?c_(s,t):()=>s[t]:t.bind(s,s);let a;de(e)?a=e:(a=e.handler,n=e);const l=no(this),u=l_(r,a.bind(s),n);return l(),u}function c_(t,e){const n=e.split(".");return()=>{let s=t;for(let r=0;r<n.length&&s;r++)s=s[n[r]];return s}}const $w=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${vi(e)}Modifiers`]||t[`${Ji(e)}Modifiers`];function jw(t,e,...n){if(t.isUnmounted)return;const s=t.vnode.props||We;let r=n;const a=e.startsWith("update:"),l=a&&$w(s,e.slice(7));l&&(l.trim&&(r=n.map(m=>at(m)?m.trim():m)),l.number&&(r=n.map(Jo)));let u,d=s[u=Ol(e)]||s[u=Ol(vi(e))];!d&&a&&(d=s[u=Ol(Ji(e))]),d&&Pn(d,t,6,r);const f=s[u+"Once"];if(f){if(!t.emitted)t.emitted={};else if(t.emitted[u])return;t.emitted[u]=!0,Pn(f,t,6,r)}}function u_(t,e,n=!1){const s=e.emitsCache,r=s.get(t);if(r!==void 0)return r;const a=t.emits;let l={},u=!1;if(!de(t)){const d=f=>{const m=u_(f,e,!0);m&&(u=!0,It(l,m))};!n&&e.mixins.length&&e.mixins.forEach(d),t.extends&&d(t.extends),t.mixins&&t.mixins.forEach(d)}return!a&&!u?(Ge(t)&&s.set(t,null),null):(ae(a)?a.forEach(d=>l[d]=null):It(l,a),Ge(t)&&s.set(t,l),l)}function Wa(t,e){return!t||!Oa(e)?!1:(e=e.slice(2).replace(/Once$/,""),Fe(t,e[0].toLowerCase()+e.slice(1))||Fe(t,Ji(e))||Fe(t,e))}function md(t){const{type:e,vnode:n,proxy:s,withProxy:r,propsOptions:[a],slots:l,attrs:u,emit:d,render:f,renderCache:m,props:_,data:v,setupState:y,ctx:P,inheritAttrs:T}=t,O=ea(t);let z,B;try{if(n.shapeFlag&4){const R=r||s,j=R;z=bn(f.call(j,R,m,_,y,v,P)),B=u}else{const R=e;z=bn(R.length>1?R(_,{attrs:u,slots:l,emit:d}):R(_,null)),B=e.props?u:Zw(u)}}catch(R){xr.length=0,Ua(R,t,1),z=Qe(Vi)}let A=z;if(B&&T!==!1){const R=Object.keys(B),{shapeFlag:j}=A;R.length&&j&7&&(a&&R.some(Vc)&&(B=qw(B,a)),A=ks(A,B,!1,!0))}return n.dirs&&(A=ks(A,null,!1,!0),A.dirs=A.dirs?A.dirs.concat(n.dirs):n.dirs),n.transition&&tu(A,n.transition),z=A,ea(O),z}const Zw=t=>{let e;for(const n in t)(n==="class"||n==="style"||Oa(n))&&((e||(e={}))[n]=t[n]);return e},qw=(t,e)=>{const n={};for(const s in t)(!Vc(s)||!(s.slice(9)in e))&&(n[s]=t[s]);return n};function Gw(t,e,n){const{props:s,children:r,component:a}=t,{props:l,children:u,patchFlag:d}=e,f=a.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&d>=0){if(d&1024)return!0;if(d&16)return s?gd(s,l,f):!!l;if(d&8){const m=e.dynamicProps;for(let _=0;_<m.length;_++){const v=m[_];if(l[v]!==s[v]&&!Wa(f,v))return!0}}}else return(r||u)&&(!u||!u.$stable)?!0:s===l?!1:s?l?gd(s,l,f):!0:!!l;return!1}function gd(t,e,n){const s=Object.keys(e);if(s.length!==Object.keys(t).length)return!0;for(let r=0;r<s.length;r++){const a=s[r];if(e[a]!==t[a]&&!Wa(n,a))return!0}return!1}function Kw({vnode:t,parent:e},n){for(;e;){const s=e.subTree;if(s.suspense&&s.suspense.activeBranch===t&&(s.el=t.el),s===t)(t=e.vnode).el=n,e=e.parent;else break}}const h_=t=>t.__isSuspense;function Yw(t,e){e&&e.pendingBranch?ae(t)?e.effects.push(...t):e.effects.push(t):cw(t)}const Et=Symbol.for("v-fgt"),Va=Symbol.for("v-txt"),Vi=Symbol.for("v-cmt"),zl=Symbol.for("v-stc"),xr=[];let $t=null;function fe(t=!1){xr.push($t=t?null:[])}function Jw(){xr.pop(),$t=xr[xr.length-1]||null}let zr=1;function vd(t,e=!1){zr+=t,t<0&&$t&&e&&($t.hasOnce=!0)}function d_(t){return t.dynamicChildren=zr>0?$t||ws:null,Jw(),zr>0&&$t&&$t.push(t),t}function _e(t,e,n,s,r,a){return d_(C(t,e,n,s,r,a,!0))}function f_(t,e,n,s,r){return d_(Qe(t,e,n,s,r,!0))}function sa(t){return t?t.__v_isVNode===!0:!1}function fr(t,e){return t.type===e.type&&t.key===e.key}const p_=({key:t})=>t??null,Vo=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?at(t)||Ct(t)||de(t)?{i:Qt,r:t,k:e,f:!!n}:t:null);function C(t,e=null,n=null,s=0,r=null,a=t===Et?0:1,l=!1,u=!1){const d={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&p_(e),ref:e&&Vo(e),scopeId:$p,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:s,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Qt};return u?(iu(d,n),a&128&&t.normalize(d)):n&&(d.shapeFlag|=at(n)?8:16),zr>0&&!l&&$t&&(d.patchFlag>0||a&6)&&d.patchFlag!==32&&$t.push(d),d}const Qe=Qw;function Qw(t,e=null,n=null,s=0,r=null,a=!1){if((!t||t===Ew)&&(t=Vi),sa(t)){const u=ks(t,e,!0);return n&&iu(u,n),zr>0&&!a&&$t&&(u.shapeFlag&6?$t[$t.indexOf(t)]=u:$t.push(u)),u.patchFlag=-2,u}if(lb(t)&&(t=t.__vccOpts),e){e=Xw(e);let{class:u,style:d}=e;u&&!at(u)&&(e.class=Wt(u)),Ge(d)&&(Xc(d)&&!ae(d)&&(d=It({},d)),e.style=Zc(d))}const l=at(t)?1:h_(t)?128:hw(t)?64:Ge(t)?4:de(t)?2:0;return C(t,e,n,s,r,l,a,!0)}function Xw(t){return t?Xc(t)||Xp(t)?It({},t):t:null}function ks(t,e,n=!1,s=!1){const{props:r,ref:a,patchFlag:l,children:u,transition:d}=t,f=e?eb(r||{},e):r,m={__v_isVNode:!0,__v_skip:!0,type:t.type,props:f,key:f&&p_(f),ref:e&&e.ref?n&&a?ae(a)?a.concat(Vo(e)):[a,Vo(e)]:Vo(e):a,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:u,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==Et?l===-1?16:l|16:l,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:d,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&ks(t.ssContent),ssFallback:t.ssFallback&&ks(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return d&&s&&tu(m,d.clone(m)),m}function br(t=" ",e=0){return Qe(Va,null,t,e)}function ot(t="",e=!1){return e?(fe(),f_(Vi,null,t)):Qe(Vi,null,t)}function bn(t){return t==null||typeof t=="boolean"?Qe(Vi):ae(t)?Qe(Et,null,t.slice()):sa(t)?ri(t):Qe(Va,null,String(t))}function ri(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:ks(t)}function iu(t,e){let n=0;const{shapeFlag:s}=t;if(e==null)e=null;else if(ae(e))n=16;else if(typeof e=="object")if(s&65){const r=e.default;r&&(r._c&&(r._d=!1),iu(t,r()),r._c&&(r._d=!0));return}else{n=32;const r=e._;!r&&!Xp(e)?e._ctx=Qt:r===3&&Qt&&(Qt.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else de(e)?(e={default:e,_ctx:Qt},n=32):(e=String(e),s&64?(n=16,e=[br(e)]):n=8);t.children=e,t.shapeFlag|=n}function eb(...t){const e={};for(let n=0;n<t.length;n++){const s=t[n];for(const r in s)if(r==="class")e.class!==s.class&&(e.class=Wt([e.class,s.class]));else if(r==="style")e.style=Zc([e.style,s.style]);else if(Oa(r)){const a=e[r],l=s[r];l&&a!==l&&!(ae(a)&&a.includes(l))&&(e[r]=a?[].concat(a,l):l)}else r!==""&&(e[r]=s[r])}return e}function yn(t,e,n,s=null){Pn(t,e,7,[n,s])}const tb=Yp();let nb=0;function ib(t,e,n){const s=t.type,r=(e?e.appContext:t.appContext)||tb,a={uid:nb++,vnode:t,type:s,parent:e,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ny(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(r.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:t_(s,r),emitsOptions:u_(s,r),emit:null,emitted:null,propsDefaults:We,inheritAttrs:s.inheritAttrs,ctx:We,data:We,props:We,attrs:We,slots:We,refs:We,setupState:We,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,
vendor: 1,921 bytes, lines 14-17
14sp:null};return a.ctx={_:a},a.root=e?e.root:a,a.emit=jw.bind(null,a),t.ce&&t.ce(a),a}let At=null,ra,_c;{const t=Da(),e=(n,s)=>{let r;return(r=t[n])||(r=t[n]=[]),r.push(s),a=>{r.length>1?r.forEach(l=>l(a)):r[0](a)}};ra=e("__VUE_INSTANCE_SETTERS__",n=>At=n),_c=e("__VUE_SSR_SETTERS__",n=>Hr=n)}const no=t=>{const e=At;return ra(t),t.scope.on(),()=>{t.scope.off(),ra(e)}},yd=()=>{At&&At.scope.off(),ra(null)};function __(t){return t.vnode.shapeFlag&4}let Hr=!1;function sb(t,e=!1,n=!1){e&&_c(e);const{props:s,children:r}=t.vnode,a=__(t);Aw(t,s,a,e),Mw(t,r,n);const l=a?rb(t,e):void 0;return e&&_c(!1),l}function rb(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Tw);const{setup:s}=n;if(s){bi();const r=t.setupContext=s.length>1?ab(t):null,a=no(t),l=eo(s,t,0,[t.props,r]),u=pp(l);if(Ei(),a(),(u||t.sp)&&!Sr(t)&&jp(t),u){if(l.then(yd,yd),e)return l.then(d=>{wd(t,d)}).catch(d=>{Ua(d,t,0)});t.asyncDep=l}else wd(t,l)}else m_(t)}function wd(t,e,n){de(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Ge(e)&&(t.setupState=Up(e)),m_(t)}function m_(t,e,n){const s=t.type;t.render||(t.render=s.render||Tn);{const r=no(t);bi();try{Cw(t)}finally{Ei(),r()}}}const ob={get(t,e){return wt(t,"get",""),t[e]}};function ab(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,ob),slots:t.slots,emit:t.emit,expose:e}}function $a(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Up(Qi(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in Pr)return Pr[n](t)},has(e,n){return n in e||n in Pr}})):t.proxy}function lb(t){return de(t)&&"__vccOpts"in t}const gt=(t,e)=>sw(t,e,Hr);function Kn(t,e,n){const s=arguments.length;return s===2?Ge(e)&&!ae(e)?sa(e)?Qe(t,null,[e]):Qe(t,e):Qe(t,null,e):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&sa(n)&&(n=[n]),Qe(t,e,n))}const cb="3.5.13";/** 15* @vue/runtime-dom v3.5.13 16* (c) 2018-present Yuxi (Evan) You and Vue contributors 17* @license MIT
18**/let mc;const bd=typeof window<"u"&&window.trustedTypes;if(bd)try{mc=bd.createPolicy("vue",{createHTML:t=>t})}catch{}const g_=mc?t=>mc.createHTML(t):t=>t,ub="http://www.w3.org/2000/svg",hb="http://www.w3.org/1998/Math/MathML",Nn=typeof document<"u"?document:null,Ed=Nn&&Nn.createElement("template"),db={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,s)=>{const r=e==="svg"?Nn.createElementNS(ub,t):e==="mathml"?Nn.createElementNS(hb,t):n?Nn.createElement(t,{is:n}):Nn.createElement(t);return t==="select"&&s&&s.multiple!=null&&r.setAttribute("multiple",s.multiple),r},createText:t=>Nn.createTextNode(t),createComment:t=>Nn.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Nn.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,s,r,a){const l=n?n.previousSibling:e.lastChild;if(r&&(r===a||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),n),!(r===a||
vendor: 11,001 bytes, lines 18-22
18!(r=r.nextSibling)););else{Ed.innerHTML=g_(s==="svg"?`<svg>${t}</svg>`:s==="mathml"?`<math>${t}</math>`:t);const u=Ed.content;if(s==="svg"||s==="mathml"){const d=u.firstChild;for(;d.firstChild;)u.appendChild(d.firstChild);u.removeChild(d)}e.insertBefore(u,n)}return[l?l.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},fb=Symbol("_vtc");function pb(t,e,n){const s=t[fb];s&&(e=(e?[e,...s]:[...s]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const oa=Symbol("_vod"),v_=Symbol("_vsh"),Re={beforeMount(t,{value:e},{transition:n}){t[oa]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):pr(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:s}){!e!=!n&&(s?e?(s.beforeEnter(t),pr(t,!0),s.enter(t)):s.leave(t,()=>{pr(t,!1)}):pr(t,e))},beforeUnmount(t,{value:e}){pr(t,e)}};function pr(t,e){t.style.display=e?t[oa]:"none",t[v_]=!e}const _b=Symbol(""),mb=/(^|;)\s*display\s*:/;function gb(t,e,n){const s=t.style,r=at(n);let a=!1;if(n&&!r){if(e)if(at(e))for(const l of e.split(";")){const u=l.slice(0,l.indexOf(":")).trim();n[u]==null&&$o(s,u,"")}else for(const l in e)n[l]==null&&$o(s,l,"");for(const l in n)l==="display"&&(a=!0),$o(s,l,n[l])}else if(r){if(e!==n){const l=s[_b];l&&(n+=";"+l),s.cssText=n,a=mb.test(n)}}else e&&t.removeAttribute("style");oa in t&&(t[oa]=a?s.display:"",t[v_]&&(s.display="none"))}const Td=/\s*!important$/;function $o(t,e,n){if(ae(n))n.forEach(s=>$o(t,e,s));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const s=vb(t,e);Td.test(n)?t.setProperty(Ji(s),n.replace(Td,""),"important"):t[s]=n}}const Cd=["Webkit","Moz","ms"],Hl={};function vb(t,e){const n=Hl[e];if(n)return n;let s=vi(e);if(s!=="filter"&&s in t)return Hl[e]=s;s=gp(s);for(let r=0;r<Cd.length;r++){const a=Cd[r]+s;if(a in t)return Hl[e]=a}return e}const Id="http://www.w3.org/1999/xlink";function Sd(t,e,n,s,r,a=Ay(e)){s&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(Id,e.slice(6,e.length)):t.setAttributeNS(Id,e,n):n==null||a&&!yp(n)?t.removeAttribute(e):t.setAttribute(e,a?"":Sn(n)?String(n):n)}function Pd(t,e,n,s,r){if(e==="innerHTML"||e==="textContent"){n!=null&&(t[e]=e==="innerHTML"?g_(n):n);return}const a=t.tagName;if(e==="value"&&a!=="PROGRESS"&&!a.includes("-")){const u=a==="OPTION"?t.getAttribute("value")||"":t.value,d=n==null?t.type==="checkbox"?"on":"":String(n);(u!==d||!("_value"in t))&&(t.value=d),n==null&&t.removeAttribute(e),t._value=n;return}let l=!1;if(n===""||n==null){const u=typeof t[e];u==="boolean"?n=yp(n):n==null&&u==="string"?(n="",l=!0):u==="number"&&(n=0,l=!0)}try{t[e]=n}catch{}l&&t.removeAttribute(r||e)}function Mi(t,e,n,s){t.addEventListener(e,n,s)}function yb(t,e,n,s){t.removeEventListener(e,n,s)}const xd=Symbol("_vei");function wb(t,e,n,s,r=null){const a=t[xd]||(t[xd]={}),l=a[e];if(s&&l)l.value=s;else{const[u,d]=bb(e);if(s){const f=a[e]=Cb(s,r);Mi(t,u,f,d)}else l&&(yb(t,u,l,d),a[e]=void 0)}}const Ld=/(?:Once|Passive|Capture)$/;function bb(t){let e;if(Ld.test(t)){e={};let s;for(;s=t.match(Ld);)t=t.slice(0,t.length-s[0].length),e[s[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):Ji(t.slice(2)),e]}let Wl=0;const Eb=Promise.resolve(),Tb=()=>Wl||(Eb.then(()=>Wl=0),Wl=Date.now());function Cb(t,e){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;Pn(Ib(s,n.value),e,5,[s])};return n.value=t,n.attached=Tb(),n}function Ib(t,e){if(ae(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(s=>r=>!r._stopped&&s&&s(r))}else return e}const Rd=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Sb=(t,e,n,s,r,a)=>{const l=r==="svg";e==="class"?pb(t,s,l):e==="style"?gb(t,n,s):Oa(e)?Vc(e)||wb(t,e,n,s,a):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):Pb(t,e,s,l))?(Pd(t,e,s),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&Sd(t,e,s,l,a,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!at(s))?Pd(t,vi(e),s,a,e):(e==="true-value"?t._trueValue=s:e==="false-value"&&(t._falseValue=s),Sd(t,e,s,l))};function Pb(t,e,n,s){if(s)return!!(e==="innerHTML"||e==="textContent"||e in t&&Rd(e)&&de(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=t.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Rd(e)&&at(n)?!1:e in t}const aa=t=>{const e=t.props["onUpdate:modelValue"]||!1;return ae(e)?n=>Wo(e,n):e};function xb(t){t.target.composing=!0}function Ad(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const Is=Symbol("_assign"),Ye={created(t,{modifiers:{lazy:e,trim:n,number:s}},r){t[Is]=aa(r);const a=s||r.props&&r.props.type==="number";Mi(t,e?"change":"input",l=>{if(l.target.composing)return;let u=t.value;n&&(u=u.trim()),a&&(u=Jo(u)),t[Is](u)}),n&&Mi(t,"change",()=>{t.value=t.value.trim()}),e||(Mi(t,"compositionstart",xb),Mi(t,"compositionend",Ad),Mi(t,"change",Ad))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:s,trim:r,number:a}},l){if(t[Is]=aa(l),t.composing)return;const u=(a||t.type==="number")&&!/^0\d/.test(t.value)?Jo(t.value):t.value,d=e??"";u!==d&&(document.activeElement===t&&t.type!=="range"&&(s&&e===n||r&&t.value.trim()===d)||(t.value=d))}},Ui={deep:!0,created(t,{value:e,modifiers:{number:n}},s){const r=Na(e);Mi(t,"change",()=>{const a=Array.prototype.filter.call(t.options,l=>l.selected).map(l=>n?Jo(la(l)):la(l));t[Is](t.multiple?r?new Set(a):a:a[0]),t._assigning=!0,hn(()=>{t._assigning=!1})}),t[Is]=aa(s)},mounted(t,{value:e}){kd(t,e)},beforeUpdate(t,e,n){t[Is]=aa(n)},updated(t,{value:e}){t._assigning||kd(t,e)}};function kd(t,e){const n=t.multiple,s=ae(e);if(!(n&&!s&&!Na(e))){for(let r=0,a=t.options.length;r<a;r++){const l=t.options[r],u=la(l);if(n)if(s){const d=typeof u;d==="string"||d==="number"?l.selected=e.some(f=>String(f)===String(u)):l.selected=Oy(e,u)>-1}else l.selected=e.has(u);else if(Fa(la(l),e)){t.selectedIndex!==r&&(t.selectedIndex=r);return}}!n&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function la(t){return"_value"in t?t._value:t.value}const Lb=["ctrl","shift","alt","meta"],Rb={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>Lb.some(n=>t[`${n}Key`]&&!e.includes(n))},Od=(t,e)=>{const n=t._withMods||(t._withMods={}),s=e.join(".");return n[s]||(n[s]=(r,...a)=>{for(let l=0;l<e.length;l++){const u=Rb[e[l]];if(u&&u(r,e))return}return t(r,...a)})},Ab=It({patchProp:Sb},db);let Nd;function y_(){return Nd||(Nd=Fw(Ab))}const kb=(...t)=>{y_().render(...t)},Ob=(...t)=>{const e=y_().createApp(...t),{mount:n}=e;return e.mount=s=>{const r=Mb(s);if(!r)return;const a=e._component;!de(a)&&!a.render&&!a.template&&(a.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const l=n(r,!1,Nb(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),l},e};function Nb(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Mb(t){return at(t)?document.querySelector(t):t}/*! 19 * vue-router v4.5.1 20 * (c) 2025 Eduardo San Martin Morote 21 * @license MIT 22 */const ms=typeof document<"u";function w_(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function Db(t){return t.__esModule||t[Symbol.toStringTag]==="Module"||t.default&&w_(t.default)}const Ne=Object.assign;function Vl(t,e){const n={};for(const s in e){const r=e[s];n[s]=dn(r)?r.map(t):t(r)}return n}const Lr=()=>{},dn=Array.isArray,b_=/#/g,Fb=/&/g,Bb=/\//g,Ub=/=/g,zb=/\?/g,E_=/\+/g,Hb=/%5B/g,Wb=/%5D/g,T_=/%5E/g,Vb=/%60/g,C_=/%7B/g,$b=/%7C/g,I_=/%7D/g,jb=/%20/g;function su(t){return encodeURI(""+t).replace($b,"|").replace(Hb,"[").replace(Wb,"]")}function Zb(t){return su(t).replace(C_,"{").replace(I_,"}").replace(T_,"^")}function gc(t){return su(t).replace(E_,"%2B").replace(jb,"+").replace(b_,"%23").replace(Fb,"%26").replace(Vb,"`").replace(C_,"{").replace(I_,"}").replace(T_,"^")}function qb(t){return gc(t).replace(Ub,"%3D")}function Gb(t){return su(t).replace(b_,"%23").replace(zb,"%3F")}function Kb(t){return t==null?"":Gb(t).replace(Bb,"%2F")}function Wr(t){try{return decodeURIComponent(""+t)}catch{}return""+t}const Yb=/\/$/,Jb=t=>t.replace(Yb,"");function $l(t,e,n="/"){let s,r={},a="",l="";const u=e.indexOf("#");let d=e.indexOf("?");return u<d&&u>=0&&(d=-1),d>-1&&(s=e.slice(0,d),a=e.slice(d+1,u>-1?u:e.length),r=t(a)),u>-1&&(s=s||e.slice(0,u),l=e.slice(u,e.length)),s=tE(s??e,n),{fullPath:s+(a&&"?")+a+l,path:s,query:r,hash:Wr(l)}}function Qb(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function Md(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function Xb(t,e,n){const s=e.matched.length-1,r=n.matched.length-1;return s>-1&&s===r&&Os(e.matched[s],n.matched[r])&&S_(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function Os(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function S_(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(!eE(t[n],e[n]))return!1;return!0}function eE(t,e){return dn(t)?Dd(t,e):dn(e)?Dd(e,t):t===e}function Dd(t,e){return dn(e)?t.length===e.length&&t.every((n,s)=>n===e[s]):t.length===1&&t[0]===e}function tE(t,e){if(t.startsWith("/"))return t;if(!t)return e;const n=e.split("/"),s=t.split("/"),r=s[s.length-1];(r===".."||r===".")&&s.push("");let a=n.length-1,l,u;for(l=0;l<s.length;l++)if(u=s[l],u!==".")if(u==="..")a>1&&a--;else break;return n.slice(0,a).join("/")+"/"+s.slice(l).join("/")}const ni={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Vr;(function(t){t.pop="pop",t.push="push"})(Vr||(Vr={}));var Rr;(function(t){t.back="back",t.forward="forward",t.unknown=""})(Rr||(Rr={}));function nE(t){if(!t)if(ms){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),Jb(t)}const iE=/^[^#]+#/;function sE(t,e){return t.replace(iE,"#")+e}function rE(t,e){const n=document.documentElement.getBoundingClientRect(),s=t.getBoundingClientRect();return{behavior:e.behavior,left:s.left-n.left-(e.left||0),top:s.top-n.top-(e.top||0)}}const ja=()=>({left:window.scrollX,top:window.scrollY});function oE(t){let e;if("el"in t){const n=t.el,s=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?s?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;e=rE(r,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}
vendor: 6,423 bytes, line 22
22function Fd(t,e){return(history.state?history.state.position-e:-1)+t}const vc=new Map;function aE(t,e){vc.set(t,e)}function lE(t){const e=vc.get(t);return vc.delete(t),e}let cE=()=>location.protocol+"//"+location.host;function P_(t,e){const{pathname:n,search:s,hash:r}=e,a=t.indexOf("#");if(a>-1){let u=r.includes(t.slice(a))?t.slice(a).length:1,d=r.slice(u);return d[0]!=="/"&&(d="/"+d),Md(d,"")}return Md(n,t)+s+r}function uE(t,e,n,s){let r=[],a=[],l=null;const u=({state:v})=>{const y=P_(t,location),P=n.value,T=e.value;let O=0;if(v){if(n.value=y,e.value=v,l&&l===P){l=null;return}O=T?v.position-T.position:0}else s(y);r.forEach(z=>{z(n.value,P,{delta:O,type:Vr.pop,direction:O?O>0?Rr.forward:Rr.back:Rr.unknown})})};function d(){l=n.value}function f(v){r.push(v);const y=()=>{const P=r.indexOf(v);P>-1&&r.splice(P,1)};return a.push(y),y}function m(){const{history:v}=window;v.state&&v.replaceState(Ne({},v.state,{scroll:ja()}),"")}function _(){for(const v of a)v();a=[],window.removeEventListener("popstate",u),window.removeEventListener("beforeunload",m)}return window.addEventListener("popstate",u),window.addEventListener("beforeunload",m,{passive:!0}),{pauseListeners:d,listen:f,destroy:_}}function Bd(t,e,n,s=!1,r=!1){return{back:t,current:e,forward:n,replaced:s,position:window.history.length,scroll:r?ja():null}}function hE(t){const{history:e,location:n}=window,s={value:P_(t,n)},r={value:e.state};r.value||a(s.value,{back:null,current:s.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function a(d,f,m){const _=t.indexOf("#"),v=_>-1?(n.host&&document.querySelector("base")?t:t.slice(_))+d:cE()+t+d;try{e[m?"replaceState":"pushState"](f,"",v),r.value=f}catch(y){console.error(y),n[m?"replace":"assign"](v)}}function l(d,f){const m=Ne({},e.state,Bd(r.value.back,d,r.value.forward,!0),f,{position:r.value.position});a(d,m,!0),s.value=d}function u(d,f){const m=Ne({},r.value,e.state,{forward:d,scroll:ja()});a(m.current,m,!0);const _=Ne({},Bd(s.value,d,null),{position:m.position+1},f);a(d,_,!1),s.value=d}return{location:s,state:r,push:u,replace:l}}function dE(t){t=nE(t);const e=hE(t),n=uE(t,e.state,e.location,e.replace);function s(a,l=!0){l||n.pauseListeners(),history.go(a)}const r=Ne({location:"",base:t,go:s,createHref:sE.bind(null,t)},e,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>e.state.value}),r}function fE(t){return typeof t=="string"||t&&typeof t=="object"}function x_(t){return typeof t=="string"||typeof t=="symbol"}const L_=Symbol("");var Ud;(function(t){t[t.aborted=4]="aborted",t[t.cancelled=8]="cancelled",t[t.duplicated=16]="duplicated"})(Ud||(Ud={}));function Ns(t,e){return Ne(new Error,{type:t,[L_]:!0},e)}function On(t,e){return t instanceof Error&&L_ in t&&(e==null||!!(t.type&e))}const zd="[^/]+?",pE={sensitive:!1,strict:!1,start:!0,end:!0},_E=/[.+*?^${}()[\]/\\]/g;function mE(t,e){const n=Ne({},pE,e),s=[];let r=n.start?"^":"";const a=[];for(const f of t){const m=f.length?[]:[90];n.strict&&!f.length&&(r+="/");for(let _=0;_<f.length;_++){const v=f[_];let y=40+(n.sensitive?.25:0);if(v.type===0)_||(r+="/"),r+=v.value.replace(_E,"\\$&"),y+=40;else if(v.type===1){const{value:P,repeatable:T,optional:O,regexp:z}=v;a.push({name:P,repeatable:T,optional:O});const B=z||zd;if(B!==zd){y+=10;try{new RegExp(`(${B})`)}catch(R){throw new Error(`Invalid custom RegExp for param "${P}" (${B}): `+R.message)}}let A=T?`((?:${B})(?:/(?:${B}))*)`:`(${B})`;_||(A=O&&f.length<2?`(?:/${A})`:"/"+A),O&&(A+="?"),r+=A,y+=20,O&&(y+=-8),T&&(y+=-20),B===".*"&&(y+=-50)}m.push(y)}s.push(m)}if(n.strict&&n.end){const f=s.length-1;s[f][s[f].length-1]+=.7000000000000001}n.strict||(r+="/?"),n.end?r+="$":n.strict&&!r.endsWith("/")&&(r+="(?:/|$)");const l=new RegExp(r,n.sensitive?"":"i");function u(f){const m=f.match(l),_={};if(!m)return null;for(let v=1;v<m.length;v++){const y=m[v]||"",P=a[v-1];_[P.name]=y&&P.repeatable?y.split("/"):y}return _}function d(f){let m="",_=!1;for(const v of t){(!_||!m.endsWith("/"))&&(m+="/"),_=!1;for(const y of v)if(y.type===0)m+=y.value;else if(y.type===1){const{value:P,repeatable:T,optional:O}=y,z=P in f?f[P]:"";if(dn(z)&&!T)throw new Error(`Provided param "${P}" is an array but it is not repeatable (* or + modifiers)`);const B=dn(z)?z.join("/"):z;if(!B)if(O)v.length<2&&(m.endsWith("/")?m=m.slice(0,-1):_=!0);else throw new Error(`Missing required param "${P}"`);m+=B}}return m||"/"}return{re:l,score:s,keys:a,parse:u,stringify:d}}function gE(t,e){let n=0;for(;n<t.length&&n<e.length;){const s=e[n]-t[n];if(s)return s;n++}return t.length<e.length?t.length===1&&t[0]===80?-1:1:t.length>e.length?e.length===1&&e[0]===80?1:-1:0}function R_(t,e){let n=0;const s=t.score,r=e.score;for(;n<s.length&&n<r.length;){const a=gE(s[n],r[n]);if(a)return a;n++}if(Math.abs(r.length-s.length)===1){if(Hd(s))return 1;if(Hd(r))return-1}return r.length-s.length}function Hd(t){const e=t[t.length-1];return t.length>0&&e[e.length-1]<0}const vE={type:0,value:""},yE=/[a-zA-Z0-9_]/;function wE(t){if(!t)return[[]];if(t==="/")return[[vE]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(y){throw new Error(`ERR (${n})/"${f}": ${y}`)}let n=0,s=n;const r=[];let a;function l(){a&&r.push(a),a=[]}let u=0,d,f="",m="";function _(){f&&(n===0?a.push({type:0,value:f}):n===1||n===2||n===3?(a.length>1&&(d==="*"||d==="+")&&e(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:f,regexp:m,repeatable:d==="*"||d==="+",optional:d==="*"||d==="?"})):e("Invalid state to consume buffer"),f="")}function v(){f+=d}for(;u<t.length;){if(d=t[u++],d==="\\"&&n!==2){s=n,n=4;continue}switch(n){case 0:d==="/"?(f&&_(),l()):d===":"?(_(),n=1):v();break;case 4:v(),n=s;break;case 1:d==="("?n=2:yE.test(d)?v():(_(),n=0,d!=="*"&&d!=="?"&&d!=="+"&&u--);break;case 2:d===")"?m[m.length-1]=="\\"?m=m.slice(0,-1)+d:n=3:m+=d;break;case 3:_(),n=0,d!=="*"&&d!=="?"&&d!=="+"&&u--,m="";break;default:e("Unknown state");break}}return n===2&&e(`Unfinished custom RegExp for param "${f}"`),_(),l(),r}function bE(t,e,n){const s=mE(wE(t.path),n),r=Ne(s,{record:t,parent:e,children:[],alias:[]});return e&&!r.record.aliasOf==!e.record.aliasOf&&e.children.push(r),r}function EE(t,e){const n=[],s=new Map;e=jd({strict:!1,end:!0,sensitive:!1},e);function r(_){return s.get(_)}function a(_,v,y){const P=!y,T=Vd(_);T.aliasOf=y&&y.record;const O=jd(e,_),z=[T];
vendor: 9,732 bytes, line 22
22if("alias"in _){const R=typeof _.alias=="string"?[_.alias]:_.alias;for(const j of R)z.push(Vd(Ne({},T,{components:y?y.record.components:T.components,path:j,aliasOf:y?y.record:T})))}let B,A;for(const R of z){const{path:j}=R;if(v&&j[0]!=="/"){const J=v.record.path,Ae=J[J.length-1]==="/"?"":"/";R.path=v.record.path+(j&&Ae+j)}if(B=bE(R,v,O),y?y.alias.push(B):(A=A||B,A!==B&&A.alias.push(B),P&&_.name&&!$d(B)&&l(_.name)),A_(B)&&d(B),T.children){const J=T.children;for(let Ae=0;Ae<J.length;Ae++)a(J[Ae],B,y&&y.children[Ae])}y=y||B}return A?()=>{l(A)}:Lr}function l(_){if(x_(_)){const v=s.get(_);v&&(s.delete(_),n.splice(n.indexOf(v),1),v.children.forEach(l),v.alias.forEach(l))}else{const v=n.indexOf(_);v>-1&&(n.splice(v,1),_.record.name&&s.delete(_.record.name),_.children.forEach(l),_.alias.forEach(l))}}function u(){return n}function d(_){const v=IE(_,n);n.splice(v,0,_),_.record.name&&!$d(_)&&s.set(_.record.name,_)}function f(_,v){let y,P={},T,O;if("name"in _&&_.name){if(y=s.get(_.name),!y)throw Ns(1,{location:_});O=y.record.name,P=Ne(Wd(v.params,y.keys.filter(A=>!A.optional).concat(y.parent?y.parent.keys.filter(A=>A.optional):[]).map(A=>A.name)),_.params&&Wd(_.params,y.keys.map(A=>A.name))),T=y.stringify(P)}else if(_.path!=null)T=_.path,y=n.find(A=>A.re.test(T)),y&&(P=y.parse(T),O=y.record.name);else{if(y=v.name?s.get(v.name):n.find(A=>A.re.test(v.path)),!y)throw Ns(1,{location:_,currentLocation:v});O=y.record.name,P=Ne({},v.params,_.params),T=y.stringify(P)}const z=[];let B=y;for(;B;)z.unshift(B.record),B=B.parent;return{name:O,path:T,params:P,matched:z,meta:CE(z)}}t.forEach(_=>a(_));function m(){n.length=0,s.clear()}return{addRoute:a,resolve:f,removeRoute:l,clearRoutes:m,getRoutes:u,getRecordMatcher:r}}function Wd(t,e){const n={};for(const s of e)s in t&&(n[s]=t[s]);return n}function Vd(t){const e={path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:t.aliasOf,beforeEnter:t.beforeEnter,props:TE(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function TE(t){const e={},n=t.props||!1;if("component"in t)e.default=n;else for(const s in t.components)e[s]=typeof n=="object"?n[s]:n;return e}function $d(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function CE(t){return t.reduce((e,n)=>Ne(e,n.meta),{})}function jd(t,e){const n={};for(const s in t)n[s]=s in e?e[s]:t[s];return n}function IE(t,e){let n=0,s=e.length;for(;n!==s;){const a=n+s>>1;R_(t,e[a])<0?s=a:n=a+1}const r=SE(t);return r&&(s=e.lastIndexOf(r,s-1)),s}function SE(t){let e=t;for(;e=e.parent;)if(A_(e)&&R_(t,e)===0)return e}function A_({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function PE(t){const e={};if(t===""||t==="?")return e;const s=(t[0]==="?"?t.slice(1):t).split("&");for(let r=0;r<s.length;++r){const a=s[r].replace(E_," "),l=a.indexOf("="),u=Wr(l<0?a:a.slice(0,l)),d=l<0?null:Wr(a.slice(l+1));if(u in e){let f=e[u];dn(f)||(f=e[u]=[f]),f.push(d)}else e[u]=d}return e}function Zd(t){let e="";for(let n in t){const s=t[n];if(n=qb(n),s==null){s!==void 0&&(e+=(e.length?"&":"")+n);continue}(dn(s)?s.map(a=>a&&gc(a)):[s&&gc(s)]).forEach(a=>{a!==void 0&&(e+=(e.length?"&":"")+n,a!=null&&(e+="="+a))})}return e}function xE(t){const e={};for(const n in t){const s=t[n];s!==void 0&&(e[n]=dn(s)?s.map(r=>r==null?null:""+r):s==null?s:""+s)}return e}const LE=Symbol(""),qd=Symbol(""),ru=Symbol(""),ou=Symbol(""),yc=Symbol("");function _r(){let t=[];function e(s){return t.push(s),()=>{const r=t.indexOf(s);r>-1&&t.splice(r,1)}}function n(){t=[]}return{add:e,list:()=>t.slice(),reset:n}}function oi(t,e,n,s,r,a=l=>l()){const l=s&&(s.enterCallbacks[r]=s.enterCallbacks[r]||[]);return()=>new Promise((u,d)=>{const f=v=>{v===!1?d(Ns(4,{from:n,to:e})):v instanceof Error?d(v):fE(v)?d(Ns(2,{from:e,to:v})):(l&&s.enterCallbacks[r]===l&&typeof v=="function"&&l.push(v),u())},m=a(()=>t.call(s&&s.instances[r],e,n,f));let _=Promise.resolve(m);t.length<3&&(_=_.then(f)),_.catch(v=>d(v))})}function jl(t,e,n,s,r=a=>a()){const a=[];for(const l of t)for(const u in l.components){let d=l.components[u];if(!(e!=="beforeRouteEnter"&&!l.instances[u]))if(w_(d)){const m=(d.__vccOpts||d)[e];m&&a.push(oi(m,n,s,l,u,r))}else{let f=d();a.push(()=>f.then(m=>{if(!m)throw new Error(`Couldn't resolve component "${u}" at "${l.path}"`);const _=Db(m)?m.default:m;l.mods[u]=m,l.components[u]=_;const y=(_.__vccOpts||_)[e];return y&&oi(y,n,s,l,u,r)()}))}}return a}function Gd(t){const e=vt(ru),n=vt(ou),s=gt(()=>{const d=_t(t.to);return e.resolve(d)}),r=gt(()=>{const{matched:d}=s.value,{length:f}=d,m=d[f-1],_=n.matched;if(!m||!_.length)return-1;const v=_.findIndex(Os.bind(null,m));if(v>-1)return v;const y=Kd(d[f-2]);return f>1&&Kd(m)===y&&_[_.length-1].path!==y?_.findIndex(Os.bind(null,d[f-2])):v}),a=gt(()=>r.value>-1&&OE(n.params,s.value.params)),l=gt(()=>r.value>-1&&r.value===n.matched.length-1&&S_(n.params,s.value.params));function u(d={}){if(kE(d)){const f=e[_t(t.replace)?"replace":"push"](_t(t.to)).catch(Lr);return t.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>f),f}return Promise.resolve()}return{route:s,href:gt(()=>s.value.href),isActive:a,isExactActive:l,navigate:u}}function RE(t){return t.length===1?t[0]:t}const AE=Bt({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Gd,setup(t,{slots:e}){const n=Hi(Gd(t)),{options:s}=vt(ru),r=gt(()=>({[Yd(t.activeClass,s.linkActiveClass,"router-link-active")]:n.isActive,[Yd(t.exactActiveClass,s.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const a=e.default&&RE(e.default(n));return t.custom?a:Kn("a",{"aria-current":n.isExactActive?t.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},a)}}}),gs=AE;function kE(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function OE(t,e){for(const n in e){const s=e[n],r=t[n];if(typeof s=="string"){if(s!==r)return!1}else if(!dn(r)||r.length!==s.length||s.some((a,l)=>a!==r[l]))return!1}return!0}function Kd(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const Yd=(t,e,n)=>t??e??n,NE=Bt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:n}){const s=vt(yc),r=gt(()=>t.route||s.value),a=vt(qd,0),l=gt(()=>{let f=_t(a);const{matched:m}=r.value;let _;for(;(_=m[f])&&!_.components;)f++;return f}),u=gt(()=>r.value.matched[l.value]);Vt(qd,gt(()=>l.value+1)),Vt(LE,u),Vt(yc,r);const d=be();return fi(()=>[d.value,u.value,t.name],([f,m,_],[v,y,P])=>{m&&(m.instances[_]=f,y&&y!==m&&f&&f===v&&(m.leaveGuards.size||(m.leaveGuards=y.leaveGuards),m.updateGuards.size||(m.updateGuards=y.updateGuards))),f&&m&&(!y||!Os(m,y)||!v)&&(m.enterCallbacks[_]||[]).forEach(T=>T(f))},{flush:"post"}),()=>{const f=r.value,m=t.name,_=u.value,v=_&&_.components[m];if(!v)return Jd(n.default,{Component:v,route:f});const y=_.props[m],P=y?y===!0?f.params:typeof y=="function"?y(f):y:null,O=Kn(v,Ne({},P,e,{onVnodeUnmounted:z=>{z.component.isUnmounted&&(_.instances[m]=null)},ref:d}));return Jd(n.default,{Component:O,route:f})||O}}});function Jd(t,e){if(!t)return null;const n=t(e);return n.length===1?n[0]:n}const k_=NE;function ME(t){const e=EE(t.routes,t),n=t.parseQuery||PE,s=t.stringifyQuery||Zd,r=t.history,a=_r(),l=_r(),u=_r(),d=ew(ni);let f=ni;ms&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const m=Vl.bind(null,k=>""+k),_=Vl.bind(null,Kb),v=Vl.bind(null,Wr);function y(k,Z){let q,Q;return x_(k)?(q=e.getRecordMatcher(k),Q=Z):Q=k,e.addRoute(Q,q)}function P(k){const Z=e.getRecordMatcher(k);Z&&e.removeRoute(Z)}function T(){return e.getRoutes().map(k=>k.record)}function O(k){return!!e.getRecordMatcher(k)}function z(k,Z){if(Z=Ne({},Z||d.value),typeof k=="string"){const I=$l(n,k,Z.path),N=e.resolve({path:I.path},Z),D=r.createHref(I.fullPath);return Ne(I,N,{params:v(N.params),hash:Wr(I.hash),redirectedFrom:void 0,href:D})}let q;if(k.path!=null)q=Ne({},k,{path:$l(n,k.path,Z.path).path});else{const I=Ne({},k.params);for(const N in I)I[N]==null&&delete I[N];q=Ne({},k,{params:_(I)}),Z.params=_(Z.params)}const Q=e.resolve(q,Z),ke=k.hash||"";Q.params=m(v(Q.params));const w=Qb(s,Ne({},k,{hash:Zb(ke),path:Q.path})),b=r.createHref(w);return Ne({fullPath:w,hash:ke,query:s===Zd?xE(k.query):k.query||{}},Q,{redirectedFrom:void 0,href:b})}function B(k){return typeof k=="string"?$l(n,k,d.value.path):Ne({},k)}function A(k,Z){if(f!==k)return Ns(8,{from:Z,to:k})}function R(k){return Ae(k)}function j(k){return R(Ne(B(k),{replace:!0}))}function J(k){const Z=k.matched[k.matched.length-1];if(Z&&Z.redirect){const{redirect:q}=Z;let Q=typeof q=="function"?q(k):q;return typeof Q=="string"&&(Q=Q.includes("?")||Q.includes("#")?Q=B(Q):{path:Q},Q.params={}),Ne({query:k.query,hash:k.hash,params:Q.path!=null?{}:k.params},Q)}}function Ae(k,Z){const q=f=z(k),Q=d.value,ke=k.state,w=k.force,b=k.replace===!0,I=J(q);if(I)return Ae(Ne(B(I),{state:typeof I=="object"?Ne({},ke,I.state):ke,force:w,replace:b}),Z||q);const N=q;N.redirectedFrom=Z;let D;return!w&&Xb(s,Q,q)&&(D=Ns(16,{to:N,from:Q}),Ce(Q,Q,!0,!1)),(D?Promise.resolve(D):we(N,Q)).catch(M=>On(M)?On(M,2)?M:te(M):G(M,N,Q)).then(M=>
vendor: 2,372 bytes, line 22
22{if(M){if(On(M,2))return Ae(Ne({replace:b},B(M.to),{state:typeof M.to=="object"?Ne({},ke,M.to.state):ke,force:w}),Z||N)}else M=it(N,Q,!0,b,ke);return $e(N,Q,M),M})}function et(k,Z){const q=A(k,Z);return q?Promise.reject(q):Promise.resolve()}function ie(k){const Z=He.values().next().value;return Z&&typeof Z.runWithContext=="function"?Z.runWithContext(k):k()}function we(k,Z){let q;const[Q,ke,w]=DE(k,Z);q=jl(Q.reverse(),"beforeRouteLeave",k,Z);for(const I of Q)I.leaveGuards.forEach(N=>{q.push(oi(N,k,Z))});const b=et.bind(null,k,Z);return q.push(b),le(q).then(()=>{q=[];for(const I of a.list())q.push(oi(I,k,Z));return q.push(b),le(q)}).then(()=>{q=jl(ke,"beforeRouteUpdate",k,Z);for(const I of ke)I.updateGuards.forEach(N=>{q.push(oi(N,k,Z))});return q.push(b),le(q)}).then(()=>{q=[];for(const I of w)if(I.beforeEnter)if(dn(I.beforeEnter))for(const N of I.beforeEnter)q.push(oi(N,k,Z));else q.push(oi(I.beforeEnter,k,Z));return q.push(b),le(q)}).then(()=>(k.matched.forEach(I=>I.enterCallbacks={}),q=jl(w,"beforeRouteEnter",k,Z,ie),q.push(b),le(q))).then(()=>{q=[];for(const I of l.list())q.push(oi(I,k,Z));return q.push(b),le(q)}).catch(I=>On(I,8)?I:Promise.reject(I))}function $e(k,Z,q){u.list().forEach(Q=>ie(()=>Q(k,Z,q)))}function it(k,Z,q,Q,ke){const w=A(k,Z);if(w)return w;const b=Z===ni,I=ms?history.state:{};q&&(Q||b?r.replace(k.fullPath,Ne({scroll:b&&I&&I.scroll},ke)):r.push(k.fullPath,ke)),d.value=k,Ce(k,Z,q,b),te()}let jt;function St(){jt||(jt=r.listen((k,Z,q)=>{if(!Se.listening)return;const Q=z(k),ke=J(Q);if(ke){Ae(Ne(ke,{replace:!0,force:!0}),Q).catch(Lr);return}f=Q;const w=d.value;ms&&aE(Fd(w.fullPath,q.delta),ja()),we(Q,w).catch(b=>On(b,12)?b:On(b,2)?(Ae(Ne(B(b.to),{force:!0}),Q).then(I=>{On(I,20)&&!q.delta&&q.type===Vr.pop&&r.go(-1,!1)}).catch(Lr),Promise.reject()):(q.delta&&r.go(-q.delta,!1),G(b,Q,w))).then(b=>{b=b||it(Q,w,!1),b&&(q.delta&&!On(b,8)?r.go(-q.delta,!1):q.type===Vr.pop&&On(b,20)&&r.go(-1,!1)),$e(Q,w,b)}).catch(Lr)}))}let Jn=_r(),Pe=_r(),Te;function G(k,Z,q){te(k);const Q=Pe.list();return Q.length?Q.forEach(ke=>ke(k,Z,q)):console.error(k),Promise.reject(k)}function Zt(){return Te&&d.value!==ni?Promise.resolve():new Promise((k,Z)=>{Jn.add([k,Z])})}function te(k){return Te||(Te=!k,St(),Jn.list().forEach(([Z,q])=>k?q(k):Z()),Jn.reset()),k}function Ce(k,Z,q,Q){const{scrollBehavior:ke}=t;if(!ms||!ke)return Promise.resolve();
22const w=!q&&lE(Fd(k.fullPath,0))||(Q||!q)&&history.state&&history.state.scroll||null;return hn().then(()=>ke(k,Z,w)).then(b=>b&&oE(b)).catch(b=>G(b,k,Z))}const Be=k=>r.go(k);let tt;const He=new Set,Se={currentRoute:d,listening:!0,addRoute:y,removeRoute:P,clearRoutes:e.clearRoutes,hasRoute:O,getRoutes:T,resolve:z,options:t,push:R,replace:j,go:Be,back:()=>Be(-1),forward:()=>Be(1),beforeEach:a.add,beforeResolve:l.add,afterEach:u.add,onError:Pe.add,isReady:Zt,install(k){const Z=this;k.component("RouterLink",gs),k.component("RouterView",k_),k.config.globalProperties.$router=Z,Object.defineProperty(k.config.globalProperties,"$route",{enumerable:!0,get:()=>_t(d)}),ms&&!tt&&d.value===ni&&(tt=!0,R(r.location).catch(ke=>{}));const q={};for(const ke in ni)Object.defineProperty(q,ke,{get:()=>d.value[ke],enumerable:!0});k.provide(ru,Z),k.provide(ou,Dp(q)),k.provide(yc,d);const Q=k.unmount;He.add(k),k.unmount=function(){He.delete(k),He.size<1&&(f=ni,jt&&jt(),jt=null,d.value=ni,tt=!1,Te=!1),Q()}}};function le(k){return k.reduce((Z,q)=>Z.then(()=>ie(q)),Promise.resolve())}return Se}function DE(t,e){const n=[],s=[],r=[],a=Math.max(e.matched.length,t.matched.length);for(let l=0;l<a;l++){const u=e.matched[l];u&&(t.matched.find(f=>Os(f,u))?s.push(u):n.push(u));const d=t.matched[l];d&&(e.matched.find(f=>Os(f,d))||r.push(d))}return[n,s,r]}function FE(t){return vt(ou)}const BE={class:"gf-nav"},UE={class:"gf-nav-links"},zE={key:0,class:"gf-footer"},HE=Bt({__name:"App",setup(t){const e=FE();return(n,s)=>(fe(),_e(Et,null,[C("nav",BE,[Qe(_t(gs),{class:"gf-nav-brand",to:"/",tabindex:"-1","aria-label":"é¦é "},{default:Fn(()=>s[0]||(s[0]=[C("span",{class:"brand-icon"},"ðª´",-1),C("span",{class:"brand-name"},"ç¡éº©è³ªå°ç£",-1)])),_:1}),C("div",UE,[Qe(_t(gs),{class:"gf-nav-link",to:"/"},{default:Fn(()=>s[1]||(s[1]=[br("實é«åº")])),_:1}),Qe(_t(gs),{class:"gf-nav-link",to:"/web-stores"},{default:Fn(()=>s[2]||(s[2]=[br("網路åº")])),_:1}),Qe(_t(gs),{class:"gf-nav-link",to:"/collaborate"},{default:Fn(()=>s[3]||(s[3]=[br("æ°å¢åºå®¶")])),_:1}),Qe(_t(gs),{class:"gf-nav-link",to:"/review"},{default:Fn(()=>s[4]||(s[4]=[br("æ ¡å°è³æ")])),_:1})])]),Qe(_t(k_)),_t(e).path!=="/"?(fe(),_e("footer",zE,s[5]||(s[5]=[C("div",{class:"gf-footer-inner"},[C("span",null,"æ¬ç«è³æçºéæ¾åä½ï¼æ¡è¿ååæ ¡å°ç¶è·ã"),C("a",{href:"https://github.com/bestian/gf-tw",target:"_blank",rel:"noopener noreferrer"}," åå§ç¢¼ â ")],-1)]))):ot("",!0)],64))}}),Za=(t,e)=>{const n=t.__vccOpts||t;for(const[s,r]of e)n[s]=r;return n},WE=Za(HE,[["__scopeId","data-v-6a57f1ab"]]),VE="modulepreload",$E=function(t){return"/"+t},Qd={},en=function(e,n,s){let r=Promise.resolve();if(n&&n.length>0){let l=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),d=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));r=l(n.map(f=>{if(f=$E(f),f in Qd)return;Qd[f]=!0;const m=f.endsWith(".css"),_=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${_}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":VE,m||(v.as="script"),v.crossOrigin="",v.href=f,d&&v.setAttribute("nonce",d),document.head.appendChild(v),m)return new Promise((y,P)=>{v.addEventListener("load",y),v.addEventListener("error",()=>P(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return r.then(l=>{for(const u of l||[])u.status==="rejected"&&a(u.reason);return e().catch(a)})},Xd=(t,e)=>{for(const n of Object.keys(e))t.on(n,e[n])},O_=t=>{for(const e of Object.keys(t)){const n=t[e];n&&ai(n.cancel)&&n.cancel()}},jE=t=>!t||typeof t.charAt!="function"?t:t.charAt(0).toUpperCase()+t.slice(1),ai=t=>typeof t=="function",Xi=(t,e,n)=>{for(const s in n){const r="set"+jE(s);t[r]?fi(()=>n[s],(a,l)=>{t[r](a,l)}):e[r]&&fi(()=>n[s],a=>{e[r](a)})}},es=(t,e,n={})=>{const s={...n};for(const r in t){const a=e[r],l=t[r];a&&(a&&a.custom===!0||l!==void 0&&(s[r]=l))}return s},$s=t=>{const e={},n={};for(const s in t)if(s.startsWith("on")&&!s.startsWith("onUpdate")&&s!=="onReady"){const r=s.slice(2).toLocaleLowerCase();e[r]=t[s]}else n[s]=t[s];return{listeners:e,attrs:n}},ZE=async t=>{const e=await Promise.all([en(()=>import("./marker-icon-2x-D4k_ikNW.js"),[]),en(()=>import("./marker-icon-C2eJqgqv.js"),[]),en(()=>import("./marker-shadow-DU6CIJ0p.js"),[])]);delete t.Default.prototype._getIconUrl,t.Default.mergeOptions({iconRetinaUrl:e[0].default,iconUrl:e[1].default,shadowUrl:e[2].default})},Fo=t=>{const e=be((...s)=>console.warn(`Method ${t} has been invoked without being replaced`)),n=(...s)=>e.value(...s);return n.wrapped=e,Vt(t,n),n},Bo=(t,e)=>t.wrapped.value=e,Hn=typeof self=="object"&&self.self===self&&self||typeof global=="object"&&global.global===global&&global||globalThis,cn=t=>{const e=vt(t);if(e===void 0)throw new Error(`Attempt to inject ${t.description} before it was provided.`);return e},ts=Symbol("useGlobalLeaflet"),io=Symbol("addLayer"),N_=Symbol("removeLayer"),M_=Symbol("registerControl"),qE=Symbol("registerLayerControl"),D_=Symbol("canSetParentHtml"),F_=Symbol("setParentHtml"),B_=Symbol("setIcon"),U_=Symbol("bindPopup"),GE=Symbol("bindTooltip"),z_=Symbol("unbindPopup"),KE=Symbol("unbindTooltip"),so={options:{type:Object,default:()=>({}),custom:!0}},ro=t=>({options:t.options,methods:{}}),js={...so,pane:{type:String},attribution:{type:String},name:{type:String,custom:!0},layerType:{type:String,custom:!0},visible:{type:Boolean,custom:!0,default:!0}},H_=(t,e,n)=>{const s=cn(io),r=cn(N_),{options:a,methods:l}=ro(t),u=es(t,js,a),d=()=>s({leafletObject:e.value}),f=()=>r({leafletObject:e.value}),m={...l,setAttribution(_){f(),e.value.options.attribution=_,t.visible&&d()},setName(){f(),t.visible&&d()},setLayerType(){f(),t.visible&&d()},setVisible(_){e.value&&(_?d():f())},bindPopup(_){if(!e.value||!ai(e.value.bindPopup)){console.warn("Attempt to bind popup before bindPopup method available on layer.");return}e.value.bindPopup(_)},bindTooltip(_){if(!e.value||!ai(e.value.bindTooltip)){console.warn("Attempt to bind tooltip before bindTooltip method available on layer.");return}e.value.bindTooltip(_)}
22,unbindTooltip(){e.value&&(ai(e.value.closeTooltip)&&e.value.closeTooltip(),ai(e.value.unbindTooltip)&&e.value.unbindTooltip())},unbindPopup(){e.value&&(ai(e.value.closePopup)&&e.value.closePopup(),ai(e.value.unbindPopup)&&e.value.unbindPopup())},updateVisibleProp(_){n.emit("update:visible",_)}};return Vt(U_,m.bindPopup),Vt(GE,m.bindTooltip),Vt(z_,m.unbindPopup),Vt(KE,m.unbindTooltip),to(()=>{m.unbindPopup(),m.unbindTooltip(),f()}),{options:u,methods:m}},YE=(t,e)=>{if(t&&e.default)return Kn("div",{style:{display:"none"}},e.default())},JE={...js,interactive:{type:Boolean,default:void 0},bubblingMouseEvents:{type:Boolean,default:void 0}},W_={...JE,stroke:{type:Boolean,default:void 0},color:{type:String},weight:{type:Number},opacity:{type:Number},lineCap:{type:String},lineJoin:{type:String},dashArray:{type:String},dashOffset:{type:String},fill:{type:Boolean,default:void 0},fillColor:{type:String},fillOpacity:{type:Number},fillRule:{type:String},className:{type:String}},QE={...W_,radius:{type:Number},latLng:{type:[Object,Array],required:!0,custom:!0}};({...QE});const Zs={...so,position:{type:String}},XE=(t,e)=>{const{options:n,methods:s}=ro(t),r=es(t,Zs,n),a={...s,setPosition(l){e.value&&e.value.setPosition(l)}};return to(()=>{e.value&&e.value.remove()}),{options:r,methods:a}},eT=t=>t.default?Kn("div",{ref:"root"},t.default()):null;({...Zs});({...Zs});({...Zs});({...Zs});({...Zs});const V_={...js};({...V_});({...V_});const au={...js,opacity:{type:Number},zIndex:{type:Number},tileSize:{type:[Number,Array,Object]},noWrap:{type:Boolean,default:void 0},minZoom:{type:Number},maxZoom:{type:Number},className:{type:String}},$_=(t,e,n)=>{const{options:s,methods:r}=H_(t,e,n),a=es(t,au,s),l={...r,setTileComponent(){var u;(u=e.value)==null||u.redraw()}};return to(()=>{e.value.off()}),{options:a,methods:l}},tT=(t,e,n,s)=>t.extend({initialize(r){this.tileComponents={},this.on("tileunload",this._unloadTile),n.setOptions(this,r)},createTile(r){const a=this._tileCoordsToKey(r);this.tileComponents[a]=e.create("div");const l=Kn({setup:s,props:["coords"]},{coords:r});return kb(l,this.tileComponents[a]),this.tileComponents[a]},_unloadTile(r){const a=this._tileCoordsToKey(r.coords);this.tileComponents[a]&&(this.tileComponents[a].innerHTML="",this.tileComponents[a]=void 0)}});({...au});const ef={iconUrl:{type:String},iconRetinaUrl:{type:String},iconSize:{type:[Object,Array]},iconAnchor:{type:[Object,Array]},popupAnchor:{type:[Object,Array]},tooltipAnchor:{type:[Object,Array]},shadowUrl:{type:String},shadowRetinaUrl:{type:String},shadowSize:{type:[Object,Array]},shadowAnchor:{type:[Object,Array]},bgPos:{type:[Object,Array]},className:{type:String}};({...ef,...so});({...js});function j_(t,e,n){var s,r,a;e===void 0&&(e=50),n===void 0&&(n={});var l=(s=n.isImmediate)!=null&&s,u=(r=n.callback)!=null&&r,d=n.maxWait,f=Date.now(),m=[];function _(){if(d!==void 0){var y=Date.now()-f;if(y+e>=d)return d-y}return e}var v=function(){var y=[].slice.call(arguments),P=this;return new Promise(function(T,O){var z=l&&a===void 0;if(a!==void 0&&clearTimeout(a),a=setTimeout(function(){if(a=void 0,f=Date.now(),!l){var A=t.apply(P,y);u&&u(A),m.forEach(function(R){return(0,R.resolve)(A)}),m=[]}},_()),z){var B=t.apply(P,y);return u&&u(B),T(B)}m.push({resolve:T,reject:O})})};return v.cancel=function(y){a!==void 0&&clearTimeout(a),m.forEach(function(P){return(0,P.reject)(y)}),m=[]},v}const tf={...so,center:{type:[Object,Array]},bounds:{type:[Array,Object]},maxBounds:{type:[Array,Object]},zoom:{type:Number},minZoom:{type:Number},maxZoom:{type:Number},paddingBottomRight:{type:[Object,Array]},paddingTopLeft:{type:Object},padding:{type:Object},worldCopyJump:{type:Boolean,default:void 0},crs:{type:[String,Object]},maxBoundsViscosity:{type:Number},inertia:{type:Boolean,default:void 0},inertiaDeceleration:{type:Number},inertiaMaxSpeed:{type:Number},easeLinearity:{type:Number},zoomAnimation:{type:Boolean,default:void 0},zoomAnimationThreshold:{type:Number},fadeAnimation:{type:Boolean,default:void 0},markerZoomAnimation:{type:Boolean,default:void 0},noBlockingAnimations:{type:Boolean,default:void 0},useGlobalLeaflet:{type:Boolean,default:!0,custom:!0}},nT=Bt({inheritAttrs:!1,emits:["ready","update:zoom","update:center","update:bounds"],props:tf,setup(t,e){const n=be(),s=Hi({ready:!1,layersToAdd:[],layersInControl:[]}),{options:r}=ro(t),a=es(t,tf,r),{listeners:l,attrs:u}=$s(e.attrs),d=Fo(io),f=Fo(N_),m=Fo(M_),_=Fo(qE);Vt(ts,t.useGlobalLeaflet);const v=gt(()=>{const z={};return t.noBlockingAnimations&&(z.animate=!1),z}),y=gt(()=>{const z=v.value;return t.padding&&(z.padding=t.padding),t.paddingTopLeft&&(z.paddingTopLeft=t.paddingTopLeft),t.paddingBottomRight&&(z.paddingBottomRight=t.paddingBottomRight),z}),P={moveend:j_(z=>{s.leafletRef&&(e.emit("update:zoom",s.leafletRef.getZoom()),e.emit("update:center",s.leafletRef.getCenter()),e.emit("update:bounds",s.leafletRef.getBounds()))}),overlayadd(z){const B=s.layersInControl.find(A=>A.name===z.name);B&&B.updateVisibleProp(!0)},overlayremove(z){const B=s.layersInControl.find(A=>A.name===z.name);B&&B.updateVisibleProp(!1)}};fn(async()=>{t.useGlobalLeaflet&&(Hn.L=Hn.L||await en(()=>Promise.resolve().then(()=>wT),void 0));const{map:z,CRS:B,Icon:A,latLngBounds:R,latLng:j,stamp:J}=t.useGlobalLeaflet?Hn.L:await en(()=>import("./leaflet-src.esm-HdBnhJze.js"),[]);try{a.beforeMapMount&&await a.beforeMapMount()}catch(ie){console.error(`The following error occurred running the provided beforeMapMount hook ${ie.message}`)}await ZE(A);const Ae=typeof a.crs=="string"?B[a.crs]:a.crs;a.crs=Ae||B.EPSG3857;const et={addLayer(ie){ie.layerType!==void 0&&(s.layerControl===void 0?s.layersToAdd.push(ie):s.layersInControl.find(we=>J(we.leafletObject)===J(ie.leafletObject))||(s.layerControl.addLayer(ie),s.layersInControl.push(ie))),ie.visible!==!1&&s.leafletRef.addLayer(ie.leafletObject)},removeLayer(ie){ie.layerType!==void 0&&(s.layerControl===void 0?s.layersToAdd=s.layersToAdd.filter(we=>we.name!==ie.name):(s.layerControl.removeLayer(ie.leafletObject),s.layersInControl
22=s.layersInControl.filter(we=>J(we.leafletObject)!==J(ie.leafletObject)))),s.leafletRef.removeLayer(ie.leafletObject)},registerLayerControl(ie){s.layerControl=ie,s.layersToAdd.forEach(we=>{s.layerControl.addLayer(we)}),s.layersToAdd=[],m(ie)},registerControl(ie){s.leafletRef.addControl(ie.leafletObject)},setZoom(ie){const we=s.leafletRef.getZoom();ie!==we&&s.leafletRef.setZoom(ie,v.value)},setCrs(ie){const we=s.leafletRef.getBounds();s.leafletRef.options.crs=ie,s.leafletRef.fitBounds(we,{animate:!1,padding:[0,0]})},fitBounds(ie){s.leafletRef.fitBounds(ie,y.value)},setBounds(ie){if(!ie)return;const we=R(ie);we.isValid()&&!(s.lastSetBounds||s.leafletRef.getBounds()).equals(we,0)&&(s.lastSetBounds=we,s.leafletRef.fitBounds(we))},setCenter(ie){if(ie==null)return;const we=j(ie),$e=s.lastSetCenter||s.leafletRef.getCenter();($e.lat!==we.lat||$e.lng!==we.lng)&&(s.lastSetCenter=we,s.leafletRef.panTo(we,v.value))}};Bo(d,et.addLayer),Bo(f,et.removeLayer),Bo(m,et.registerControl),Bo(_,et.registerLayerControl),s.leafletRef=Qi(z(n.value,a)),Xi(et,s.leafletRef,t),Xd(s.leafletRef,P),Xd(s.leafletRef,l),s.ready=!0,hn(()=>e.emit("ready",s.leafletRef))}),Ha(()=>{O_(P),s.leafletRef&&(s.leafletRef.off(),s.leafletRef.remove())});const T=gt(()=>s.leafletRef),O=gt(()=>s.ready);return{root:n,ready:O,leafletObject:T,attrs:u}},render({attrs:t}){return t.style||(t.style={}),t.style.width||(t.style.width="100%"),t.style.height||(t.style.height="100%"),Kn("div",{...t,ref:"root"},this.ready&&this.$slots.default?this.$slots.default():{})}}),iT=["Symbol(Comment)","Symbol(Text)"],sT=["LTooltip","LPopup"],Z_={...js,draggable:{type:Boolean,default:void 0},icon:{type:[Object]},zIndexOffset:{type:Number},latLng:{type:[Object,Array],custom:!0,required:!0}},rT=(t,e,n)=>{const{options:s,methods:r}=H_(t,e,n),a=es(t,Z_,s),l={...r,setDraggable(u){e.value.dragging&&(u?e.value.dragging.enable():e.value.dragging.disable())},latLngSync(u){n.emit("update:latLng",u.latlng),n.emit("update:lat-lng",u.latlng)},setLatLng(u){if(u!=null&&e.value){const d=e.value.getLatLng();(!d||!d.equals(u))&&e.value.setLatLng(u)}}};return{options:a,methods:l}},oT=(t,e)=>{const n=e.slots.default&&e.slots.default();return n&&n.length&&n.some(aT)};function aT(t){return!(iT.includes(t.type.toString())||sT.includes(t.type.name))}const lT=Bt({name:"LMarker",props:Z_,setup(t,e){const n=be(),s=be(!1),r=vt(ts),a=cn(io);Vt(D_,()=>{var f;return!!((f=n.value)!=null&&f.getElement())}),Vt(F_,f=>{var m,_;const v=ai((m=n.value)==null?void 0:m.getElement)&&((_=n.value)==null?void 0:_.getElement());v&&(v.innerHTML=f)}),Vt(B_,f=>{var m;return((m=n.value)==null?void 0:m.setIcon)&&n.value.setIcon(f)});const{options:l,methods:u}=rT(t,n,e),d={moveHandler:j_(u.latLngSync)};return fn(async()=>{const{marker:f,divIcon:m}=r?Hn.L:await en(()=>import("./leaflet-src.esm-HdBnhJze.js"),[]);oT(l,e)&&(l.icon=m({className:""})),n.value=Qi(f(t.latLng,l));const{listeners:_}=$s(e.attrs);n.value.on(_),n.value.on("move",d.moveHandler),Xi(u,n.value,t),a({...t,...u,leafletObject:n.value}),s.value=!0,hn(()=>e.emit("ready",n.value))}),Ha(()=>O_(d)),{ready:s,leafletObject:n}},render(){return YE(this.ready,this.$slots)}}),cT={...W_,smoothFactor:{type:Number},noClip:{type:Boolean,default:void 0},latLngs:{type:Array,required:!0,custom:!0}},nf={...cT},q_={...so,content:{type:String,default:null}},uT=(t,e)=>{const{options:n,methods:s}=ro(t),r={...s,setContent(a){e.value&&a!==null&&a!==void 0&&e.value.setContent(a)}};return{options:n,methods:r}},hT=t=>t.default?Kn("div",{ref:"root"},t.default()):null,dT={...q_,latLng:{type:[Object,Array],default:()=>[]}},fT=(t,e)=>{const{options:n,methods:s}=uT(t,e);return{options:n,methods:s}},pT=Bt({name:"LPopup",props:dT,setup(t,e){const n=be(),s=be(null),r=vt(ts),a=cn(U_),l=cn(z_),{options:u,methods:d}=fT(t,n);return fn(async()=>{const{popup:f}=r?Hn.L:await en(()=>import("./leaflet-src.esm-HdBnhJze.js"),[]);n.value=Qi(f(u)),t.latLng!==void 0&&n.value.setLatLng(t.latLng),Xi(d,n.value,t);const{listeners:m}=$s(e.attrs);n.value.on(m),n.value.setContent(t.content||s.value||""),a(n.value),hn(()=>e.emit("ready",n.value))}),Ha(()=>{l()}),{root:s,leafletObject:n}},render(){return hT(this.$slots)}});({...nf,latLngs:{...nf.latLngs}});const lu={...au,tms:{type:Boolean,default:void 0}
22,subdomains:{type:[String,Array],validator:t=>typeof t=="string"?!0:Array.isArray(t)?t.every(e=>typeof e=="string"):!1},detectRetina:{type:Boolean,default:void 0},url:{type:String,required:!0,custom:!0}},_T=(t,e,n)=>{const{options:s,methods:r}=$_(t,e,n),a=es(t,lu,s),l={...r};return{options:a,methods:l}},mT=Bt({props:lu,setup(t,e){const n=be(),s=vt(ts),r=cn(io),{options:a,methods:l}=_T(t,n,e);return fn(async()=>{const{tileLayer:u}=s?Hn.L:await en(()=>import("./leaflet-src.esm-HdBnhJze.js"),[]);n.value=Qi(u(t.url,a));const{listeners:d}=$s(e.attrs);n.value.on(d),Xi(l,n.value,t),r({...t,...l,leafletObject:n.value}),hn(()=>e.emit("ready",n.value))}),{leafletObject:n}},render(){return null}});({...q_});({...lu});function gT(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Er={exports:{}};/* @preserve 23 * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com 24 * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade 25 */var vT=Er.exports,sf;function yT(){return sf||(sf=1,function(t,e){(function(n,s){s(e)})(vT,function(n){var s="1.9.4";function r(i){var o,c,h,p;for(c=1,h=arguments.length;c<h;c++){p=arguments[c];for(o in p)i[o]=p[o]}return i}var a=Object.create||function(){function i(){}return function(o){return i.prototype=o,new i}}();function l(i,o){var c=Array.prototype.slice;if(i.bind)return i.bind.apply(i,c.call(arguments,1));var h=c.call(arguments,2);return function(){return i.apply(o,h.length?h.concat(c.call(arguments)):arguments)}}var u=0;function d(i){return"_leaflet_id"in i||(i._leaflet_id=++u),i._leaflet_id}function f(i,o,c){var h,p,g,E;return E=function(){h=!1,p&&(g.apply(c,p),p=!1)},g=function(){h?p=arguments:(i.apply(c,arguments),setTimeout(E,o),h=!0)},g}function m(i,o,c){var h=o[1],p=o[0],g=h-p;return i===h&&c?i:((i-p)%g+g)%g+p}function _(){return!1}function v(i,o){if(o===!1)return i;var c=Math.pow(10,o===void 0?6:o);return Math.round(i*c)/c}function y(i){return i.trim?i.trim():i.replace(/^\s+|\s+$/g,"")}function P(i){return y(i).split(/\s+/)}function T(i,o){Object.prototype.hasOwnProperty.call(i,"options")||(i.options=i.options?a(i.options):{});for(var c in o)i.options[c]=o[c];return i.options}function O(i,o,c){var h=[];for(var p in i)h.push(encodeURIComponent(c?p.toUpperCase():p)+"="+encodeURIComponent(i[p]));return(!o||o.indexOf("?")===-1?"?":"&")+h.join("&")}var z=/\{ *([\w_ -]+) *\}/g;function B(i,o){return i.replace(z,function(c,h){var p=o[h];if(p===void 0)throw new Error("No value provided for variable "+c);return typeof p=="function"&&(p=p(o)),p})}var A=Array.isArray||function(i){return Object.prototype.toString.call(i)==="[object Array]"};function R(i,o){for(var c=0;c<i.length;c++)if(i[c]===o)return c;return-1}var j="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function J(i){return window["webkit"+i]||window["moz"+i]||window["ms"+i]}var Ae=0;function et(i){var o=+new Date,c=Math.max(0,16-(o-Ae));return Ae=o+c,window.setTimeout(i,c)}var ie=window.requestAnimationFrame||J("RequestAnimationFrame")||et,we=window.cancelAnimationFrame||J("CancelAnimationFrame")||J("CancelRequestAnimationFrame")||function(i){window.clearTimeout(i)};function $e(i,o,c){if(c&&ie===et)i.call(o);else return ie.call(window,l(i,o))}function it(i){i&&we.call(window,i)}var jt={__proto__:null,extend:r,create:a,bind:l,get lastId(){return u},stamp:d,throttle:f,wrapNum:m,falseFn:_,formatNum:v,trim:y,splitWords:P,setOptions:T,getParamString:O,template:B,isArray:A,indexOf:R,emptyImageUrl:j,requestFn:ie,cancelFn:we,requestAnimFrame:$e,cancelAnimFrame:it};function St(){}St.extend=function(i){var o=function(){T(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},c=o.__super__=this.prototype,h=a(c);h.constructor=o,o.prototype=h;for(var p in this)Object.prototype.hasOwnProperty.call(this,p)&&p!=="prototype"&&p!=="__super__"&&(o[p]=this[p]);return i.statics&&r(o,i.statics),i.includes&&(Jn(i.includes),r.apply(null,[h].concat(i.includes))),r(h,i),delete h.statics,delete h.includes,h.options&&(h.options=c.options?a(c.options):{},r(h.options,i.options)),h._initHooks=[],h.callInitHooks=function(){if(!this._initHooksCalled){c.callInitHooks&&c.callInitHooks.call(this),this._initHooksCalled=!0;for(var g=0,E=h._initHooks.length;g<E;g++)h._initHooks[g].call(this)}},o},St.include=function(i){var o=this.prototype.options;
25return r(this.prototype,i),i.options&&(this.prototype.options=o,this.mergeOptions(i.options)),this},St.mergeOptions=function(i){return r(this.prototype.options,i),this},St.addInitHook=function(i){var o=Array.prototype.slice.call(arguments,1),c=typeof i=="function"?i:function(){this[i].apply(this,o)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(c),this};function Jn(i){if(!(typeof L>"u"||!L||!L.Mixin)){i=A(i)?i:[i];for(var o=0;o<i.length;o++)i[o]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var Pe={on:function(i,o,c){if(typeof i=="object")for(var h in i)this._on(h,i[h],o);else{i=P(i);for(var p=0,g=i.length;p<g;p++)this._on(i[p],o,c)}return this},off:function(i,o,c){if(!arguments.length)delete this._events;else if(typeof i=="object")for(var h in i)this._off(h,i[h],o);else{i=P(i);for(var p=arguments.length===1,g=0,E=i.length;g<E;g++)p?this._off(i[g]):this._off(i[g],o,c)}return this},_on:function(i,o,c,h){if(typeof o!="function"){console.warn("wrong listener type: "+typeof o);return}if(this._listens(i,o,c)===!1){c===this&&(c=void 0);var p={fn:o,ctx:c};h&&(p.once=!0),this._events=this._events||{},this._events[i]=this._events[i]||[],this._events[i].push(p)}},_off:function(i,o,c){var h,p,g;if(this._events&&(h=this._events[i],!!h)){if(arguments.length===1){if(this._firingCount)for(p=0,g=h.length;p<g;p++)h[p].fn=_;delete this._events[i];return}if(typeof o!="function"){console.warn("wrong listener type: "+typeof o);return}var E=this._listens(i,o,c);if(E!==!1){var S=h[E];this._firingCount&&(S.fn=_,this._events[i]=h=h.slice()),h.splice(E,1)}}},fire:function(i,o,c){if(!this.listens(i,c))return this;var h=r({},o,{type:i,target:this,sourceTarget:o&&o.sourceTarget||this});if(this._events){var p=this._events[i];if(p){this._firingCount=this._firingCount+1||1;for(var g=0,E=p.length;g<E;g++){var S=p[g],x=S.fn;S.once&&this.off(i,x,S.ctx),x.call(S.ctx||this,h)}this._firingCount--}}return c&&this._propagateEvent(h),this},listens:function(i,o,c,h){typeof i!="string"&&console.warn('"string" type argument expected');var p=o;typeof o!="function"&&(h=!!o,p=void 0,c=void 0);var g=this._events&&this._events[i];if(g&&g.length&&this._listens(i,p,c)!==!1)return!0;if(h){for(var E in this._eventParents)if(this._eventParents[E].listens(i,o,c,h))return!0}return!1},_listens:function(i,o,c){if(!this._events)return!1;var h=this._events[i]||[];if(!o)return!!h.length;c===this&&(c=void 0);for(var p=0,g=h.length;p<g;p++)if(h[p].fn===o&&h[p].ctx===c)return p;return!1},once:function(i,o,c){if(typeof i=="object")for(var h in i)this._on(h,i[h],o,!0);else{i=P(i);for(var p=0,g=i.length;p<g;p++)this._on(i[p],o,c,!0)}return this},addEventParent:function(i){return this._eventParents=this._eventParents||{},this._eventParents[d(i)]=i,this},removeEventParent:function(i){return this._eventParents&&delete this._eventParents[d(i)],this},_propagateEvent:function(i){for(var o in this._eventParents)this._eventParents[o].fire(i.type,r({layer:i.target,propagatedFrom:i.target},i),!0)}};Pe.addEventListener=Pe.on,Pe.removeEventListener=Pe.clearAllEventListeners=Pe.off,Pe.addOneTimeEventListener=Pe.once,Pe.fireEvent=Pe.fire,Pe.hasEventListeners=Pe.listens;var Te=St.extend(Pe);function G(i,o,c){this.x=c?Math.round(i):i,this.y=c?Math.round(o):o}var Zt=Math.trunc||function(i){return i>0?Math.floor(i):Math.ceil(i)};G.prototype={clone:function(){return new G(this.x,this.y)},add:function(i){return this.clone()._add(te(i))},_add:function(i){return this.x+=i.x,this.y+=i.y,this},subtract:function(i){return this.clone()._subtract(te(i))},_subtract:function(i){return this.x-=i.x,this.y-=i.y,this},divideBy:function(i){return this.clone()._divideBy(i)},_divideBy:function(i){return this.x/=i,this.y/=i,this},multiplyBy:function(i){return this.clone()._multiplyBy(i)},_multiplyBy:function(i){return this.x*=i,this.y*=i,this},scaleBy:function(i){return new G(this.x*i.x,this.y*i.y)},unscaleBy:function(i){return new G(this.x/i.x,this.y/i.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=Zt(this.x),this.y=Zt(this.y),this},distanceTo:function(i){i=te(i);var o=i.x-this.x,c=i.y-this.y;return Math.sqrt(o*o+c*c)},equals:function(i){return i=te(i),i.x===this.x&&i.y===this.y},contains:function(i){return i=te(i),Math.abs(i.x)<=Math.abs(this.x)&&Math.abs(i.y)<=Math.abs(this.y)},toString:function(){return"Point("+v(this.x)+", "+v(this.y)+")"}};function te(i,o,c){return i instanceof G?i:A(i)?new G(i[0],i[1]):i==null?i:typeof i=="object"&&"x"in i&&"y"in i?new G(i.x,i.y):new G(i,o,c)}function Ce(i,o){if(i)for(var c=o?[i,o]:i,h=0,p=c.length;h<p;h++)this.extend(c[h])}Ce.prototype={extend:function(i){var o,c;if(!i)return this;if(i instanceof G||typeof i[0]=="number"||"x"in i)o=c=te(i);
25else if(i=Be(i),o=i.min,c=i.max,!o||!c)return this;return!this.min&&!this.max?(this.min=o.clone(),this.max=c.clone()):(this.min.x=Math.min(o.x,this.min.x),this.max.x=Math.max(c.x,this.max.x),this.min.y=Math.min(o.y,this.min.y),this.max.y=Math.max(c.y,this.max.y)),this},getCenter:function(i){return te((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,i)},getBottomLeft:function(){return te(this.min.x,this.max.y)},getTopRight:function(){return te(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(i){var o,c;return typeof i[0]=="number"||i instanceof G?i=te(i):i=Be(i),i instanceof Ce?(o=i.min,c=i.max):o=c=i,o.x>=this.min.x&&c.x<=this.max.x&&o.y>=this.min.y&&c.y<=this.max.y},intersects:function(i){i=Be(i);var o=this.min,c=this.max,h=i.min,p=i.max,g=p.x>=o.x&&h.x<=c.x,E=p.y>=o.y&&h.y<=c.y;return g&&E},overlaps:function(i){i=Be(i);var o=this.min,c=this.max,h=i.min,p=i.max,g=p.x>o.x&&h.x<c.x,E=p.y>o.y&&h.y<c.y;return g&&E},isValid:function(){return!!(this.min&&this.max)},pad:function(i){var o=this.min,c=this.max,h=Math.abs(o.x-c.x)*i,p=Math.abs(o.y-c.y)*i;return Be(te(o.x-h,o.y-p),te(c.x+h,c.y+p))},equals:function(i){return i?(i=Be(i),this.min.equals(i.getTopLeft())&&this.max.equals(i.getBottomRight())):!1}};function Be(i,o){return!i||i instanceof Ce?i:new Ce(i,o)}function tt(i,o){if(i)for(var c=o?[i,o]:i,h=0,p=c.length;h<p;h++)this.extend(c[h])}tt.prototype={extend:function(i){var o=this._southWest,c=this._northEast,h,p;if(i instanceof Se)h=i,p=i;else if(i instanceof tt){if(h=i._southWest,p=i._northEast,!h||!p)return this}else return i?this.extend(le(i)||He(i)):this;return!o&&!c?(this._southWest=new Se(h.lat,h.lng),this._northEast=new Se(p.lat,p.lng)):(o.lat=Math.min(h.lat,o.lat),o.lng=Math.min(h.lng,o.lng),c.lat=Math.max(p.lat,c.lat),c.lng=Math.max(p.lng,c.lng)),this},pad:function(i){var o=this._southWest,c=this._northEast,h=Math.abs(o.lat-c.lat)*i,p=Math.abs(o.lng-c.lng)*i;return new tt(new Se(o.lat-h,o.lng-p),new Se(c.lat+h,c.lng+p))},getCenter:function(){return new Se((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new Se(this.getNorth(),this.getWest())},getSouthEast:function(){return new Se(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(i){typeof i[0]=="number"||i instanceof Se||"lat"in i?i=le(i):i=He(i);var o=this._southWest,c=this._northEast,h,p;
25return i instanceof tt?(h=i.getSouthWest(),p=i.getNorthEast()):h=p=i,h.lat>=o.lat&&p.lat<=c.lat&&h.lng>=o.lng&&p.lng<=c.lng},intersects:function(i){i=He(i);var o=this._southWest,c=this._northEast,h=i.getSouthWest(),p=i.getNorthEast(),g=p.lat>=o.lat&&h.lat<=c.lat,E=p.lng>=o.lng&&h.lng<=c.lng;return g&&E},overlaps:function(i){i=He(i);var o=this._southWest,c=this._northEast,h=i.getSouthWest(),p=i.getNorthEast(),g=p.lat>o.lat&&h.lat<c.lat,E=p.lng>o.lng&&h.lng<c.lng;return g&&E},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(i,o){return i?(i=He(i),this._southWest.equals(i.getSouthWest(),o)&&this._northEast.equals(i.getNorthEast(),o)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function He(i,o){return i instanceof tt?i:new tt(i,o)}function Se(i,o,c){if(isNaN(i)||isNaN(o))throw new Error("Invalid LatLng object: ("+i+", "+o+")");this.lat=+i,this.lng=+o,c!==void 0&&(this.alt=+c)}Se.prototype={equals:function(i,o){if(!i)return!1;i=le(i);var c=Math.max(Math.abs(this.lat-i.lat),Math.abs(this.lng-i.lng));return c<=(o===void 0?1e-9:o)},toString:function(i){return"LatLng("+v(this.lat,i)+", "+v(this.lng,i)+")"},distanceTo:function(i){return Z.distance(this,le(i))},wrap:function(){return Z.wrapLatLng(this)},toBounds:function(i){var o=180*i/40075017,c=o/Math.cos(Math.PI/180*this.lat);return He([this.lat-o,this.lng-c],[this.lat+o,this.lng+c])},clone:function(){return new Se(this.lat,this.lng,this.alt)}};function le(i,o,c){return i instanceof Se?i:A(i)&&typeof i[0]!="object"?i.length===3?new Se(i[0],i[1],i[2]):i.length===2?new Se(i[0],i[1]):null:i==null?i:typeof i=="object"&&"lat"in i?new Se(i.lat,"lng"in i?i.lng:i.lon,i.alt):o===void 0?null:new Se(i,o,c)}var k={latLngToPoint:function(i,o){var c=this.projection.project(i),h=this.scale(o);return this.transformation._transform(c,h)},pointToLatLng:function(i,o){var c=this.scale(o),h=this.transformation.untransform(i,c);return this.projection.unproject(h)},project:function(i){return this.projection.project(i)},unproject:function(i){return this.projection.unproject(i)},scale:function(i){return 256*Math.pow(2,i)},zoom:function(i){return Math.log(i/256)/Math.LN2},getProjectedBounds:function(i){if(this.infinite)return null;var o=this.projection.bounds,c=this.scale(i),h=this.transformation.transform(o.min,c),p=this.transformation.transform(o.max,c);return new Ce(h,p)},infinite:!1,wrapLatLng:function(i){var o=this.wrapLng?m(i.lng,this.wrapLng,!0):i.lng,c=this.wrapLat?m(i.lat,this.wrapLat,!0):i.lat,h=i.alt;return new Se(c,o,h)},wrapLatLngBounds:function(i){var o=i.getCenter(),c=this.wrapLatLng(o),h=o.lat-c.lat,p=o.lng-c.lng;if(h===0&&p===0)return i;
25var g=i.getSouthWest(),E=i.getNorthEast(),S=new Se(g.lat-h,g.lng-p),x=new Se(E.lat-h,E.lng-p);return new tt(S,x)}},Z=r({},k,{wrapLng:[-180,180],R:6371e3,distance:function(i,o){var c=Math.PI/180,h=i.lat*c,p=o.lat*c,g=Math.sin((o.lat-i.lat)*c/2),E=Math.sin((o.lng-i.lng)*c/2),S=g*g+Math.cos(h)*Math.cos(p)*E*E,x=2*Math.atan2(Math.sqrt(S),Math.sqrt(1-S));return this.R*x}}),q=6378137,Q={R:q,MAX_LATITUDE:85.0511287798,project:function(i){var o=Math.PI/180,c=this.MAX_LATITUDE,h=Math.max(Math.min(c,i.lat),-c),p=Math.sin(h*o);return new G(this.R*i.lng*o,this.R*Math.log((1+p)/(1-p))/2)},unproject:function(i){var o=180/Math.PI;return new Se((2*Math.atan(Math.exp(i.y/this.R))-Math.PI/2)*o,i.x*o/this.R)},bounds:function(){var i=q*Math.PI;return new Ce([-i,-i],[i,i])}()};function ke(i,o,c,h){if(A(i)){this._a=i[0],this._b=i[1],this._c=i[2],this._d=i[3];return}this._a=i,this._b=o,this._c=c,this._d=h}ke.prototype={transform:function(i,o){return this._transform(i.clone(),o)},_transform:function(i,o){return o=o||1,i.x=o*(this._a*i.x+this._b),i.y=o*(this._c*i.y+this._d),i},untransform:function(i,o){return o=o||1,new G((i.x/o-this._b)/this._a,(i.y/o-this._d)/this._c)}};function w(i,o,c,h){return new ke(i,o,c,h)}var b=r({},Z,{code:"EPSG:3857",projection:Q,transformation:function(){var i=.5/(Math.PI*Q.R);return w(i,.5,-i,.5)}()}),I=r({},b,{code:"EPSG:900913"});function N(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function D(i,o){var c="",h,p,g,E,S,x;for(h=0,g=i.length;h<g;h++){for(S=i[h],p=0,E=S.length;p<E;p++)x=S[p],c+=(p?"L":"M")+x.x+" "+x.y;c+=o?X.svg?"z":"x":""}return c||"M0 0"}var M=document.documentElement.style,$="ActiveXObject"in window,V=$&&!document.addEventListener,W="msLaunchUri"in navigator&&!("documentMode"in document),U=_n("webkit"),ne=_n("android"),K=_n("android 2")||_n("android 3"),ee=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),ce=ne&&_n("Google")&&ee<537&&!("AudioNode"in window),me=!!window.opera,Ue=!W&&_n("chrome"),xe=_n("gecko")&&!U&&!me&&!$,Pt=!Ue&&_n("safari"),ft=_n("phantom"),Ut="OTransition"in M,qt=navigator.platform.indexOf("Win")===0,Qn=$&&"transition"in M,is="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!K,yt="MozPerspective"in M,Gt=!window.L_DISABLE_3D&&(Qn||is||yt)&&!Ut&&!ft,Xn=typeof orientation<"u"||_n("mobile"),iv=Xn&&U,sv=Xn&&is,ah=!window.PointerEvent&&window.MSPointerEvent,lh=!!(window.PointerEvent||ah),ch="ontouchstart"in window||!!window.TouchEvent,rv=!window.L_NO_TOUCH&&(ch||lh),ov=Xn&&me,av=Xn&&xe,lv=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,cv=function(){var i=!1;try{var o=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("testPassiveEventSupport",_,o),window.removeEventListener("testPassiveEventSupport",_,o)}catch{}return i}(),uv=function(){return!!document.createElement("canvas").getContext}(),ol=!!(document.createElementNS&&N("svg").createSVGRect),hv=!!ol&&function(){var i=document.createElement("div");return i.innerHTML="<svg/>",(i.firstChild&&i.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"}(),dv=!ol&&function(){try{var i=document.createElement("div");i.innerHTML='<v:shape adj="1"/>';var o=i.firstChild;return o.style.behavior="url(#default#VML)",o&&typeof o.adj=="object"}catch{return!1}}(),fv=navigator.platform.indexOf("Mac")===0,pv=navigator.platform.indexOf("Linux")===0;function _n(i){return navigator.userAgent.toLowerCase().indexOf(i)>=0}var X={ie:$,ielt9:V,edge:W,webkit:U,android:ne,android23:K,androidStock:ce,opera:me,chrome:Ue,gecko:xe,safari:Pt,phantom:ft,opera12:Ut,win:qt,ie3d:Qn,webkit3d:is,gecko3d:yt,any3d:Gt,mobile:Xn,mobileWebkit:iv,mobileWebkit3d:sv,msPointer:ah,pointer:lh,touch:rv,touchNative:ch,mobileOpera:ov,mobileGecko:av,retina:lv,passiveEvents:cv,canvas:uv,svg:ol,vml:dv,inlineSvg:hv,mac:fv,linux:pv},uh=X.msPointer?"MSPointerDown":"pointerdown",hh=X.msPointer?"MSPointerMove":"pointermove",dh=X.msPointer?"MSPointerUp":"pointerup",fh=X.msPointer?"MSPointerCancel":"pointercancel",al={touchstart:uh,touchmove:hh,touchend:dh,touchcancel:fh},ph={touchstart:wv,touchmove:mo,touchend:mo,touchcancel:mo},ss={},_h=!1;function _v(i,o,c){return o==="touchstart"&&yv(),ph[o]?(c=ph[o].bind(this,c),i.addEventListener(al[o],c,!1),c):(console.warn("wrong event specified:",o),_)}function mv(i,o,c){if(!al[o]){console.warn("wrong event specified:",o);return}i.removeEventListener(al[o],c,!1)}
25function gv(i){ss[i.pointerId]=i}function vv(i){ss[i.pointerId]&&(ss[i.pointerId]=i)}function mh(i){delete ss[i.pointerId]}function yv(){_h||(document.addEventListener(uh,gv,!0),document.addEventListener(hh,vv,!0),document.addEventListener(dh,mh,!0),document.addEventListener(fh,mh,!0),_h=!0)}function mo(i,o){if(o.pointerType!==(o.MSPOINTER_TYPE_MOUSE||"mouse")){o.touches=[];for(var c in ss)o.touches.push(ss[c]);o.changedTouches=[o],i(o)}}function wv(i,o){o.MSPOINTER_TYPE_TOUCH&&o.pointerType===o.MSPOINTER_TYPE_TOUCH&&pt(o),mo(i,o)}function bv(i){var o={},c,h;for(h in i)c=i[h],o[h]=c&&c.bind?c.bind(i):c;return i=o,o.type="dblclick",o.detail=2,o.isTrusted=!1,o._simulated=!0,o}var Ev=200;function Tv(i,o){i.addEventListener("dblclick",o);var c=0,h;function p(g){if(g.detail!==1){h=g.detail;return}if(!(g.pointerType==="mouse"||g.sourceCapabilities&&!g.sourceCapabilities.firesTouchEvents)){var E=bh(g);if(!(E.some(function(x){return x instanceof HTMLLabelElement&&x.attributes.for})&&!E.some(function(x){return x instanceof HTMLInputElement||x instanceof HTMLSelectElement}))){var S=Date.now();S-c<=Ev?(h++,h===2&&o(bv(g))):h=1,c=S}}}return i.addEventListener("click",p),{dblclick:o,simDblclick:p}}function Cv(i,o){i.removeEventListener("dblclick",o.dblclick),i.removeEventListener("click",o.simDblclick)}var ll=yo(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),er=yo(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),gh=er==="webkitTransition"||er==="OTransition"?er+"End":"transitionend";function vh(i){return typeof i=="string"?document.getElementById(i):i}function tr(i,o){var c=i.style[o]||i.currentStyle&&i.currentStyle[o];if((!c||c==="auto")&&document.defaultView){var h=document.defaultView.getComputedStyle(i,null);c=h?h[o]:null}return c==="auto"?null:c}function Le(i,o,c){var h=document.createElement(i);return h.className=o||"",c&&c.appendChild(h),h}function Je(i){var o=i.parentNode;o&&o.removeChild(i)}function go(i){for(;i.firstChild;)i.removeChild(i.firstChild)}function rs(i){var o=i.parentNode;o&&o.lastChild!==i&&o.appendChild(i)}function os(i){var o=i.parentNode;o&&o.firstChild!==i&&o.insertBefore(i,o.firstChild)}function cl(i,o){if(i.classList!==void 0)return i.classList.contains(o);var c=vo(i);return c.length>0&&new RegExp("(^|\\s)"+o+"(\\s|$)").test(c)}function pe(i,o){if(i.classList!==void 0)for(var c=P(o),h=0,p=c.length;h<p;h++)i.classList.add(c[h]);else if(!cl(i,o)){var g=vo(i);ul(i,(g?g+" ":"")+o)}}function nt(i,o){i.classList!==void 0?i.classList.remove(o):ul(i,y((" "+vo(i)+" ").replace(" "+o+" "," ")))}function ul(i,o){i.className.baseVal===void 0?i.className=o:i.className.baseVal=o}function vo(i){return i.correspondingElement&&(i=i.correspondingElement),i.className.baseVal===void 0?i.className:i.className.baseVal}function Kt(i,o){"opacity"in i.style?i.style.opacity=o:"filter"in i.style&&Iv(i,o)}function Iv(i,o){var c=!1,h="DXImageTransform.Microsoft.Alpha";try{c=i.filters.item(h)}catch{if(o===1)return}o=Math.round(o*100),c?(c.Enabled=o!==100,c.Opacity=o):i.style.filter+=" progid:"+h+"(opacity="+o+")"}function yo(i){for(var o=document.documentElement.style,c=0;c<i.length;c++)if(i[c]in o)return i[c];return!1}function Ii(i,o,c){var h=o||new G(0,0);i.style[ll]=(X.ie3d?"translate("+h.x+"px,"+h.y+"px)":"translate3d("+h.x+"px,"+h.y+"px,0)")+(c?" scale("+c+")":"")}function st(i,o){i._leaflet_pos=o,X.any3d?Ii(i,o):(i.style.left=o.x+"px",i.style.top=o.y+"px")}function Si(i){return i._leaflet_pos||new G(0,0)}var nr,ir,hl;if("onselectstart"in document)nr=function(){he(window,"selectstart",pt)},ir=function(){je(window,"selectstart",pt)};else{var sr=yo(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);nr=function(){if(sr){var i=document.documentElement.style;hl=i[sr],i[sr]="none"}},ir=function(){sr&&(document.documentElement.style[sr]=hl,hl=void 0)}}function dl(){he(window,"dragstart",pt)}function fl(){je(window,"dragstart",pt)}var wo,pl;function _l(i){for(;i.tabIndex===-1;)i=i.parentNode;i.style&&(bo(),wo=i,pl=i.style.outlineStyle,i.style.outlineStyle="none",he(window,"keydown",bo))}function bo(){wo&&(wo.style.outlineStyle=pl,wo=void 0,pl=void 0,je(window,"keydown",bo))}function yh(i){do i=i.parentNode;while((!i.offsetWidth||!i.offsetHeight)&&i!==document.body);return i}function ml(i){var o=i.getBoundingClientRect();return{x:o.width/i.offsetWidth||1,y:o.height/i.offsetHeight||1,boundingClientRect:o}}var Sv={__proto__:null,TRANSFORM:ll,TRANSITION:er,TRANSITION_END:gh,get:vh,getStyle:tr,create:Le,remove:Je,empty:go,toFront:rs,toBack:os,hasClass:cl,addClass:pe,removeClass:nt,setClass:ul,getClass:vo,setOpacity:Kt,testProp:yo,setTransform:Ii,setPosition:st,getPosition:Si,get disableTextSelection(){return nr},get enableTextSelection(){return ir},disableImageDrag:dl,enableImageDrag:fl,preventOutline:_l,restoreOutline:bo,getSizedParentNode:yh,getScale:ml};function he(i,o,c,h){if(o&&typeof o=="object")for(var p in o)vl(i,p,o[p],c);else{o=P(o);for(var g=0,E=o.length;g<E;g++)vl(i,o[g],c,h)}return this}var mn="_leaflet_events";function je(i,o,c,h){if(arguments.length===1)wh(i),delete i[mn];else if(o&&typeof o=="object")for(var p in o)yl(i,p,o[p],c);
25else if(o=P(o),arguments.length===2)wh(i,function(S){return R(o,S)!==-1});else for(var g=0,E=o.length;g<E;g++)yl(i,o[g],c,h);return this}function wh(i,o){for(var c in i[mn]){var h=c.split(/\d/)[0];(!o||o(h))&&yl(i,h,null,null,c)}}var gl={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function vl(i,o,c,h){var p=o+d(c)+(h?"_"+d(h):"");if(i[mn]&&i[mn][p])return this;var g=function(S){return c.call(h||i,S||window.event)},E=g;!X.touchNative&&X.pointer&&o.indexOf("touch")===0?g=_v(i,o,g):X.touch&&o==="dblclick"?g=Tv(i,g):"addEventListener"in i?o==="touchstart"||o==="touchmove"||o==="wheel"||o==="mousewheel"?i.addEventListener(gl[o]||o,g,X.passiveEvents?{passive:!1}:!1):o==="mouseenter"||o==="mouseleave"?(g=function(S){S=S||window.event,bl(i,S)&&E(S)},i.addEventListener(gl[o],g,!1)):i.addEventListener(o,E,!1):i.attachEvent("on"+o,g),i[mn]=i[mn]||{},i[mn][p]=g}function yl(i,o,c,h,p){p=p||o+d(c)+(h?"_"+d(h):"");var g=i[mn]&&i[mn][p];if(!g)return this;!X.touchNative&&X.pointer&&o.indexOf("touch")===0?mv(i,o,g):X.touch&&o==="dblclick"?Cv(i,g):"removeEventListener"in i?i.removeEventListener(gl[o]||o,g,!1):i.detachEvent("on"+o,g),i[mn][p]=null}function Pi(i){return i.stopPropagation?i.stopPropagation():i.originalEvent?i.originalEvent._stopped=!0:i.cancelBubble=!0,this}function wl(i){return vl(i,"wheel",Pi),this}function rr(i){return he(i,"mousedown touchstart dblclick contextmenu",Pi),i._leaflet_disable_click=!0,this}function pt(i){return i.preventDefault?i.preventDefault():i.returnValue=!1,this}function xi(i){return pt(i),Pi(i),this}function bh(i){if(i.composedPath)return i.composedPath();for(var o=[],c=i.target;c;)o.push(c),c=c.parentNode;return o}function Eh(i,o){if(!o)return new G(i.clientX,i.clientY);var c=ml(o),h=c.boundingClientRect;return new G((i.clientX-h.left)/c.x-o.clientLeft,(i.clientY-h.top)/c.y-o.clientTop)}var Pv=X.linux&&X.chrome?window.devicePixelRatio:X.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function Th(i){return X.edge?i.wheelDeltaY/2:i.deltaY&&i.deltaMode===0?-i.deltaY/Pv:i.deltaY&&i.deltaMode===1?-i.deltaY*20:i.deltaY&&i.deltaMode===2?-i.deltaY*60:i.deltaX||i.deltaZ?0:i.wheelDelta?(i.wheelDeltaY||i.wheelDelta)/2:i.detail&&Math.abs(i.detail)<32765?-i.detail*20:i.detail?i.detail/-32765*60:0}function bl(i,o){var c=o.relatedTarget;if(!c)return!0;try{for(;c&&c!==i;)c=c.parentNode}catch{return!1}return c!==i}var xv={__proto__:null,on:he,off:je,stopPropagation:Pi,disableScrollPropagation:wl,disableClickPropagation:rr,preventDefault:pt,stop:xi,getPropagationPath:bh,getMousePosition:Eh,getWheelDelta:Th,isExternalTarget:bl,addListener:he,removeListener:je},Ch=Te.extend({run:function(i,o,c,h){this.stop(),this._el=i,this._inProgress=!0,this._duration=c||.25,this._easeOutPower=1/Math.max(h||.5,.2),this._startPos=Si(i),this._offset=o.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=$e(this._animate,this),this._step()},_step:function(i){var o=+new Date-this._startTime,c=this._duration*1e3;o<c?this._runFrame(this._easeOut(o/c),i):(this._runFrame(1),this._complete())},_runFrame:function(i,o){var c=this._startPos.add(this._offset.multiplyBy(i));o&&c._round(),st(this._el,c),this.fire("step")},_complete:function(){it(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(i){return 1-Math.pow(1-i,this._easeOutPower)}}),Ie=Te.extend({options:{crs:b,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(i,o){o=T(this,o),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(i),this._initLayout(),this._onResize=l(this._onResize,this),this._initEvents(),o.maxBounds&&this.setMaxBounds(o.maxBounds),o.zoom!==void 0&&(this._zoom=this._limitZoom(o.zoom)),o.center&&o.zoom!==void 0&&this.setView(le(o.center),o.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=er&&X.any3d&&!X.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),he(this._proxy,gh,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)}
25,setView:function(i,o,c){if(o=o===void 0?this._zoom:this._limitZoom(o),i=this._limitCenter(le(i),o,this.options.maxBounds),c=c||{},this._stop(),this._loaded&&!c.reset&&c!==!0){c.animate!==void 0&&(c.zoom=r({animate:c.animate},c.zoom),c.pan=r({animate:c.animate,duration:c.duration},c.pan));var h=this._zoom!==o?this._tryAnimatedZoom&&this._tryAnimatedZoom(i,o,c.zoom):this._tryAnimatedPan(i,c.pan);if(h)return clearTimeout(this._sizeTimer),this}return this._resetView(i,o,c.pan&&c.pan.noMoveStart),this},setZoom:function(i,o){return this._loaded?this.setView(this.getCenter(),i,{zoom:o}):(this._zoom=i,this)},zoomIn:function(i,o){return i=i||(X.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+i,o)},zoomOut:function(i,o){return i=i||(X.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-i,o)},setZoomAround:function(i,o,c){var h=this.getZoomScale(o),p=this.getSize().divideBy(2),g=i instanceof G?i:this.latLngToContainerPoint(i),E=g.subtract(p).multiplyBy(1-1/h),S=this.containerPointToLatLng(p.add(E));return this.setView(S,o,{zoom:c})},_getBoundsCenterZoom:function(i,o){o=o||{},i=i.getBounds?i.getBounds():He(i);var c=te(o.paddingTopLeft||o.padding||[0,0]),h=te(o.paddingBottomRight||o.padding||[0,0]),p=this.getBoundsZoom(i,!1,c.add(h));if(p=typeof o.maxZoom=="number"?Math.min(o.maxZoom,p):p,p===1/0)return{center:i.getCenter(),zoom:p};
25var g=h.subtract(c).divideBy(2),E=this.project(i.getSouthWest(),p),S=this.project(i.getNorthEast(),p),x=this.unproject(E.add(S).divideBy(2).add(g),p);return{center:x,zoom:p}},fitBounds:function(i,o){if(i=He(i),!i.isValid())throw new Error("Bounds are not valid.");var c=this._getBoundsCenterZoom(i,o);return this.setView(c.center,c.zoom,o)},fitWorld:function(i){return this.fitBounds([[-90,-180],[90,180]],i)},panTo:function(i,o){return this.setView(i,this._zoom,{pan:o})},panBy:function(i,o){if(i=te(i).round(),o=o||{},!i.x&&!i.y)return this.fire("moveend");if(o.animate!==!0&&!this.getSize().contains(i))return this._resetView(this.unproject(this.project(this.getCenter()).add(i)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Ch,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),o.noMoveStart||this.fire("movestart"),o.animate!==!1){pe(this._mapPane,"leaflet-pan-anim");var c=this._getMapPanePos().subtract(i).round();this._panAnim.run(this._mapPane,c,o.duration||.25,o.easeLinearity)}else this._rawPanBy(i),this.fire("move").fire("moveend");return this},flyTo:function(i,o,c){if(c=c||{},c.animate===!1||!X.any3d)return this.setView(i,o,c);this._stop();var h=this.project(this.getCenter()),p=this.project(i),g=this.getSize(),E=this._zoom;i=le(i),o=o===void 0?E:o;var S=Math.max(g.x,g.y),x=S*this.getZoomScale(E,o),F=p.distanceTo(h)||1,Y=1.42,re=Y*Y;function ge(rt){var Oo=rt?-1:1,my=rt?x:S,gy=x*x-S*S+Oo*re*re*F*F,vy=2*my*re*F,kl=gy/vy,sd=Math.sqrt(kl*kl+1)-kl,yy=sd<1e-9?-18:Math.log(sd);return yy}function xt(rt){return(Math.exp(rt)-Math.exp(-rt))/2}function ct(rt){return(Math.exp(rt)+Math.exp(-rt))/2}function Jt(rt){return xt(rt)/ct(rt)}var Ot=ge(0);function ds(rt){return S*(ct(Ot)/ct(Ot+Y*rt))}function dy(rt){return S*(ct(Ot)*Jt(Ot+Y*rt)-xt(Ot))/re}function fy(rt){return 1-Math.pow(1-rt,1.5)}var py=Date.now(),nd=(ge(1)-Ot)/Y,_y=c.duration?1e3*c.duration:1e3*nd*.8;function id(){var rt=(Date.now()-py)/_y,Oo=fy(rt)*nd;rt<=1?(this._flyToFrame=$e(id,this),this._move(this.unproject(h.add(p.subtract(h).multiplyBy(dy(Oo)/F)),E),this.getScaleZoom(S/ds(Oo),E),{flyTo:!0})):this._move(i,o)._moveEnd(!0)}return this._moveStart(!0,c.noMoveStart),id.call(this),this},flyToBounds:function(i,o){var c=this._getBoundsCenterZoom(i,o);return this.flyTo(c.center,c.zoom,o)},setMaxBounds:function(i){return i=He(i),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),i.isValid()?(this.options.maxBounds=i,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(i){var o=this.options.minZoom;return this.options.minZoom=i,this._loaded&&o!==i&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(i):this},setMaxZoom:function(i){var o=this.options.maxZoom;return this.options.maxZoom=i,this._loaded&&o!==i&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(i):this},panInsideBounds:function(i,o){this._enforcingBounds=!0;var c=this.getCenter(),h=this._limitCenter(c,this._zoom,He(i));return c.equals(h)||this.panTo(h,o),this._enforcingBounds=!1,this},panInside:function(i,o){o=o||{};var c=te(o.paddingTopLeft||o.padding||[0,0]),h=te(o.paddingBottomRight||o.padding||[0,0]),p=this.project(this.getCenter()),g=this.project(i),E=this.getPixelBounds(),S=Be([E.min.add(c),E.max.subtract(h)]),x=S.getSize();if(!S.contains(g)){this._enforcingBounds=!0;var F=g.subtract(S.getCenter()),Y=S.extend(g).getSize().subtract(x);p.x+=F.x<0?-Y.x:Y.x,p.y+=F.y<0?-Y.y:Y.y,this.panTo(this.unproject(p),o),this._enforcingBounds=!1}return this},invalidateSize:function(i){if(!this._loaded)return this;i=r({animate:!1,pan:!0},i===!0?{animate:!0}:i);var o=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var c=this.getSize(),h=o.divideBy(2).round(),p=c.divideBy(2).round(),g=h.subtract(p);return!g.x&&!g.y?this:(i.animate&&i.pan?this.panBy(g):(i.pan&&this._rawPanBy(g),this.fire("move"),i.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(l(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:o,newSize:c}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(i){if(i=this._locateOptions=r({timeout:1e4,watch:!1},i),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var o=l(this._handleGeolocationResponse,this),c=l(this._handleGeolocationError,this);return i.watch?this._locationWatchId=navigator.geolocation.watchPosition(o,c,i):navigator.geolocation.getCurrentPosition(o,c,i),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(i){if(this._container._leaflet_id){var o=i.code,c=i.message||(o===1?"permission denied":o===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:o,message:"Geolocation error: "+c+"."})}},_handleGeolocationResponse:function(i){if(this._container._leaflet_id){var o=i.coords.latitude,c=i.coords.longitude,h=new Se(o,c),p=
25h.toBounds(i.coords.accuracy*2),g=this._locateOptions;if(g.setView){var E=this.getBoundsZoom(p);this.setView(h,g.maxZoom?Math.min(E,g.maxZoom):E)}var S={latlng:h,bounds:p,timestamp:i.timestamp};for(var x in i.coords)typeof i.coords[x]=="number"&&(S[x]=i.coords[x]);this.fire("locationfound",S)}},addHandler:function(i,o){if(!o)return this;var c=this[i]=new o(this);return this._handlers.push(c),this.options[i]&&c.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),Je(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(it(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var i;for(i in this._layers)this._layers[i].remove();for(i in this._panes)Je(this._panes[i]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(i,o){var c="leaflet-pane"+(i?" leaflet-"+i.replace("Pane","")+"-pane":""),h=Le("div",c,o||this._mapPane);return i&&(this._panes[i]=h),h},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var i=this.getPixelBounds(),o=this.unproject(i.getBottomLeft()),c=this.unproject(i.getTopRight());return new tt(o,c)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(i,o,c){i=He(i),c=te(c||[0,0]);var h=this.getZoom()||0,p=this.getMinZoom(),g=this.getMaxZoom(),E=i.getNorthWest(),S=i.getSouthEast(),x=this.getSize().subtract(c),F=Be(this.project(S,h),this.project(E,h)).getSize(),Y=X.any3d?this.options.zoomSnap:1,re=x.x/F.x,ge=x.y/F.y,xt=o?Math.max(re,ge):Math.min(re,ge);return h=this.getScaleZoom(xt,h),Y&&(h=Math.round(h/(Y/100))*(Y/100),h=o?Math.ceil(h/Y)*Y:Math.floor(h/Y)*Y),Math.max(p,Math.min(g,h))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new G(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(i,o){var c=this._getTopLeftPoint(i,o);return new Ce(c,c.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(i){return this.options.crs.getProjectedBounds(i===void 0?this.getZoom():i)},getPane:function(i){return typeof i=="string"?this._panes[i]:i},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(i,o){var c=this.options.crs;return o=o===void 0?this._zoom:o,c.scale(i)/c.scale(o)},getScaleZoom:function(i,o){var c=this.options.crs;o=o===void 0?this._zoom:o;var h=c.zoom(i*c.scale(o));return isNaN(h)?1/0:h},project:function(i,o){return o=o===void 0?this._zoom:o,this.options.crs.latLngToPoint(le(i),o)},unproject:function(i,o){return o=o===void 0?this._zoom:o,this.options.crs.pointToLatLng(te(i),o)},layerPointToLatLng:function(i){var o=te(i).add(this.getPixelOrigin());return this.unproject(o)},latLngToLayerPoint:function(i){var o=this.project(le(i))._round();return o._subtract(this.getPixelOrigin())},wrapLatLng:function(i){return this.options.crs.wrapLatLng(le(i))},wrapLatLngBounds:function(i){return this.options.crs.wrapLatLngBounds(He(i))},distance:function(i,o){return this.options.crs.distance(le(i),le(o))},containerPointToLayerPoint:function(i){return te(i).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(i){return te(i).add(this._getMapPanePos())},containerPointToLatLng:function(i){var o=this.containerPointToLayerPoint(te(i));return this.layerPointToLatLng(o)},latLngToContainerPoint:function(i){return this.layerPointToContainerPoint(this.latLngToLayerPoint(le(i)))},mouseEventToContainerPoint:function(i){return Eh(i,this._container)},mouseEventToLayerPoint:function(i){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(i))},mouseEventToLatLng:function(i){return this.layerPointToLatLng(this.mouseEventToLayerPoint(i))},_initContainer:function(i){var o=this._container=vh(i);if(o){if(o._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");he(o,"scroll",this._onScroll,this),this._containerId=d(o)},_initLayout:function(){var i=this._container;this._fadeAnimated=this.options.fadeAnimation&&X.any3d,pe(i,"leaflet-container"+(X.touch?" leaflet-touch":"")+(X.retina?" leaflet-retina":"")+(X.ielt9?" leaflet-oldie":"")+(X.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var o=tr(i,"position");o!=="absolute"&&o!=="relative"&&o!=="fixed"&&o!=="sticky"&&(i.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var i=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),st(this._mapPane,new G(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(pe(i.markerPane,"leaflet-zoom-hide"),pe(i.shadowPane,"leaflet-zoom-hide"))},_resetView:function(i,o,c){st(this._mapPane,new G(0,0));var h=!this._loaded;this._loaded=!0,o=this._limitZoom(o),this.fire("viewprereset");var p=this._zoom!==o;this._moveStart(p,c)._move(i,o)._moveEnd(p),this.fire("viewreset"),h&&this.fire("load")},_moveStart:function(i,o){return i&&this.fire("zoomstart"),o||this.fire("movestart"),this},_move:function(i,o,c,h){o===void 0&&(o=this._zoom);var p=this._zoom!==o;return this._zoom=o,this._lastCenter=i,this._pixelOrigin=this._getNewPixelOrigin(i),h?c&&c.pinch&&this.fire("zoom",c):((p||c&&c.pinch)&&this.fire("zoom",c),this.fire("move",c)),this},_moveEnd:function(i){return i&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return it(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(i){st(this._mapPane,this._getMapPanePos().subtract(i))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(i){this._targets={},this._targets[d(this._container)]=this;var o=i?je:he;o(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&o(window,"resize",this._onResize,this),X.any3d&&this.options.transform3DLimit&&(i?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){it(this._resizeRequest),this._resizeRequest=$e(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var i=this._getMapPanePos();Math.max(Math.abs(i.x),Math.abs(i.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(i,o){for(var c=[],h,p=o==="mouseout"||o==="mouseover",g=i.target||i.srcElement,E=!1;g;){if(h=this._targets[d(g)],h&&(o==="click"||o==="preclick")&&this._draggableMoved(h)){E=!0;break}if(h&&h.listens(o,!0)&&(p&&!bl(g,i)||(c.push(h),p))||g===this._container)break;g=g.parentNode}return!c.length&&!E&&!p&&this.listens(o,!0)&&(c=[this]),c},_isClickDisabled:function(i){for(;i&&i!==this._container;){if(i._leaflet_disable_click)return!0;
25i=i.parentNode}},_handleDOMEvent:function(i){var o=i.target||i.srcElement;if(!(!this._loaded||o._leaflet_disable_events||i.type==="click"&&this._isClickDisabled(o))){var c=i.type;c==="mousedown"&&_l(o),this._fireDOMEvent(i,c)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(i,o,c){if(i.type==="click"){var h=r({},i);h.type="preclick",this._fireDOMEvent(h,h.type,c)}var p=this._findEventTargets(i,o);if(c){for(var g=[],E=0;E<c.length;E++)c[E].listens(o,!0)&&g.push(c[E]);p=g.concat(p)}if(p.length){o==="contextmenu"&&pt(i);var S=p[0],x={originalEvent:i};if(i.type!=="keypress"&&i.type!=="keydown"&&i.type!=="keyup"){var F=S.getLatLng&&(!S._radius||S._radius<=10);x.containerPoint=F?this.latLngToContainerPoint(S.getLatLng()):this.mouseEventToContainerPoint(i),x.layerPoint=this.containerPointToLayerPoint(x.containerPoint),x.latlng=F?S.getLatLng():this.layerPointToLatLng(x.layerPoint)}for(E=0;E<p.length;E++)if(p[E].fire(o,x,!0),x.originalEvent._stopped||p[E].options.bubblingMouseEvents===!1&&R(this._mouseEvents,o)!==-1)return}},_draggableMoved:function(i){return i=i.dragging&&i.dragging.enabled()?i:this,i.dragging&&i.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var i=0,o=this._handlers.length;i<o;i++)this._handlers[i].disable()},whenReady:function(i,o){return this._loaded?i.call(o||this,{target:this}):this.on("load",i,o),this},_getMapPanePos:function(){return Si(this._mapPane)||new G(0,0)},_moved:function(){var i=this._getMapPanePos();return i&&!i.equals([0,0])},_getTopLeftPoint:function(i,o){var c=i&&o!==void 0?this._getNewPixelOrigin(i,o):this.getPixelOrigin();return c.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(i,o){var c=this.getSize()._divideBy(2);return this.project(i,o)._subtract(c)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(i,o,c){var h=this._getNewPixelOrigin(c,o);return this.project(i,o)._subtract(h)},_latLngBoundsToNewLayerBounds:function(i,o,c){var h=this._getNewPixelOrigin(c,o);
25return Be([this.project(i.getSouthWest(),o)._subtract(h),this.project(i.getNorthWest(),o)._subtract(h),this.project(i.getSouthEast(),o)._subtract(h),this.project(i.getNorthEast(),o)._subtract(h)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(i){return this.latLngToLayerPoint(i).subtract(this._getCenterLayerPoint())},_limitCenter:function(i,o,c){if(!c)return i;var h=this.project(i,o),p=this.getSize().divideBy(2),g=new Ce(h.subtract(p),h.add(p)),E=this._getBoundsOffset(g,c,o);return Math.abs(E.x)<=1&&Math.abs(E.y)<=1?i:this.unproject(h.add(E),o)},_limitOffset:function(i,o){if(!o)return i;var c=this.getPixelBounds(),h=new Ce(c.min.add(i),c.max.add(i));return i.add(this._getBoundsOffset(h,o))},_getBoundsOffset:function(i,o,c){var h=Be(this.project(o.getNorthEast(),c),this.project(o.getSouthWest(),c)),p=h.min.subtract(i.min),g=h.max.subtract(i.max),E=this._rebound(p.x,-g.x),S=this._rebound(p.y,-g.y);return new G(E,S)},_rebound:function(i,o){return i+o>0?Math.round(i-o)/2:Math.max(0,Math.ceil(i))-Math.max(0,Math.floor(o))},_limitZoom:function(i){var o=this.getMinZoom(),c=this.getMaxZoom(),h=X.any3d?this.options.zoomSnap:1;return h&&(i=Math.round(i/h)*h),Math.max(o,Math.min(c,i))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){nt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(i,o){var c=this._getCenterOffset(i)._trunc();return(o&&o.animate)!==!0&&!this.getSize().contains(c)?!1:(this.panBy(c,o),!0)},_createAnimProxy:function(){var i=this._proxy=Le("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(i),this.on("zoomanim",function(o){var c=ll,h=this._proxy.style[c];Ii(this._proxy,this.project(o.center,o.zoom),this.getZoomScale(o.zoom,1)),h===this._proxy.style[c]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Je(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var i=this.getCenter(),o=this.getZoom();Ii(this._proxy,this.project(i,o),this.getZoomScale(o,1))},_catchTransitionEnd:function(i){this._animatingZoom&&i.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(i,o,c){if(this._animatingZoom)return!0;if(c=c||{},!this._zoomAnimated||c.animate===!1||this._nothingToAnimate()||Math.abs(o-this._zoom)>this.options.zoomAnimationThreshold)return!1;var h=this.getZoomScale(o),p=this._getCenterOffset(i)._divideBy(1-1/h);return c.animate!==!0&&!this.getSize().contains(p)?!1:($e(function(){this._moveStart(!0,c.noMoveStart||!1)._animateZoom(i,o,!0)},this),!0)},_animateZoom:function(i,o,c,h){this._mapPane&&(c&&(this._animatingZoom=!0,this._animateToCenter=i,this._animateToZoom=o,pe(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:i,zoom:o,noUpdate:h}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(l(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&nt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Lv(i,o){return new Ie(i,o)}var tn=St.extend({options:{position:"topright"},initialize:function(i){T(this,i)},getPosition:function(){return this.options.position},setPosition:function(i){var o=this._map;return o&&o.removeControl(this),this.options.position=i,o&&o.addControl(this),this},getContainer:function(){return this._container},addTo:function(i){this.remove(),this._map=i;var o=this._container=this.onAdd(i),c=this.getPosition(),h=i._controlCorners[c];return pe(o,"leaflet-control"),c.indexOf("bottom")!==-1?h.insertBefore(o,h.firstChild):h.appendChild(o),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Je(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(i){this._map&&i&&i.screenX>0&&i.screenY>0&&this._map.getContainer().focus()}}),or=function(i){return new tn(i)};Ie.include({addControl:function(i){return i.addTo(this),this},removeControl:function(i){return i.remove(),this}
vendor: 9,679 bytes, line 25
25,_initControlPos:function(){var i=this._controlCorners={},o="leaflet-",c=this._controlContainer=Le("div",o+"control-container",this._container);function h(p,g){var E=o+p+" "+o+g;i[p+g]=Le("div",E,c)}h("top","left"),h("top","right"),h("bottom","left"),h("bottom","right")},_clearControlPos:function(){for(var i in this._controlCorners)Je(this._controlCorners[i]);Je(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Ih=tn.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(i,o,c,h){return c<h?-1:h<c?1:0}},initialize:function(i,o,c){T(this,c),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var h in i)this._addLayer(i[h],h);for(h in o)this._addLayer(o[h],h,!0)},onAdd:function(i){this._initLayout(),this._update(),this._map=i,i.on("zoomend",this._checkDisabledLayers,this);for(var o=0;o<this._layers.length;o++)this._layers[o].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(i){return tn.prototype.addTo.call(this,i),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var i=0;i<this._layers.length;i++)this._layers[i].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(i,o){return this._addLayer(i,o),this._map?this._update():this},addOverlay:function(i,o){return this._addLayer(i,o,!0),this._map?this._update():this},removeLayer:function(i){i.off("add remove",this._onLayerChange,this);var o=this._getLayer(d(i));return o&&this._layers.splice(this._layers.indexOf(o),1),this._map?this._update():this},expand:function(){pe(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var i=this._map.getSize().y-(this._container.offsetTop+50);return i<this._section.clientHeight?(pe(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=i+"px"):nt(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return nt(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var i="leaflet-control-layers",o=this._container=Le("div",i),c=this.options.collapsed;o.setAttribute("aria-haspopup",!0),rr(o),wl(o);var h=this._section=Le("section",i+"-list");c&&(this._map.on("click",this.collapse,this),he(o,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var p=this._layersLink=Le("a",i+"-toggle",o);p.href="#",p.title="Layers",p.setAttribute("role","button"),he(p,{keydown:function(g){g.keyCode===13&&this._expandSafely()},click:function(g){pt(g),this._expandSafely()}},this),c||this.expand(),this._baseLayersList=Le("div",i+"-base",h),this._separator=Le("div",i+"-separator",h),this._overlaysList=Le("div",i+"-overlays",h),o.appendChild(h)},_getLayer:function(i){for(var o=0;o<this._layers.length;o++)if(this._layers[o]&&d(this._layers[o].layer)===i)return this._layers[o]},_addLayer:function(i,o,c){this._map&&i.on("add remove",this._onLayerChange,this),this._layers.push({layer:i,name:o,overlay:c}),this.options.sortLayers&&this._layers.sort(l(function(h,p){return this.options.sortFunction(h.layer,p.layer,h.name,p.name)},this)),this.options.autoZIndex&&i.setZIndex&&(this._lastZIndex++,i.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;go(this._baseLayersList),go(this._overlaysList),this._layerControlInputs=[];var i,o,c,h,p=0;for(c=0;c<this._layers.length;c++)h=this._layers[c],this._addItem(h),o=o||h.overlay,i=i||!h.overlay,p+=h.overlay?0:1;return this.options.hideSingleBase&&(i=i&&p>1,this._baseLayersList.style.display=i?"":"none"),this._separator.style.display=o&&i?"":"none",this},_onLayerChange:function(i){this._handlingClick||this._update();var o=this._getLayer(d(i.target)),c=o.overlay?i.type==="add"?"overlayadd":"overlayremove":i.type==="add"?"baselayerchange":null;c&&this._map.fire(c,o)},_createRadioElement:function(i,o){var c='<input type="radio" class="leaflet-control-layers-selector" name="'+i+'"'+(o?' checked="checked"':"")+"/>",h=document.createElement("div");return h.innerHTML=c,h.firstChild},_addItem:function(i){var o=document.createElement("label"),c=this._map.hasLayer(i.layer),h;i.overlay?(h=document.createElement("input"),h.type="checkbox",h.className="leaflet-control-layers-selector",h.defaultChecked=c):h=this._createRadioElement("leaflet-base-layers_"+d(this),c),this._layerControlInputs.push(h),h.layerId=d(i.layer),he(h,"click",this._onInputClick,this);var p=document.createElement("span");p.innerHTML=" "+i.name;var g=document.createElement("span");o.appendChild(g),g.appendChild(h),g.appendChild(p);var E=i.overlay?this._overlaysList:this._baseLayersList;return E.appendChild(o),this._checkDisabledLayers(),o},_onInputClick:function(){if(!this._preventClick){var i=this._layerControlInputs,o,c,h=[],p=[];this._handlingClick=!0;for(var g=i.length-1;g>=0;g--)o=i[g],c=this._getLayer(o.layerId).layer,o.checked?h.push(c):o.checked||p.push(c);for(g=0;g<p.length;g++)this._map.hasLayer(p[g])&&this._map.removeLayer(p[g]);for(g=0;g<h.length;g++)this._map.hasLayer(h[g])||this._map.addLayer(h[g]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var i=this._layerControlInputs,o,c,h=this._map.getZoom(),p=i.length-1;p>=0;p--)o=i[p],c=this._getLayer(o.layerId).layer,o.disabled=c.options.minZoom!==void 0&&h<c.options.minZoom||c.options.maxZoom!==void 0&&h>c.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var i=this._section;this._preventClick=!0,he(i,"click",pt),this.expand();var o=this;setTimeout(function(){je(i,"click",pt),o._preventClick=!1})}}),Rv=function(i,o,c){return new Ih(i,o,c)},El=tn.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(i){var o="leaflet-control-zoom",c=Le("div",o+" leaflet-bar"),h=this.options;return this._zoomInButton=this._createButton(h.zoomInText,h.zoomInTitle,o+"-in",c,this._zoomIn),this._zoomOutButton=this._createButton(h.zoomOutText,h.zoomOutTitle,o+"-out",c,this._zoomOut),this._updateDisabled(),i.on("zoomend zoomlevelschange",this._updateDisabled,this),c},onRemove:function(i){i.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(i){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(i.shiftKey?3:1))},_zoomOut:function(i){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(i.shiftKey?3:1))},_createButton:function(i,o,c,h,p){var g=Le("a",c,h);return g.innerHTML=i,g.href="#",g.title=o,g.setAttribute("role","button"),g.setAttribute("aria-label",o),rr(g),he(g,"click",xi),he(g,"click",p,this),he(g,"click",this._refocusOnMap,this),g},_updateDisabled:function(){var i=this._map,o="leaflet-disabled";nt(this._zoomInButton,o),nt(this._zoomOutButton,o),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||i._zoom===i.getMinZoom())&&(pe(this._zoomOutButton,o),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||i._zoom===i.getMaxZoom())&&(pe(this._zoomInButton,o),this._zoomInButton.setAttribute("aria-disabled","true"))}});Ie.mergeOptions({zoomControl:!0}),Ie.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new El,this.addControl(this.zoomControl))});var Av=function(i){return new El(i)},Sh=tn.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(i){var o="leaflet-control-scale",c=Le("div",o),h=this.options;return this._addScales(h,o+"-line",c),i.on(h.updateWhenIdle?"moveend":"move",this._update,this),i.whenReady(this._update,this),c},onRemove:function(i){i.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(i,o,c){i.metric&&(this._mScale=Le("div",o,c)),i.imperial&&(this._iScale=Le("div",o,c))},_update:function(){var i=this._map,o=i.getSize().y/2,c=i.distance(i.containerPointToLatLng([0,o]),i.containerPointToLatLng([this.options.maxWidth,o]));this._updateScales(c)},_updateScales:function(i){this.options.metric&&i&&this._updateMetric(i),this.options.imperial&&i&&this._updateImperial(i)},_updateMetric:function(i){var o=this._getRoundNum(i),c=o<1e3?o+" m":o/1e3+" km";this._updateScale(this._mScale,c,o/i)},_updateImperial:function(i){var o=i*3.2808399,c,h,p;o>5280?(c=o/5280,h=this._getRoundNum(c),this._updateScale(this._iScale,h+" mi",h/c)):(p=this._getRoundNum(o),this._updateScale(this._iScale,p+" ft",p/o))},_updateScale:function(i,o,c){i.style.width=Math.round(this.options.maxWidth*c)+"px",i.innerHTML=o},_getRoundNum:function(i){var o=Math.pow(10,(Math.floor(i)+"").length-1),c=i/o;return c=c>=10?10:c>=5?5:c>=3?3:c>=2?2:1,o*c}}),kv=function(i){return new Sh(i)},Ov='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',Tl=tn.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(X.inlineSvg?Ov+" ":"")+"Leaflet</a>"},initialize:function(i){T(this,i),this._attributions={}}
25,onAdd:function(i){i.attributionControl=this,this._container=Le("div","leaflet-control-attribution"),rr(this._container);for(var o in i._layers)i._layers[o].getAttribution&&this.addAttribution(i._layers[o].getAttribution());return this._update(),i.on("layeradd",this._addAttribution,this),this._container},onRemove:function(i){i.off("layeradd",this._addAttribution,this)},_addAttribution:function(i){i.layer.getAttribution&&(this.addAttribution(i.layer.getAttribution()),i.layer.once("remove",function(){this.removeAttribution(i.layer.getAttribution())},this))},setPrefix:function(i){return this.options.prefix=i,this._update(),this},addAttribution:function(i){return i?(this._attributions[i]||(this._attributions[i]=0),this._attributions[i]++,this._update(),this):this},removeAttribution:function(i){return i?(this._attributions[i]&&(this._attributions[i]--,this._update()),this):this},_update:function(){if(this._map){var i=[];for(var o in this._attributions)this._attributions[o]&&i.push(o);var c=[];this.options.prefix&&c.push(this.options.prefix),i.length&&c.push(i.join(", ")),this._container.innerHTML=c.join(' <span aria-hidden="true">|</span> ')}}});Ie.mergeOptions({attributionControl:!0}),Ie.addInitHook(function(){this.options.attributionControl&&new Tl().addTo(this)});var Nv=function(i){return new Tl(i)};tn.Layers=Ih,tn.Zoom=El,tn.Scale=Sh,tn.Attribution=Tl,or.layers=Rv,or.zoom=Av,or.scale=kv,or.attribution=Nv;var gn=St.extend({initialize:function(i){this._map=i},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});gn.addTo=function(i,o){return i.addHandler(o,this),this};var Mv={Events:Pe},Ph=X.touch?"touchstart mousedown":"mousedown",ei=Te.extend({options:{clickTolerance:3},initialize:function(i,o,c,h){T(this,h),this._element=i,this._dragStartTarget=o||i,this._preventOutline=c},enable:function(){this._enabled||(he(this._dragStartTarget,Ph,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ei._dragging===this&&this.finishDrag(!0),je(this._dragStartTarget,Ph,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(i){if(this._enabled&&(this._moved=!1,!cl(this._element,"leaflet-zoom-anim"))){if(i.touches&&i.touches.length!==1){ei._dragging===this&&this.finishDrag();return}if(!(ei._dragging||i.shiftKey||i.which!==1&&i.button!==1&&!i.touches)&&(ei._dragging=this,this._preventOutline&&_l(this._element),dl(),nr(),!this._moving)){this.fire("down");var o=i.touches?i.touches[0]:i,c=yh(this._element);this._startPoint=new G(o.clientX,o.clientY),this._startPos=Si(this._element),this._parentScale=ml(c);var h=i.type==="mousedown";he(document,h?"mousemove":"touchmove",this._onMove,this),he(document,h?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(i){if(this._enabled){if(i.touches&&i.touches.length>1){this._moved=!0;return}var o=i.touches&&i.touches.length===1?i.touches[0]:i,c=new G(o.clientX,o.clientY)._subtract(this._startPoint);!c.x&&!c.y||Math.abs(c.x)+Math.abs(c.y)<this.options.clickTolerance||(c.x/=this._parentScale.x,c.y/=this._parentScale.y,pt(i),this._moved||(this.fire("dragstart"),this._moved=!0,pe(document.body,"leaflet-dragging"),this._lastTarget=i.target||i.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),pe(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(c),this._moving=!0,this._lastEvent=i,this._updatePosition())}},_updatePosition:function(){var i={originalEvent:this._lastEvent};this.fire("predrag",i),st(this._element,this._newPos),this.fire("drag",i)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(i){nt(document.body,"leaflet-dragging"),this._lastTarget&&(nt(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),je(document,"mousemove touchmove",this._onMove,this),je(document,"mouseup touchend touchcancel",this._onUp,this),fl(),ir();var o=this._moved&&this._moving;this._moving=!1,ei._dragging=!1,o&&this.fire("dragend",{noInertia:i,distance:this._newPos.distanceTo(this._startPos)})}});function xh(i,o,c){var h,p=[1,4,2,8],g,E,S,x,F,Y,re,ge;for(g=0,Y=i.length;g<Y;g++)i[g]._code=Li(i[g],o);for(S=0;S<4;S++){for(re=p[S],h=[],g=0,Y=i.length,E=Y-1;g<Y;
25E=g++)x=i[g],F=i[E],x._code&re?F._code&re||(ge=Eo(F,x,re,o,c),ge._code=Li(ge,o),h.push(ge)):(F._code&re&&(ge=Eo(F,x,re,o,c),ge._code=Li(ge,o),h.push(ge)),h.push(x));i=h}return i}function Lh(i,o){var c,h,p,g,E,S,x,F,Y;if(!i||i.length===0)throw new Error("latlngs not passed");Yt(i)||(console.warn("latlngs are not flat! Only the first ring will be used"),i=i[0]);var re=le([0,0]),ge=He(i),xt=ge.getNorthWest().distanceTo(ge.getSouthWest())*ge.getNorthEast().distanceTo(ge.getNorthWest());xt<1700&&(re=Cl(i));var ct=i.length,Jt=[];for(c=0;c<ct;c++){var Ot=le(i[c]);Jt.push(o.project(le([Ot.lat-re.lat,Ot.lng-re.lng])))}for(S=x=F=0,c=0,h=ct-1;c<ct;h=c++)p=Jt[c],g=Jt[h],E=p.y*g.x-g.y*p.x,x+=(p.x+g.x)*E,F+=(p.y+g.y)*E,S+=E*3;S===0?Y=Jt[0]:Y=[x/S,F/S];var ds=o.unproject(te(Y));return le([ds.lat+re.lat,ds.lng+re.lng])}function Cl(i){for(var o=0,c=0,h=0,p=0;p<i.length;p++){var g=le(i[p]);o+=g.lat,c+=g.lng,h++}return le([o/h,c/h])}var Dv={__proto__:null,clipPolygon:xh,polygonCenter:Lh,centroid:Cl};function Rh(i,o){if(!o||!i.length)return i.slice();var c=o*o;return i=Uv(i,c),i=Bv(i,c),i}function Ah(i,o,c){return Math.sqrt(ar(i,o,c,!0))}function Fv(i,o,c){return ar(i,o,c)}function Bv(i,o){var c=i.length,h=typeof Uint8Array<"u"?Uint8Array:Array,p=new h(c);p[0]=p[c-1]=1,Il(i,p,o,0,c-1);var g,E=[];for(g=0;g<c;g++)p[g]&&E.push(i[g]);return E}function Il(i,o,c,h,p){var g=0,E,S,x;for(S=h+1;S<=p-1;S++)x=ar(i[S],i[h],i[p],!0),x>g&&(E=S,g=x);g>c&&(o[E]=1,Il(i,o,c,h,E),Il(i,o,c,E,p))}function Uv(i,o){for(var c=[i[0]],h=1,p=0,g=i.length;h<g;h++)zv(i[h],i[p])>o&&(c.push(i[h]),p=h);return p<g-1&&c.push(i[g-1]),c}var kh;function Oh(i,o,c,h,p){var g=h?kh:Li(i,c),E=Li(o,c),S,x,F;for(kh=E;;){if(!(g|E))return[i,o];if(g&E)return!1;S=g||E,x=Eo(i,o,S,c,p),F=Li(x,c),S===g?(i=x,g=F):(o=x,E=F)}}function Eo(i,o,c,h,p){var g=o.x-i.x,E=o.y-i.y,S=h.min,x=h.max,F,Y;return c&8?(F=i.x+g*(x.y-i.y)/E,Y=x.y):c&4?(F=i.x+g*(S.y-i.y)/E,Y=S.y):c&2?(F=x.x,Y=i.y+E*(x.x-i.x)/g):c&1&&(F=S.x,Y=i.y+E*(S.x-i.x)/g),new G(F,Y,p)}function Li(i,o){var c=0;return i.x<o.min.x?c|=1:i.x>o.max.x&&(c|=2),i.y<o.min.y?c|=4:i.y>o.max.y&&(c|=8),c}function zv(i,o){var c=o.x-i.x,h=o.y-i.y;return c*c+h*h}function ar(i,o,c,h){var p=o.x,g=o.y,E=c.x-p,S=c.y-g,x=E*E+S*S,F;return x>0&&(F=((i.x-p)*E+(i.y-g)*S)/x,F>1?(p=c.x,g=c.y):F>0&&(p+=E*F,g+=S*F)),E=i.x-p,S=i.y-g,h?E*E+S*S:new G(p,g)}function Yt(i){return!A(i[0])||typeof i[0][0]!="object"&&typeof i[0][0]<"u"}function Nh(i){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Yt(i)}function Mh(i,o){var c,h,p,g,E,S,x,F;if(!i||i.length===0)throw new Error("latlngs not passed");Yt(i)||(console.warn("latlngs are not flat! Only the first ring will be used"),i=i[0]);var Y=le([0,0]),re=He(i),ge=re.getNorthWest().distanceTo(re.getSouthWest
25())*re.getNorthEast().distanceTo(re.getNorthWest());ge<1700&&(Y=Cl(i));var xt=i.length,ct=[];for(c=0;c<xt;c++){var Jt=le(i[c]);ct.push(o.project(le([Jt.lat-Y.lat,Jt.lng-Y.lng])))}for(c=0,h=0;c<xt-1;c++)h+=ct[c].distanceTo(ct[c+1])/2;if(h===0)F=ct[0];else for(c=0,g=0;c<xt-1;c++)if(E=ct[c],S=ct[c+1],p=E.distanceTo(S),g+=p,g>h){x=(g-h)/p,F=[S.x-x*(S.x-E.x),S.y-x*(S.y-E.y)];break}var Ot=o.unproject(te(F));return le([Ot.lat+Y.lat,Ot.lng+Y.lng])}var Hv={__proto__:null,simplify:Rh,pointToSegmentDistance:Ah,closestPointOnSegment:Fv,clipSegment:Oh,_getEdgeIntersection:Eo,_getBitCode:Li,_sqClosestPointOnSegment:ar,isFlat:Yt,_flat:Nh,polylineCenter:Mh},Sl={project:function(i){return new G(i.lng,i.lat)},unproject:function(i){return new Se(i.y,i.x)},bounds:new Ce([-180,-90],[180,90])},Pl={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Ce([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(i){var o=Math.PI/180,c=this.R,h=i.lat*o,p=this.R_MINOR/c,g=Math.sqrt(1-p*p),E=g*Math.sin(h),S=Math.tan(Math.PI/4-h/2)/Math.pow((1-E)/(1+E),g/2);return h=-c*Math.log(Math.max(S,1e-10)),new G(i.lng*o*c,h)},unproject:function(i){for(var o=180/Math.PI,c=this.R,h=this.R_MINOR/c,p=Math.sqrt(1-h*h),g=Math.exp(-i.y/c),E=Math.PI/2-2*Math.atan(g),S=0,x=.1,F;S<15&&Math.abs(x)>1e-7;S++)F=p*Math.sin(E),F=Math.pow((1-F)/(1+F),p/2),x=Math.PI/2-2*Math.atan(g*F)-E,E+=x;return new Se(E*o,i.x*o/c)}},Wv={__proto__:null,LonLat:Sl,Mercator:Pl,SphericalMercator:Q},Vv=r({},Z,{code:"EPSG:3395",projection:Pl,transformation:function(){var i=.5/(Math.PI*Pl.R);return w(i,.5,-i,.5)}()}),Dh=r({},Z,{code:"EPSG:4326",projection:Sl,transformation:w(1/180,1,-1/180,.5)}),$v=r({},k,{projection:Sl,transformation:w(1,0,-1,0),scale:function(i){return Math.pow(2,i)},zoom:function(i){return Math.log(i)/Math.LN2},distance:function(i,o){var c=o.lng-i.lng,h=o.lat-i.lat;return Math.sqrt(c*c+h*h)},infinite:!0});k.Earth=Z,k.EPSG3395=Vv,k.EPSG3857=b,k.EPSG900913=I,k.EPSG4326=Dh,k.Simple=$v;var nn=Te.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(i){return i.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(i){return i&&i.removeLayer(this),this},getPane:function(i){return this._map.getPane(i?this.options[i]||i:this.options.pane)},addInteractiveTarget:function(i){return this._map._targets[d(i)]=this,this},removeInteractiveTarget:function(i){return delete this._map._targets[d(i)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(i){var o=i.target;if(o.hasLayer(this)){if(this._map=o,this._zoomAnimated=o._zoomAnimated,this.getEvents){var c=this.getEvents();o.on(c,this),this.once("remove",function(){o.off(c,this)},this)}this.onAdd(o),this.fire("add"),o.fire("layeradd",{layer:this})}}});Ie.include({addLayer:function(i){if(!i._layerAdd)throw new Error("The provided object is not a Layer.");var o=d(i);return this._layers[o]?this:(this._layers[o]=i,i._mapToAdd=this,i.beforeAdd&&i.beforeAdd(this),this.whenReady(i._layerAdd,i),this)},removeLayer:function(i){var o=d(i);return this._layers[o]?(this._loaded&&i.onRemove(this),delete this._layers[o],this._loaded&&(this.fire("layerremove",{layer:i}),i.fire("remove")),i._map=i._mapToAdd=null,this):this},hasLayer:function(i){return d(i)in this._layers},eachLayer:function(i,o){for(var c in this._layers)i.call(o,this._layers[c]);return this},_addLayers:function(i){i=i?A(i)?i:[i]:[];for(var o=0,c=i.length;o<c;o++)this.addLayer(i[o])},_addZoomLimit:function(i){(!isNaN(i.options.maxZoom)||!isNaN(i.options.minZoom))&&(this._zoomBoundLayers[d(i)]=i,this._updateZoomLevels())},_removeZoomLimit:function(i){var o=d(i);this._zoomBoundLayers[o]&&(delete this._zoomBoundLayers[o],this._updateZoomLevels())},_updateZoomLevels:function(){var i=1/0,o=-1/0,c=this._getZoomSpan();for(var h in this._zoomBoundLayers){var p=this._zoomBoundLayers[h].options;i=p.minZoom===void 0?i:Math.min(i,p.minZoom),o=p.maxZoom===void 0?o:Math.max(o,p.maxZoom)}this._layersMaxZoom=o===-1/0?void 0:o,this._layersMinZoom=i===1/0?void 0:i,c!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZo
25om&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var as=nn.extend({initialize:function(i,o){T(this,o),this._layers={};var c,h;if(i)for(c=0,h=i.length;c<h;c++)this.addLayer(i[c])},addLayer:function(i){var o=this.getLayerId(i);return this._layers[o]=i,this._map&&this._map.addLayer(i),this},removeLayer:function(i){var o=i in this._layers?i:this.getLayerId(i);return this._map&&this._layers[o]&&this._map.removeLayer(this._layers[o]),delete this._layers[o],this},hasLayer:function(i){var o=typeof i=="number"?i:this.getLayerId(i);return o in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(i){var o=Array.prototype.slice.call(arguments,1),c,h;for(c in this._layers)h=this._layers[c],h[i]&&h[i].apply(h,o);return this},onAdd:function(i){this.eachLayer(i.addLayer,i)},onRemove:function(i){this.eachLayer(i.removeLayer,i)},eachLayer:function(i,o){for(var c in this._layers)i.call(o,this._layers[c]);return this},getLayer:function(i){return this._layers[i]},getLayers:function(){var i=[];return this.eachLayer(i.push,i),i},setZIndex:function(i){return this.invoke("setZIndex",i)},getLayerId:function(i){return d(i)}}),jv=function(i,o){return new as(i,o)},xn=as.extend({addLayer:function(i){return this.hasLayer(i)?this:(i.addEventParent(this),as.prototype.addLayer.call(this,i),this.fire("layeradd",{layer:i}))},removeLayer:function(i){return this.hasLayer(i)?(i in this._layers&&(i=this._layers[i]),i.removeEventParent(this),as.prototype.removeLayer.call(this,i),this.fire("layerremove",{layer:i})):this},setStyle:function(i){return this.invoke("setStyle",i)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var i=new tt;for(var o in this._layers){var c=this._layers[o];i.extend(c.getBounds?c.getBounds():c.getLatLng())}return i}}),Zv=function(i,o){return new xn(i,o)},ls=St.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(i){T(this,i)},createIcon:function(i){return this._createIcon("icon",i)},createShadow:function(i){return this._createIcon("shadow",i)},_createIcon:function(i,o){var c=this._getIconUrl(i);if(!c){if(i==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var h=this._createImg(c,o&&o.tagName==="IMG"?o:null);return this._setIconStyles(h,i),(this.options.crossOrigin||this.options.crossOrigin==="")&&(h.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),h},_setIconStyles:function(i,o){var c=this.options,h=c[o+"Size"];typeof h=="number"&&(h=[h,h]);var p=te(h),g=te(o==="shadow"&&c.shadowAnchor||c.iconAnchor||p&&p.divideBy(2,!0));i.className="leaflet-marker-"+o+" "+(c.className||""),g&&(i.style.marginLeft=-g.x+"px",i.style.marginTop=-g.y+"px"),p&&(i.style.width=p.x+"px",i.style.height=p.y+"px")},_createImg:function(i,o){return o=o||document.createElement("img"),o.src=i,o},_getIconUrl:function(i){return X.retina&&this.options[i+"RetinaUrl"]||this.options[i+"Url"]}});function qv(i){return new ls(i)}var lr=ls.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(i){return typeof lr.imagePath!="string"&&(lr.imagePath=this._detectIconPath()),(this.options.imagePath||lr.imagePath)+ls.prototype._getIconUrl.call(this,i)},_stripUrl:function(i){var o=function(c,h,p){var g=h.exec(c);return g&&g[p]};return i=o(i,/^url\((['"])?(.+)\1\)$/,2),i&&o(i,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var i=Le("div","leaflet-default-icon-path",document.body),o=tr(i,"background-image")||tr(i,"backgroundImage");if(document.body.removeChild(i),o=this._stripUrl(o),o)return o;var c=document.querySelector('link[href$="leaflet.css"]');return c?c.href.substring(0,c.href.length-11-1):""}}),Fh=gn.extend({initialize:function(i){this._marker=i},addHooks:function(){var i=this._marker._icon;this._draggable||(this._draggable=new ei(i,i,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),pe(i,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&nt(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(i){var o=this._marker,c=o._map,h=this._marker.options.autoPanSpeed,p=this._marker.options.autoPanPadding,g=Si(o._icon),E=c.getPixelBounds(),S=c.getPixelOrigin(),x=Be(E.min._subtract(S).add(p),E.max._subtract(S).subtract(p));if(!x.contains(g)){var F=te((Math.max(x.max.x,g.x)-x.max.x)/(E.max.x-x.max.x)-(Math.min(x.min.x,g.x)-x.min.x)/(E.min.x-x.min.x),(Math.max(x.max.y,g.y)-x.max.y)/(E.max.y-x.max.y)-(Math.min(x.min.y,g.y)-x.min.y)/(E.min.y-x.min.y)).multiplyBy(h);c.panBy(F,{animate:!1}),this._draggable._newPos._add(F),this._draggable._startPos._add(F),st(o._icon,this._draggable._newPos),this._onDrag(i),this._panRequest=$e(this._adjustPan.bind(this,i))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(i){this._marker.options.autoPan&&(it(this._panRequest),this._panRequest=$e(this._adjustPan.bind(this,i)))},_onDrag:function(i){var o=this._marker,c=o._shadow,h=Si(o._icon),p=o._map.layerPointToLatLng(h);c&&st(c,h),o._latlng=p,i.latlng=p,i.oldLatLng=this._oldLatLng,o.fire("move",i).fire("drag",i)},_onDragEnd:function(i){it(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",i)}}),To=nn.extend({options:{icon:new lr,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(i,o){T(this,o),this._latlng=le(i)},onAdd:function(i){this._zoomAnimated=this._zoomAnimated&&i.options.markerZoomAnimation,this._zoomAnimated&&i.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(i){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&i.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(i){var o=this._latlng;return this._latlng=le(i),this.update(),this.fire("move",{oldLatLng:o,latlng:this._latlng})},setZIndexOffset:function(i){return this.options.zIndexOffset=i,this.update()},getIcon:function(){return this.options.icon},setIcon:function(i){return this.options.icon=i,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var i=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(i)}return this},_initIcon:function(){var i=this.options,o="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),c=i.icon.createIcon(this._icon),h=!1;c!==this._icon&&(this._icon&&this._removeIcon(),h=!0,i.title&&(c.title=i.title),c.tagName==="IMG"&&(c.alt=i.alt||"")),pe(c,o),i.keyboard&&(c.tabIndex="0",c.setAttribute("role","button")),this._icon=c,i.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&he(c,"focus",this._panOnFocus,this);var p=i.icon.createShadow(this._shadow),g=!1;p!==this._shadow&&(this._removeShadow(),g=!0),p&&(pe(p,o),p.alt=""),this._shadow=p,i.opacity<1&&this._updateOpacity(),h&&this.getPane().appendChild(this._icon),this._initInteraction(),p&&g&&this.getPane(i.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}
vendor: 5,633 bytes, line 25
25),this.options.autoPanOnFocus&&je(this._icon,"focus",this._panOnFocus,this),Je(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&Je(this._shadow),this._shadow=null},_setPos:function(i){this._icon&&st(this._icon,i),this._shadow&&st(this._shadow,i),this._zIndex=i.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(i){this._icon&&(this._icon.style.zIndex=this._zIndex+i)},_animateZoom:function(i){var o=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center).round();this._setPos(o)},_initInteraction:function(){if(this.options.interactive&&(pe(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Fh)){var i=this.options.draggable;this.dragging&&(i=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Fh(this),i&&this.dragging.enable()}},setOpacity:function(i){return this.options.opacity=i,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var i=this.options.opacity;this._icon&&Kt(this._icon,i),this._shadow&&Kt(this._shadow,i)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var i=this._map;if(i){var o=this.options.icon.options,c=o.iconSize?te(o.iconSize):te(0,0),h=o.iconAnchor?te(o.iconAnchor):te(0,0);i.panInside(this._latlng,{paddingTopLeft:h,paddingBottomRight:c.subtract(h)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Gv(i,o){return new To(i,o)}var ti=nn.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(i){this._renderer=i.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(i){return T(this,i),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&i&&Object.prototype.hasOwnProperty.call(i,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),Co=ti.extend({options:{fill:!0,radius:10},initialize:function(i,o){T(this,o),this._latlng=le(i),this._radius=this.options.radius},setLatLng:function(i){var o=this._latlng;return this._latlng=le(i),this.redraw(),this.fire("move",{oldLatLng:o,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(i){return this.options.radius=this._radius=i,this.redraw()},getRadius:function(){return this._radius},setStyle:function(i){var o=i&&i.radius||this._radius;return ti.prototype.setStyle.call(this,i),this.setRadius(o),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var i=this._radius,o=this._radiusY||i,c=this._clickTolerance(),h=[i+c,o+c];this._pxBounds=new Ce(this._point.subtract(h),this._point.add(h))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(i){return i.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function Kv(i,o){return new Co(i,o)}var xl=Co.extend({initialize:function(i,o,c){if(typeof o=="number"&&(o=r({},c,{radius:o})),T(this,o),this._latlng=le(i),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(i){return this._mRadius=i,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var i=[this._radius,this._radiusY||this._radius];return new tt(this._map.layerPointToLatLng(this._point.subtract(i)),this._map.layerPointToLatLng(this._point.add(i)))},setStyle:ti.prototype.setStyle,_project:function(){var i=this._latlng.lng,o=this._latlng.lat,c=this._map,h=c.options.crs;if(h.distance===Z.distance){var p=Math.PI/180,g=this._mRadius/Z.R/p,E=c.project([o+g,i]),S=c.project([o-g,i]),x=E.add(S).divideBy(2),F=c.unproject(x).lat,Y=Math.acos((Math.cos(g*p)-Math.sin(o*p)*Math.sin(F*p))/(Math.cos(o*p)*Math.cos(F*p)))/p;(isNaN(Y)||Y===0)&&(Y=g/Math.cos(Math.PI/180*o)),this._point=x.subtract(c.getPixelOrigin()),this._radius=isNaN(Y)?0:x.x-c.project([F,i-Y]).x,this._radiusY=x.y-E.y}else{var re=h.unproject(h.project(this._latlng).subtract([this._mRadius,0]));this._point=c.latLngToLayerPoint(this._latlng),this._radius=this._point.x-c.latLngToLayerPoint(re).x}this._updateBounds()}});function Yv(i,o,c){return new xl(i,o,c)}var Ln=ti.extend({options:{smoothFactor:1,noClip:!1},initialize:function(i,o){T(this,o),this._setLatLngs(i)},getLatLngs:function(){return this._latlngs},setLatLngs:function(i){return this._setLatLngs(i),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(i){for(var o=1/0,c=null,h=ar,p,g,E=0,S=this._parts.length;E<S;E++)for(var x=this._parts[E],F=1,Y=x.length;F<Y;F++){p=x[F-1],g=x[F];var re=h(i,p,g,!0);re<o&&(o=re,c=h(i,p,g))}return c&&(c.distance=Math.sqrt(o)),c}
25,getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Mh(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(i,o){return o=o||this._defaultShape(),i=le(i),o.push(i),this._bounds.extend(i),this.redraw()},_setLatLngs:function(i){this._bounds=new tt,this._latlngs=this._convertLatLngs(i)},_defaultShape:function(){return Yt(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(i){for(var o=[],c=Yt(i),h=0,p=i.length;h<p;h++)c?(o[h]=le(i[h]),this._bounds.extend(o[h])):o[h]=this._convertLatLngs(i[h]);return o},_project:function(){var i=new Ce;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,i),this._bounds.isValid()&&i.isValid()&&(this._rawPxBounds=i,this._updateBounds())},_updateBounds:function(){var i=this._clickTolerance(),o=new G(i,i);this._rawPxBounds&&(this._pxBounds=new Ce([this._rawPxBounds.min.subtract(o),this._rawPxBounds.max.add(o)]))},_projectLatlngs:function(i,o,c){var h=i[0]instanceof Se,p=i.length,g,E;if(h){for(E=[],g=0;g<p;g++)E[g]=this._map.latLngToLayerPoint(i[g]),c.extend(E[g]);o.push(E)}else for(g=0;g<p;g++)this._projectLatlngs(i[g],o,c)},_clipPoints:function(){var i=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(i))){if(this.options.noClip){this._parts=this._rings;return}var o=this._parts,c,h,p,g,E,S,x;for(c=0,p=0,g=this._rings.length;c<g;c++)for(x=this._rings[c],h=0,E=x.length;h<E-1;h++)S=Oh(x[h],x[h+1],i,h,!0),S&&(o[p]=o[p]||[],o[p].push(S[0]),(S[1]!==x[h+1]||h===E-2)&&(o[p].push(S[1]),p++))}},_simplifyPoints:function(){for(var i=this._parts,o=this.options.smoothFactor,c=0,h=i.length;c<h;c++)i[c]=Rh(i[c],o)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(i,o){var c,h,p,g,E,S,x=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(i))return!1;for(c=0,g=this._parts.length;c<g;c++)for(S=this._parts[c],h=0,E=S.length,p=E-1;h<E;p=h++)if(!(!o&&h===0)&&Ah(i,S[p],S[h])<=x)return!0;return!1}});function Jv(i,o){return new Ln(i,o)}Ln._flat=Nh;var cs=Ln.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length}
25,getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Lh(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(i){var o=Ln.prototype._convertLatLngs.call(this,i),c=o.length;return c>=2&&o[0]instanceof Se&&o[0].equals(o[c-1])&&o.pop(),o},_setLatLngs:function(i){Ln.prototype._setLatLngs.call(this,i),Yt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Yt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var i=this._renderer._bounds,o=this.options.weight,c=new G(o,o);if(i=new Ce(i.min.subtract(c),i.max.add(c)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(i))){if(this.options.noClip){this._parts=this._rings;return}for(var h=0,p=this._rings.length,g;h<p;h++)g=xh(this._rings[h],i,!0),g.length&&this._parts.push(g)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(i){var o=!1,c,h,p,g,E,S,x,F;if(!this._pxBounds||!this._pxBounds.contains(i))return!1;for(g=0,x=this._parts.length;g<x;g++)for(c=this._parts[g],E=0,F=c.length,S=F-1;E<F;S=E++)h=c[E],p=c[S],h.y>i.y!=p.y>i.y&&i.x<(p.x-h.x)*(i.y-h.y)/(p.y-h.y)+h.x&&(o=!o);return o||Ln.prototype._containsPoint.call(this,i,!0)}});function Qv(i,o){return new cs(i,o)}var Rn=xn.extend({initialize:function(i,o){T(this,o),this._layers={},i&&this.addData(i)},addData:function(i){var o=A(i)?i:i.features,c,h,p;if(o){for(c=0,h=o.length;c<h;c++)p=o[c],(p.geometries||p.geometry||p.features||p.coordinates)&&this.addData(p);return this}var g=this.options;if(g.filter&&!g.filter(i))return this;var E=Io(i,g);return E?(E.feature=xo(i),E.defaultOptions=E.options,this.resetStyle(E),g.onEachFeature&&g.onEachFeature(i,E),this.addLayer(E)):this},resetStyle:function(i){return i===void 0?this.eachLayer(this.resetStyle,this):(i.options=r({},i.defaultOptions),this._setLayerStyle(i,this.options.style),this)},setStyle:function(i){return this.eachLayer(function(o){this._setLayerStyle(o,i)},this)},_setLayerStyle:function(i,o){i.setStyle&&(typeof o=="function"&&(o=o(i.feature)),i.setStyle(o))}});function Io(i,o){var c=i.type==="Feature"?i.geometry:i,h=c?c.coordinates:null,p=[],g=o&&o.pointToLayer,E=o&&o.coordsToLatLng||Ll,S,x,F,Y;if(!h&&!c)return null;switch(c.type){case"Point":return S=E(h),Bh(g,i,S,o);case"MultiPoint":for(F=0,Y=h.length;F<Y;F++)S=E(h[F]),p.push(Bh(g,i,S,o));return new xn(p);case"LineString":case"MultiLineString":return x=So(h,c.type==="LineString"?0:1,E),new Ln(x,o);case"Polygon":case"MultiPolygon":return x=So(h,c.type==="Polygon"?1:2,E),new cs(x,o);case"GeometryCollection":for(F=0,Y=c.geometries.length;F<Y;F++){var re=Io({geometry:c.geometries[F],type:"Feature",properties:i.properties},o);re&&p.push(re)}return new xn(p);case"FeatureCollection":for(F=0,Y=c.features.length;F<Y;F++){var ge=Io(c.features[F],o);ge&&p.push(ge)}return new xn(p);default:throw new Error("Invalid GeoJSON object.")}}function Bh(i,o,c,h){return i?i(o,c):new To(c,h&&h.markersInheritOptions&&h)}function Ll(i){return new Se(i[1],i[0],i[2])}function So(i,o,c){for(var h=[],p=0,g=i.length,E;p<g;p++)E=o?So(i[p],o-1,c):(c||Ll)(i[p]),h.push(E);return h}function Rl(i,o){return i=le(i),i.alt!==void 0?[v(i.lng,o),v(i.lat,o),v(i.alt,o)]:[v(i.lng,o),v(i.lat,o)]}function Po(i,o,c,h){for(var p=[],g=0,E=i.length;g<E;g++)p.push(o?Po(i[g],Yt(i[g])?0:o-1,c,h):Rl(i[g],h));return!o&&c&&p.length>0&&p.push(p[0].slice()),p}function us(i,o){return i.feature?r({},i.feature,{geometry:o}):xo(o)}function xo(i){return i.type==="Feature"||i.type==="FeatureCollection"?i:{type:"Feature",properties:{},geometry:i}}var Al={toGeoJSON:function(i){return us(this,{type:"Point",coordinates:Rl(this.getLatLng(),i)})}};To.include(Al),xl.include(Al),Co.include(Al),Ln.include({toGeoJSON:function(i){var o=!Yt(this._latlngs),c=Po(this._latlngs,o?1:0,!1,i);return us(this,{type:(o?"Multi":"")+"LineString",coordinates:c})}}),cs.include({toGeoJSON:function(i){var o=!Yt(this._latlngs),c=o&&!Yt(this._latlngs[0]),h=Po(this._latlngs,c?2:o?1:0,!0,i);return o||(h=[h]),us(this,{type:(c?"Multi":"")+"Polygon",coordinates:h})}}),as.include({toMultiPoint:function(i){var o=[];return this.eachLayer(function(c){o.push(c.toGeoJSON(i).geometry.coordinates)}),us(this,{type:"MultiPoint",coordinates:o})},toGeoJSON:function(i){var o=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(o==="MultiPoint")return this.toMultiPoint(i);var c=o==="GeometryCollection",h=[];return this.eachLayer(function(p){if(p.toGeoJSON){var g=p.toGeoJSON(i);if(c)h.push(g.geometry);else{var E=xo(g);E.type==="FeatureCollection"?h.push.apply(h,E.features):h.push(E)}}}),c?us(this,{geometries:h,type:"GeometryCollection"}):{type:"FeatureCollection",features:h}}});function Uh(i,o){return new Rn(i,o)}var Xv=Uh,Lo=nn.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(i,o,c){this._url=i,this._bounds=He(o),T(this,c)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(pe(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Je(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(i){return this.options.opacity=i,this._image&&this._updateOpacity(),this},setStyle:function(i){return i.opacity&&this.setOpacity(i.opacity),this},bringToFront:function(){return this._map&&rs(this._image),this},bringToBack:function(){return this._map&&os(this._image),this},setUrl:function(i){return this._url=i,this._image&&(this._image.src=i),this},setBounds:function(i){return this._bounds=He(i),this._map&&this._reset(),this},getEvents:function(){var i={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(i.zoomanim=this._animateZoom),i},setZIndex:function(i){return this.options.zIndex=i,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var i=this._url.tagName==="IMG",o=this._image=i?this._url:Le("img");if(pe(o,"leaflet-image-layer"),this._zoomAnimated&&pe(o,"leaflet-zoom-animated"),this.options.className&&pe(o,this.options.className),o.onselectstart=_,o.onmousemove=_,o.onload=l(this.fire,this,"load"),o.onerror=l(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(o.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),i){this._url=o.src;return}o.src=this._url,o.alt=this.options.alt},_animateZoom:function(i){var o=this._map.getZoomScale(i.zoom),c=this._map._latLngBoundsToNewLayerBounds(this._bounds,i.zoom,i.center).min;Ii(this._image,c,o)},_reset:function(){var i=this._image,o=new Ce(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),c=o.getSize();st(i,o.min),i.style.width=c.x+"px",i.style.height=c.y+"px"},_updateOpacity:function(){Kt(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var i=this.options.errorOverlayUrl;i&&this._url!==i&&(this._url=i,this._image.src=i)},getCenter:function(){return this._bounds.getCenter()}}),ey=function(i,o,c){return new Lo(i,o,c)},zh=Lo.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInl
25ine:!0},_initImage:function(){var i=this._url.tagName==="VIDEO",o=this._image=i?this._url:Le("video");if(pe(o,"leaflet-image-layer"),this._zoomAnimated&&pe(o,"leaflet-zoom-animated"),this.options.className&&pe(o,this.options.className),o.onselectstart=_,o.onmousemove=_,o.onloadeddata=l(this.fire,this,"load"),i){for(var c=o.getElementsByTagName("source"),h=[],p=0;p<c.length;p++)h.push(c[p].src);this._url=c.length>0?h:[o.src];return}A(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(o.style,"objectFit")&&(o.style.objectFit="fill"),o.autoplay=!!this.options.autoplay,o.loop=!!this.options.loop,o.muted=!!this.options.muted,o.playsInline=!!this.options.playsInline;for(var g=0;g<this._url.length;g++){var E=Le("source");E.src=this._url[g],o.appendChild(E)}}});function ty(i,o,c){return new zh(i,o,c)}var Hh=Lo.extend({_initImage:function(){var i=this._image=this._url;pe(i,"leaflet-image-layer"),this._zoomAnimated&&pe(i,"leaflet-zoom-animated"),this.options.className&&pe(i,this.options.className),i.onselectstart=_,i.onmousemove=_}});function ny(i,o,c){return new Hh(i,o,c)}var vn=nn.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(i,o){i&&(i instanceof Se||A(i))?(this._latlng=le(i),T(this,o)):(T(this,i),this._source=o),this.options.content&&(this._content=this.options.content)},openOn:function(i){return i=arguments.length?i:this._source._map,i.hasLayer(this)||i.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(i){return this._map?this.close():(arguments.length?this._source=i:i=this._source,this._prepareOpen(),this.openOn(i._map)),this},onAdd:function(i){this._zoomAnimated=i._zoomAnimated,this._container||this._initLayout(),i._fadeAnimated&&Kt(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),i._fadeAnimated&&Kt(this._container,1),this.bringToFront(),this.options.interactive&&(pe(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(i){i._fadeAnimated?(Kt(this._container,0),this._removeTimeout=setTimeout(l(Je,void 0,this._container),200)):Je(this._container),this.options.interactive&&(nt(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(i){return this._latlng=le(i),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(i){return this._content=i,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var i={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(i.zoomanim=this._animateZoom),i},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&rs(this._container),this},bringToBack:function(){return this._map&&os(this._container),this},_prepareOpen:function(i){var o=this._source;if(!o._map)return!1;if(o instanceof xn){o=null;var c=this._source._layers;for(var h in c)if(c[h]._map){o=c[h];break}if(!o)return!1;this._source=o}if(!i)if(o.getCenter)i=o.getCenter();else if(o.getLatLng)i=o.getLatLng();else if(o.getBounds)i=o.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(i),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var i=this._contentNode,o=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof o=="string")i.innerHTML=o;else{for(;i.hasChildNodes();)i.removeChild(i.firstChild);i.appendChild(o)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var i=this._map.latLngToLayerPoint(this._latlng),o=te(this.options.offset),c=this._getAnchor();this._zoomAnimated?st(this._container,i.add(c)):o=o.add(i).add(c);var h=this._containerBottom=-o.y,p=this._containerLeft=-Math.round(this._containerWidth/2)+o.x;this._container.style.bottom=h+"px",this._container.style.left=p+"px"}},_getAnchor:function(){return[0,0]}});Ie.include({_initOverlay:function(i,o,c,h){var p=o;
25return p instanceof i||(p=new i(h).setContent(o)),c&&p.setLatLng(c),p}}),nn.include({_initOverlay:function(i,o,c,h){var p=c;return p instanceof i?(T(p,h),p._source=this):(p=o&&!h?o:new i(h,this),p.setContent(c)),p}});var Ro=vn.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(i){return i=arguments.length?i:this._source._map,!i.hasLayer(this)&&i._popup&&i._popup.options.autoClose&&i.removeLayer(i._popup),i._popup=this,vn.prototype.openOn.call(this,i)},onAdd:function(i){vn.prototype.onAdd.call(this,i),i.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof ti||this._source.on("preclick",Pi))},onRemove:function(i){vn.prototype.onRemove.call(this,i),i.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof ti||this._source.off("preclick",Pi))},getEvents:function(){var i=vn.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(i.preclick=this.close),this.options.keepInView&&(i.moveend=this._adjustPan),i},_initLayout:function(){var i="leaflet-popup",o=this._container=Le("div",i+" "+(this.options.className||"")+" leaflet-zoom-animated"),c=this._wrapper=Le("div",i+"-content-wrapper",o);if(this._contentNode=Le("div",i+"-content",c),rr(o),wl(this._contentNode),he(o,"contextmenu",Pi),this._tipContainer=Le("div",i+"-tip-container",o),this._tip=Le("div",i+"-tip",this._tipContainer),this.options.closeButton){var h=this._closeButton=Le("a",i+"-close-button",o);h.setAttribute("role","button"),h.setAttribute("aria-label","Close popup"),h.href="#close",h.innerHTML='<span aria-hidden="true">×</span>',he(h,"click",function(p){pt(p),this.close()},this)}},_updateLayout:function(){var i=this._contentNode,o=i.style;o.width="",o.whiteSpace="nowrap";var c=i.offsetWidth;c=Math.min(c,this.options.maxWidth),c=Math.max(c,this.options.minWidth),o.width=c+1+"px",o.whiteSpace="",o.height="";var h=i.offsetHeight,p=this.options.maxHeight,g="leaflet-popup-scrolled";p&&h>p?(o.height=p+"px",pe(i,g)):nt(i,g),this._containerWidth=this._container.offsetWidth},_animateZoom:function(i){var o=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center),c=this._getAnchor();st(this._container,o.add(c))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var i=this._map,o=parseInt(tr(this._container,"marginBottom"),10)||0,c=this._container.offsetHeight+o,h=this._containerWidth,p=new G(this._containerLeft,-c-this._containerBottom);p._add(Si(this._container));var g=i.layerPointToContainerPoint(p),E=te(this.options.autoPanPadding),S=te(this.options.autoPanPaddingTopLeft||E),x=te(this.options.autoPanPaddingBottomRight||E),F=i.getSize(),Y=0,re=0;g.x+h+x.x>F.x&&(Y=g.x+h-F.x+x.x),g.x-Y-S.x<0&&(Y=g.x-S.x),g.y+c+x.y>F.y&&(re=g.y+c-F.y+x.y),g.y-re-S.y<0&&(re=g.y-S.y),(Y||re)&&(this.options.keepInView&&(this._autopanning=!0),i.fire("autopanstart").panBy([Y,re]))}},_getAnchor:function(){return te(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),iy=function(i,o){return new Ro(i,o)};Ie.mergeOptions({closePopupOnClick:!0}),Ie.include({openPopup:function(i,o,c){return this._initOverlay(Ro,i,o,c).openOn(this),this},closePopup:function(i){return i=arguments.length?i:this._popup,i&&i.close(),this}}),nn.include({bindPopup:function(i,o){return this._popup=this._initOverlay(Ro,this._popup,i,o),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(i){return this._popup&&(this instanceof xn||(this._popup._source=this),this._popup._prepareOpen(i||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1}
25,setPopupContent:function(i){return this._popup&&this._popup.setContent(i),this},getPopup:function(){return this._popup},_openPopup:function(i){if(!(!this._popup||!this._map)){xi(i);var o=i.layer||i.target;if(this._popup._source===o&&!(o instanceof ti)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(i.latlng);return}this._popup._source=o,this.openPopup(i.latlng)}},_movePopup:function(i){this._popup.setLatLng(i.latlng)},_onKeyPress:function(i){i.originalEvent.keyCode===13&&this._openPopup(i)}});var Ao=vn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(i){vn.prototype.onAdd.call(this,i),this.setOpacity(this.options.opacity),i.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(i){vn.prototype.onRemove.call(this,i),i.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var i=vn.prototype.getEvents.call(this);return this.options.permanent||(i.preclick=this.close),i},_initLayout:function(){var i="leaflet-tooltip",o=i+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Le("div",o),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+d(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(i){var o,c,h=this._map,p=this._container,g=h.latLngToContainerPoint(h.getCenter()),E=h.layerPointToContainerPoint(i),S=this.options.direction,x=p.offsetWidth,F=p.offsetHeight,Y=te(this.options.offset),re=this._getAnchor();S==="top"?(o=x/2,c=F):S==="bottom"?(o=x/2,c=0):S==="center"?(o=x/2,c=F/2):S==="right"?(o=0,c=F/2):S==="left"?(o=x,c=F/2):E.x<g.x?(S="right",o=0,c=F/2):(S="left",o=x+(Y.x+re.x)*2,c=F/2),i=i.subtract(te(o,c,!0)).add(Y).add(re),nt(p,"leaflet-tooltip-right"),nt(p,"leaflet-tooltip-left"),nt(p,"leaflet-tooltip-top"),nt(p,"leaflet-tooltip-bottom"),pe(p,"leaflet-tooltip-"+S),st(p,i)},_updatePosition:function(){var i=this._map.latLngToLayerPoint(this._latlng);this._setPosition(i)},setOpacity:function(i){this.options.opacity=i,this._container&&Kt(this._container,i)},_animateZoom:function(i){var o=this._map._latLngToNewLayerPoint(this._latlng,i.zoom,i.center);this._setPosition(o)},_getAnchor:function(){return te(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),sy=function(i,o){return new Ao(i,o)};Ie.include({openTooltip:function(i,o,c){return this._initOverlay(Ao,i,o,c).openOn(this),this},closeTooltip:function(i){return i.close(),this}}),nn.include({bindTooltip:function(i,o){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ao,this._tooltip,i,o),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(i){if(!(!i&&this._tooltipHandlersAdded)){var o=i?"off":"on",c={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?c.add=this._openTooltip:(c.mouseover=this._openTooltip,c.mouseout=this.closeTooltip,c.click=this._openTooltip,this._map?this._addFocusListeners():c.add=this._addFocusListeners),this._tooltip.options.sticky&&(c.mousemove=this._moveTooltip),this[o](c),this._tooltipHandlersAdded=!i}},openTooltip:function(i){return this._tooltip&&(this instanceof xn||(this._tooltip._source=this),this._tooltip._prepareOpen(i)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(i){return this._tooltip&&this._tooltip.setContent(i),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(i){var o=typeof i.getElement=="function"&&i.getElement();o&&(he(o,"focus",function(){this._tooltip._source=i,this.openTooltip()},this),he(o,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(i){var o=typeof i.getElement=="function"&&i.getElement();o&&o.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(i){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var o=this;this._map.once("moveend",function(){o._openOnceFlag=!1,o._openTooltip(i)});return}this._tooltip._source=i.layer||i.target,this.openTooltip(this._tooltip.options.sticky?i.latlng:void 0)}},_moveTooltip:function(i){var o=i.latlng,c,h;this._tooltip.options.sticky&&i.originalEvent&&(c=this._map.mouseEventToContainerPoint(i.originalEvent),h=this._map.containerPointToLayerPoint(c),o=this._map.layerPointToLatLng(h)),this._tooltip.setLatLng(o)}});var Wh=ls.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(i){var o=i&&i.tagName==="DIV"?i:document.createElement("div"),c=this.options;if(c.html instanceof Element?(go(o),o.appendChild(c.html)):o.innerHTML=c.html!==!1?c.html:"",c.bgPos){var h=te(c.bgPos);o.style.backgroundPosition=-h.x+"px "+-h.y+"px"}return this._setIconStyles(o,"icon"),o},createShadow:function(){return null}});function ry(i){return new Wh(i)}ls.Default=lr;var cr=nn.extend({options:{tileSize:256,opacity:1,updateWhenIdle:X.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(i){T(this,i)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()}
25,beforeAdd:function(i){i._addZoomLimit(this)},onRemove:function(i){this._removeAllTiles(),Je(this._container),i._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(rs(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(os(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(i){return this.options.opacity=i,this._updateOpacity(),this},setZIndex:function(i){return this.options.zIndex=i,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var i=this._clampZoom(this._map.getZoom());i!==this._tileZoom&&(this._tileZoom=i,this._updateLevels()),this._update()}return this},getEvents:function(){var i={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=f(this._onMoveEnd,this.options.updateInterval,this)),i.move=this._onMove),this._zoomAnimated&&(i.zoomanim=this._animateZoom),i},createTile:function(){return document.createElement("div")},getTileSize:function(){var i=this.options.tileSize;return i instanceof G?i:new G(i,i)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(i){for(var o=this.getPane().children,c=-i(-1/0,1/0),h=0,p=o.length,g;h<p;h++)g=o[h].style.zIndex,o[h]!==this._container&&g&&(c=i(c,+g));isFinite(c)&&(this.options.zIndex=c+i(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!X.ielt9){Kt(this._container,this.options.opacity);var i=+new Date,o=!1,c=!1;for(var h in this._tiles){var p=this._tiles[h];if(!(!p.current||!p.loaded)){var g=Math.min(1,(i-p.loaded)/200);Kt(p.el,g),g<1?o=!0:(p.active?c=!0:this._onOpaqueTile(p),p.active=!0)}}c&&!this._noPrune&&this._pruneTiles(),o&&(it(this._fadeFrame),this._fadeFrame=$e(this._updateOpacity,this))}},_onOpaqueTile:_,_initContainer:function(){this._container||(this._container=Le("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var i=this._tileZoom,o=this.options.maxZoom;if(i!==void 0){for(var c in this._levels)c=Number(c),this._levels[c].el.children.length||c===i?(this._levels[c].el.style.zIndex=o-Math.abs(i-c),this._onUpdateLevel(c)):(Je(this._levels[c].el),this._removeTilesAtZoom(c),this._onRemoveLevel(c),delete this._levels[c]);var h=this._levels[i],p=this._map;return h||(h=this._levels[i]={},h.el=Le("div","leaflet-tile-container leaflet-zoom-animated",this._container),h.el.style.zIndex=o,h.origin=p.project(p.unproject(p.getPixelOrigin()),i).round(),h.zoom=i,this._setZoomTransform(h,p.getCenter(),p.getZoom()),_(h.el.offsetWidth),this._onCreateLevel(h)),this._level=h,h}},_onUpdateLevel:_,_onRemoveLevel:_,_onCreateLevel:_,_pruneTiles:function(){if(this._map){var i,o,c=this._map.getZoom();if(c>this.options.maxZoom||c<this.options.minZoom){this._removeAllTiles();return}for(i in this._tiles)o=this._tiles[i],o.retain=o.current;for(i in this._tiles)if(o=this._tiles[i],o.current&&!o.active){var h=o.coords;this._retainParent(h.x,h.y,h.z,h.z-5)||this._retainChildren(h.x,h.y,h.z,h.z+2)}for(i in this._tiles)this._tiles[i].retain||this._removeTile(i)}},_removeTilesAtZoom:function(i){for(var o in this._tiles)this._tiles[o].coords.z===i&&this._removeTile(o)},_removeAllTiles:function(){for(var i in this._tiles)this._removeTile(i)},_invalidateAll:function(){for(var i in this._levels)Je(this._levels[i].el),this._onRemoveLevel(Number(i)),delete this._levels[i];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(i,o,c,h){var p=Math.floor(i/2),g=Math.floor(o/2),E=c-1,S=new G(+p,+g);S.z=+E;var x=this._tileCoordsToKey(S),F=this._tiles[x];return F&&F.active?(F.retain=!0,!0):(F&&F.loaded&&(F.retain=!0),E>h?this._retainParent(p,g,E,h):!1)},_retainChildren:function(i,o,c,h){for(var p=2*i;p<2*i+2;p++)for(var g=2*o;g<2*o+2;g++){var E=new G(p,g);E.z=c+1;var S=this._tileCoordsToKey(E),x=this._tiles[S];if(x&&x.active){x.retain=!0;continue}else x&&x.loaded&&(x.retain=!0);c+1<h&&this._retainChildren(p,g,c+1,h)}},_resetView:function(i){var o=i&&(i.pinch||i.flyTo);
25this._setView(this._map.getCenter(),this._map.getZoom(),o,o)},_animateZoom:function(i){this._setView(i.center,i.zoom,!0,i.noUpdate)},_clampZoom:function(i){var o=this.options;return o.minNativeZoom!==void 0&&i<o.minNativeZoom?o.minNativeZoom:o.maxNativeZoom!==void 0&&o.maxNativeZoom<i?o.maxNativeZoom:i},_setView:function(i,o,c,h){var p=Math.round(o);this.options.maxZoom!==void 0&&p>this.options.maxZoom||this.options.minZoom!==void 0&&p<this.options.minZoom?p=void 0:p=this._clampZoom(p);var g=this.options.updateWhenZooming&&p!==this._tileZoom;(!h||g)&&(this._tileZoom=p,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),p!==void 0&&this._update(i),c||this._pruneTiles(),this._noPrune=!!c),this._setZoomTransforms(i,o)},_setZoomTransforms:function(i,o){for(var c in this._levels)this._setZoomTransform(this._levels[c],i,o)},_setZoomTransform:function(i,o,c){var h=this._map.getZoomScale(c,i.zoom),p=i.origin.multiplyBy(h).subtract(this._map._getNewPixelOrigin(o,c)).round();X.any3d?Ii(i.el,p,h):st(i.el,p)},_resetGrid:function(){var i=this._map,o=i.options.crs,c=this._tileSize=this.getTileSize(),h=this._tileZoom,p=this._map.getPixelWorldBounds(this._tileZoom);p&&(this._globalTileRange=this._pxBoundsToTileRange(p)),this._wrapX=o.wrapLng&&!this.options.noWrap&&[Math.floor(i.project([0,o.wrapLng[0]],h).x/c.x),Math.ceil(i.project([0,o.wrapLng[1]],h).x/c.y)],this._wrapY=o.wrapLat&&!this.options.noWrap&&[Math.floor(i.project([o.wrapLat[0],0],h).y/c.x),Math.ceil(i.project([o.wrapLat[1],0],h).y/c.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(i){var o=this._map,c=o._animatingZoom?Math.max(o._animateToZoom,o.getZoom()):o.getZoom(),h=o.getZoomScale(c,this._tileZoom),p=o.project(i,this._tileZoom).floor(),g=o.getSize().divideBy(h*2);return new Ce(p.subtract(g),p.add(g))},_update:function(i){var o=this._map;if(o){var c=this._clampZoom(o.getZoom());if(i===void 0&&(i=o.getCenter()),this._tileZoom!==void 0){var h=this._getTiledPixelBounds(i),p=this._pxBoundsToTileRange(h),g=p.getCenter(),E=[],S=this.options.keepBuffer,x=new Ce(p.getBottomLeft().subtract([S,-S]),p.getTopRight().add([S,-S]));if(!(isFinite(p.min.x)&&isFinite(p.min.y)&&isFinite(p.max.x)&&isFinite(p.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var F in this._tiles){var Y=this._tiles[F].coords;(Y.z!==this._tileZoom||!x.contains(new G(Y.x,Y.y)))&&(this._tiles[F].current=!1)}if(Math.abs(c-this._tileZoom)>1){this._setView(i,c);return}for(var re=p.min.y;re<=p.max.y;re++)for(var ge=p.min.x;ge<=p.max.x;ge++){var xt=new G(ge,re);if(xt.z=this._tileZoom,!!this._isValidTile(xt)){var ct=this._tiles[this._tileCoordsToKey(xt)];ct?ct.current=!0:E.push(xt)}}if(E.sort(function(Ot,ds){return Ot.distanceTo(g)-ds.distanceTo(g)}),E.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Jt=document.createDocumentFragment();for(ge=0;ge<E.length;ge++)this._addTile(E[ge],Jt);this._level.el.appendChild(Jt)}}}},_isValidTile:function(i){var o=this._map.options.crs;if(!o.infinite){var c=this._globalTileRange;if(!o.wrapLng&&(i.x<c.min.x||i.x>c.max.x)||!o.wrapLat&&(i.y<c.min.y||i.y>c.max.y))return!1}if(!this.options.bounds)return!0;var h=this._tileCoordsToBounds(i);return He(this.options.bounds).overlaps(h)},_keyToBounds:function(i){return this._tileCoordsToBounds(this._keyToTileCoords(i))},_tileCoordsToNwSe:function(i){var o=this._map,c=this.getTileSize(),h=i.scaleBy(c),p=h.add(c),g=o.unproject(h,i.z),E=o.unproject(p,i.z);return[g,E]},_tileCoordsToBounds:function(i){var o=this._tileCoordsToNwSe(i),c=new tt(o[0],o[1]);return this.options.noWrap||(c=this._map.wrapLatLngBounds(c)),c},_tileCoordsToKey:function(i){return i.x+":"+i.y+":"+i.z},_keyToTileCoords:function(i){var o=i.split(":"),c=new G(+o[0],+o[1]);return c.z=+o[2],c},_removeTile:function(i){var o=this._tiles[i];o&&(Je(o.el),delete this._tiles[i],this.fire("tileunload",{tile:o.el,coords:this._keyToTileCoords(i)}))},_initTile:function(i){pe(i,"leaflet-tile");var o=this.getTileSize();i.style.width=o.x+"px",i.style.height=o.y+"px",i.onselectstart=_,i.onmousemove=_,X.ielt9&&this.options.opacity<1&&Kt(i,this.options.opacity)},_addTile:function(i,o){var c=this._getTilePos(i),h=this._tileCoordsToKey(i),p=this.createTile(this._wrapCoords(i),l(this._tileReady,this,i));this._initTile(p),this.createTile.length<2&&$e(l(this._tileReady,this,i,null,p)),st(p,c),this._tiles[h]={el:p,coords:i,current:!0},o.appendChild(p),this.fire("tileloadstart",{tile:p,coords:i})},_tileReady:function(i,o,c){o&&this.fire("tileerror",{error:o,tile:c,coords:i});var h=this._tileCoordsToKey(i);c=this._tiles[h],c&&(c.loaded=+new Date,this._map._fadeAnimated?(Kt(c.el,0),it
vendor: 5,849 bytes, line 25
25(this._fadeFrame),this._fadeFrame=$e(this._updateOpacity,this)):(c.active=!0,this._pruneTiles()),o||(pe(c.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:c.el,coords:i})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),X.ielt9||!this._map._fadeAnimated?$e(this._pruneTiles,this):setTimeout(l(this._pruneTiles,this),250)))},_getTilePos:function(i){return i.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(i){var o=new G(this._wrapX?m(i.x,this._wrapX):i.x,this._wrapY?m(i.y,this._wrapY):i.y);return o.z=i.z,o},_pxBoundsToTileRange:function(i){var o=this.getTileSize();return new Ce(i.min.unscaleBy(o).floor(),i.max.unscaleBy(o).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var i in this._tiles)if(!this._tiles[i].loaded)return!1;return!0}});function oy(i){return new cr(i)}var hs=cr.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(i,o){this._url=i,o=T(this,o),o.detectRetina&&X.retina&&o.maxZoom>0?(o.tileSize=Math.floor(o.tileSize/2),o.zoomReverse?(o.zoomOffset--,o.minZoom=Math.min(o.maxZoom,o.minZoom+1)):(o.zoomOffset++,o.maxZoom=Math.max(o.minZoom,o.maxZoom-1)),o.minZoom=Math.max(0,o.minZoom)):o.zoomReverse?o.minZoom=Math.min(o.maxZoom,o.minZoom):o.maxZoom=Math.max(o.minZoom,o.maxZoom),typeof o.subdomains=="string"&&(o.subdomains=o.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(i,o){return this._url===i&&o===void 0&&(o=!0),this._url=i,o||this.redraw(),this},createTile:function(i,o){var c=document.createElement("img");return he(c,"load",l(this._tileOnLoad,this,o,c)),he(c,"error",l(this._tileOnError,this,o,c)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(c.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(c.referrerPolicy=this.options.referrerPolicy),c.alt="",c.src=this.getTileUrl(i),c},getTileUrl:function(i){var o={r:X.retina?"@2x":"",s:this._getSubdomain(i),x:i.x,y:i.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var c=this._globalTileRange.max.y-i.y;this.options.tms&&(o.y=c),o["-y"]=c}return B(this._url,r(o,this.options))},_tileOnLoad:function(i,o){X.ielt9?setTimeout(l(i,this,null,o),0):i(null,o)},_tileOnError:function(i,o,c){var h=this.options.errorTileUrl;h&&o.getAttribute("src")!==h&&(o.src=h),i(c,o)},_onTileRemove:function(i){i.tile.onload=null},_getZoomForUrl:function(){var i=this._tileZoom,o=this.options.maxZoom,c=this.options.zoomReverse,h=this.options.zoomOffset;return c&&(i=o-i),i+h},_getSubdomain:function(i){var o=Math.abs(i.x+i.y)%this.options.subdomains.length;return this.options.subdomains[o]},_abortLoading:function(){var i,o;for(i in this._tiles)if(this._tiles[i].coords.z!==this._tileZoom&&(o=this._tiles[i].el,o.onload=_,o.onerror=_,!o.complete)){o.src=j;var c=this._tiles[i].coords;Je(o),delete this._tiles[i],this.fire("tileabort",{tile:o,coords:c})}},_removeTile:function(i){var o=this._tiles[i];if(o)return o.el.setAttribute("src",j),cr.prototype._removeTile.call(this,i)},_tileReady:function(i,o,c){if(!(!this._map||c&&c.getAttribute("src")===j))return cr.prototype._tileReady.call(this,i,o,c)}});function Vh(i,o){return new hs(i,o)}var $h=hs.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(i,o){this._url=i;var c=r({},this.defaultWmsParams);for(var h in o)h in this.options||(c[h]=o[h]);o=T(this,o);var p=o.detectRetina&&X.retina?2:1,g=this.getTileSize();c.width=g.x*p,c.height=g.y*p,this.wmsParams=c},onAdd:function(i){this._crs=this.options.crs||i.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var o=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[o]=this._crs.code,hs.prototype.onAdd.call(this,i)},getTileUrl:function(i){var o=this._tileCoordsToNwSe(i),c=this._crs,h=Be(c.project(o[0]),c.project(o[1])),p=h.min,g=h.max,E=(this._wmsVersion>=1.3&&this._crs===Dh?[p.y,p.x,g.y,g.x]:[p.x,p.y,g.x,g.y]).join(","),S=hs.prototype.getTileUrl.call(this,i);return S+O(this.wmsParams,S,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+E},setParams:function(i,o){return r(this.wmsParams,i),o||this.redraw(),this}});function ay(i,o){return new $h(i,o)}hs.WMS=$h,Vh.wms=ay;var An=nn.extend({options:{padding:.1},initialize:function(i){T(this,i),d(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),pe(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var i={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(i.zoomanim=this._onAnimZoom),i},_onAnimZoom:function(i){this._updateTransform(i.center,i.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(i,o){var c=this._map.getZoomScale(o,this._zoom),h=this._map.getSize().multiplyBy(.5+this.options.padding),p=this._map.project(this._center,o),g=h.multiplyBy(-c).add(p).subtract(this._map._getNewPixelOrigin(i,o));X.any3d?Ii(this._container,g,c):st(this._container,g)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var i in this._layers)this._layers[i]._reset()},_onZoomEnd:function(){for(var i in this._layers)this._layers[i]._project()},_updatePaths:function(){for(var i in this._layers)this._layers[i]._update()},_update:function(){var i=this.options.padding,o=this._map.getSize(),c=this._map.containerPointToLayerPoint(o.multiplyBy(-i)).round();
25this._bounds=new Ce(c,c.add(o.multiplyBy(1+i*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),jh=An.extend({options:{tolerance:0},getEvents:function(){var i=An.prototype.getEvents.call(this);return i.viewprereset=this._onViewPreReset,i},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){An.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var i=this._container=document.createElement("canvas");he(i,"mousemove",this._onMouseMove,this),he(i,"click dblclick mousedown mouseup contextmenu",this._onClick,this),he(i,"mouseout",this._handleMouseOut,this),i._leaflet_disable_events=!0,this._ctx=i.getContext("2d")},_destroyContainer:function(){it(this._redrawRequest),delete this._ctx,Je(this._container),je(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var i;this._redrawBounds=null;for(var o in this._layers)i=this._layers[o],i._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){An.prototype._update.call(this);var i=this._bounds,o=this._container,c=i.getSize(),h=X.retina?2:1;st(o,i.min),o.width=h*c.x,o.height=h*c.y,o.style.width=c.x+"px",o.style.height=c.y+"px",X.retina&&this._ctx.scale(2,2),this._ctx.translate(-i.min.x,-i.min.y),this.fire("update")}},_reset:function(){An.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(i){this._updateDashArray(i),this._layers[d(i)]=i;var o=i._order={layer:i,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=o),this._drawLast=o,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(i){this._requestRedraw(i)},_removePath:function(i){var o=i._order,c=o.next,h=o.prev;c?c.prev=h:this._drawLast=h,h?h.next=c:this._drawFirst=c,delete i._order,delete this._layers[d(i)],this._requestRedraw(i)},_updatePath:function(i){this._extendRedrawBounds(i),i._project(),i._update(),this._requestRedraw(i)},_updateStyle:function(i){this._updateDashArray(i),this._requestRedraw(i)},_updateDashArray:function(i){if(typeof i.options.dashArray=="string"){var o=i.options.dashArray.split(/[, ]+/),c=[],h,p;for(p=0;p<o.length;p++){if(h=Number(o[p]),isNaN(h))return;c.push(h)}i.options._dashArray=c}else i.options._dashArray=i.options.dashArray},_requestRedraw:function(i){this._map&&(this._extendRedrawBounds(i),this._redrawRequest=this._redrawRequest||$e(this._redraw,this))},_extendRedrawBounds:function(i){if(i._pxBounds){var o=(i.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Ce,this._redrawBounds.extend(i._pxBounds.min.subtract([o,o])),this._redrawBounds.extend(i._pxBounds.max.add([o,o]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var i=this._redrawBounds;if(i){var o=i.getSize();this._ctx.clearRect(i.min.x,i.min.y,o.x,o.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var i,o=this._redrawBounds;if(this._ctx.save(),o){var c=o.getSize();this._ctx.beginPath(),this._ctx.rect(o.min.x,o.min.y,c.x,c.y),this._ctx.clip()}this._drawing=!0;for(var h=this._drawFirst;h;h=h.next)i=h.layer,(!o||i._pxBounds&&i._pxBounds.intersects(o))&&i._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(i,o){if(this._drawing){var c,h,p,g,E=i._parts,S=E.length,x=this._ctx;if(S){for(x.beginPath(),c=0;c<S;c++){for(h=0,p=E[c].length;h<p;h++)g=E[c][h],x[h?"lineTo":"moveTo"](g.x,g.y);o&&x.closePath()}this._fillStroke(x,i)}}},_updateCircle:function(i){if(!(!this._drawing||i._empty())){var o=i._point,c=this._ctx,h=Math.max(Math.round(i._radius),1),p=(Math.max(Math.round(i._radiusY),1)||h)/h;p!==1&&(c.save(),c.scale(1,p)),c.beginPath(),c.arc(o.x,o.y/p,h,0,Math.PI*2,!1),p!==1&&c.restore(),this._fillStroke(c,i)}},_fillStroke:function(i,o){var c=o.options;c.fill&&(i.globalAlpha=c.fillOpacity,i.fillStyle=c.fillColor||c.color,i.fill(c.fillRule||"evenodd")),c.stroke&&c.weight!==0&&(i.setLineDash&&i.setLineDash(o.options&&o.options._dashArray||[]),i.globalAlpha=c.opacity,i.lineWidth=c.weight,i.strokeStyle=c.color,i.lineCap=c.lineCap,i.lineJoin=c.lineJoin,i.stroke())},_onClick:function(i){for(var o=this._map.mouseEventToLayerPoint(i),c,h,p=this._drawFirst;p;p=p.next)c=p.layer,c.options.interactive&&c._containsPoint(o)&&(!(i.type==="click"||i.type==="preclick")||!this._map._draggableMoved(c))&&(h=c);this._fireEvent(h?[h]:!1,i)},_onMouseMove:function(i){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var o=this._map.mouseEventToLayerPoint(i);this._handleMouseHover(i,o)}},_handleMouseOut:function(i){var o=this._hoveredLayer;o&&(nt(this._container,"leaflet-interactive"),this._fireEvent([o],i,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(i,o){if(!this._mouseHoverThrottled){for(var c,h,p=this._drawFirst;p;p=p.next)c=p.layer,c.options.interactive&&c._containsPoint(o)&&(h=c);h!==this._hoveredLayer&&(this._handleMouseOut(i),h&&(pe(this._container,"leaflet-interactive"),this._fireEvent([h],i,"mouseover"),this._hoveredLayer=h)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,i),this._mouseHoverThrottled=!0,setTimeout(l(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(i,o,c){this._map._fireDOMEvent(o,c||o.type,i)},_bringToFront:function(i){var o=i._order;if(o){var c=o.next,h=o.prev;if(c)c.prev=h;else return;h?h.next=c:c&&(this._drawFirst=c),o.prev=this._drawLast,this._drawLast.next=o,o.next=null,this._drawLast=o,this._requestRedraw(i)}},_bringToBack:function(i){var o=i._order;if(o){var c=o.next,h=o.prev;if(h)h.next=c;else return;c?c.prev=h:h&&(this._drawLast=h),o.prev=null,o.next=this._drawFirst,this._drawFirst.prev=o,this._drawFirst=o,this._requestRedraw(i)}}});function Zh(i){return X.canvas?new jh(i):null}var ur=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(i){return document.createElement("<lvml:"+i+' class="lvml">')}}catch{}return function(i){return document.createElement("<"+i+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),ly={_initContainer:function(){this._container=Le("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(An.prototype._update.call(this),this.fire("update"))},_initPath:function(i){var o=i._container=ur("shape");pe(o,"leaflet-vml-shape "+(this.options.className||"")),o.coordsize="1 1",i._path=ur("path"),o.appendChild(i._path),this._updateStyle(i),this._layers[d(i)]=i},_addPath:function(i){var o=i._container;this._container.appendChild(o),i.options.interactive&&i.addInteractiveTarget(o)},_removePath:function(i){var o=i._container;Je(o),i.removeInteractiveTarget(o),delete this._layers[d(i)]},_updateStyle:function(i){var o=i._stroke,c=i._fill,h=i.options,p=i._container;p.stroked=!!h.stroke,p.filled=!!h.fill,h.stroke?(o||(o=i._stroke=ur("stroke")),p.appendChild(o),o.weight=h.weight+"px",o.color=h.color,o.opacity=h.opacity,h.dashArray?o.dashStyle=A(h.dashArray)?h.dashArray.join(" "):h.dashArray.replace(/( *, *)/g," "):o.dashStyle="",o.endcap=h.lineCap.replace("butt","flat"),o.joinstyle=h.lineJoin):o&&(p.removeChild(o),i._stroke=null),h.fill?(c||(c=i._fill=ur("fill")),p.appendChild(c),c.color=h.fillColor||h.color,c.opacity=h.fillOpacity):c&&(p.removeChild(c),i._fill=null)},_updateCircle:function(i){var o=i._point.round(),c=Math.round(i._radius),h=Math.round(i._radiusY||c);this._setPath(i,i._empty()?"M0 0":"AL "+o.x+","+o.y+" "+c+","+h+" 0,"+65535*360)},_setPath:function(i,o){i._path.v=o},_bringToFront:function(i){rs(i._container)},_bringToBack:function(i){os(i._container)}},ko=X.vml?ur:N,hr=An.extend({_initContainer:function(){this._container=ko("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=ko("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Je(this._container),je(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){An.prototype._update.call(this);var i=this._bounds,o=i.getSize(),c=this._container;(!this._svgSize||!this._svgSize.equals(o))&&(this._svgSize=o,c.setAttribute("width",o.x),c.setAttribute("height",o.y)),st(c,i.min),c.setAttribute("viewBox",[i.min.x,i.min.y,o.x,o.y].join(" ")),this.fire("update")}},_initPath:function(i){var o=i._path=ko("path");i.options.className&&pe(o,i.options.className),i.options.interactive&&pe(o,"leaflet-interactive"),this._updateStyle(i),this._layers[d(i)]=i},_addPath:function(i){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(i._path),i.addInteractiveTarget(i._path)},_removePath:function(i){Je(i._path),i.removeInteractiveTarget(i._path),delete this._layers[d(i)]},_updatePath:function(i){i._project(),i._update()},_updateStyle:function(i){var o=i._path,c=i.options;
25o&&(c.stroke?(o.setAttribute("stroke",c.color),o.setAttribute("stroke-opacity",c.opacity),o.setAttribute("stroke-width",c.weight),o.setAttribute("stroke-linecap",c.lineCap),o.setAttribute("stroke-linejoin",c.lineJoin),c.dashArray?o.setAttribute("stroke-dasharray",c.dashArray):o.removeAttribute("stroke-dasharray"),c.dashOffset?o.setAttribute("stroke-dashoffset",c.dashOffset):o.removeAttribute("stroke-dashoffset")):o.setAttribute("stroke","none"),c.fill?(o.setAttribute("fill",c.fillColor||c.color),o.setAttribute("fill-opacity",c.fillOpacity),o.setAttribute("fill-rule",c.fillRule||"evenodd")):o.setAttribute("fill","none"))},_updatePoly:function(i,o){this._setPath(i,D(i._parts,o))},_updateCircle:function(i){var o=i._point,c=Math.max(Math.round(i._radius),1),h=Math.max(Math.round(i._radiusY),1)||c,p="a"+c+","+h+" 0 1,0 ",g=i._empty()?"M0 0":"M"+(o.x-c)+","+o.y+p+c*2+",0 "+p+-c*2+",0 ";this._setPath(i,g)},_setPath:function(i,o){i._path.setAttribute("d",o)},_bringToFront:function(i){rs(i._path)},_bringToBack:function(i){os(i._path)}});X.vml&&hr.include(ly);function qh(i){return X.svg||X.vml?new hr(i):null}Ie.include({getRenderer:function(i){var o=i.options.renderer||this._getPaneRenderer(i.options.pane)||this.options.renderer||this._renderer;return o||(o=this._renderer=this._createRenderer()),this.hasLayer(o)||this.addLayer(o),o},_getPaneRenderer:function(i){if(i==="overlayPane"||i===void 0)return!1;var o=this._paneRenderers[i];return o===void 0&&(o=this._createRenderer({pane:i}),this._paneRenderers[i]=o),o},_createRenderer:function(i){return this.options.preferCanvas&&Zh(i)||qh(i)}});var Gh=cs.extend({initialize:function(i,o){cs.prototype.initialize.call(this,this._boundsToLatLngs(i),o)},setBounds:function(i){return this.setLatLngs(this._boundsToLatLngs(i))}
vendor: 6,251 bytes, line 25
25,_boundsToLatLngs:function(i){return i=He(i),[i.getSouthWest(),i.getNorthWest(),i.getNorthEast(),i.getSouthEast()]}});function cy(i,o){return new Gh(i,o)}hr.create=ko,hr.pointsToPath=D,Rn.geometryToLayer=Io,Rn.coordsToLatLng=Ll,Rn.coordsToLatLngs=So,Rn.latLngToCoords=Rl,Rn.latLngsToCoords=Po,Rn.getFeature=us,Rn.asFeature=xo,Ie.mergeOptions({boxZoom:!0});var Kh=gn.extend({initialize:function(i){this._map=i,this._container=i._container,this._pane=i._panes.overlayPane,this._resetStateTimeout=0,i.on("unload",this._destroy,this)},addHooks:function(){he(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){je(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Je(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(i){if(!i.shiftKey||i.which!==1&&i.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),nr(),dl(),this._startPoint=this._map.mouseEventToContainerPoint(i),he(document,{contextmenu:xi,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(i){this._moved||(this._moved=!0,this._box=Le("div","leaflet-zoom-box",this._container),pe(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(i);var o=new Ce(this._point,this._startPoint),c=o.getSize();st(this._box,o.min),this._box.style.width=c.x+"px",this._box.style.height=c.y+"px"},_finish:function(){this._moved&&(Je(this._box),nt(this._container,"leaflet-crosshair")),ir(),fl(),je(document,{contextmenu:xi,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(i){if(!(i.which!==1&&i.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(l(this._resetState,this),0);var o=new tt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(o).fire("boxzoomend",{boxZoomBounds:o})}},_onKeyDown:function(i){i.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Ie.addInitHook("addHandler","boxZoom",Kh),Ie.mergeOptions({doubleClickZoom:!0});var Yh=gn.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(i){var o=this._map,c=o.getZoom(),h=o.options.zoomDelta,p=i.originalEvent.shiftKey?c-h:c+h;o.options.doubleClickZoom==="center"?o.setZoom(p):o.setZoomAround(i.containerPoint,p)}});Ie.addInitHook("addHandler","doubleClickZoom",Yh),Ie.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Jh=gn.extend({addHooks:function(){if(!this._draggable){var i=this._map;this._draggable=new ei(i._mapPane,i._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),i.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),i.on("zoomend",this._onZoomEnd,this),i.whenReady(this._onZoomEnd,this))}pe(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){nt(this._map._container,"leaflet-grab"),nt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var i=this._map;if(i._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var o=He(this._map.options.maxBounds);this._offsetLimit=Be(this._map.latLngToContainerPoint(o.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(o.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;i.fire("movestart").fire("dragstart"),i.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(i){if(this._map.options.inertia){var o=this._lastTime=+new Date,c=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(c),this._times.push(o),this._prunePositions(o)}this._map.fire("move",i).fire("drag",i)},_prunePositions:function(i){for(;this._positions.length>1&&i-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var i=this._map.getSize().divideBy(2),o=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=o.subtract(i).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(i,o){return i-(i-o)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var i=this._draggable._newPos.subtract(this._draggable._startPos),o=this._offsetLimit;i.x<o.min.x&&(i.x=this._viscousLimit(i.x,o.min.x)),i.y<o.min.y&&(i.y=this._viscousLimit(i.y,o.min.y)),i.x>o.max.x&&(i.x=this._viscousLimit(i.x,o.max.x)),i.y>o.max.y&&(i.y=this._viscousLimit(i.y,o.max.y)),this._draggable._newPos=this._draggable._startPos.add(i)}},_onPreDragWrap:function(){var i=this._worldWidth,o=Math.round(i/2),c=this._initialWorldOffset,h=this._draggable._newPos.x,p=(h-o+c)%i+o-c,g=(h+o+c)%i-o-c,E=Math.abs(p+c)<Math.abs(g+c)?p:g;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=E},_onDragEnd:function(i){var o=this._map,c=o.options,h=!c.inertia||i.noInertia||this._times.length<2;if(o.fire("dragend",i),h)o.fire("moveend");else{this._prunePositions(+new Date);var p=this._lastPos.subtract(this._positions[0]),g=(this._lastTime-this._times[0])/1e3,E=c.easeLinearity,S=p.multiplyBy(E/g),x=S.distanceTo([0,0]),F=Math.min(c.inertiaMaxSpeed,x),Y=S.multiplyBy(F/x),re=F/(c.inertiaDeceleration*E),ge=Y.multiplyBy(-re/2).round();!ge.x&&!ge.y?o.fire("moveend"):(ge=o._limitOffset(ge,o.options.maxBounds),$e(function(){o.panBy(ge,{duration:re,easeLinearity:E,noMoveStart:!0,animate:!0})}
25))}}});Ie.addInitHook("addHandler","dragging",Jh),Ie.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Qh=gn.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(i){this._map=i,this._setPanDelta(i.options.keyboardPanDelta),this._setZoomDelta(i.options.zoomDelta)},addHooks:function(){var i=this._map._container;i.tabIndex<=0&&(i.tabIndex="0"),he(i,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),je(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var i=document.body,o=document.documentElement,c=i.scrollTop||o.scrollTop,h=i.scrollLeft||o.scrollLeft;this._map._container.focus(),window.scrollTo(h,c)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(i){var o=this._panKeys={},c=this.keyCodes,h,p;for(h=0,p=c.left.length;h<p;h++)o[c.left[h]]=[-1*i,0];for(h=0,p=c.right.length;h<p;h++)o[c.right[h]]=[i,0];for(h=0,p=c.down.length;h<p;h++)o[c.down[h]]=[0,i];for(h=0,p=c.up.length;h<p;h++)o[c.up[h]]=[0,-1*i]},_setZoomDelta:function(i){var o=this._zoomKeys={},c=this.keyCodes,h,p;for(h=0,p=c.zoomIn.length;h<p;h++)o[c.zoomIn[h]]=i;for(h=0,p=c.zoomOut.length;h<p;h++)o[c.zoomOut[h]]=-i},_addHooks:function(){he(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){je(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(i){if(!(i.altKey||i.ctrlKey||i.metaKey)){var o=i.keyCode,c=this._map,h;if(o in this._panKeys){if(!c._panAnim||!c._panAnim._inProgress)if(h=this._panKeys[o],i.shiftKey&&(h=te(h).multiplyBy(3)),c.options.maxBounds&&(h=c._limitOffset(te(h),c.options.maxBounds)),c.options.worldCopyJump){var p=c.wrapLatLng(c.unproject(c.project(c.getCenter()).add(h)));c.panTo(p)}else c.panBy(h)}else if(o in this._zoomKeys)c.setZoom(c.getZoom()+(i.shiftKey?3:1)*this._zoomKeys[o]);else if(o===27&&c._popup&&c._popup.options.closeOnEscapeKey)c.closePopup();else return;xi(i)}}});Ie.addInitHook("addHandler","keyboard",Qh),Ie.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Xh=gn.extend({addHooks:function(){he(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){je(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(i){var o=Th(i),c=this._map.options.wheelDebounceTime;this._delta+=o,this._lastMousePos=this._map.mouseEventToContainerPoint(i),this._startTime||(this._startTime=+new Date);var h=Math.max(c-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(l(this._performZoom,this),h),xi(i)},_performZoom:function(){var i=this._map,o=i.getZoom(),c=this._map.options.zoomSnap||0;i._stop();var h=this._delta/(this._map.options.wheelPxPerZoomLevel*4),p=4*Math.log(2/(1+Math.exp(-Math.abs(h))))/Math.LN2,g=c?Math.ceil(p/c)*c:p,E=i._limitZoom(o+(this._delta>0?g:-g))-o;this._delta=0,this._startTime=null,E&&(i.options.scrollWheelZoom==="center"?i.setZoom(o+E):i.setZoomAround(this._lastMousePos,o+E))}});Ie.addInitHook("addHandler","scrollWheelZoom",Xh);var uy=600;Ie.mergeOptions({tapHold:X.touchNative&&X.safari&&X.mobile,tapTolerance:15});var ed=gn.extend({addHooks:function(){he(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){je(this._map._container,"touchstart",this._onDown,this)},_onDown:function(i){if(clearTimeout(this._holdTimeout),i.touches.length===1){var o=i.touches[0];this._startPos=this._newPos=new G(o.clientX,o.clientY),this._holdTimeout=setTimeout(l(function(){this._cancel(),this._isTapValid()&&(he(document,"touchend",pt),he(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",o))},this),uy),he(document,"touchend touchcancel contextmenu",this._cancel,this),he(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function i(){je(document,"touchend",pt),je(document,"touchend touchcancel",i)},_cancel:function(){clearTimeout(this._holdTimeout),je(document,"touchend touchcancel contextmenu",this._cancel,this),je(document,"touchmove",this._onMove,this)},_onMove:function(i){var o=i.touches[0];this._newPos=new G(o.clientX,o.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(i,o){var c=new MouseEvent(i,{bubbles:!0,cancelable:!0,view:window,screenX:o.screenX,screenY:o.screenY,clientX:o.clientX,clientY:o.clientY});c._simulated=!0,o.target.dispatchEvent(c)}});Ie.addInitHook("addHandler","tapHold",ed),Ie.mergeOptions({touchZoom:X.touch,bounceAtZoomLimits:!0});var td=gn.extend({addHooks:function(){pe(this._map._container,"leaflet-touch-zoom"),he(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){nt(this._map._container,"leaflet-touch-zoom"),je(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(i){var o=this._map;if(!(!i.touches||i.touches.length!==2||o._animatingZoom||this._zooming)){var c=o.mouseEventToContainerPoint(i.touches[0]),h=o.mouseEventToContainerPoint(i.touches[1]);this._centerPoint=o.getSize()._divideBy(2),this._startLatLng=o.containerPointToLatLng(this._centerPoint),o.options.touchZoom!=="center"&&(this._pinchStartLatLng=o.containerPointToLatLng(c.add(h)._divideBy(2))),this._startDist=c.distanceTo(h),this._startZoom=o.getZoom(),this._moved=!1,this._zooming=!0,o._stop(),he(document,"touchmove",this._onTouchMove,this),he(document,"touchend touchcancel",this._onTouchEnd,this),pt(i)}},_onTouchMove:function(i){if(!(!i.touches||i.touches.length!==2||!this._zooming)){var o=this._map,c=o.mouseEventToContainerPoint(i.touches[0]),h=o.mouseEventToContainerPoint(i.touches[1]),p=c.distanceTo(h)
25/this._startDist;if(this._zoom=o.getScaleZoom(p,this._startZoom),!o.options.bounceAtZoomLimits&&(this._zoom<o.getMinZoom()&&p<1||this._zoom>o.getMaxZoom()&&p>1)&&(this._zoom=o._limitZoom(this._zoom)),o.options.touchZoom==="center"){if(this._center=this._startLatLng,p===1)return}else{var g=c._add(h)._divideBy(2)._subtract(this._centerPoint);if(p===1&&g.x===0&&g.y===0)return;this._center=o.unproject(o.project(this._pinchStartLatLng,this._zoom).subtract(g),this._zoom)}this._moved||(o._moveStart(!0,!1),this._moved=!0),it(this._animRequest);var E=l(o._move,o,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=$e(E,this,!0),pt(i)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,it(this._animRequest),je(document,"touchmove",this._onTouchMove,this),je(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Ie.addInitHook("addHandler","touchZoom",td),Ie.BoxZoom=Kh,Ie.DoubleClickZoom=Yh,Ie.Drag=Jh,Ie.Keyboard=Qh,Ie.ScrollWheelZoom=Xh,Ie.TapHold=ed,Ie.TouchZoom=td,n.Bounds=Ce,n.Browser=X,n.CRS=k,n.Canvas=jh,n.Circle=xl,n.CircleMarker=Co,n.Class=St,n.Control=tn,n.DivIcon=Wh,n.DivOverlay=vn,n.DomEvent=xv,n.DomUtil=Sv,n.Draggable=ei,n.Evented=Te,n.FeatureGroup=xn,n.GeoJSON=Rn,n.GridLayer=cr,n.Handler=gn,n.Icon=ls,n.ImageOverlay=Lo,n.LatLng=Se,n.LatLngBounds=tt,n.Layer=nn,n.LayerGroup=as,n.LineUtil=Hv,n.Map=Ie,n.Marker=To,n.Mixin=Mv,n.Path=ti,n.Point=G,n.PolyUtil=Dv,n.Polygon=cs,n.Polyline=Ln,n.Popup=Ro,n.PosAnimation=Ch,n.Projection=Wv,n.Rectangle=Gh,n.Renderer=An,n.SVG=hr,n.SVGOverlay=Hh,n.TileLayer=hs,n.Tooltip=Ao,n.Transformation=ke,n.Util=jt,n.VideoOverlay=zh,n.bind=l,n.bounds=Be,n.canvas=Zh,n.circle=Yv,n.circleMarker=Kv,n.control=or,n.divIcon=ry,n.extend=r,n.featureGroup=Zv,n.geoJSON=Uh,n.geoJson=Xv,n.gridLayer=oy,n.icon=qv,n.imageOverlay=ey,n.latLng=le,n.latLngBounds=He,n.layerGroup=jv,n.map=Lv,n.marker=Gv,n.point=te,n.polygon=Qv,n.polyline=Jv,n.popup=iy,n.rectangle=cy,n.setOptions=T,n.stamp=d,n.svg=qh,n.svgOverlay=ny,n.tileLayer=Vh,n.tooltip=sy,n.transformation=w,n.version=s,n.videoOverlay=ty;var hy=window.L;n.noConflict=function(){return window.L=hy,this},window.L=n})}(Er,Er.exports)),Er.exports}var G_=yT();const jo=gT(G_),wT=wy({__proto__:null,default:jo},[G_]),bT=()=>{};var rf={};/** 26 * @license 27 * Copyright 2017 Google LLC 28 * 29 * Licensed under the Apache License, Version 2.0 (the "License"); 30 * you may not use this file except in compliance with the License. 31 * You may obtain a copy of the License at 32 * 33 * http://www.apache.org/licenses/LICENSE-2.0 34 * 35 * Unless required by applicable law or agreed to in writing, software 36 * distributed under the License is distributed on an "AS IS" BASIS, 37 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 38 * See the License for the specific language governing permissions and 39 * limitations under the License. 40 */const K_={NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"};/** 41 * @license 42 * Copyright 2017 Google LLC 43 * 44 * Licensed under the Apache License, Version 2.0 (the "License"); 45 * you may not use this file except in compliance with the License. 46 * You may obtain a copy of the License at 47 * 48 * http://www.apache.org/licenses/LICENSE-2.0 49 * 50 * Unless required by applicable law or agreed to in writing, software 51 * distributed under the License is distributed on an "AS IS" BASIS, 52 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 53 * See the License for the specific language governing permissions and 54 * limitations under the License. 55 */const H=function(t,e){if(!t)throw qs(e)},qs=function(t){return new Error("Firebase Database ("+K_.SDK_VERSION+") INTERNAL ASSERT FAILED: "+t)};/** 56 * @license 57 * Copyright 2017 Google LLC 58 * 59 * Licensed under the Apache License, Version 2.0 (the "License"); 60 * you may not use this file except in compliance with the License. 61 * You may obtain a copy of the License at 62 * 63 * http://www.apache.org/licenses/LICENSE-2.0 64 * 65 * Unless required by applicable law or agreed to in writing, softw
65are 66 * distributed under the License is distributed on an "AS IS" BASIS, 67 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 68 * See the License for the specific language governing permissions and 69 * limitations under the License. 70 */const Y_=function(t){const e=[];let n=0;for(let s=0;s<t.length;s++){let r=t.charCodeAt(s);r<128?e[n++]=r:r<2048?(e[n++]=r>>6|192,e[n++]=r&63|128):(r&64512)===55296&&s+1<t.length&&(t.charCodeAt(s+1)&64512)===56320?(r=65536+((r&1023)<<10)+(t.charCodeAt(++s)&1023),e[n++]=r>>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=r&63|128):(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=r&63|128)}return e},ET=function(t){const e=[];let n=0,s=0;for(;n<t.length;){const r=t[n++];if(r<128)e[s++]=String.fromCharCode(r);else if(r>191&&r<224){const a=t[n++];e[s++]=String.fromCharCode((r&31)<<6|a&63)}else if(r>239&&r<365){const a=t[n++],l=t[n++],u=t[n++],d=((r&7)<<18|(a&63)<<12|(l&63)<<6|u&63)-65536;e[s++]=String.fromCharCode(55296+(d>>10)),e[s++]=String.fromCharCode(56320+(d&1023))}else{const a=t[n++],l=t[n++];e[s++]=String.fromCharCode((r&15)<<12|(a&63)<<6|l&63)}}return e.join("")},cu={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:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,s=[];for(let r=0;r<t.length;r+=3){const a=t[r],l=r+1<t.length,u=l?t[r+1]:0,d=r+2<t.length,f=d?t[r+2]:0,m=a>>2,_=(a&3)<<4|u>>4;let v=(u&15)<<2|f>>6,y=f&63;d||(y=64,l||(v=64)),s.push(n[m],n[_],n[v],n[y])}return s.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(Y_(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):ET(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,s=[];for(let r=0;r<t.length;){const a=n[t.charAt(r++)],u=r<t.length?n[t.charAt(r)]:0;++r;const f=r<t.length?n[t.charAt(r)]:64;++r;const _=r<t.length?n[t.charAt(r)]:64;if(++r,a==null||u==null||f==null||_==null)throw new TT;const v=a<<2|u>>4;if(s.push(v),f!==64){const y=u<<4&240|f>>2;if(s.push(y),_!==64){const P=f<<6&192|_;s.push(P)}}}return s},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class TT extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const J_=function(t){const e=Y_(t);return cu.encodeByteArray(e,!0)},ca=function(t){return J_(t).replace(/\./g,"")},ua=function(t){try{return cu.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/** 71 * @license 72 * Copyright 2017 Google LLC 73 * 74 * Licensed under the Apache License, Version 2.0 (the "License"); 75 * you may not use this file except in compliance with the License. 76 * You may obtain a copy of the License at 77 * 78 * http://www.apache.org/licenses/LICENSE-2.0 79 * 80 * Unless required by applicable law or agreed to in writing, software 81 * distributed under the License is distributed on an "AS IS" BASIS, 82 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 83 * See the License for the specific language governing permissions and 84 * limitations under the License. 85 */function CT(t){return Q_(void 0,t)}function Q_(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:const n=e;return new Date(n.getTime());case Object:t===void 0&&(t={});break;case Array:t=[];break;default:return e}for(const n in e)!e.hasOwnProperty(n)||!IT(n)||(t[n]=Q_(t[n],e[n]));return t}function IT(t){return t!=="__proto__"}/** 86 * @license 87 * Copyright 2022 Google LLC 88 * 89 * Licensed under the Apache License, Version 2.0 (the "License");
90 * you may not use this file except in compliance with the License. 91 * You may obtain a copy of the License at 92 * 93 * http://www.apache.org/licenses/LICENSE-2.0 94 * 95 * Unless required by applicable law or agreed to in writing, software 96 * distributed under the License is distributed on an "AS IS" BASIS, 97 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 98 * See the License for the specific language governing permissions and 99 * limitations under the License. 100 */function ST(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/** 101 * @license 102 * Copyright 2022 Google LLC 103 * 104 * Licensed under the Apache License, Version 2.0 (the "License"); 105 * you may not use this file except in compliance with the License. 106 * You may obtain a copy of the License at 107 * 108 * http://www.apache.org/licenses/LICENSE-2.0 109 * 110 * Unless required by applicable law or agreed to in writing, software 111 * distributed under the License is distributed on an "AS IS" BASIS, 112 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 113 * See the License for the specific language governing permissions and 114 * limitations under the License. 115 */const PT=()=>ST().__FIREBASE_DEFAULTS__,xT=()=>{if(typeof process>"u"||typeof rf>"u")return;const t=rf.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},LT=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&ua(t[1]);return e&&JSON.parse(e)},uu=()=>{try{return bT()||PT()||xT()||LT()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},X_=t=>{var e,n;return(n=(e=uu())===null||e===void 0?void 0:e.emulatorHosts)===null||n===void 0?void 0:n[t]},RT=t=>{const e=X_(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const s=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),s]:[e.substring(0,n),s]},em=()=>{var t;return(t=uu())===null||t===void 0?void 0:t.config},tm=t=>{var e;return(e=uu())===null||e===void 0?void 0:e[`_${t}`]};/** 116 * @license 117 * Copyright 2017 Google LLC 118 * 119 * Licensed under the Apache License, Version 2.0 (the "License"); 120 * you may not use this file except in compliance with the License. 121 * You may obtain a copy of the License at 122 * 123 * http://www.apache.org/licenses/LICENSE-2.0 124 * 125 * Unless required by applicable law or agreed to in writing, software 126 * distributed under the License is distributed on an "AS IS" BASIS, 127 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 128 * See the License for the specific language governing permissions and 129 * limitations under the License. 130 */class qa{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,s)=>{n?this.reject(n):this.resolve(s),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,s))}}}/** 131 * @license 132 * Copyright 2021 Google LLC 133 * 134 * Licensed under the Apache License, Version 2.0 (the "License"); 135 * you may not use this file except in compliance with the License. 136 * You may obtain a copy of the License at 137 * 138 * http://www.apache.org/licenses/LICENSE-2.0 139 * 140 * Unless required by applicable law or agreed to in writing, software 141 * distributed under the License is distributed on an "AS IS" BASIS, 142 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 143 * See the License for the specific language governing permissions and 144 * limitations under the License. 145 */function AT(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={alg:"none",type:"JWT"},s=e||"demo-project",r=t.iat||0,a=t.sub||t.user_id;if(!a)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const l=Object.assign({iss:`https://securetoken.google.com/${s}`,aud:s,iat:r,exp:r+3600,auth_time:r,sub:a,user_id:a,firebase:{sign_in_provider:"custom",identities:{}}},t);return[ca(JSON.stringify(n)),ca(JSON.stringify(l)),""].join(".")}/** 146 * @license 147 * Copyright 2017 Google LLC 148 * 149 * Licensed under the Apache License, Version 2.0 (the "License");
150 * you may not use this file except in compliance with the License. 151 * You may obtain a copy of the License at 152 * 153 * http://www.apache.org/licenses/LICENSE-2.0 154 * 155 * Unless required by applicable law or agreed to in writing, software 156 * distributed under the License is distributed on an "AS IS" BASIS, 157 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 158 * See the License for the specific language governing permissions and 159 * limitations under the License. 160 */function kt(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function hu(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(kt())}function kT(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function OT(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function nm(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function NT(){const t=kt();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function MT(){return K_.NODE_ADMIN===!0}function DT(){try{return typeof indexedDB=="object"}catch{return!1}}function FT(){return new Promise((t,e)=>{try{let n=!0;const s="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(s);r.onsuccess=()=>{r.result.close(),n||self.indexedDB.deleteDatabase(s),t(!0)},r.onupgradeneeded=()=>{n=!1},r.onerror=()=>{var a;e(((a=r.error)===null||a===void 0?void 0:a.message)||"")}}catch(n){e(n)}})}/** 161 * @license 162 * Copyright 2017 Google LLC 163 * 164 * Licensed under the Apache License, Version 2.0 (the "License"); 165 * you may not use this file except in compliance with the License. 166 * You may obtain a copy of the License at 167 * 168 * http://www.apache.org/licenses/LICENSE-2.0 169 * 170 * Unless required by applicable law or agreed to in writing, software 171 * distributed under the License is distributed on an "AS IS" BASIS, 172 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 173 * See the License for the specific language governing permissions and 174 * limitations under the License. 175 */const BT="FirebaseError";class Ti extends Error{constructor(e,n,s){super(n),this.code=e,this.customData=s,this.name=BT,Object.setPrototypeOf(this,Ti.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,oo.prototype.create)}}class oo{constructor(e,n,s){this.service=e,this.serviceName=n,this.errors=s}create(e,...n){const s=n[0]||{},r=`${this.service}/${e}`,a=this.errors[e],l=a?UT(a,s):"Error",u=`${this.serviceName}: ${l} (${r}).`;return new Ti(r,u,s)}}function UT(t,e){return t.replace(zT,(n,s)=>{const r=e[s];return r!=null?String(r):`<${s}?>`})}const zT=/\{\$([^}]+)}/g;/** 176 * @license 177 * Copyright 2017 Google LLC 178 * 179 * Licensed under the Apache License, Version 2.0 (the "License"); 180 * you may not use this file except in compliance with the License. 181 * You may obtain a copy of the License at 182 * 183 * http://www.apache.org/licenses/LICENSE-2.0 184 * 185 * Unless required by applicable law or agreed to in writing, software 186 * distributed under the License is distributed on an "AS IS" BASIS, 187 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 188 * See the License for the specific language governing permissions and 189 * limitations under the License. 190 */function $r(t){return JSON.parse(t)}function dt(t){return JSON.stringify(t)}/** 191 * @license 192 * Copyright 2017 Google LLC 193 * 194 * Licensed under the Apache License, Version 2.0 (the "License"); 195 * you may not use this file except in compliance with the License. 196 * You may obtain a copy of the License at 197 * 198 * http://www.apache.org/licenses/LICENSE-2.0 199 * 200 * Unless required by applicable law or agreed to in writing, software 201 * distributed under the License is distributed on an "AS IS" BASIS, 202 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 203 * See the License for the specific language governing permissions and 204 * limitations under the License. 205 */const im=function(t){let e={},n={},s={},r="";try{const a=t.split(".");e=$r(ua(a[0])||""),n=$r(ua(a[1])||""),r=a[2],s=n.d||{},delete n.d}catch{}return{header:e,claims:n,data:s,signature:r}},HT=function(t){const e=im(t),n=e.claims;return!!n&&typeof n=="object"&&n.hasOwnProperty("iat")},WT=function(t){const e=im(t).claims;return typeof e=="object"&&e.admin===!0};/** 206 * @license 207 * Copyright 2017 Google LLC 208 * 209 * Licensed under the Apache License, Version 2.0 (the "License");
210 * you may not use this file except in compliance with the License. 211 * You may obtain a copy of the License at 212 * 213 * http://www.apache.org/licenses/LICENSE-2.0 214 * 215 * Unless required by applicable law or agreed to in writing, software 216 * distributed under the License is distributed on an "AS IS" BASIS, 217 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 218 * See the License for the specific language governing permissions and 219 * limitations under the License. 220 */function Yn(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Ms(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]}function wc(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function ha(t,e,n){const s={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(s[r]=e.call(n,t[r],r,t));return s}function $i(t,e){if(t===e)return!0;const n=Object.keys(t),s=Object.keys(e);for(const r of n){if(!s.includes(r))return!1;const a=t[r],l=e[r];if(of(a)&&of(l)){if(!$i(a,l))return!1}else if(a!==l)return!1}for(const r of s)if(!n.includes(r))return!1;return!0}function of(t){return t!==null&&typeof t=="object"}/** 221 * @license 222 * Copyright 2017 Google LLC 223 * 224 * Licensed under the Apache License, Version 2.0 (the "License"); 225 * you may not use this file except in compliance with the License. 226 * You may obtain a copy of the License at 227 * 228 * http://www.apache.org/licenses/LICENSE-2.0 229 * 230 * Unless required by applicable law or agreed to in writing, software 231 * distributed under the License is distributed on an "AS IS" BASIS, 232 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 233 * See the License for the specific language governing permissions and 234 * limitations under the License. 235 */function Gs(t){const e=[];for(const[n,s]of Object.entries(t))Array.isArray(s)?s.forEach(r=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(r))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(s));return e.length?"&"+e.join("&"):""}/** 236 * @license 237 * Copyright 2017 Google LLC 238 * 239 * Licensed under the Apache License, Version 2.0 (the "License"); 240 * you may not use this file except in compliance with the License. 241 * You may obtain a copy of the License at 242 * 243 * http://www.apache.org/licenses/LICENSE-2.0 244 * 245 * Unless required by applicable law or agreed to in writing, software 246 * distributed under the License is distributed on an "AS IS" BASIS, 247 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 248 * See the License for the specific language governing permissions and 249 * limitations under the License. 250 */class VT{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=512/8,this.pad_[0]=128;for(let e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}reset(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0}compress_(e,n){n||(n=0);const s=this.W_;if(typeof e=="string")for(let _=0;_<16;_++)s[_]=e.charCodeAt(n)<<24|e.charCodeAt(n+1)<<16|e.charCodeAt(n+2)<<8|e.charCodeAt(n+3),n+=4;else for(let _=0;_<16;_++)s[_]=e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3],n+=4;for(let _=16;_<80;_++){const v=s[_-3]^s[_-8]^s[_-14]^s[_-16];s[_]=(v<<1|v>>>31)&4294967295}let r=this.chain_[0],a=this.chain_[1],l=this.chain_[2],u=this.chain_[3],d=this.chain_[4],f,m;for(let _=0;_<80;_++){_<40?_<20?(f=u^a&(l^u),m=1518500249):(f=a^l^u,m=1859775393):_<60?(f=a&l|u&(a|l),m=2400959708):(f=a^l^u,m=3395469782);const v=(r<<5|r>>>27)+f+d+m+s[_]&4294967295;d=u,u=l,l=(a<<30|a>>>2)&4294967295,a=r,r=v}this.chain_[0]=this.chain_[0]+r&4294967295,this.chain_[1]=this.chain_[1]+a&4294967295,this.chain_[2]=this.chain_[2]+l&4294967295,this.chain_[3]=this.chain_[3]+u&4294967295,this.chain_[4]=this.chain_[4]+d&4294967295}update(e,n){if(e==null)return;n===void 0&&(n=e.length);const s=n-this.blockSize;let r=0;const a=this.buf_;let l=this.inbuf_;for(;r<n;){if(l===0)for(;r<=s;)this.compress_(e,r),r+=this.blockSize;if(typeof e=="string"){for(;r<n;)if(a[l]=e.charCodeAt(r),++l,++r,l===this.blockSize){this.compress_(a),l=0;break}}else for(;r<n;)if(a[l]=e[r],++l,++r,l===this.blockSize){this.compress_(a),l=0;break}}this.inbuf_=l,this.total_+=n}
250digest(){const e=[];let n=this.total_*8;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(let r=this.blockSize-1;r>=56;r--)this.buf_[r]=n&255,n/=256;this.compress_(this.buf_);let s=0;for(let r=0;r<5;r++)for(let a=24;a>=0;a-=8)e[s]=this.chain_[r]>>a&255,++s;return e}}function $T(t,e){const n=new jT(t,e);return n.subscribe.bind(n)}class jT{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(s=>{this.error(s)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,s){let r;if(e===void 0&&n===void 0&&s===void 0)throw new Error("Missing Observer.");ZT(e,["next","error","complete"])?r=e:r={next:e,error:n,complete:s},r.next===void 0&&(r.next=Zl),r.error===void 0&&(r.error=Zl),r.complete===void 0&&(r.complete=Zl);const a=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch{}}),this.observers.push(r),a}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,e)}sendOne(e,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(s){typeof console<"u"&&console.error&&console.error(s)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function ZT(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function Zl(){}function du(t,e){return`${t} failed: ${e} argument `}/** 251 * @license 252 * Copyright 2017 Google LLC 253 * 254 * Licensed under the Apache License, Version 2.0 (the "License"); 255 * you may not use this file except in compliance with the License. 256 * You may obtain a copy of the License at 257 * 258 * http://www.apache.org/licenses/LICENSE-2.0 259 * 260 * Unless required by applicable law or agreed to in writing, software 261 * distributed under the License is distributed on an "AS IS" BASIS, 262 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 263 * See the License for the specific language governing permissions and 264 * limitations under the License. 265 */const qT=function(t){const e=[];let n=0;for(let s=0;s<t.length;s++){let r=t.charCodeAt(s);if(r>=55296&&r<=56319){const a=r-55296;s++,H(s<t.length,"Surrogate pair missing trail surrogate.");const l=t.charCodeAt(s)-56320;r=65536+(a<<10)+l}r<128?e[n++]=r:r<2048?(e[n++]=r>>6|192,e[n++]=r&63|128):r<65536?(e[n++]=r>>12|224,e[n++]=r>>6&63|128,e[n++]=r&63|128):(e[n++]=r>>18|240,e[n++]=r>>12&63|128,e[n++]=r>>6&63|128,e[n++]=r&63|128)}return e},Ga=function(t){let e=0;for(let n=0;n<t.length;n++){const s=t.charCodeAt(n);s<128?e++:s<2048?e+=2:s>=55296&&s<=56319?(e+=4,n++):e+=3}return e};/** 266 * @license 267 * Copyright 2021 Google LLC 268 * 269 * Licensed under the Apache License, Version 2.0 (the "License"); 270 * you may not use this file except in compliance with the License. 271 * You may obtain a copy of the License at 272 * 273 * http://www.apache.org/licenses/LICENSE-2.0 274 * 275 * Unless required by applicable law or agreed to in writing, software 276 * distributed under the License is distributed on an "AS IS" BASIS, 277 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 278 * See the License for the specific language governing permissions and 279 * limitations under the License. 280 */function pn(t){return t&&t._delegate?t._delegate:t}/** 281 * @license 282 * Copyright 2025 Google LLC 283 * 284 * Licensed under the Apache License, Version 2.0 (the "License"); 285 * you may not use this file except in compliance with the License. 286 * You may obtain a copy of the License at 287 * 288 * http://www.apache.org/licenses/LICENSE-2.0 289 * 290 * Unless required by applicable law or agreed to in writing, softw
290are 291 * distributed under the License is distributed on an "AS IS" BASIS, 292 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 293 * See the License for the specific language governing permissions and 294 * limitations under the License. 295 */function Ka(t){return t.endsWith(".cloudworkstations.dev")}async function sm(t){return(await fetch(t,{credentials:"include"})).ok}class ji{constructor(e,n,s){this.name=e,this.instanceFactory=n,this.type=s,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/** 296 * @license 297 * Copyright 2019 Google LLC 298 * 299 * Licensed under the Apache License, Version 2.0 (the "License"); 300 * you may not use this file except in compliance with the License. 301 * You may obtain a copy of the License at 302 * 303 * http://www.apache.org/licenses/LICENSE-2.0 304 * 305 * Unless required by applicable law or agreed to in writing, software 306 * distributed under the License is distributed on an "AS IS" BASIS, 307 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 308 * See the License for the specific language governing permissions and 309 * limitations under the License. 310 */const Oi="[DEFAULT]";/** 311 * @license 312 * Copyright 2019 Google LLC 313 * 314 * Licensed under the Apache License, Version 2.0 (the "License"); 315 * you may not use this file except in compliance with the License. 316 * You may obtain a copy of the License at 317 * 318 * http://www.apache.org/licenses/LICENSE-2.0 319 * 320 * Unless required by applicable law or agreed to in writing, software 321 * distributed under the License is distributed on an "AS IS" BASIS, 322 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 323 * See the License for the specific language governing permissions and 324 * limitations under the License. 325 */class GT{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const s=new qa;if(this.instancesDeferred.set(n,s),this.isInitialized(n)||this.shouldAutoInitialize())try{const r=this.getOrInitializeService({instanceIdentifier:n});r&&s.resolve(r)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){var n;const s=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),r=(n=e==null?void 0:e.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(s)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:s})}catch(a){if(r)return null;throw a}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(YT(e))try{this.getOrInitializeService({instanceIdentifier:Oi})}catch{}for(const[n,s]of this.instancesDeferred.entries()){const r=this.normalizeInstanceIdentifier(n);try{const a=this.getOrInitializeService({instanceIdentifier:r});s.resolve(a)}catch{}}}}clearInstance(e=Oi){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=Oi){return this.instances.has(e)}getOptions(e=Oi){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,s=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(s))throw Error(`${this.name}(${s}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const r=this.getOrInitializeService({instanceIdentifier:s,options:n});for(const[a,l]of this.instancesDeferred.entries()){const u=this.normalizeInstanceIdentifier(a);s===u&&l.resolve(r)}return r}onInit(e,n){var s;const r=this.normalizeInstanceIdentifier(n),a=(s=this.onInitCallbacks.get(r))!==null&&s!==void 0?s:new Set;a.add(e),this.onInitCallbacks.set(r,a);const l=this.instances.get(r);return l&&e(l,r),()=>{a.delete(e)}}invokeOnInitCallbacks(e,n){const s=this.onInitCallbacks.get(n);if(s)for(const r of s)try{r(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let s=this.instances.get(e);if(!s&&this.component&&(s=this.component.instanceFactory(this.container,{instanceIdentifier:KT(e),options:n}),this.instances.set(e,s),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(s,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,s)}catch{}return s||null}normalizeInstanceIdentifier(e=Oi){return this.component?this.component.multipleInstances?e:Oi:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function KT(t){return t===Oi?void 0:t}function YT(t){return t.instantiationMode==="EAGER"}/** 326 * @license 327 * Copyright 2019 Google LLC 328 * 329 * Licensed under the Apache License, Version 2.0 (the "License");
330 * you may not use this file except in compliance with the License. 331 * You may obtain a copy of the License at 332 * 333 * http://www.apache.org/licenses/LICENSE-2.0 334 * 335 * Unless required by applicable law or agreed to in writing, software 336 * distributed under the License is distributed on an "AS IS" BASIS, 337 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 338 * See the License for the specific language governing permissions and 339 * limitations under the License. 340 */class JT{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new GT(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}/** 341 * @license 342 * Copyright 2017 Google LLC 343 * 344 * Licensed under the Apache License, Version 2.0 (the "License"); 345 * you may not use this file except in compliance with the License. 346 * You may obtain a copy of the License at 347 * 348 * http://www.apache.org/licenses/LICENSE-2.0 349 * 350 * Unless required by applicable law or agreed to in writing, software 351 * distributed under the License is distributed on an "AS IS" BASIS, 352 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 353 * See the License for the specific language governing permissions and 354 * limitations under the License. 355 */var ze;(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"})(ze||(ze={}));const QT={debug:ze.DEBUG,verbose:ze.VERBOSE,info:ze.INFO,warn:ze.WARN,error:ze.ERROR,silent:ze.SILENT},XT=ze.INFO,eC={[ze.DEBUG]:"log",[ze.VERBOSE]:"log",[ze.INFO]:"info",[ze.WARN]:"warn",[ze.ERROR]:"error"},tC=(t,e,...n)=>{if(e<t.logLevel)return;const s=new Date().toISOString(),r=eC[e];if(r)console[r](`[${s}] ${t.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class fu{constructor(e){this.name=e,this._logLevel=XT,this._logHandler=tC,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in ze))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?QT[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,ze.DEBUG,...e),this._logHandler(this,ze.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,ze.VERBOSE,...e),this._logHandler(this,ze.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,ze.INFO,...e),this._logHandler(this,ze.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,ze.WARN,...e),this._logHandler(this,ze.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,ze.ERROR,...e),this._logHandler(this,ze.ERROR,...e)}}const nC=(t,e)=>e.some(n=>t instanceof n);let af,lf;function iC(){return af||(af=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function sC(){return lf||(lf=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const rm=new WeakMap,bc=new WeakMap,om=new WeakMap,ql=new WeakMap,pu=new WeakMap;function rC(t){const e=new Promise((n,s)=>{const r=()=>{t.removeEventListener("success",a),t.removeEventListener("error",l)},a=()=>{n(pi(t.result)),r()},l=()=>{s(t.error),r()};t.addEventListener("success",a),t.addEventListener("error",l)});return e.then(n=>{n instanceof IDBCursor&&rm.set(n,t)}).catch(()=>{}),pu.set(e,t),e}function oC(t){if(bc.has(t))return;const e=new Promise((n,s)=>{const r=()=>{t.removeEventListener("complete",a),t.removeEventListener("error",l),t.removeEventListener("abort",l)},a=()=>{n(),r()},l=()=>{s(t.error||new DOMException("AbortError","AbortError")),r()};t.addEventListener("complete",a),t.addEventListener("error",l),t.addEventListener("abort",l)});bc.set(t,e)}let Ec={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return bc.get(t);if(e==="objectStoreNames")return t.objectStoreNames||om.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return pi(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function aC(t){Ec=t(Ec)}function lC(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const s=t.call(Gl(this),e,...n);return om.set(s,e.sort?e.sort():[e]),pi(s)}:sC().includes(t)?function(...e){return t.apply(Gl(this),e),pi(rm.get(this))}:function(...e){return pi(t.apply(Gl(this),e))}}function cC(t){return typeof t=="function"?lC(t):(t instanceof IDBTransaction&&oC(t),nC(t,iC())?new Proxy(t,Ec):t)}function pi(t){if(t instanceof IDBRequest)return rC(t);if(ql.has(t))return ql.get(t);const e=cC(t);return e!==t&&(ql.set(t,e),pu.set(e,t)),e}const Gl=t=>pu.get(t);function uC(t,e,{blocked:n,upgrade:s,blocking:r,terminated:a}={}){const l=indexedDB.open(t,e),u=pi(l);return s&&l.addEventListener("upgradeneeded",d=>{s(pi(l.result),d.oldVersion,d.newVersion,pi(l.transaction),d)}),n&&l.addEventListener("blocked",d=>n(d.oldVersion,d.newVersion,d)),u.then(d=>{a&&d.addEventListener("close",()=>a()),r&&d.addEventListener("versionchange",f=>r(f.oldVersion,f.newVersion,f))}).catch(()=>{}),u}const hC=["get","getKey","getAll","getAllKeys","count"],dC=["put","add","delete","clear"],Kl=new Map;function cf(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(Kl.get(e))return Kl.get(e);const n=e.replace(/FromIndex$/,""),s=e!==n,r=dC.includes(n);if(!(n in(s?IDBIndex:IDBObjectStore).prototype)||!(r||hC.includes(n)))return;const a=async function(l,...u){const d=this.transaction(l,r?"readwrite":"readonly");let f=d.store;
355return s&&(f=f.index(u.shift())),(await Promise.all([f[n](...u),r&&d.done]))[0]};return Kl.set(e,a),a}aC(t=>({...t,get:(e,n,s)=>cf(e,n)||t.get(e,n,s),has:(e,n)=>!!cf(e,n)||t.has(e,n)}));/** 356 * @license 357 * Copyright 2019 Google LLC 358 * 359 * Licensed under the Apache License, Version 2.0 (the "License"); 360 * you may not use this file except in compliance with the License. 361 * You may obtain a copy of the License at 362 * 363 * http://www.apache.org/licenses/LICENSE-2.0 364 * 365 * Unless required by applicable law or agreed to in writing, software 366 * distributed under the License is distributed on an "AS IS" BASIS, 367 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 368 * See the License for the specific language governing permissions and 369 * limitations under the License. 370 */class fC{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(pC(n)){const s=n.getImmediate();return`${s.library}/${s.version}`}else return null}).filter(n=>n).join(" ")}}function pC(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const Tc="@firebase/app",uf="0.12.1";/** 371 * @license 372 * Copyright 2019 Google LLC 373 * 374 * Licensed under the Apache License, Version 2.0 (the "License"); 375 * you may not use this file except in compliance with the License. 376 * You may obtain a copy of the License at 377 * 378 * http://www.apache.org/licenses/LICENSE-2.0 379 * 380 * Unless required by applicable law or agreed to in writing, software 381 * distributed under the License is distributed on an "AS IS" BASIS, 382 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 383 * See the License for the specific language governing permissions and 384 * limitations under the License. 385 */const Vn=new fu("@firebase/app"),_C="@firebase/app-compat",mC="@firebase/analytics-compat",gC="@firebase/analytics",vC="@firebase/app-check-compat",yC="@firebase/app-check",wC="@firebase/auth",bC="@firebase/auth-compat",EC="@firebase/database",TC="@firebase/data-connect",CC="@firebase/database-compat",IC="@firebase/functions",SC="@firebase/functions-compat",PC="@firebase/installations",xC="@firebase/installations-compat",LC="@firebase/messaging",RC="@firebase/messaging-compat",AC="@firebase/performance",kC="@firebase/performance-compat",OC="@firebase/remote-config",NC="@firebase/remote-config-compat",MC="@firebase/storage",DC="@firebase/storage-compat",FC="@firebase/firestore",BC="@firebase/vertexai",UC="@firebase/firestore-compat",zC="firebase",HC="11.7.1";/** 386 * @license 387 * Copyright 2019 Google LLC 388 * 389 * Licensed under the Apache License, Version 2.0 (the "License"); 390 * you may not use this file except in compliance with the License. 391 * You may obtain a copy of the License at 392 * 393 * http://www.apache.org/licenses/LICENSE-2.0 394 * 395 * Unless required by applicable law or agreed to in writing, software 396 * distributed under the License is distributed on an "AS IS" BASIS, 397 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 398 * See the License for the specific language governing permissions and 399 * limitations under the License. 400 */const Cc="[DEFAULT]",WC={[Tc]:"fire-core",[_C]:"fire-core-compat",[gC]:"fire-analytics",[mC]:"fire-analytics-compat",[yC]:"fire-app-check",[vC]:"fire-app-check-compat",[wC]:"fire-auth",[bC]:"fire-auth-compat",[EC]:"fire-rtdb",[TC]:"fire-data-connect",[CC]:"fire-rtdb-compat",[IC]:"fire-fn",[SC]:"fire-fn-compat",[PC]:"fire-iid",[xC]:"fire-iid-compat",[LC]:"fire-fcm",[RC]:"fire-fcm-compat",[AC]:"fire-perf",[kC]:"fire-perf-compat",[OC]:"fire-rc",[NC]:"fire-rc-compat",[MC]:"fire-gcs",[DC]:"fire-gcs-compat",[FC]:"fire-fst",[UC]:"fire-fst-compat",[BC]:"fire-vertex","fire-js":"fire-js",[zC]:"fire-js-all"};/** 401 * @license 402 * Copyright 2019 Google LLC 403 * 404 * Licensed under the Apache License, Version 2.0 (the "License"); 405 * you may not use this file except in compliance with the License. 406 * You may obtain a copy of the License at 407 * 408 * http://www.apache.org/licenses/LICENSE-2.0 409 * 410 * Unless required by applicable law or agreed to in writing, software 411 * distributed under the License is distributed on an "AS IS" BASIS, 412 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 413 * See the License for the specific language governing permissions and 414 * limitations under the License. 415 */const da=new Map,VC=new Map,Ic=new Map;function hf(t,e){try{t.container.addComponent(e)}catch(n){Vn.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function Ds(t){const e=t.name;if(Ic.has(e))return Vn.debug(`There were multiple attempts to register component ${e}.`),!1;Ic.set(e,t);for(const n of da.values())hf(n,t);for(const n of VC.values())hf(n,t);return!0}function _u(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function En(t){return t==null?!1:t.settings!==void 0}/** 416 * @license 417 * Copyright 2019 Google LLC 418 * 419 * Licensed under the Apache License, Version 2.0 (the "License");
420 * you may not use this file except in compliance with the License. 421 * You may obtain a copy of the License at 422 * 423 * http://www.apache.org/licenses/LICENSE-2.0 424 * 425 * Unless required by applicable law or agreed to in writing, software 426 * distributed under the License is distributed on an "AS IS" BASIS, 427 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 428 * See the License for the specific language governing permissions and 429 * limitations under the License. 430 */const $C={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invali
430d-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},_i=new oo("app","Firebase",$C);/** 431 * @license 432 * Copyright 2019 Google LLC 433 * 434 * Licensed under the Apache License, Version 2.0 (the "License"); 435 * you may not use this file except in compliance with the License. 436 * You may obtain a copy of the License at 437 * 438 * http://www.apache.org/licenses/LICENSE-2.0 439 * 440 * Unless required by applicable law or agreed to in writing, software 441 * distributed under the License is distributed on an "AS IS" BASIS, 442 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 443 * See the License for the specific language governing permissions and 444 * limitations under the License. 445 */class jC{constructor(e,n,s){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=s,this.container.addComponent(new ji("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw _i.create("app-deleted",{appName:this._name})}}/** 446 * @license 447 * Copyright 2019 Google LLC 448 * 449 * Licensed under the Apache License, Version 2.0 (the "License"); 450 * you may not use this file except in compliance with the License. 451 * You may obtain a copy of the License at 452 * 453 * http://www.apache.org/licenses/LICENSE-2.0 454 * 455 * Unless required by applicable law or agreed to in writing, software 456 * distributed under the License is distributed on an "AS IS" BASIS, 457 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 458 * See the License for the specific language governing permissions and 459 * limitations under the License. 460 */const Ks=HC;function am(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const s=Object.assign({name:Cc,automaticDataCollectionEnabled:!1},e),r=s.name;if(typeof r!="string"||!r)throw _i.create("bad-app-name",{appName:String(r)});if(n||(n=em()),!n)throw _i.create("no-options");const a=da.get(r);if(a){if($i(n,a.options)&&$i(s,a.config))return a;throw _i.create("duplicate-app",{appName:r})}const l=new JT(r);for(const d of Ic.values())l.addComponent(d);const u=new jC(n,s,l);return da.set(r,u),u}function lm(t=Cc){const e=da.get(t);if(!e&&t===Cc&&em())return am();if(!e)throw _i.create("no-app",{appName:t});return e}function mi(t,e,n){var s;let r=(s=WC[t])!==null&&s!==void 0?s:t;n&&(r+=`-${n}`);const a=r.match(/\s|\//),l=e.match(/\s|\//);if(a||l){const u=[`Unable to register library "${r}" with version "${e}":`];a&&u.push(`library name "${r}" contains illegal characters (whitespace or "/")`),a&&l&&u.push("and"),l&&u.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Vn.warn(u.join(" "));return}Ds(new ji(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}/** 461 * @license 462 * Copyright 2021 Google LLC 463 * 464 * Licensed under the Apache License, Version 2.0 (the "License"); 465 * you may not use this file except in compliance with the License. 466 * You may obtain a copy of the License at 467 * 468 * http://www.apache.org/licenses/LICENSE-2.0 469 * 470 * Unless required by applicable law or agreed to in writing, softw
470are 471 * distributed under the License is distributed on an "AS IS" BASIS, 472 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 473 * See the License for the specific language governing permissions and 474 * limitations under the License. 475 */const ZC="firebase-heartbeat-database",qC=1,jr="firebase-heartbeat-store";let Yl=null;function cm(){return Yl||(Yl=uC(ZC,qC,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(jr)}catch(n){console.warn(n)}}}}).catch(t=>{throw _i.create("idb-open",{originalErrorMessage:t.message})})),Yl}async function GC(t){try{const n=(await cm()).transaction(jr),s=await n.objectStore(jr).get(um(t));return await n.done,s}catch(e){if(e instanceof Ti)Vn.warn(e.message);else{const n=_i.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});Vn.warn(n.message)}}}async function df(t,e){try{const s=(await cm()).transaction(jr,"readwrite");await s.objectStore(jr).put(e,um(t)),await s.done}catch(n){if(n instanceof Ti)Vn.warn(n.message);else{const s=_i.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});Vn.warn(s.message)}}}function um(t){return`${t.name}!${t.options.appId}`}/** 476 * @license 477 * Copyright 2021 Google LLC 478 * 479 * Licensed under the Apache License, Version 2.0 (the "License"); 480 * you may not use this file except in compliance with the License. 481 * You may obtain a copy of the License at 482 * 483 * http://www.apache.org/licenses/LICENSE-2.0 484 * 485 * Unless required by applicable law or agreed to in writing, software 486 * distributed under the License is distributed on an "AS IS" BASIS, 487 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 488 * See the License for the specific language governing permissions and 489 * limitations under the License. 490 */const KC=1024,YC=30;class JC{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new XC(n),this._heartbeatsCachePromise=this._storage.read().then(s=>(this._heartbeatsCache=s,s))}async triggerHeartbeat(){var e,n;try{const r=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),a=ff();if(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)===null||n===void 0?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===a||this._heartbeatsCache.heartbeats.some(l=>l.date===a))return;if(this._heartbeatsCache.heartbeats.push({date:a,agent:r}),this._heartbeatsCache.heartbeats.length>YC){const l=eI(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(l,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(s){Vn.warn(s)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=ff(),{heartbeatsToSend:s,unsentEntries:r}=QC(this._heartbeatsCache.heartbeats),a=ca(JSON.stringify({version:2,heartbeats:s}));return this._heartbeatsCache.lastSentHeartbeatDate=n,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),a}catch(n){return Vn.warn(n),""}}}function ff(){return new Date().toISOString().substring(0,10)}function QC(t,e=KC){const n=[];let s=t.slice();for(const r of t){const a=n.find(l=>l.agent===r.agent);if(a){if(a.dates.push(r.date),pf(n)>e){a.dates.pop();break}}else if(n.push({agent:r.agent,dates:[r.date]}),pf(n)>e){n.pop();break}s=s.slice(1)}return{heartbeatsToSend:n,unsentEntries:s}}class XC{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return DT()?FT().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await GC(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var n;if(await this._canUseIndexedDBPromise){const r=await this.read();return df(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var n;if(await this._canUseIndexedDBPromise){const r=await this.read();return df(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return}}function pf(t){return ca(JSON.stringify({version:2,heartbeats:t})).length}function eI(t){if(t.length===0)return-1;let e=0,n=t[0].date;for(let s=1;s<t.length;s++)t[s].date<n&&(n=t[s].date,e=s);return e}/** 491 * @license 492 * Copyright 2019 Google LLC 493 * 494 * Licensed under the Apache License, Version 2.0 (the "License");
495 * you may not use this file except in compliance with the License. 496 * You may obtain a copy of the License at 497 * 498 * http://www.apache.org/licenses/LICENSE-2.0 499 * 500 * Unless required by applicable law or agreed to in writing, software 501 * distributed under the License is distributed on an "AS IS" BASIS, 502 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 503 * See the License for the specific language governing permissions and 504 * limitations under the License. 505 */function tI(t){Ds(new ji("platform-logger",e=>new fC(e),"PRIVATE")),Ds(new ji("heartbeat",e=>new JC(e),"PRIVATE")),mi(Tc,uf,t),mi(Tc,uf,"esm2017"),mi("fire-js","")}tI("");var nI="firebase",iI="11.7.1";/** 506 * @license 507 * Copyright 2020 Google LLC 508 * 509 * Licensed under the Apache License, Version 2.0 (the "License"); 510 * you may not use this file except in compliance with the License. 511 * You may obtain a copy of the License at 512 * 513 * http://www.apache.org/licenses/LICENSE-2.0 514 * 515 * Unless required by applicable law or agreed to in writing, software 516 * distributed under the License is distributed on an "AS IS" BASIS, 517 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 518 * See the License for the specific language governing permissions and 519 * limitations under the License. 520 */mi(nI,iI,"app");var _f={};const mf="@firebase/database",gf="1.0.15";/** 521 * @license 522 * Copyright 2019 Google LLC 523 * 524 * Licensed under the Apache License, Version 2.0 (the "License"); 525 * you may not use this file except in compliance with the License. 526 * You may obtain a copy of the License at 527 * 528 * http://www.apache.org/licenses/LICENSE-2.0 529 * 530 * Unless required by applicable law or agreed to in writing, software 531 * distributed under the License is distributed on an "AS IS" BASIS, 532 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 533 * See the License for the specific language governing permissions and 534 * limitations under the License. 535 */let hm="";function sI(t){hm=t}/** 536 * @license 537 * Copyright 2017 Google LLC 538 * 539 * Licensed under the Apache License, Version 2.0 (the "License"); 540 * you may not use this file except in compliance with the License. 541 * You may obtain a copy of the License at 542 * 543 * http://www.apache.org/licenses/LICENSE-2.0 544 * 545 * Unless required by applicable law or agreed to in writing, software 546 * distributed under the License is distributed on an "AS IS" BASIS, 547 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 548 * See the License for the specific language governing permissions and 549 * limitations under the License. 550 */class rI{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,n){n==null?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),dt(n))}get(e){const n=this.domStorage_.getItem(this.prefixedName_(e));return n==null?null:$r(n)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}}/** 551 * @license 552 * Copyright 2017 Google LLC 553 * 554 * Licensed under the Apache License, Version 2.0 (the "License"); 555 * you may not use this file except in compliance with the License. 556 * You may obtain a copy of the License at 557 * 558 * http://www.apache.org/licenses/LICENSE-2.0 559 * 560 * Unless required by applicable law or agreed to in writing, software 561 * distributed under the License is distributed on an "AS IS" BASIS, 562 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 563 * See the License for the specific language governing permissions and 564 * limitations under the License. 565 */class oI{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,n){n==null?delete this.cache_[e]:this.cache_[e]=n}get(e){return Yn(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}}/** 566 * @license 567 * Copyright 2017 Google LLC 568 * 569 * Licensed under the Apache License, Version 2.0 (the "License"); 570 * you may not use this file except in compliance with the License. 571 * You may obtain a copy of the License at 572 * 573 * http://www.apache.org/licenses/LICENSE-2.0 574 * 575 * Unless required by applicable law or agreed to in writing, softw
575are 576 * distributed under the License is distributed on an "AS IS" BASIS, 577 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 578 * See the License for the specific language governing permissions and 579 * limitations under the License. 580 */const dm=function(t){try{if(typeof window<"u"&&typeof window[t]<"u"){const e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new rI(e)}}catch{}return new oI},Di=dm("localStorage"),aI=dm("sessionStorage");/** 581 * @license 582 * Copyright 2017 Google LLC 583 * 584 * Licensed under the Apache License, Version 2.0 (the "License"); 585 * you may not use this file except in compliance with the License. 586 * You may obtain a copy of the License at 587 * 588 * http://www.apache.org/licenses/LICENSE-2.0 589 * 590 * Unless required by applicable law or agreed to in writing, software 591 * distributed under the License is distributed on an "AS IS" BASIS, 592 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 593 * See the License for the specific language governing permissions and 594 * limitations under the License. 595 */const Ss=new fu("@firebase/database"),lI=function(){let t=1;return function(){return t++}}(),fm=function(t){const e=qT(t),n=new VT;n.update(e);const s=n.digest();return cu.encodeByteArray(s)},ao=function(...t){let e="";for(let n=0;n<t.length;n++){const s=t[n];Array.isArray(s)||s&&typeof s=="object"&&typeof s.length=="number"?e+=ao.apply(null,s):typeof s=="object"?e+=dt(s):e+=s,e+=" "}return e};let Ar=null,vf=!0;const cI=function(t,e){H(!0,"Can't turn on custom loggers persistently."),Ss.logLevel=ze.VERBOSE,Ar=Ss.log.bind(Ss)},Tt=function(...t){if(vf===!0&&(vf=!1,Ar===null&&aI.get("logging_enabled")===!0&&cI()),Ar){const e=ao.apply(null,t);Ar(e)}},lo=function(t){return function(...e){Tt(t,...e)}},Sc=function(...t){const e="FIREBASE INTERNAL ERROR: "+ao(...t);Ss.error(e)},$n=function(...t){const e=`FIREBASE FATAL ERROR: ${ao(...t)}`;throw Ss.error(e),new Error(e)},Dt=function(...t){const e="FIREBASE WARNING: "+ao(...t);Ss.warn(e)},uI=function(){typeof window<"u"&&window.location&&window.location.protocol&&window.location.protocol.indexOf("https:")!==-1&&Dt("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().")},pm=function(t){return typeof t=="number"&&(t!==t||t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY)},hI=function(t){if(document.readyState==="complete")t();else{let e=!1;const n=function(){if(!document.body){setTimeout(n,Math.floor(10));return}e||(e=!0,t())};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&n()}),window.attachEvent("onload",n))}},Fs="[MIN_NAME]",Zi="[MAX_NAME]",Ys=function(t,e){if(t===e)return 0;if(t===Fs||e===Zi)return-1;if(e===Fs||t===Zi)return 1;{const n=yf(t),s=yf(e);return n!==null?s!==null?n-s===0?t.length-e.length:n-s:-1:s!==null?1:t<e?-1:1}},dI=function(t,e){return t===e?0:t<e?-1:1},mr=function(t,e){if(e&&t in e)return e[t];throw new Error("Missing required key ("+t+") in object: "+dt(e))},mu=function(t){if(typeof t!="object"||t===null)return dt(t);const e=[];for(const s in t)e.push(s);e.sort();let n="{";for(let s=0;s<e.length;s++)s!==0&&(n+=","),n+=dt(e[s]),n+=":",n+=mu(t[e[s]]);return n+="}",n},_m=function(t,e){const n=t.length;if(n<=e)return[t];const s=[];for(let r=0;r<n;r+=e)r+e>n?s.push(t.substring(r,n)):s.push(t.substring(r,r+e));return s};function Ft(t,e){for(const n in t)t.hasOwnProperty(n)&&e(n,t[n])}const mm=function(t){H(!pm(t),"Invalid JSON number");const e=11,n=52,s=(1<<e-1)-1;let r,a,l,u,d;t===0?(a=0,l=0,r=1/t===-1/0?1:0):(r=t<0,t=Math.abs(t),t>=Math.pow(2,1-s)?(u=Math.min(Math.floor(Math.log(t)/Math.LN2),s),a=u+s,l=Math.round(t*Math.pow(2,n-u)-Math.pow(2,n))):(a=0,l=Math.round(t/Math.pow(2,1-s-n))));const f=[];for(d=n;d;d-=1)f.push(l%2?1:0),l=Math.floor(l/2);for(d=e;d;d-=1)f.push(a%2?1:0),a=Math.floor(a/2);f.push(r?1:0),f.reverse();const m=f.join("");let _="";for(d=0;d<64;d+=8){let v=parseInt(m.substr(d,8),2).toString(16);v.length===1&&(v="0"+v),_=_+v}return _.toLowerCase()},fI=function(){return!!(typeof window=="object"&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))},pI=function(){return typeof Windows=="object"&&typeof Windows.UI=="object"};function _I(t,e){let n="Unknown Error";t==="too_big"?n="The data requested exceeds the maximum size that can be accessed with a single request.":t==="permission_denied"?n="Client doesn't have permission to access the desired data.":t==="unavailable"&&(n="The service is unavailable");const s=new Error(t+" at "+e._path.toString()+": "+n);return s.code=t.toUpperCase(),s}const mI=new RegExp("^-?(0*)\\d{1,10}$"),gI=-2147483648,vI=2147483647,yf=function(t){if(mI.test(t)){const e=Number(t);if(e>=gI&&e<=vI)return e}return null},Js=function(t){try{t()}catch(e){setTimeout(()=>{const n=e.stack||"";throw Dt("Exception was thrown by user callback.",n),e},Math.floor(0))}},yI=function(){return(typeof window=="object"&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},kr=function(t,e){const n=setTimeout(t,e);return typeof n=="number"&&typeof Deno<"u"&&Deno.unrefTimer?Deno.unrefTimer(n):typeof n=="object"&&n.unref&&n.unref(),n};/** 596 * @license 597 * Copyright 2021 Google LLC 598 * 599 * Licensed under the Apache License, Version 2.0 (the "License");
600 * you may not use this file except in compliance with the License. 601 * You may obtain a copy of the License at 602 * 603 * http://www.apache.org/licenses/LICENSE-2.0 604 * 605 * Unless required by applicable law or agreed to in writing, software 606 * distributed under the License is distributed on an "AS IS" BASIS, 607 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 608 * See the License for the specific language governing permissions and 609 * limitations under the License. 610 */class wI{constructor(e,n){this.appCheckProvider=n,this.appName=e.name,En(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.appCheck=n==null?void 0:n.getImmediate({optional:!0}),this.appCheck||n==null||n.get().then(s=>this.appCheck=s)}getToken(e){if(this.serverAppAppCheckToken){if(e)throw new Error("Attempted reuse of `FirebaseServerApp.appCheckToken` after previous usage failed.");return Promise.resolve({token:this.serverAppAppCheckToken})}return this.appCheck?this.appCheck.getToken(e):new Promise((n,s)=>{setTimeout(()=>{this.appCheck?this.getToken(e).then(n,s):n(null)},0)})}addTokenChangeListener(e){var n;(n=this.appCheckProvider)===null||n===void 0||n.get().then(s=>s.addTokenListener(e))}notifyForInvalidToken(){Dt(`Provided AppCheck credentials for the app named "${this.appName}" are invalid. This usually indicates your app was not initialized correctly.`)}}/** 611 * @license 612 * Copyright 2017 Google LLC 613 * 614 * Licensed under the Apache License, Version 2.0 (the "License"); 615 * you may not use this file except in compliance with the License. 616 * You may obtain a copy of the License at 617 * 618 * http://www.apache.org/licenses/LICENSE-2.0 619 * 620 * Unless required by applicable law or agreed to in writing, software 621 * distributed under the License is distributed on an "AS IS" BASIS, 622 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 623 * See the License for the specific language governing permissions and 624 * limitations under the License. 625 */class bI{constructor(e,n,s){this.appName_=e,this.firebaseOptions_=n,this.authProvider_=s,this.auth_=null,this.auth_=s.getImmediate({optional:!0}),this.auth_||s.onInit(r=>this.auth_=r)}getToken(e){return this.auth_?this.auth_.getToken(e).catch(n=>n&&n.code==="auth/token-not-initialized"?(Tt("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(n)):new Promise((n,s)=>{setTimeout(()=>{this.auth_?this.getToken(e).then(n,s):n(null)},0)})}addTokenChangeListener(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then(n=>n.addAuthTokenListener(e))}removeTokenChangeListener(e){this.authProvider_.get().then(n=>n.removeAuthTokenListener(e))}notifyForInvalidToken(){let e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',Dt(e)}}class Zo{constructor(e){this.accessToken=e}getToken(e){return Promise.resolve({accessToken:this.accessToken})}addTokenChangeListener(e){e(this.accessToken)}removeTokenChangeListener(e){}notifyForInvalidToken(){}}Zo.OWNER="owner";/** 626 * @license 627 * Copyright 2017 Google LLC 628 * 629 * Licensed under the Apache License, Version 2.0 (the "License"); 630 * you may not use this file except in compliance with the License. 631 * You may obtain a copy of the License at 632 * 633 * http://www.apache.org/licenses/LICENSE-2.0 634 * 635 * Unless required by applicable law or agreed to in writing, software 636 * distributed under the License is distributed on an "AS IS" BASIS, 637 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 638 * See the License for the specific language governing permissions and 639 * limitations under the License. 640 */const gu="5",gm="v",vm="s",ym="r",wm="f",bm=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,Em="ls",Tm="p",Pc="ac",Cm="websocket",Im="long_polling";/** 641 * @license 642 * Copyright 2017 Google LLC 643 * 644 * Licensed under the Apache License, Version 2.0 (the "License");
645 * you may not use this file except in compliance with the License. 646 * You may obtain a copy of the License at 647 * 648 * http://www.apache.org/licenses/LICENSE-2.0 649 * 650 * Unless required by applicable law or agreed to in writing, software 651 * distributed under the License is distributed on an "AS IS" BASIS, 652 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 653 * See the License for the specific language governing permissions and 654 * limitations under the License. 655 */class Sm{constructor(e,n,s,r,a=!1,l="",u=!1,d=!1,f=null){this.secure=n,this.namespace=s,this.webSocketOnly=r,this.nodeAdmin=a,this.persistenceKey=l,this.includeNamespaceInQueryParams=u,this.isUsingEmulator=d,this.emulatorOptions=f,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=Di.get("host:"+e)||this._host}isCacheableHost(){return this.internalHost.substr(0,2)==="s-"}isCustomHost(){return this._domain!=="firebaseio.com"&&this._domain!=="firebaseio-demo.com"}get host(){return this._host}set host(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&Di.set("host:"+this._host,this.internalHost))}toString(){let e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e}toURLString(){const e=this.secure?"https://":"http://",n=this.includeNamespaceInQueryParams?`?ns=${this.namespace}`:"";return`${e}${this.host}/${n}`}}function EI(t){return t.host!==t.internalHost||t.isCustomHost()||t.includeNamespaceInQueryParams}function Pm(t,e,n){H(typeof e=="string","typeof type must == string"),H(typeof n=="object","typeof params must == object");let s;if(e===Cm)s=(t.secure?"wss://":"ws://")+t.internalHost+"/.ws?";else if(e===Im)s=(t.secure?"https://":"http://")+t.internalHost+"/.lp?";else throw new Error("Unknown connection type: "+e);EI(t)&&(n.ns=t.namespace);const r=[];return Ft(n,(a,l)=>{r.push(a+"="+l)}),s+r.join("&")}/** 656 * @license 657 * Copyright 2017 Google LLC 658 * 659 * Licensed under the Apache License, Version 2.0 (the "License"); 660 * you may not use this file except in compliance with the License. 661 * You may obtain a copy of the License at 662 * 663 * http://www.apache.org/licenses/LICENSE-2.0 664 * 665 * Unless required by applicable law or agreed to in writing, software 666 * distributed under the License is distributed on an "AS IS" BASIS, 667 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 668 * See the License for the specific language governing permissions and 669 * limitations under the License. 670 */class TI{constructor(){this.counters_={}}incrementCounter(e,n=1){Yn(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=n}get(){return CT(this.counters_)}}/** 671 * @license 672 * Copyright 2017 Google LLC 673 * 674 * Licensed under the Apache License, Version 2.0 (the "License"); 675 * you may not use this file except in compliance with the License. 676 * You may obtain a copy of the License at 677 * 678 * http://www.apache.org/licenses/LICENSE-2.0 679 * 680 * Unless required by applicable law or agreed to in writing, software 681 * distributed under the License is distributed on an "AS IS" BASIS, 682 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 683 * See the License for the specific language governing permissions and 684 * limitations under the License. 685 */const Jl={},Ql={};function vu(t){const e=t.toString();return Jl[e]||(Jl[e]=new TI),Jl[e]}function CI(t,e){const n=t.toString();return Ql[n]||(Ql[n]=e()),Ql[n]}/** 686 * @license 687 * Copyright 2017 Google LLC 688 * 689 * Licensed under the Apache License, Version 2.0 (the "License"); 690 * you may not use this file except in compliance with the License. 691 * You may obtain a copy of the License at 692 * 693 * http://www.apache.org/licenses/LICENSE-2.0 694 * 695 * Unless required by applicable law or agreed to in writing, software 696 * distributed under the License is distributed on an "AS IS" BASIS, 697 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 698 * See the License for the specific language governing permissions and 699 * limitations under the License. 700 */class II{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}closeAfter(e,n){this.closeAfterResponse=e,this.onClose=n,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)}handleResponse(e,n){for(this.pendingResponses[e]=n;this.pendingResponses[this.currentResponseNum];){const s=this.pendingResponses[this.currentResponseNum];delete this.pendingResponses[this.currentResponseNum];for(let r=0;r<s.length;++r)s[r]&&Js(()=>{this.onMessage_(s[r])});if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}}/** 701 * @license 702 * Copyright 2017 Google LLC 703 * 704 * Licensed under the Apache License, Version 2.0 (the "License");
705 * you may not use this file except in compliance with the License. 706 * You may obtain a copy of the License at 707 * 708 * http://www.apache.org/licenses/LICENSE-2.0 709 * 710 * Unless required by applicable law or agreed to in writing, software 711 * distributed under the License is distributed on an "AS IS" BASIS, 712 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 713 * See the License for the specific language governing permissions and 714 * limitations under the License. 715 */const wf="start",SI="close",PI="pLPCommand",xI="pRTLPCB",xm="id",Lm="pw",Rm="ser",LI="cb",RI="seg",AI="ts",kI="d",OI="dframe",Am=1870,km=30,NI=Am-km,MI=25e3,DI=3e4;class vs{constructor(e,n,s,r,a,l,u){this.connId=e,this.repoInfo=n,this.applicationId=s,this.appCheckToken=r,this.authToken=a,this.transportSessionId=l,this.lastSessionId=u,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=lo(e),this.stats_=vu(n),this.urlFn=d=>(this.appCheckToken&&(d[Pc]=this.appCheckToken),Pm(n,Im,d))}open(e,n){this.curSegmentNum=0,this.onDisconnect_=n,this.myPacketOrderer=new II(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null},Math.floor(DI)),hI(()=>{if(this.isClosed_)return;this.scriptTagHolder=new yu((...a)=>{const[l,u,d,f,m]=a;if(this.incrementIncomingBytes_(a),!!this.scriptTagHolder)if(this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null),this.everConnected_=!0,l===wf)this.id=u,this.password=d;else if(l===SI)u?(this.scriptTagHolder.sendNewPolls=!1,this.myPacketOrderer.closeAfter(u,()=>{this.onClosed_()})):this.onClosed_();else throw new Error("Unrecognized command received: "+l)},(...a)=>{const[l,u]=a;this.incrementIncomingBytes_(a),this.myPacketOrderer.handleResponse(l,u)},()=>{this.onClosed_()},this.urlFn);const s={};s[wf]="t",s[Rm]=Math.floor(Math.random()*1e8),this.scriptTagHolder.uniqueCallbackIdentifier&&(s[LI]=this.scriptTagHolder.uniqueCallbackIdentifier),s[gm]=gu,this.transportSessionId&&(s[vm]=this.transportSessionId),this.lastSessionId&&(s[Em]=this.lastSessionId),this.applicationId&&(s[Tm]=this.applicationId),this.appCheckToken&&(s[Pc]=this.appCheckToken),typeof location<"u"&&location.hostname&&bm.test(location.hostname)&&(s[ym]=wm);const r=this.urlFn(s);this.log_("Connecting via long-poll to "+r),this.scriptTagHolder.addTag(r,()=>{})})}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){vs.forceAllow_=!0}static forceDisallow(){vs.forceDisallow_=!0}static isAvailable(){return vs.forceAllow_?!0:!vs.forceDisallow_&&typeof document<"u"&&document.createElement!=null&&!fI()&&!pI()}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(e){const n=dt(e);this.bytesSent+=n.length,this.stats_.incrementCounter("bytes_sent",n.length);const s=J_(n),r=_m(s,NI);for(let a=0;a<r.length;a++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,r.length,r[a]),this.curSegmentNum++}addDisconnectPingFrame(e,n){this.myDisconnFrame=document.createElement("iframe");const s={};s[OI]="t",s[xm]=e,s[Lm]=n,this.myDisconnFrame.src=this.urlFn(s),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}incrementIncomingBytes_(e){const n=dt(e).length;this.bytesReceived+=n,this.stats_.incrementCounter("bytes_received",n)}}class yu{constructor(e,n,s,r){this.onDisconnect=s,this.urlFn=r,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(Math.random()*1e8),this.sendNewPolls=!0;{this.uniqueCallbackIdentifier=lI(),window[PI+this.uniqueCallbackIdentifier]=e,window[xI+this.uniqueCallbackIdentifier]=n,this.myIFrame=yu.createI
715Frame_();let a="";this.myIFrame.src&&this.myIFrame.src.substr(0,11)==="javascript:"&&(a='<script>document.domain="'+document.domain+'";<\/script>');const l="<html><body>"+a+"</body></html>";try{this.myIFrame.doc.open(),this.myIFrame.doc.write(l),this.myIFrame.doc.close()}catch(u){Tt("frame writing exception"),u.stack&&Tt(u.stack),Tt(u)}}}static createIFrame_(){const e=document.createElement("iframe");if(e.style.display="none",document.body){document.body.appendChild(e);try{e.contentWindow.document||Tt("No IE domain setting required")}catch{const s=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+s+"';document.close();})())"}}else throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.textContent="",setTimeout(()=>{this.myIFrame!==null&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)},Math.floor(0)));const e=this.onDisconnect;e&&(this.onDisconnect=null,e())}startLongPoll(e,n){for(this.myID=e,this.myPW=n,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;const e={};e[xm]=this.myID,e[Lm]=this.myPW,e[Rm]=this.currentSerial;let n=this.urlFn(e),s="",r=0;for(;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+km+s.length<=Am;){const l=this.pendingSegs.shift();s=s+"&"+RI+r+"="+l.seg+"&"+AI+r+"="+l.ts+"&"+kI+r+"="+l.d,r++}return n=n+s,this.addLongPollTag_(n,this.currentSerial),!0}else return!1}enqueueSegment(e,n,s){this.pendingSegs.push({seg:e,ts:n,d:s}),this.alive&&this.newRequest_()}addLongPollTag_(e,n){this.outstandingRequests.add(n);const s=()=>{this.outstandingRequests.delete(n),this.newRequest_()},r=setTimeout(s,Math.floor(MI)),a=()=>{clearTimeout(r),s()};this.addTag(e,a)}addTag(e,n){setTimeout(()=>{try{if(!this.sendNewPolls)return;const s=this.myIFrame.doc.createElement("script");s.type="text/javascript",s.async=!0,s.src=e,s.onload=s.onreadystatechange=function(){const r=s.readyState;(!r||r==="loaded"||r==="complete")&&(s.onload=s.onreadystatechange=null,s.parentNode&&s.parentNode.removeChild(s),n())},s.onerror=()=>{Tt("Long-poll script failed to load: "+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(s)}catch{}},Math.floor(1))}}/** 716 * @license 717 * Copyright 2017 Google LLC 718 * 719 * Licensed under the Apache License, Version 2.0 (the "License"); 720 * you may not use this file except in compliance with the License. 721 * You may obtain a copy of the License at 722 * 723 * http://www.apache.org/licenses/LICENSE-2.0 724 * 725 * Unless required by applicable law or agreed to in writing, software 726 * distributed under the License is distributed on an "AS IS" BASIS, 727 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 728 * See the License for the specific language governing permissions and 729 * limitations under the License. 730 */const FI=16384,BI=45e3;let fa=null;typeof MozWebSocket<"u"?fa=MozWebSocket:typeof WebSocket<"u"&&(fa=WebSocket);class sn{constructor(e,n,s,r,a,l,u){this.connId=e,this.applicationId=s,this.appCheckToken=r,this.authToken=a,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=lo(this.connId),this.stats_=vu(n),this.connURL=sn.connectionURL_(n,l,u,r,s),this.nodeAdmin=n.nodeAdmin}static connectionURL_(e,n,s,r,a){const l={};return l[gm]=gu,typeof location<"u"&&location.hostname&&bm.test(location.hostname)&&(l[ym]=wm),n&&(l[vm]=n),s&&(l[Em]=s),r&&(l[Pc]=r),a&&(l[Tm]=a),Pm(e,Cm,l)}open(e,n){this.onDisconnect=n,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,Di.set("previous_websocket_failure",!0);try{let s;MT(),this.mySock=new fa(this.connURL,[],s)}catch(s){this.log_("Error instantiating WebSocket.");const r=s.message||s.data;r&&this.log_(r),this.onClosed_();return}this.mySock.onopen=()=>{this.log_("Websocket connected."),this.everConnected_=!0}
730,this.mySock.onclose=()=>{this.log_("Websocket connection was disconnected."),this.mySock=null,this.onClosed_()},this.mySock.onmessage=s=>{this.handleIncomingFrame(s)},this.mySock.onerror=s=>{this.log_("WebSocket error. Closing connection.");const r=s.message||s.data;r&&this.log_(r),this.onClosed_()}}start(){}static forceDisallow(){sn.forceDisallow_=!0}static isAvailable(){let e=!1;if(typeof navigator<"u"&&navigator.userAgent){const n=/Android ([0-9]{0,}\.[0-9]{0,})/,s=navigator.userAgent.match(n);s&&s.length>1&&parseFloat(s[1])<4.4&&(e=!0)}return!e&&fa!==null&&!sn.forceDisallow_}static previouslyFailed(){return Di.isInMemoryStorage||Di.get("previous_websocket_failure")===!0}markConnectionHealthy(){Di.remove("previous_websocket_failure")}appendFrame_(e){if(this.frames.push(e),this.frames.length===this.totalFrames){const n=this.frames.join("");this.frames=null;const s=$r(n);this.onMessage(s)}}handleNewFrameCount_(e){this.totalFrames=e,this.frames=[]}extractFrameCount_(e){if(H(this.frames===null,"We already have a frame buffer"),e.length<=6){const n=Number(e);if(!isNaN(n))return this.handleNewFrameCount_(n),null}return this.handleNewFrameCount_(1),e}handleIncomingFrame(e){if(this.mySock===null)return;const n=e.data;if(this.bytesReceived+=n.length,this.stats_.incrementCounter("bytes_received",n.length),this.resetKeepAlive(),this.frames!==null)this.appendFrame_(n);else{const s=this.extractFrameCount_(n);s!==null&&this.appendFrame_(s)}}send(e){this.resetKeepAlive();const n=dt(e);this.bytesSent+=n.length,this.stats_.incrementCounter("bytes_sent",n.length);const s=_m(n,FI);s.length>1&&this.sendString_(String(s.length));for(let r=0;r<s.length;r++)this.sendString_(s[r])}shutdown_(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)}onClosed_(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))}close(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())}resetKeepAlive(){clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(()=>{this.mySock&&this.sendString_("0"),this.resetKeepAlive()},Math.floor(BI))}sendString_(e){try{this.mySock.send(e)}catch(n){this.log_("Exception thrown from WebSocket.send():",n.message||n.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}}sn.responsesRequiredToBeHealthy=2;sn.healthyTimeout=3e4;/** 731 * @license 732 * Copyright 2017 Google LLC 733 * 734 * Licensed under the Apache License, Version 2.0 (the "License"); 735 * you may not use this file except in compliance with the License. 736 * You may obtain a copy of the License at 737 * 738 * http://www.apache.org/licenses/LICENSE-2.0 739 * 740 * Unless required by applicable law or agreed to in writing, software 741 * distributed under the License is distributed on an "AS IS" BASIS, 742 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 743 * See the License for the specific language governing permissions and 744 * limitations under the License. 745 */class Zr{static get ALL_TRANSPORTS(){return[vs,sn]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}constructor(e){this.initTransports_(e)}initTransports_(e){const n=sn&&sn.isAvailable();let s=n&&!sn.previouslyFailed();if(e.webSocketOnly&&(n||Dt("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),s=!0),s)this.transports_=[sn];else{const r=this.transports_=[];for(const a of Zr.ALL_TRANSPORTS)a&&a.isAvailable()&&r.push(a);Zr.globalTransportInitialized_=!0}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}}Zr.globalTransportInitialized_=!1;/** 746 * @license 747 * Copyright 2017 Google LLC 748 * 749 * Licensed under the Apache License, Version 2.0 (the "License"); 750 * you may not use this file except in compliance with the License. 751 * You may obtain a copy of the License at 752 * 753 * http://www.apache.org/licenses/LICENSE-2.0 754 * 755 * Unless required by applicable law or agreed to in writing, softw
755are 756 * distributed under the License is distributed on an "AS IS" BASIS, 757 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 758 * See the License for the specific language governing permissions and 759 * limitations under the License. 760 */const UI=6e4,zI=5e3,HI=10*1024,WI=100*1024,Xl="t",bf="d",VI="s",Ef="r",$I="e",Tf="o",Cf="a",If="n",Sf="p",jI="h";class ZI{constructor(e,n,s,r,a,l,u,d,f,m){this.id=e,this.repoInfo_=n,this.applicationId_=s,this.appCheckToken_=r,this.authToken_=a,this.onMessage_=l,this.onReady_=u,this.onDisconnect_=d,this.onKill_=f,this.lastSessionId=m,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=lo("c:"+this.id+":"),this.transportManager_=new Zr(n),this.log_("Connection created"),this.start_()}start_(){const e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const n=this.connReceiver_(this.conn_),s=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(()=>{this.conn_&&this.conn_.open(n,s)},Math.floor(0));const r=e.healthyTimeout||0;r>0&&(this.healthyTimeout_=kr(()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>WI?(this.log_("Connection exceeded healthy timeout but has received "+this.conn_.bytesReceived+" bytes. Marking connection healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>HI?this.log_("Connection exceeded healthy timeout but has sent "+this.conn_.bytesSent+" bytes. Leaving connection alive."):(this.log_("Closing unhealthy connection after timeout."),this.close()))},Math.floor(r)))}nextTransportId_(){return"c:"+this.id+":"+this.connectionCount++}disconnReceiver_(e){return n=>{e===this.conn_?this.onConnectionLost_(n):e===this.secondaryConn_?(this.log_("Secondary connection lost."),this.onSecondaryConnectionLost_()):this.log_("closing an old connection")}}connReceiver_(e){return n=>{this.state_!==2&&(e===this.rx_?this.onPrimaryMessageReceived_(n):e===this.secondaryConn_?this.onSecondaryMessageReceived_(n):this.log_("message on old connection"))}}sendRequest(e){const n={t:"d",d:e};this.sendData_(n)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(e){if(Xl in e){const n=e[Xl];n===Cf?this.upgradeIfSecondaryHealthy_():n===Ef?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),(this.tx_===this.secondaryConn_||this.rx_===this.secondaryConn_)&&this.close()):n===Tf&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){const n=mr("t",e),s=mr("d",e);if(n==="c")this.onSecondaryControl_(s);else if(n==="d")this.pendingDataMessages.push(s);else throw new Error("Unknown protocol layer: "+n)}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t:"c",d:{t:Sf,d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:Cf,d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:If,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){const n=mr("t",e),s=mr("d",e);n==="c"?this.onControl_(s):n==="d"&&this.onDataMessage_(s)}onDataMessage_(e){this.onPrimaryResponse_(),this.onMessage_(e)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(e){const n=mr(Xl,e);if(bf in e){const s=e[bf];if(n===jI){const r=Object.assign({},s);this.repoInfo_.isUsingEmulator&&(r.h=this.repoInfo_.host),this.onHandshake_(r)}else if(n===If){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let r=0;r<this.pendingDataMessages.length;++r)this.onDataMessage_(this.pendingDataMessages[r]);this.pendingDataMessages=[],this.tryCleanupConnection()}else n===VI?this.onConnectionShutdown_(s):n===Ef?this.onReset_(s):n===$I?Sc("Server Error: "+s):n===Tf?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):Sc("Unknown control packet command: "+n)}}onHandshake_(e){const n=e.ts,s=e.v,r=e.h;this.sessionId=e.s,this.repoInfo_.host=r,this.state_===0&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,n),gu!==s&&Dt("Protocol version mismatch detected"),this.tryStartUpgrade_())}tryStartUpgrade_(){const e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)}startUpgrade_(e){this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const n=this.connReceiver_(this.secondaryConn_),s=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(n,s),kr(()=>{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())},Math.floor(UI))}onReset_(e){this.log_("Reset packet received. New host: "+e),this.repoInfo_.host=e,this.state_===1?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(e,n){this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(n,this.sessionId),this.onReady_=null),this.primaryResponsesRequired_===0?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):kr(()=>{this.sendPingOnPrimaryIfNecessary_()},Math.floor(zI))}sendPingOnPrimaryIfNecessary_(){!this.isHealthy_&&this.state_===1&&(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:Sf,d:{}}}))}onSecondaryConnectionLost_(){const e=this.secondaryConn_;this.secondaryConn_=null,(this.tx_===e||this.rx_===e)&&this.close()}onConnectionLost_(e){this.conn_=null,!e&&this.state_===0?(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(Di.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)):this.state_===1&&this.log_("Realtime connection lost."),this.close()}onConnectionShutdown_(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()}sendData_(e){if(this.state_!==1)throw"Connection is not connected";this.tx_.send(e)}close(){this.state_!==2&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))}closeConnections_(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)}}/** 761 * @license 762 * Copyright 2017 Google LLC 763 * 764 * Licensed under the Apache License, Version 2.0 (the "License");
765 * you may not use this file except in compliance with the License. 766 * You may obtain a copy of the License at 767 * 768 * http://www.apache.org/licenses/LICENSE-2.0 769 * 770 * Unless required by applicable law or agreed to in writing, software 771 * distributed under the License is distributed on an "AS IS" BASIS, 772 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 773 * See the License for the specific language governing permissions and 774 * limitations under the License. 775 */class Om{put(e,n,s,r){}merge(e,n,s,r){}refreshAuthToken(e){}refreshAppCheckToken(e){}onDisconnectPut(e,n,s){}onDisconnectMerge(e,n,s){}onDisconnectCancel(e,n){}reportStats(e){}}/** 776 * @license 777 * Copyright 2017 Google LLC 778 * 779 * Licensed under the Apache License, Version 2.0 (the "License"); 780 * you may not use this file except in compliance with the License. 781 * You may obtain a copy of the License at 782 * 783 * http://www.apache.org/licenses/LICENSE-2.0 784 * 785 * Unless required by applicable law or agreed to in writing, software 786 * distributed under the License is distributed on an "AS IS" BASIS, 787 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 788 * See the License for the specific language governing permissions and 789 * limitations under the License. 790 */class Nm{constructor(e){this.allowedEvents_=e,this.listeners_={},H(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}trigger(e,...n){if(Array.isArray(this.listeners_[e])){const s=[...this.listeners_[e]];for(let r=0;r<s.length;r++)s[r].callback.apply(s[r].context,n)}}on(e,n,s){this.validateEventType_(e),this.listeners_[e]=this.listeners_[e]||[],this.listeners_[e].push({callback:n,context:s});const r=this.getInitialEvent(e);r&&n.apply(s,r)}off(e,n,s){this.validateEventType_(e);const r=this.listeners_[e]||[];for(let a=0;a<r.length;a++)if(r[a].callback===n&&(!s||s===r[a].context)){r.splice(a,1);return}}validateEventType_(e){H(this.allowedEvents_.find(n=>n===e),"Unknown event: "+e)}}/** 791 * @license 792 * Copyright 2017 Google LLC 793 * 794 * Licensed under the Apache License, Version 2.0 (the "License"); 795 * you may not use this file except in compliance with the License. 796 * You may obtain a copy of the License at 797 * 798 * http://www.apache.org/licenses/LICENSE-2.0 799 * 800 * Unless required by applicable law or agreed to in writing, software 801 * distributed under the License is distributed on an "AS IS" BASIS, 802 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 803 * See the License for the specific language governing permissions and 804 * limitations under the License. 805 */class pa extends Nm{static getInstance(){return new pa}constructor(){super(["online"]),this.online_=!0,typeof window<"u"&&typeof window.addEventListener<"u"&&!hu()&&(window.addEventListener("online",()=>{this.online_||(this.online_=!0,this.trigger("online",!0))},!1),window.addEventListener("offline",()=>{this.online_&&(this.online_=!1,this.trigger("online",!1))},!1))}getInitialEvent(e){return H(e==="online","Unknown event type: "+e),[this.online_]}currentlyOnline(){return this.online_}}/** 806 * @license 807 * Copyright 2017 Google LLC 808 * 809 * Licensed under the Apache License, Version 2.0 (the "License"); 810 * you may not use this file except in compliance with the License. 811 * You may obtain a copy of the License at 812 * 813 * http://www.apache.org/licenses/LICENSE-2.0 814 * 815 * Unless required by applicable law or agreed to in writing, software 816 * distributed under the License is distributed on an "AS IS" BASIS, 817 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 818 * See the License for the specific language governing permissions and 819 * limitations under the License. 820 */const Pf=32,xf=768;class Ve{constructor(e,n){if(n===void 0){this.pieces_=e.split("/");let s=0;for(let r=0;r<this.pieces_.length;r++)this.pieces_[r].length>0&&(this.pieces_[s]=this.pieces_[r],s++);this.pieces_.length=s,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=n}toString(){let e="";for(let n=this.pieceNum_;n<this.pieces_.length;n++)this.pieces_[n]!==""&&(e+="/"+this.pieces_[n]);return e||"/"}}function Oe(){return new Ve("")}function ve(t){return t.pieceNum_>=t.pieces_.length?null:t.pieces_[t.pieceNum_]}function yi(t){return t.pieces_.length-t.pieceNum_}function qe(t){let e=t.pieceNum_;return e<t.pieces_.length&&e++,new Ve(t.pieces_,e)}function Mm(t){return t.pieceNum_<t.pieces_.length?t.pieces_[t.pieces_.length-1]:null}function qI(t){let e="";for(let n=t.pieceNum_;n<t.pieces_.length;n++)t.pieces_[n]!==""&&(e+="/"+encodeURIComponent(String(t.pieces_[n])));return e||"/"}function Dm(t,e=0){return t.pieces_.slice(t.pieceNum_+e)}function Fm(t){if(t.pieceNum_>=t.pieces_.length)return null;const e=[];for(let n=t.pieceNum_;n<t.pieces_.length-1;n++)e.push(t.pieces_[n]);return new Ve(e,0)}function lt(t,e){const n=[];for(let s=t.pieceNum_;s<t.pieces_.length;s++)n.push(t.pieces_[s]);if(e instanceof Ve)for(let s=e.pieceNum_;s<e.pieces_.length;s++)n.push(e.pieces_[s]);else{const s=e.split("/");for(let r=0;r<s.length;r++)s[r].length>0&&n.push(s[r])}return new Ve(n,0)}function Ee(t){return t.pieceNum_>=t.pieces_.length}function Nt(t,e){const n=ve(t),s=ve(e);
vendor: 11,959 bytes, lines 820-851
820if(n===null)return e;if(n===s)return Nt(qe(t),qe(e));throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+t+")")}function wu(t,e){if(yi(t)!==yi(e))return!1;for(let n=t.pieceNum_,s=e.pieceNum_;n<=t.pieces_.length;n++,s++)if(t.pieces_[n]!==e.pieces_[s])return!1;return!0}function rn(t,e){let n=t.pieceNum_,s=e.pieceNum_;if(yi(t)>yi(e))return!1;for(;n<t.pieces_.length;){if(t.pieces_[n]!==e.pieces_[s])return!1;++n,++s}return!0}class GI{constructor(e,n){this.errorPrefix_=n,this.parts_=Dm(e,0),this.byteLength_=Math.max(1,this.parts_.length);for(let s=0;s<this.parts_.length;s++)this.byteLength_+=Ga(this.parts_[s]);Bm(this)}}function KI(t,e){t.parts_.length>0&&(t.byteLength_+=1),t.parts_.push(e),t.byteLength_+=Ga(e),Bm(t)}function YI(t){const e=t.parts_.pop();t.byteLength_-=Ga(e),t.parts_.length>0&&(t.byteLength_-=1)}function Bm(t){if(t.byteLength_>xf)throw new Error(t.errorPrefix_+"has a key path longer than "+xf+" bytes ("+t.byteLength_+").");if(t.parts_.length>Pf)throw new Error(t.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+Pf+") or object contains a cycle "+Ni(t))}function Ni(t){return t.parts_.length===0?"":"in property '"+t.parts_.join(".")+"'"}/** 821 * @license 822 * Copyright 2017 Google LLC 823 * 824 * Licensed under the Apache License, Version 2.0 (the "License"); 825 * you may not use this file except in compliance with the License. 826 * You may obtain a copy of the License at 827 * 828 * http://www.apache.org/licenses/LICENSE-2.0 829 * 830 * Unless required by applicable law or agreed to in writing, software 831 * distributed under the License is distributed on an "AS IS" BASIS, 832 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 833 * See the License for the specific language governing permissions and 834 * limitations under the License. 835 */class bu extends Nm{static getInstance(){return new bu}constructor(){super(["visible"]);let e,n;typeof document<"u"&&typeof document.addEventListener<"u"&&(typeof document.hidden<"u"?(n="visibilitychange",e="hidden"):typeof document.mozHidden<"u"?(n="mozvisibilitychange",e="mozHidden"):typeof document.msHidden<"u"?(n="msvisibilitychange",e="msHidden"):typeof document.webkitHidden<"u"&&(n="webkitvisibilitychange",e="webkitHidden")),this.visible_=!0,n&&document.addEventListener(n,()=>{const s=!document[e];s!==this.visible_&&(this.visible_=s,this.trigger("visible",s))},!1)}getInitialEvent(e){return H(e==="visible","Unknown event type: "+e),[this.visible_]}}/** 836 * @license 837 * Copyright 2017 Google LLC 838 * 839 * Licensed under the Apache License, Version 2.0 (the "License"); 840 * you may not use this file except in compliance with the License. 841 * You may obtain a copy of the License at 842 * 843 * http://www.apache.org/licenses/LICENSE-2.0 844 * 845 * Unless required by applicable law or agreed to in writing, software 846 * distributed under the License is distributed on an "AS IS" BASIS, 847 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 848 * See the License for the specific language governing permissions and 849 * limitations under the License. 850 */const gr=1e3,JI=60*5*1e3,Lf=30*1e3,QI=1.3,XI=3e4,eS="server_kill",Rf=3;class Wn extends Om{constructor(e,n,s,r,a,l,u,d){if(super(),this.repoInfo_=e,this.applicationId_=n,this.onDataUpdate_=s,this.onConnectStatus_=r,this.onServerInfoUpdate_=a,this.authTokenProvider_=l,this.appCheckTokenProvider_=u,this.authOverride_=d,this.id=Wn.nextPersistentConnectionId_++,this.log_=lo("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=gr,this.maxReconnectDelay_=JI,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,d)throw new Error("Auth override specified in options, but not supported on non Node.js platforms");bu.getInstance().on("visible",this.onVisible_,this),e.host.indexOf("fblocal")===-1&&pa.getInstance().on("online",this.onOnline_,this)}sendRequest(e,n,s){const r=++this.requestNumber_,a={r,a:e,b:n};this.log_(dt(a)),H(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(a),s&&(this.requestCBHash_[r]=s)}get(e){this.initConnection_();const n=new qa,r={action:"g",request:{p:e._path.toString(),q:e._queryObject},onComplete:l=>{const u=l.d;l.s==="ok"?n.resolve(u):n.reject(u)}};this.outstandingGets_.push(r),this.outstandingGetCount_++;const a=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(a),n.promise}listen(e,n,s,r){this.initConnection_();const a=e._queryIdentifier,l=e._path.toString();this.log_("Listen called for "+l+" "+a),this.listens.has(l)||this.listens.set(l,new Map),H(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"listen() called for non-default but complete query"),H(!this.listens.get(l).has(a),"listen() called twice for same path/queryId.");const u={onComplete:r,hashFn:n,query:e,tag:s};this.listens.get(l).set(a,u),this.connected_&&this.sendListen_(u)}sendGet_(e){const n=this.outstandingGets_[e];this.sendRequest("g",n.request,s=>{delete this.outstandingGets_[e],this.outstandingGetCount_--,this.outstandingGetCount_===0&&(this.outstandingGets_=[]),n.onComplete&&n.onComplete(s)})}sendListen_(e){const n=e.query,s=n._path.toString(),r=n._queryIdentifier;this.log_("Listen on "+s+" for "+r);const a={p:s},l="q";e.tag&&(a.q=n._queryObject,a.t=e.tag),a.h=e.hashFn(),this.sendRequest(l,a,u=>{const d=u.d,f=u.s;Wn.warnOnListenWarnings_(d,n),(this.listens.get(s)&&this.listens.get(s).get(r))===e&&(this.log_("listen response",u),f!=="ok"&&this.removeListen_(s,r),e.onComplete&&e.onComplete(f,d))})}static warnOnListenWarnings_(e,n){if(e&&typeof e=="object"&&Yn(e,"w")){const s=Ms(e,"w");if(Array.isArray(s)&&~s.indexOf("no_index")){const r='".indexOn": "'+n._queryParams.getIndex().toString()+'"',a=n._path.toString();Dt(`Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ${r} at ${a} to your security rules for better performance.`)}}}refreshAuthToken(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},()=>{}),this.reduceReconnectDelayIfAdminCredential_(e)}reduceReconnectDelayIfAdminCredential_(e){(e&&e.length===40||WT(e))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=Lf)}refreshAppCheckToken(e){this.appCheckToken_=e,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},()=>{})}tryAuth(){if(this.connected_&&this.authToken_){const e=this.authToken_,n=HT(e)?"auth":"gauth",s={cred:e};this.authOverride_===null?s.noauth=!0:typeof this.authOverride_=="object"&&(s.authvar=this.authOverride_),this.sendRequest(n,s,r=>{const a=r.s,l=r.d||"error";this.authToken_===e&&(a==="ok"?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(a,l))})}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},e=>{const n=e.s,s=e.d||"error";n==="ok"?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(n,s)})}unlisten(e,n){const s=e._path.toString(),r=e._queryIdentifier;this.log_("Unlisten called for "+s+" "+r),H(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(s,r)&&this.connected_&&this.sendUnlisten_(s,r,e._queryObject,n)}sendUnlisten_(e,n,s,r){this.log_("Unlisten on "+e+" for "+n);const a={p:e},l="n";r&&(a.q=s,a.t=r),this.sendRequest(l,a)}onDisconnectPut(e,n,s){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",e,n,s):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:n,onComplete:s})}onDisconnectMerge(e,n,s){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",e,n,s):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:n,onComplete:s})}onDisconnectCancel(e,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",e,null,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:n})}sendOnDisconnect_(e,n,s,r){const a={p:n,d:s};this.log_("onDisconnect "+e,a),this.sendRequest(e,a,l=>{r&&setTimeout(()=>{r(l.s,l.d)},Math.floor(0))})}put(e,n,s,r){this.putInternal("p",e,n,s,r)}merge(e,n,s,r){this.putInternal("m",e,n,s,r)}putInternal(e,n,s,r,a){this.initConnection_();const l={p:n,d:s};a!==void 0&&(l.h=a),this.outstandingPuts_.push({action:e,request:l,onComplete:r}),this.outstandingPutCount_++;const u=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(u):this.log_("Buffering put: "+n)}sendPut_(e){const n=this.outstandingPuts_[e].action,s=this.outstandingPuts_[e].request,r=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(n,s,a=>{this.log_(n+" response",a),delete this.outstandingPuts_[e],this.outstandingPutCount_--,this.outstandingPutCount_===0&&(this.outstandingPuts_=[]),r&&r(a.s,a.d)})}reportStats(e){if(this.connected_){const n={c:e};this.log_("reportStats",n),this.sendRequest("s",n,s=>{if(s.s!=="ok"){const a=s.d;this.log_("reportStats","Error sending stats: "+a)}})}}onDataMessage_(e){if("r"in e){this.log_("from server: "+dt(e));const n=e.r,s=this.requestCBHash_[n];s&&(delete this.requestCBHash_[n],s(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}}onDataPush_(e,n){this.log_("handleServerMessage",e,n),e==="d"?this.onDataUpdate_(n.p,n.d,!1,n.t):e==="m"?this.onDataUpdate_(n.p,n.d,!0,n.t):e==="c"?this.onListenRevoked_(n.p,n.q):e==="ac"?this.onAuthRevoked_(n.s,n.d):e==="apc"?this.onAppCheckRevoked_(n.s,n.d):e==="sd"?this.onSecurityDebugPacket_(n):Sc("Unrecognized action received from server: "+dt(e)+` 851Are you using the latest client?`)}onReady_(e,n){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=new Date().getTime(),this.handleTimestamp_(e),this.lastSessionId=n,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(e){H(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(()=>{this.establishConnectionTimer_=null,this.establishConnection_()},Math.floor(e))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=gr,this.realtime_||this.scheduleConnect_(0)),this.visible_=e}onOnline_(e){e?(this.log_("Browser went online."),this.reconnectDelay_=gr,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){this.visible_?this.lastConnectionEstablishedTime_&&(new Date().getTime()-this.lastConnectionEstablishedTime_>XI&&(this.reconnectDelay_=gr),this.lastConnectionEstablishedTime_=null):(this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=new Date().getTime());const e=Math.max(0,new Date().getTime()-this.lastConnectionAttemptTime_);let n=Math.max(0,this.reconnectDelay_-e);
851n=Math.random()*n,this.log_("Trying to reconnect in "+n+"ms"),this.scheduleConnect_(n),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,this.reconnectDelay_*QI)}this.onConnectStatus_(!1)}async establishConnection_(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=new Date().getTime(),this.lastConnectionEstablishedTime_=null;const e=this.onDataMessage_.bind(this),n=this.onReady_.bind(this),s=this.onRealtimeDisconnect_.bind(this),r=this.id+":"+Wn.nextConnectionId_++,a=this.lastSessionId;let l=!1,u=null;const d=function(){u?u.close():(l=!0,s())},f=function(_){H(u,"sendRequest call when we're not connected not allowed."),u.sendRequest(_)};this.realtime_={close:d,sendRequest:f};const m=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{const[_,v]=await Promise.all([this.authTokenProvider_.getToken(m),this.appCheckTokenProvider_.getToken(m)]);l?Tt("getToken() completed but was canceled"):(Tt("getToken() completed. Creating connection."),this.authToken_=_&&_.accessToken,this.appCheckToken_=v&&v.token,u=new ZI(r,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,e,n,s,y=>{Dt(y+" ("+this.repoInfo_.toString()+")"),this.interrupt(eS)},a))}catch(_){this.log_("Failed to get token: "+_),l||(this.repoInfo_.nodeAdmin&&Dt(_),d())}}}interrupt(e){Tt("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())}resume(e){Tt("Resuming connection for reason: "+e),delete this.interruptReasons_[e],wc(this.interruptReasons_)&&(this.reconnectDelay_=gr,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(e){const n=e-new Date().getTime();this.onServerInfoUpdate_({serverTimeOffset:n})}cancelSentTransactions_(){for(let e=0;e<this.outstandingPuts_.length;e++){const n=this.outstandingPuts_[e];n&&"h"in n.request&&n.queued&&(n.onComplete&&n.onComplete("disconnect"),delete this.outstandingPuts_[e],this.outstandingPutCount_--)}this.outstandingPutCount_===0&&(this.outstandingPuts_=[])}onListenRevoked_(e,n){let s;n?s=n.map(a=>mu(a)).join("$"):s="default";const r=this.removeListen_(e,s);r&&r.onComplete&&r.onComplete("permission_denied")}removeListen_(e,n){const s=new Ve(e).toString();let r;if(this.listens.has(s)){const a=this.listens.get(s);r=a.get(n),a.delete(n),a.size===0&&this.listens.delete(s)}else r=void 0;return r}onAuthRevoked_(e,n){Tt("Auth token revoked: "+e+"/"+n),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),(e==="invalid_token"||e==="permission_denied")&&(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=Rf&&(this.reconnectDelay_=Lf,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(e,n){Tt("App check token revoked: "+e+"/"+n),this.appCheckToken_=null,this.forceTokenRefresh_=!0,(e==="invalid_token"||e==="permission_denied")&&(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=Rf&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace(` 852`,` 853FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of this.listens.values())for(const n of e.values())this.sendListen_(n);for(let e=0;e<this.outstandingPuts_.length;e++)this.outstandingPuts_[e]&&this.sendPut_(e);for(;this.onDisconnectRequestQueue_.length;){const e=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(e.action,e.pathString,e.data,e.onComplete)}for(let e=0;e<this.outstandingGets_.length;e++)this.outstandingGets_[e]&&this.sendGet_(e)}sendConnectStats_(){const e={};let n="js";e["sdk."+n+"."+hm.replace(/\./g,"-")]=1,hu()?e["framework.cordova"]=1:nm()&&(e["framework.reactnative"]=1),this.reportStats(e)}shouldReconnect_(){const e=pa.getInstance().currentlyOnline();return wc(this.interruptReasons_)&&e}}Wn.nextPersistentConnectionId_=0;Wn.nextConnectionId_=0;/** 854 * @license 855 * Copyright 2017 Google LLC 856 * 857 * Licensed under the Apache License, Version 2.0 (the "License");
858 * you may not use this file except in compliance with the License. 859 * You may obtain a copy of the License at 860 * 861 * http://www.apache.org/licenses/LICENSE-2.0 862 * 863 * Unless required by applicable law or agreed to in writing, software 864 * distributed under the License is distributed on an "AS IS" BASIS, 865 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 866 * See the License for the specific language governing permissions and 867 * limitations under the License. 868 */class ye{constructor(e,n){this.name=e,this.node=n}static Wrap(e,n){return new ye(e,n)}}/** 869 * @license 870 * Copyright 2017 Google LLC 871 * 872 * Licensed under the Apache License, Version 2.0 (the "License"); 873 * you may not use this file except in compliance with the License. 874 * You may obtain a copy of the License at 875 * 876 * http://www.apache.org/licenses/LICENSE-2.0 877 * 878 * Unless required by applicable law or agreed to in writing, software 879 * distributed under the License is distributed on an "AS IS" BASIS, 880 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 881 * See the License for the specific language governing permissions and 882 * limitations under the License. 883 */class Ya{getCompare(){return this.compare.bind(this)}indexedValueChanged(e,n){const s=new ye(Fs,e),r=new ye(Fs,n);return this.compare(s,r)!==0}minPost(){return ye.MIN}}/** 884 * @license 885 * Copyright 2017 Google LLC 886 * 887 * Licensed under the Apache License, Version 2.0 (the "License"); 888 * you may not use this file except in compliance with the License. 889 * You may obtain a copy of the License at 890 * 891 * http://www.apache.org/licenses/LICENSE-2.0 892 * 893 * Unless required by applicable law or agreed to in writing, software 894 * distributed under the License is distributed on an "AS IS" BASIS, 895 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 896 * See the License for the specific language governing permissions and 897 * limitations under the License. 898 */let Uo;class Um extends Ya{static get __EMPTY_NODE(){return Uo}static set __EMPTY_NODE(e){Uo=e}compare(e,n){return Ys(e.name,n.name)}isDefinedOn(e){throw qs("KeyIndex.isDefinedOn not expected to be called.")}indexedValueChanged(e,n){return!1}minPost(){return ye.MIN}maxPost(){return new ye(Zi,Uo)}makePost(e,n){return H(typeof e=="string","KeyIndex indexValue must always be a string."),new ye(e,Uo)}toString(){return".key"}}const Ps=new Um;/** 899 * @license 900 * Copyright 2017 Google LLC 901 * 902 * Licensed under the Apache License, Version 2.0 (the "License"); 903 * you may not use this file except in compliance with the License. 904 * You may obtain a copy of the License at 905 * 906 * http://www.apache.org/licenses/LICENSE-2.0 907 * 908 * Unless required by applicable law or agreed to in writing, software 909 * distributed under the License is distributed on an "AS IS" BASIS, 910 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 911 * See the License for the specific language governing permissions and 912 * limitations under the License. 913 */class zo{constructor(e,n,s,r,a=null){this.isReverse_=r,this.resultGenerator_=a,this.nodeStack_=[];let l=1;for(;!e.isEmpty();)if(e=e,l=n?s(e.key,n):1,r&&(l*=-1),l<0)this.isReverse_?e=e.left:e=e.right;else if(l===0){this.nodeStack_.push(e);break}else this.nodeStack_.push(e),this.isReverse_?e=e.right:e=e.left}getNext(){if(this.nodeStack_.length===0)return null;let e=this.nodeStack_.pop(),n;if(this.resultGenerator_?n=this.resultGenerator_(e.key,e.value):n={key:e.key,value:e.value},this.isReverse_)for(e=e.left;!e.isEmpty();)this.nodeStack_.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack_.push(e),e=e.left;return n}hasNext(){return this.nodeStack_.length>0}peek(){if(this.nodeStack_.length===0)return null;const e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}}}class ht{constructor(e,n,s,r,a){this.key=e,this.value=n,this.color=s??ht.RED,this.left=r??Mt.EMPTY_NODE,this.right=a??Mt.EMPTY_NODE}copy(e,n,s,r,a){return new ht(e??this.key,n??this.value,s??this.color,r??this.left,a??this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min_(){return this.left.isEmpty()?this:this.left.min_()}minKey(){return this.min_().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,n,s){let r=this;const a=s(e,r.key);return a<0?r=r.copy(null,null,null,r.left.insert(e,n,s),null):a===0?r=r.copy(null,n,null,null,null):r=r.copy(null,null,null,null,r.right.insert(e,n,s)),r.fixUp_()}removeMin_(){if(this.left.isEmpty())return Mt.EMPTY_NODE;let e=this;return!e.left.isRed_()&&!e.left.left.isRed_()&&(e=e.moveRedLeft_()),e=e.copy(null,null,null,e.left.removeMin_(),null),e.fixUp_()}remove(e,n){let s,r;if(s=this,n(e,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(e,n),null);else{if(s.left.isRed_()&&(s=s.rotateRight_()),!s.right.isEmpty()&&!s.right.isRed_()&&!s.right.left.isRed_()&&(s=s.moveRedRight_()),n(e,s.key)===0){if(s.right.isEmpty())return Mt.EMPTY_NODE;r=s.right.min_(),s=s.copy(r.key,r.value,null,null,s.right.removeMin_())}s=s.copy(null,null,null,null,s.right.remove(e,n))}return s.fixUp_()}isRed_(){return this.color}fixUp_(){let e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e}moveRedLeft_(){let e=this.colorFlip_();return e.right.left.isRed_()&&(e=e.copy(null,null,null,null,e.right.rotateRight_()),e=e.rotateLeft_(),e=e.colorFlip_()),e}moveRedRight_(){let e=this.colorFlip_();return e.left.left.isRed_()&&(e=e.rotateRight_(),e=e.colorFlip_()),e}rotateLeft_(){const e=this.copy(null,null,ht.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight_(){const e=this.copy(null,null,ht.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip_(){const e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)}checkMaxDepth_(){const e=this.check_();return Math.pow(2,e)<=this.count()+1}
vendor: 5,535 bytes, lines 913-958
913check_(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");const e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)}}ht.RED=!0;ht.BLACK=!1;class tS{copy(e,n,s,r,a){return this}insert(e,n,s){return new ht(e,n,null)}remove(e,n){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}}class Mt{constructor(e,n=Mt.EMPTY_NODE){this.comparator_=e,this.root_=n}insert(e,n){return new Mt(this.comparator_,this.root_.insert(e,n,this.comparator_).copy(null,null,ht.BLACK,null,null))}remove(e){return new Mt(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,ht.BLACK,null,null))}get(e){let n,s=this.root_;for(;!s.isEmpty();){if(n=this.comparator_(e,s.key),n===0)return s.value;n<0?s=s.left:n>0&&(s=s.right)}return null}getPredecessorKey(e){let n,s=this.root_,r=null;for(;!s.isEmpty();)if(n=this.comparator_(e,s.key),n===0){if(s.left.isEmpty())return r?r.key:null;for(s=s.left;!s.right.isEmpty();)s=s.right;return s.key}else n<0?s=s.left:n>0&&(r=s,s=s.right);throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(e){return this.root_.inorderTraversal(e)}reverseTraversal(e){return this.root_.reverseTraversal(e)}getIterator(e){return new zo(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,n){return new zo(this.root_,e,this.comparator_,!1,n)}getReverseIteratorFrom(e,n){return new zo(this.root_,e,this.comparator_,!0,n)}getReverseIterator(e){return new zo(this.root_,null,this.comparator_,!0,e)}}Mt.EMPTY_NODE=new tS;/** 914 * @license 915 * Copyright 2017 Google LLC 916 * 917 * Licensed under the Apache License, Version 2.0 (the "License"); 918 * you may not use this file except in compliance with the License. 919 * You may obtain a copy of the License at 920 * 921 * http://www.apache.org/licenses/LICENSE-2.0 922 * 923 * Unless required by applicable law or agreed to in writing, software 924 * distributed under the License is distributed on an "AS IS" BASIS, 925 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 926 * See the License for the specific language governing permissions and 927 * limitations under the License. 928 */function nS(t,e){return Ys(t.name,e.name)}function Eu(t,e){return Ys(t,e)}/** 929 * @license 930 * Copyright 2017 Google LLC 931 * 932 * Licensed under the Apache License, Version 2.0 (the "License"); 933 * you may not use this file except in compliance with the License. 934 * You may obtain a copy of the License at 935 * 936 * http://www.apache.org/licenses/LICENSE-2.0 937 * 938 * Unless required by applicable law or agreed to in writing, software 939 * distributed under the License is distributed on an "AS IS" BASIS, 940 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 941 * See the License for the specific language governing permissions and 942 * limitations under the License. 943 */let xc;function iS(t){xc=t}const zm=function(t){return typeof t=="number"?"number:"+mm(t):"string:"+t},Hm=function(t){if(t.isLeafNode()){const e=t.val();H(typeof e=="string"||typeof e=="number"||typeof e=="object"&&Yn(e,".sv"),"Priority must be a string or number.")}else H(t===xc||t.isEmpty(),"priority of unexpected type.");H(t===xc||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")};/** 944 * @license 945 * Copyright 2017 Google LLC 946 * 947 * Licensed under the Apache License, Version 2.0 (the "License"); 948 * you may not use this file except in compliance with the License. 949 * You may obtain a copy of the License at 950 * 951 * http://www.apache.org/licenses/LICENSE-2.0 952 * 953 * Unless required by applicable law or agreed to in writing, software 954 * distributed under the License is distributed on an "AS IS" BASIS, 955 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 956 * See the License for the specific language governing permissions and 957 * limitations under the License. 958 */let Af;class ut{static set __childrenNodeConstructor(e){Af=e}static get __childrenNodeConstructor(){return Af}constructor(e,n=ut.__childrenNodeConstructor.EMPTY_NODE){this.value_=e,this.priorityNode_=n,this.lazyHash_=null,H(this.value_!==void 0&&this.value_!==null,"LeafNode shouldn't be created with null/undefined value."),Hm(this.priorityNode_)}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(e){return new ut(this.value_,e)}getImmediateChild(e){return e===".priority"?this.priorityNode_:ut.__childrenNodeConstructor.EMPTY_NODE}getChild(e){return Ee(e)?this:ve(e)===".priority"?this.priorityNode_:ut.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(e,n){return null}updateImmediateChild(e,n){return e===".priority"?this.updatePriority(n):n.isEmpty()&&e!==".priority"?this:ut.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,n).updatePriority(this.priorityNode_)}updateChild(e,n){const s=ve(e);return s===null?n:n.isEmpty()&&s!==".priority"?this:(H(s!==".priority"||yi(e)===1,".priority must be the last token in a path"),this.updateImmediateChild(s,ut.__childrenNodeConstructor.EMPTY_NODE.updateChild(qe(e),n)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(e,n){return!1}
958val(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(this.lazyHash_===null){let e="";this.priorityNode_.isEmpty()||(e+="priority:"+zm(this.priorityNode_.val())+":");const n=typeof this.value_;e+=n+":",n==="number"?e+=mm(this.value_):e+=this.value_,this.lazyHash_=fm(e)}return this.lazyHash_}getValue(){return this.value_}compareTo(e){return e===ut.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof ut.__childrenNodeConstructor?-1:(H(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))}compareToLeafNode_(e){const n=typeof e.value_,s=typeof this.value_,r=ut.VALUE_TYPE_ORDER.indexOf(n),a=ut.VALUE_TYPE_ORDER.indexOf(s);return H(r>=0,"Unknown leaf type: "+n),H(a>=0,"Unknown leaf type: "+s),r===a?s==="object"?0:this.value_<e.value_?-1:this.value_===e.value_?0:1:a-r}withIndex(){return this}isIndexed(){return!0}equals(e){if(e===this)return!0;if(e.isLeafNode()){const n=e;return this.value_===n.value_&&this.priorityNode_.equals(n.priorityNode_)}else return!1}}ut.VALUE_TYPE_ORDER=["object","boolean","number","string"];/** 959 * @license 960 * Copyright 2017 Google LLC 961 * 962 * Licensed under the Apache License, Version 2.0 (the "License"); 963 * you may not use this file except in compliance with the License. 964 * You may obtain a copy of the License at 965 * 966 * http://www.apache.org/licenses/LICENSE-2.0 967 * 968 * Unless required by applicable law or agreed to in writing, software 969 * distributed under the License is distributed on an "AS IS" BASIS, 970 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 971 * See the License for the specific language governing permissions and 972 * limitations under the License. 973 */let Wm,Vm;function sS(t){Wm=t}function rS(t){Vm=t}class oS extends Ya{compare(e,n){const s=e.node.getPriority(),r=n.node.getPriority(),a=s.compareTo(r);return a===0?Ys(e.name,n.name):a}isDefinedOn(e){return!e.getPriority().isEmpty()}indexedValueChanged(e,n){return!e.getPriority().equals(n.getPriority())}minPost(){return ye.MIN}maxPost(){return new ye(Zi,new ut("[PRIORITY-POST]",Vm))}makePost(e,n){const s=Wm(e);return new ye(n,new ut("[PRIORITY-POST]",s))}toString(){return".priority"}}const Xe=new oS;/** 974 * @license 975 * Copyright 2017 Google LLC 976 * 977 * Licensed under the Apache License, Version 2.0 (the "License"); 978 * you may not use this file except in compliance with the License. 979 * You may obtain a copy of the License at 980 * 981 * http://www.apache.org/licenses/LICENSE-2.0 982 * 983 * Unless required by applicable law or agreed to in writing, software 984 * distributed under the License is distributed on an "AS IS" BASIS, 985 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 986 * See the License for the specific language governing permissions and 987 * limitations under the License. 988 */const aS=Math.log(2);class lS{constructor(e){const n=a=>parseInt(Math.log(a)/aS,10),s=a=>parseInt(Array(a+1).join("1"),2);this.count=n(e+1),this.current_=this.count-1;const r=s(this.count);this.bits_=e+1&r}nextBitIsOne(){const e=!(this.bits_&1<<this.current_);return this.current_--,e}}const _a=function(t,e,n,s){t.sort(e);const r=function(d,f){const m=f-d;let _,v;if(m===0)return null;if(m===1)return _=t[d],v=n?n(_):_,new ht(v,_.node,ht.BLACK,null,null);{const y=parseInt(m/2,10)+d,P=r(d,y),T=r(y+1,f);return _=t[y],v=n?n(_):_,new ht(v,_.node,ht.BLACK,P,T)}},a=function(d){let f=null,m=null,_=t.length;const v=function(P,T){const O=_-P,z=_;_-=P;const B=r(O+1,z),A=t[O],R=n?n(A):A;y(new ht(R,A.node,T,null,B))},y=function(P){f?(f.left=P,f=P):(m=P,f=P)};for(let P=0;P<d.count;++P){const T=d.nextBitIsOne(),O=Math.pow(2,d.count-(P+1));T?v(O,ht.BLACK):(v(O,ht.BLACK),v(O,ht.RED))}return m},l=new lS(t.length),u=a(l);return new Mt(s||e,u)};/** 989 * @license 990 * Copyright 2017 Google LLC 991 * 992 * Licensed under the Apache License, Version 2.0 (the "License"); 993 * you may not use this file except in compliance with the License. 994 * You may obtain a copy of the License at 995 * 996 * http://www.apache.org/licenses/LICENSE-2.0 997 * 998 * Unless required by applicable law or agreed to in writing, softw
998are 999 * distributed under the License is distributed on an "AS IS" BASIS, 1000 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1001 * See the License for the specific language governing permissions and 1002 * limitations under the License. 1003 */let ec;const ps={};class Bn{static get Default(){return H(ps&&Xe,"ChildrenNode.ts has not been loaded"),ec=ec||new Bn({".priority":ps},{".priority":Xe}),ec}constructor(e,n){this.indexes_=e,this.indexSet_=n}get(e){const n=Ms(this.indexes_,e);if(!n)throw new Error("No index defined for "+e);return n instanceof Mt?n:null}hasIndex(e){return Yn(this.indexSet_,e.toString())}addIndex(e,n){H(e!==Ps,"KeyIndex always exists and isn't meant to be added to the IndexMap.");const s=[];let r=!1;const a=n.getIterator(ye.Wrap);let l=a.getNext();for(;l;)r=r||e.isDefinedOn(l.node),s.push(l),l=a.getNext();let u;r?u=_a(s,e.getCompare()):u=ps;const d=e.toString(),f=Object.assign({},this.indexSet_);f[d]=e;const m=Object.assign({},this.indexes_);return m[d]=u,new Bn(m,f)}addToIndexes(e,n){const s=ha(this.indexes_,(r,a)=>{const l=Ms(this.indexSet_,a);if(H(l,"Missing index implementation for "+a),r===ps)if(l.isDefinedOn(e.node)){const u=[],d=n.getIterator(ye.Wrap);let f=d.getNext();for(;f;)f.name!==e.name&&u.push(f),f=d.getNext();return u.push(e),_a(u,l.getCompare())}else return ps;else{const u=n.get(e.name);let d=r;return u&&(d=d.remove(new ye(e.name,u))),d.insert(e,e.node)}});return new Bn(s,this.indexSet_)}removeFromIndexes(e,n){const s=ha(this.indexes_,r=>{if(r===ps)return r;{const a=n.get(e.name);return a?r.remove(new ye(e.name,a)):r}});return new Bn(s,this.indexSet_)}}/** 1004 * @license 1005 * Copyright 2017 Google LLC 1006 * 1007 * Licensed under the Apache License, Version 2.0 (the "License"); 1008 * you may not use this file except in compliance with the License. 1009 * You may obtain a copy of the License at 1010 * 1011 * http://www.apache.org/licenses/LICENSE-2.0 1012 * 1013 * Unless required by applicable law or agreed to in writing, software 1014 * distributed under the License is distributed on an "AS IS" BASIS, 1015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1016 * See the License for the specific language governing permissions and 1017 * limitations under the License. 1018 */let vr;class oe{static get EMPTY_NODE(){return vr||(vr=new oe(new Mt(Eu),null,Bn.Default))}constructor(e,n,s){this.children_=e,this.priorityNode_=n,this.indexMap_=s,this.lazyHash_=null,this.priorityNode_&&Hm(this.priorityNode_),this.children_.isEmpty()&&H(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}isLeafNode(){return!1}getPriority(){return this.priorityNode_||vr}updatePriority(e){return this.children_.isEmpty()?this:new oe(this.children_,e,this.indexMap_)}getImmediateChild(e){if(e===".priority")return this.getPriority();{const n=this.children_.get(e);return n===null?vr:n}}getChild(e){const n=ve(e);return n===null?this:this.getImmediateChild(n).getChild(qe(e))}hasChild(e){return this.children_.get(e)!==null}updateImmediateChild(e,n){if(H(n,"We should always be passing snapshot nodes"),e===".priority")return this.updatePriority(n);{const s=new ye(e,n);let r,a;n.isEmpty()?(r=this.children_.remove(e),a=this.indexMap_.removeFromIndexes(s,this.children_)):(r=this.children_.insert(e,n),a=this.indexMap_.addToIndexes(s,this.children_));const l=r.isEmpty()?vr:this.priorityNode_;return new oe(r,l,a)}}updateChild(e,n){const s=ve(e);if(s===null)return n;{H(ve(e)!==".priority"||yi(e)===1,".priority must be the last token in a path");const r=this.getImmediateChild(s).updateChild(qe(e),n);return this.updateImmediateChild(s,r)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(e){if(this.isEmpty())return null;const n={};let s=0,r=0,a=!0;if(this.forEachChild(Xe,(l,u)=>{n[l]=u.val(e),s++,a&&oe.INTEGER_REGEXP_.test(l)?r=Math.max(r,Number(l)):a=!1}),!e&&a&&r<2*s){const l=[];for(const u in n)l[u]=n[u];return l}else return e&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n}hash(){if(this.lazyHash_===null){let e="";
1018this.getPriority().isEmpty()||(e+="priority:"+zm(this.getPriority().val())+":"),this.forEachChild(Xe,(n,s)=>{const r=s.hash();r!==""&&(e+=":"+n+":"+r)}),this.lazyHash_=e===""?"":fm(e)}return this.lazyHash_}getPredecessorChildName(e,n,s){const r=this.resolveIndex_(s);if(r){const a=r.getPredecessorKey(new ye(e,n));return a?a.name:null}else return this.children_.getPredecessorKey(e)}getFirstChildName(e){const n=this.resolveIndex_(e);if(n){const s=n.minKey();return s&&s.name}else return this.children_.minKey()}getFirstChild(e){const n=this.getFirstChildName(e);return n?new ye(n,this.children_.get(n)):null}getLastChildName(e){const n=this.resolveIndex_(e);if(n){const s=n.maxKey();return s&&s.name}else return this.children_.maxKey()}getLastChild(e){const n=this.getLastChildName(e);return n?new ye(n,this.children_.get(n)):null}forEachChild(e,n){const s=this.resolveIndex_(e);return s?s.inorderTraversal(r=>n(r.name,r.node)):this.children_.inorderTraversal(n)}getIterator(e){return this.getIteratorFrom(e.minPost(),e)}getIteratorFrom(e,n){const s=this.resolveIndex_(n);if(s)return s.getIteratorFrom(e,r=>r);{const r=this.children_.getIteratorFrom(e.name,ye.Wrap);let a=r.peek();for(;a!=null&&n.compare(a,e)<0;)r.getNext(),a=r.peek();return r}}getReverseIterator(e){return this.getReverseIteratorFrom(e.maxPost(),e)}getReverseIteratorFrom(e,n){const s=this.resolveIndex_(n);if(s)return s.getReverseIteratorFrom(e,r=>r);{const r=this.children_.getReverseIteratorFrom(e.name,ye.Wrap);let a=r.peek();for(;a!=null&&n.compare(a,e)>0;)r.getNext(),a=r.peek();return r}}compareTo(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===co?-1:0}withIndex(e){if(e===Ps||this.indexMap_.hasIndex(e))return this;{const n=this.indexMap_.addIndex(e,this.children_);return new oe(this.children_,this.priorityNode_,n)}}isIndexed(e){return e===Ps||this.indexMap_.hasIndex(e)}equals(e){if(e===this)return!0;if(e.isLeafNode())return!1;{const n=e;if(this.getPriority().equals(n.getPriority()))if(this.children_.count()===n.children_.count()){const s=this.getIterator(Xe),r=n.getIterator(Xe);let a=s.getNext(),l=r.getNext();for(;a&&l;){if(a.name!==l.name||!a.node.equals(l.node))return!1;a=s.getNext(),l=r.getNext()}return a===null&&l===null}else return!1;else return!1}}resolveIndex_(e){return e===Ps?null:this.indexMap_.get(e.toString())}}oe.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/;class cS extends oe{constructor(){super(new Mt(Eu),oe.EMPTY_NODE,Bn.Default)}compareTo(e){return e===this?0:1}equals(e){return e===this}getPriority(){return this}getImmediateChild(e){return oe.EMPTY_NODE}isEmpty(){return!1}}const co=new cS;Object.defineProperties(ye,{MIN:{value:new ye(Fs,oe.EMPTY_NODE)},MAX:{value:new ye(Zi,co)}});Um.__EMPTY_NODE=oe.EMPTY_NODE;ut.__childrenNodeConstructor=oe;iS(co);rS(co);/** 1019 * @license 1020 * Copyright 2017 Google LLC 1021 * 1022 * Licensed under the Apache License, Version 2.0 (the "License"); 1023 * you may not use this file except in compliance with the License. 1024 * You may obtain a copy of the License at 1025 * 1026 * http://www.apache.org/licenses/LICENSE-2.0 1027 * 1028 * Unless required by applicable law or agreed to in writing, software 1029 * distributed under the License is distributed on an "AS IS" BASIS, 1030 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1031 * See the License for the specific language governing permissions and 1032 * limitations under the License. 1033 */const uS=!0;function mt(t,e=null){if(t===null)return oe.EMPTY_NODE;if(typeof t=="object"&&".priority"in t&&(e=t[".priority"]),H(e===null||typeof e=="string"||typeof e=="number"||typeof e=="object"&&".sv"in e,"Invalid priority type found: "+typeof e),typeof t=="object"&&".value"in t&&t[".value"]!==null&&(t=t[".value"]),typeof t!="object"||".sv"in t){const n=t;return new ut(n,mt(e))}if(!(t instanceof Array)&&uS){const n=[];let s=!1;if(Ft(t,(l,u)=>{if(l.substring(0,1)!=="."){const d=mt(u);d.isEmpty()||(s=s||!d.getPriority().isEmpty(),n.push(new ye(l,d)))}}),n.length===0)return oe.EMPTY_NODE;const a=_a(n,nS,l=>l.name,Eu);if(s){const l=_a(n,Xe.getCompare());return new oe(a,mt(e),new Bn({".priority":l},{".priority":Xe}))}else return new oe(a,mt(e),Bn.Default)}else{let n=oe.EMPTY_NODE;return Ft(t,(s,r)=>{if(Yn(t,s)&&s.substring(0,1)!=="."){const a=mt(r);(a.isLeafNode()||!a.isEmpty())&&(n=n.updateImmediateChild(s,a))}}),n.updatePriority(mt(e))}}sS(mt);/** 1034 * @license 1035 * Copyright 2017 Google LLC 1036 * 1037 * Licensed under the Apache License, Version 2.0 (the "License");
1038 * you may not use this file except in compliance with the License. 1039 * You may obtain a copy of the License at 1040 * 1041 * http://www.apache.org/licenses/LICENSE-2.0 1042 * 1043 * Unless required by applicable law or agreed to in writing, software 1044 * distributed under the License is distributed on an "AS IS" BASIS, 1045 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1046 * See the License for the specific language governing permissions and 1047 * limitations under the License. 1048 */class hS extends Ya{constructor(e){super(),this.indexPath_=e,H(!Ee(e)&&ve(e)!==".priority","Can't create PathIndex with empty path or .priority key")}extractChild(e){return e.getChild(this.indexPath_)}isDefinedOn(e){return!e.getChild(this.indexPath_).isEmpty()}compare(e,n){const s=this.extractChild(e.node),r=this.extractChild(n.node),a=s.compareTo(r);return a===0?Ys(e.name,n.name):a}makePost(e,n){const s=mt(e),r=oe.EMPTY_NODE.updateChild(this.indexPath_,s);return new ye(n,r)}maxPost(){const e=oe.EMPTY_NODE.updateChild(this.indexPath_,co);return new ye(Zi,e)}toString(){return Dm(this.indexPath_,0).join("/")}}/** 1049 * @license 1050 * Copyright 2017 Google LLC 1051 * 1052 * Licensed under the Apache License, Version 2.0 (the "License"); 1053 * you may not use this file except in compliance with the License. 1054 * You may obtain a copy of the License at 1055 * 1056 * http://www.apache.org/licenses/LICENSE-2.0 1057 * 1058 * Unless required by applicable law or agreed to in writing, software 1059 * distributed under the License is distributed on an "AS IS" BASIS, 1060 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1061 * See the License for the specific language governing permissions and 1062 * limitations under the License. 1063 */class dS extends Ya{compare(e,n){const s=e.node.compareTo(n.node);return s===0?Ys(e.name,n.name):s}isDefinedOn(e){return!0}indexedValueChanged(e,n){return!e.equals(n)}
1063minPost(){return ye.MIN}maxPost(){return ye.MAX}makePost(e,n){const s=mt(e);return new ye(n,s)}toString(){return".value"}}const fS=new dS;/** 1064 * @license 1065 * Copyright 2017 Google LLC 1066 * 1067 * Licensed under the Apache License, Version 2.0 (the "License"); 1068 * you may not use this file except in compliance with the License. 1069 * You may obtain a copy of the License at 1070 * 1071 * http://www.apache.org/licenses/LICENSE-2.0 1072 * 1073 * Unless required by applicable law or agreed to in writing, software 1074 * distributed under the License is distributed on an "AS IS" BASIS, 1075 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1076 * See the License for the specific language governing permissions and 1077 * limitations under the License. 1078 */function $m(t){return{type:"value",snapshotNode:t}}function Bs(t,e){return{type:"child_added",snapshotNode:e,childName:t}}function qr(t,e){return{type:"child_removed",snapshotNode:e,childName:t}}function Gr(t,e,n){return{type:"child_changed",snapshotNode:e,childName:t,oldSnap:n}}function pS(t,e){return{type:"child_moved",snapshotNode:e,childName:t}}/** 1079 * @license 1080 * Copyright 2017 Google LLC 1081 * 1082 * Licensed under the Apache License, Version 2.0 (the "License"); 1083 * you may not use this file except in compliance with the License. 1084 * You may obtain a copy of the License at 1085 * 1086 * http://www.apache.org/licenses/LICENSE-2.0 1087 * 1088 * Unless required by applicable law or agreed to in writing, software 1089 * distributed under the License is distributed on an "AS IS" BASIS, 1090 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1091 * See the License for the specific language governing permissions and 1092 * limitations under the License. 1093 */class Tu{constructor(e){this.index_=e}updateChild(e,n,s,r,a,l){H(e.isIndexed(this.index_),"A node must be indexed if only a child is updated");const u=e.getImmediateChild(n);return u.getChild(r).equals(s.getChild(r))&&u.isEmpty()===s.isEmpty()||(l!=null&&(s.isEmpty()?e.hasChild(n)?l.trackChildChange(qr(n,u)):H(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):u.isEmpty()?l.trackChildChange(Bs(n,s)):l.trackChildChange(Gr(n,s,u))),e.isLeafNode()&&s.isEmpty())?e:e.updateImmediateChild(n,s).withIndex(this.index_)}updateFullNode(e,n,s){return s!=null&&(e.isLeafNode()||e.forEachChild(Xe,(r,a)=>{n.hasChild(r)||s.trackChildChange(qr(r,a))}),n.isLeafNode()||n.forEachChild(Xe,(r,a)=>{if(e.hasChild(r)){const l=e.getImmediateChild(r);l.equals(a)||s.trackChildChange(Gr(r,a,l))}else s.trackChildChange(Bs(r,a))})),n.withIndex(this.index_)}
vendor: 1,728 bytes, lines 1093-1108
1093updatePriority(e,n){return e.isEmpty()?oe.EMPTY_NODE:e.updatePriority(n)}filtersNodes(){return!1}getIndexedFilter(){return this}getIndex(){return this.index_}}/** 1094 * @license 1095 * Copyright 2017 Google LLC 1096 * 1097 * Licensed under the Apache License, Version 2.0 (the "License"); 1098 * you may not use this file except in compliance with the License. 1099 * You may obtain a copy of the License at 1100 * 1101 * http://www.apache.org/licenses/LICENSE-2.0 1102 * 1103 * Unless required by applicable law or agreed to in writing, software 1104 * distributed under the License is distributed on an "AS IS" BASIS, 1105 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1106 * See the License for the specific language governing permissions and 1107 * limitations under the License. 1108 */class Kr{constructor(e){this.indexedFilter_=new Tu(e.getIndex()),this.index_=e.getIndex(),this.startPost_=Kr.getStartPost_(e),this.endPost_=Kr.getEndPost_(e),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}getStartPost(){return this.startPost_}getEndPost(){return this.endPost_}matches(e){const n=this.startIsInclusive_?this.index_.compare(this.getStartPost(),e)<=0:this.index_.compare(this.getStartPost(),e)<0,s=this.endIsInclusive_?this.index_.compare(e,this.getEndPost())<=0:this.index_.compare(e,this.getEndPost())<0;return n&&s}updateChild(e,n,s,r,a,l){return this.matches(new ye(n,s))||(s=oe.EMPTY_NODE),this.indexedFilter_.updateChild(e,n,s,r,a,l)}updateFullNode(e,n,s){n.isLeafNode()&&(n=oe.EMPTY_NODE);let r=n.withIndex(this.index_);r=r.updatePriority(oe.EMPTY_NODE);const a=this;return n.forEachChild(Xe,(l,u)=>{a.matches(new ye(l,u))||(r=r.updateImmediateChild(l,oe.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(e,r,s)}
vendor: 2,905 bytes, lines 1108-1123
1108updatePriority(e,n){return e}filtersNodes(){return!0}getIndexedFilter(){return this.indexedFilter_}getIndex(){return this.index_}static getStartPost_(e){if(e.hasStart()){const n=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),n)}else return e.getIndex().minPost()}static getEndPost_(e){if(e.hasEnd()){const n=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),n)}else return e.getIndex().maxPost()}}/** 1109 * @license 1110 * Copyright 2017 Google LLC 1111 * 1112 * Licensed under the Apache License, Version 2.0 (the "License"); 1113 * you may not use this file except in compliance with the License. 1114 * You may obtain a copy of the License at 1115 * 1116 * http://www.apache.org/licenses/LICENSE-2.0 1117 * 1118 * Unless required by applicable law or agreed to in writing, software 1119 * distributed under the License is distributed on an "AS IS" BASIS, 1120 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1121 * See the License for the specific language governing permissions and 1122 * limitations under the License. 1123 */class _S{constructor(e){this.withinDirectionalStart=n=>this.reverse_?this.withinEndPost(n):this.withinStartPost(n),this.withinDirectionalEnd=n=>this.reverse_?this.withinStartPost(n):this.withinEndPost(n),this.withinStartPost=n=>{const s=this.index_.compare(this.rangedFilter_.getStartPost(),n);return this.startIsInclusive_?s<=0:s<0},this.withinEndPost=n=>{const s=this.index_.compare(n,this.rangedFilter_.getEndPost());return this.endIsInclusive_?s<=0:s<0},this.rangedFilter_=new Kr(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft(),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}updateChild(e,n,s,r,a,l){return this.rangedFilter_.matches(new ye(n,s))||(s=oe.EMPTY_NODE),e.getImmediateChild(n).equals(s)?e:e.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(e,n,s,r,a,l):this.fullLimitUpdateChild_(e,n,s,a,l)}updateFullNode(e,n,s){let r;if(n.isLeafNode()||n.isEmpty())r=oe.EMPTY_NODE.withIndex(this.index_);else if(this.limit_*2<n.numChildren()&&n.isIndexed(this.index_)){r=oe.EMPTY_NODE.withIndex(this.index_);let a;this.reverse_?a=n.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):a=n.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);let l=0;for(;a.hasNext()&&l<this.limit_;){const u=a.getNext();if(this.withinDirectionalStart(u))if(this.withinDirectionalEnd(u))r=r.updateImmediateChild(u.name,u.node),l++;else break;else continue}}else{r=n.withIndex(this.index_),r=r.updatePriority(oe.EMPTY_NODE);let a;this.reverse_?a=r.getReverseIterator(this.index_):a=r.getIterator(this.index_);let l=0;for(;a.hasNext();){const u=a.getNext();l<this.limit_&&this.withinDirectionalStart(u)&&this.withinDirectionalEnd(u)?l++:r=r.updateImmediateChild(u.name,oe.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(e,r,s)}
1123updatePriority(e,n){return e}filtersNodes(){return!0}getIndexedFilter(){return this.rangedFilter_.getIndexedFilter()}getIndex(){return this.index_}fullLimitUpdateChild_(e,n,s,r,a){let l;if(this.reverse_){const _=this.index_.getCompare();l=(v,y)=>_(y,v)}else l=this.index_.getCompare();const u=e;H(u.numChildren()===this.limit_,"");const d=new ye(n,s),f=this.reverse_?u.getFirstChild(this.index_):u.getLastChild(this.index_),m=this.rangedFilter_.matches(d);if(u.hasChild(n)){const _=u.getImmediateChild(n);let v=r.getChildAfterChild(this.index_,f,this.reverse_);for(;v!=null&&(v.name===n||u.hasChild(v.name));)v=r.getChildAfterChild(this.index_,v,this.reverse_);const y=v==null?1:l(v,d);if(m&&!s.isEmpty()&&y>=0)return a!=null&&a.trackChildChange(Gr(n,s,_)),u.updateImmediateChild(n,s);{a!=null&&a.trackChildChange(qr(n,_));const T=u.updateImmediateChild(n,oe.EMPTY_NODE);return v!=null&&this.rangedFilter_.matches(v)?(a!=null&&a.trackChildChange(Bs(v.name,v.node)),T.updateImmediateChild(v.name,v.node)):T}}else return s.isEmpty()?e:m&&l(f,d)>=0?(a!=null&&(a.trackChildChange(qr(f.name,f.node)),a.trackChildChange(Bs(n,s))),u.updateImmediateChild(n,s).updateImmediateChild(f.name,oe.EMPTY_NODE)):e}}/** 1124 * @license 1125 * Copyright 2017 Google LLC 1126 * 1127 * Licensed under the Apache License, Version 2.0 (the "License"); 1128 * you may not use this file except in compliance with the License. 1129 * You may obtain a copy of the License at 1130 * 1131 * http://www.apache.org/licenses/LICENSE-2.0 1132 * 1133 * Unless required by applicable law or agreed to in writing, software 1134 * distributed under the License is distributed on an "AS IS" BASIS, 1135 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1136 * See the License for the specific language governing permissions and 1137 * limitations under the License. 1138 */class Cu{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=Xe}hasStart(){return this.startSet_}isViewFromLeft(){return this.viewFrom_===""?this.startSet_:this.viewFrom_==="l"}getIndexStartValue(){return H(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return H(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:Fs}hasEnd(){return this.endSet_}getIndexEndValue(){return H(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return H(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:Zi}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&this.viewFrom_!==""}getLimit(){return H(this.limitSet_,"Only valid if limit has been set"),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===Xe}copy(){const e=new Cu;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.startAfterSet_=this.startAfterSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.endBeforeSet_=this.endBeforeSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e}}function mS(t){return t.loadsAllData()?new Tu(t.getIndex()):t.hasLimit()?new _S(t):new Kr(t)}function kf(t){const e={};if(t.isDefault())return e;let n;if(t.index_===Xe?n="$priority":t.index_===fS?n="$value":t.index_===Ps?n="$key":(H(t.index_ instanceof hS,"Unrecognized index type!"),n=t.index_.toString()),e.orderBy=dt(n),t.startSet_){const s=t.startAfterSet_?"startAfter":"startAt";e[s]=dt(t.indexStartValue_),t.startNameSet_&&(e[s]+=","+dt(t.indexStartName_))}if(t.endSet_){const s=t.endBeforeSet_?"endBefore":"endAt";e[s]=dt(t.indexEndValue_),t.endNameSet_&&(e[s]+=","+dt(t.indexEndName_))}return t.limitSet_&&(t.isViewFromLeft()?e.limitToFirst=t.limit_:e.limitToLast=t.limit_),e}function Of(t){const e={};if(t.startSet_&&(e.sp=t.indexStartValue_,t.startNameSet_&&(e.sn=t.indexStartName_),e.sin=!t.startAfterSet_),t.endSet_&&(e.ep=t.indexEndValue_,t.endNameSet_&&(e.en=t.indexEndName_),e.ein=!t.endBeforeSet_),t.limitSet_){e.l=t.limit_;let n=t.viewFrom_;n===""&&(t.isViewFromLeft()?n="l":n="r"),e.vf=n}return t.index_!==Xe&&(e.i=t.index_.toString()),e}/** 1139 * @license 1140 * Copyright 2017 Google LLC 1141 * 1142 * Licensed under the Apache License, Version 2.0 (the "License");
1143 * you may not use this file except in compliance with the License. 1144 * You may obtain a copy of the License at 1145 * 1146 * http://www.apache.org/licenses/LICENSE-2.0 1147 * 1148 * Unless required by applicable law or agreed to in writing, software 1149 * distributed under the License is distributed on an "AS IS" BASIS, 1150 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1151 * See the License for the specific language governing permissions and 1152 * limitations under the License. 1153 */class ma extends Om{reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,n){return n!==void 0?"tag$"+n:(H(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())}constructor(e,n,s,r){super(),this.repoInfo_=e,this.onDataUpdate_=n,this.authTokenProvider_=s,this.appCheckTokenProvider_=r,this.log_=lo("p:rest:"),this.listens_={}}listen(e,n,s,r){const a=e._path.toString();this.log_("Listen called for "+a+" "+e._queryIdentifier);const l=ma.getListenId_(e,s),u={};this.listens_[l]=u;const d=kf(e._queryParams);this.restRequest_(a+".json",d,(f,m)=>{let _=m;
1153if(f===404&&(_=null,f=null),f===null&&this.onDataUpdate_(a,_,!1,s),Ms(this.listens_,l)===u){let v;f?f===401?v="permission_denied":v="rest_error:"+f:v="ok",r(v,null)}})}unlisten(e,n){const s=ma.getListenId_(e,n);delete this.listens_[s]}get(e){const n=kf(e._queryParams),s=e._path.toString(),r=new qa;return this.restRequest_(s+".json",n,(a,l)=>{let u=l;a===404&&(u=null,a=null),a===null?(this.onDataUpdate_(s,u,!1,null),r.resolve(u)):r.reject(new Error(u))}),r.promise}refreshAuthToken(e){}restRequest_(e,n={},s){return n.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(([r,a])=>{r&&r.accessToken&&(n.auth=r.accessToken),a&&a.token&&(n.ac=a.token);const l=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+e+"?ns="+this.repoInfo_.namespace+Gs(n);this.log_("Sending REST request for "+l);const u=new XMLHttpRequest;u.onreadystatechange=()=>{if(s&&u.readyState===4){this.log_("REST Response for "+l+" received. status:",u.status,"response:",u.responseText);let d=null;if(u.status>=200&&u.status<300){try{d=$r(u.responseText)}catch{Dt("Failed to parse JSON response for "+l+": "+u.responseText)}s(null,d)}else u.status!==401&&u.status!==404&&Dt("Got unsuccessful REST response for "+l+" Status: "+u.status),s(u.status);s=null}},u.open("GET",l,!0),u.send()})}}/** 1154 * @license 1155 * Copyright 2017 Google LLC 1156 * 1157 * Licensed under the Apache License, Version 2.0 (the "License"); 1158 * you may not use this file except in compliance with the License. 1159 * You may obtain a copy of the License at 1160 * 1161 * http://www.apache.org/licenses/LICENSE-2.0 1162 * 1163 * Unless required by applicable law or agreed to in writing, software 1164 * distributed under the License is distributed on an "AS IS" BASIS, 1165 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1166 * See the License for the specific language governing permissions and 1167 * limitations under the License. 1168 */class gS{constructor(){this.rootNode_=oe.EMPTY_NODE}getNode(e){return this.rootNode_.getChild(e)}updateSnapshot(e,n){this.rootNode_=this.rootNode_.updateChild(e,n)}}/** 1169 * @license 1170 * Copyright 2017 Google LLC 1171 * 1172 * Licensed under the Apache License, Version 2.0 (the "License"); 1173 * you may not use this file except in compliance with the License. 1174 * You may obtain a copy of the License at 1175 * 1176 * http://www.apache.org/licenses/LICENSE-2.0 1177 * 1178 * Unless required by applicable law or agreed to in writing, software 1179 * distributed under the License is distributed on an "AS IS" BASIS, 1180 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1181 * See the License for the specific language governing permissions and 1182 * limitations under the License. 1183 */function ga(){return{value:null,children:new Map}}function jm(t,e,n){if(Ee(e))t.value=n,t.children.clear();else if(t.value!==null)t.value=t.value.updateChild(e,n);else{const s=ve(e);t.children.has(s)||t.children.set(s,ga());const r=t.children.get(s);e=qe(e),jm(r,e,n)}}function Lc(t,e,n){t.value!==null?n(e,t.value):vS(t,(s,r)=>{const a=new Ve(e.toString()+"/"+s);Lc(r,a,n)})}function vS(t,e){t.children.forEach((n,s)=>{e(s,n)})}/** 1184 * @license 1185 * Copyright 2017 Google LLC 1186 * 1187 * Licensed under the Apache License, Version 2.0 (the "License"); 1188 * you may not use this file except in compliance with the License. 1189 * You may obtain a copy of the License at 1190 * 1191 * http://www.apache.org/licenses/LICENSE-2.0 1192 * 1193 * Unless required by applicable law or agreed to in writing, software 1194 * distributed under the License is distributed on an "AS IS" BASIS, 1195 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1196 * See the License for the specific language governing permissions and 1197 * limitations under the License. 1198 */class yS{constructor(e){this.collection_=e,this.last_=null}get(){const e=this.collection_.get(),n=Object.assign({},e);return this.last_&&Ft(this.last_,(s,r)=>{n[s]=n[s]-r}),this.last_=e,n}}/** 1199 * @license 1200 * Copyright 2017 Google LLC 1201 * 1202 * Licensed under the Apache License, Version 2.0 (the "License"); 1203 * you may not use this file except in compliance with the License. 1204 * You may obtain a copy of the License at 1205 * 1206 * http://www.apache.org/licenses/LICENSE-2.0 1207 * 1208 * Unless required by applicable law or agreed to in writing, softw
1208are 1209 * distributed under the License is distributed on an "AS IS" BASIS, 1210 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1211 * See the License for the specific language governing permissions and 1212 * limitations under the License. 1213 */const Nf=10*1e3,wS=30*1e3,bS=5*60*1e3;class ES{constructor(e,n){this.server_=n,this.statsToReport_={},this.statsListener_=new yS(e);const s=Nf+(wS-Nf)*Math.random();kr(this.reportStats_.bind(this),Math.floor(s))}reportStats_(){const e=this.statsListener_.get(),n={};let s=!1;Ft(e,(r,a)=>{a>0&&Yn(this.statsToReport_,r)&&(n[r]=a,s=!0)}),s&&this.server_.reportStats(n),kr(this.reportStats_.bind(this),Math.floor(Math.random()*2*bS))}}/** 1214 * @license 1215 * Copyright 2017 Google LLC 1216 * 1217 * Licensed under the Apache License, Version 2.0 (the "License"); 1218 * you may not use this file except in compliance with the License. 1219 * You may obtain a copy of the License at 1220 * 1221 * http://www.apache.org/licenses/LICENSE-2.0 1222 * 1223 * Unless required by applicable law or agreed to in writing, software 1224 * distributed under the License is distributed on an "AS IS" BASIS, 1225 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1226 * See the License for the specific language governing permissions and 1227 * limitations under the License. 1228 */var on;(function(t){t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"})(on||(on={}));function Zm(){return{fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}function Iu(){return{fromUser:!1,fromServer:!0,queryId:null,tagged:!1}}function Su(t){return{fromUser:!1,fromServer:!0,queryId:t,tagged:!0}}/** 1229 * @license 1230 * Copyright 2017 Google LLC 1231 * 1232 * Licensed under the Apache License, Version 2.0 (the "License"); 1233 * you may not use this file except in compliance with the License. 1234 * You may obtain a copy of the License at 1235 * 1236 * http://www.apache.org/licenses/LICENSE-2.0 1237 * 1238 * Unless required by applicable law or agreed to in writing, software 1239 * distributed under the License is distributed on an "AS IS" BASIS, 1240 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1241 * See the License for the specific language governing permissions and 1242 * limitations under the License. 1243 */class va{constructor(e,n,s){this.path=e,this.affectedTree=n,this.revert=s,this.type=on.ACK_USER_WRITE,this.source=Zm()}operationForChild(e){if(Ee(this.path)){if(this.affectedTree.value!=null)return H(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{const n=this.affectedTree.subtree(new Ve(e));return new va(Oe(),n,this.revert)}}else return H(ve(this.path)===e,"operationForChild called for unrelated child."),new va(qe(this.path),this.affectedTree,this.revert)}}/** 1244 * @license 1245 * Copyright 2017 Google LLC 1246 * 1247 * Licensed under the Apache License, Version 2.0 (the "License"); 1248 * you may not use this file except in compliance with the License. 1249 * You may obtain a copy of the License at 1250 * 1251 * http://www.apache.org/licenses/LICENSE-2.0 1252 * 1253 * Unless required by applicable law or agreed to in writing, software 1254 * distributed under the License is distributed on an "AS IS" BASIS, 1255 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1256 * See the License for the specific language governing permissions and 1257 * limitations under the License. 1258 */class Yr{constructor(e,n){this.source=e,this.path=n,this.type=on.LISTEN_COMPLETE}operationForChild(e){return Ee(this.path)?new Yr(this.source,Oe()):new Yr(this.source,qe(this.path))}}/** 1259 * @license 1260 * Copyright 2017 Google LLC 1261 * 1262 * Licensed under the Apache License, Version 2.0 (the "License"); 1263 * you may not use this file except in compliance with the License. 1264 * You may obtain a copy of the License at 1265 * 1266 * http://www.apache.org/licenses/LICENSE-2.0 1267 * 1268 * Unless required by applicable law or agreed to in writing, software 1269 * distributed under the License is distributed on an "AS IS" BASIS, 1270 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1271 * See the License for the specific language governing permissions and 1272 * limitations under the License. 1273 */class qi{constructor(e,n,s){this.source=e,this.path=n,this.snap=s,this.type=on.OVERWRITE}operationForChild(e){return Ee(this.path)?new qi(this.source,Oe(),this.snap.getImmediateChild(e)):new qi(this.source,qe(this.path),this.snap)}}/** 1274 * @license 1275 * Copyright 2017 Google LLC 1276 * 1277 * Licensed under the Apache License, Version 2.0 (the "License");
1278 * you may not use this file except in compliance with the License. 1279 * You may obtain a copy of the License at 1280 * 1281 * http://www.apache.org/licenses/LICENSE-2.0 1282 * 1283 * Unless required by applicable law or agreed to in writing, software 1284 * distributed under the License is distributed on an "AS IS" BASIS, 1285 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1286 * See the License for the specific language governing permissions and 1287 * limitations under the License. 1288 */class Jr{constructor(e,n,s){this.source=e,this.path=n,this.children=s,this.type=on.MERGE}operationForChild(e){if(Ee(this.path)){const n=this.children.subtree(new Ve(e));return n.isEmpty()?null:n.value?new qi(this.source,Oe(),n.value):new Jr(this.source,Oe(),n)}else return H(ve(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new Jr(this.source,qe(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}}/** 1289 * @license 1290 * Copyright 2017 Google LLC 1291 * 1292 * Licensed under the Apache License, Version 2.0 (the "License"); 1293 * you may not use this file except in compliance with the License. 1294 * You may obtain a copy of the License at 1295 * 1296 * http://www.apache.org/licenses/LICENSE-2.0 1297 * 1298 * Unless required by applicable law or agreed to in writing, software 1299 * distributed under the License is distributed on an "AS IS" BASIS, 1300 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1301 * See the License for the specific language governing permissions and 1302 * limitations under the License. 1303 */class Gi{constructor(e,n,s){this.node_=e,this.fullyInitialized_=n,this.filtered_=s}isFullyInitialized(){return this.fullyInitialized_}isFiltered(){return this.filtered_}isCompleteForPath(e){if(Ee(e))return this.isFullyInitialized()&&!this.filtered_;const n=ve(e);return this.isCompleteForChild(n)}isCompleteForChild(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)}getNode(){return this.node_}}/** 1304 * @license 1305 * Copyright 2017 Google LLC 1306 * 1307 * Licensed under the Apache License, Version 2.0 (the "License"); 1308 * you may not use this file except in compliance with the License. 1309 * You may obtain a copy of the License at 1310 * 1311 * http://www.apache.org/licenses/LICENSE-2.0 1312 * 1313 * Unless required by applicable law or agreed to in writing, software 1314 * distributed under the License is distributed on an "AS IS" BASIS, 1315 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1316 * See the License for the specific language governing permissions and 1317 * limitations under the License. 1318 */class TS{constructor(e){this.query_=e,this.index_=this.query_._queryParams.getIndex()}}function CS(t,e,n,s){const r=[],a=[];return e.forEach(l=>{l.type==="child_changed"&&t.index_.indexedValueChanged(l.oldSnap,l.snapshotNode)&&a.push(pS(l.childName,l.snapshotNode))}),yr(t,r,"child_removed",e,s,n),yr(t,r,"child_added",e,s,n),yr(t,r,"child_moved",a,s,n),yr(t,r,"child_changed",e,s,n),yr(t,r,"value",e,s,n),r}function yr(t,e,n,s,r,a){const l=s.filter(u=>u.type===n);l.sort((u,d)=>SS(t,u,d)),l.forEach(u=>{const d=IS(t,u,a);r.forEach(f=>{f.respondsTo(u.type)&&e.push(f.createEvent(d,t.query_))})})}function IS(t,e,n){return e.type==="value"||e.type==="child_removed"||(e.prevName=n.getPredecessorChildName(e.childName,e.snapshotNode,t.index_)),e}function SS(t,e,n){if(e.childName==null||n.childName==null)throw qs("Should only compare child_ events.");const s=new ye(e.childName,e.snapshotNode),r=new ye(n.childName,n.snapshotNode);return t.index_.compare(s,r)}/** 1319 * @license 1320 * Copyright 2017 Google LLC 1321 * 1322 * Licensed under the Apache License, Version 2.0 (the "License"); 1323 * you may not use this file except in compliance with the License. 1324 * You may obtain a copy of the License at 1325 * 1326 * http://www.apache.org/licenses/LICENSE-2.0 1327 * 1328 * Unless required by applicable law or agreed to in writing, software 1329 * distributed under the License is distributed on an "AS IS" BASIS, 1330 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1331 * See the License for the specific language governing permissions and 1332 * limitations under the License. 1333 */function Ja(t,e){return{eventCache:t,serverCache:e}}function Or(t,e,n,s){return Ja(new Gi(e,n,s),t.serverCache)}function qm(t,e,n,s){return Ja(t.eventCache,new Gi(e,n,s))}function Rc(t){return t.eventCache.isFullyInitialized()?t.eventCache.getNode():null}function Ki(t){return t.serverCache.isFullyInitialized()?t.serverCache.getNode():null}/** 1334 * @license 1335 * Copyright 2017 Google LLC 1336 * 1337 * Licensed under the Apache License, Version 2.0 (the "License");
1338 * you may not use this file except in compliance with the License. 1339 * You may obtain a copy of the License at 1340 * 1341 * http://www.apache.org/licenses/LICENSE-2.0 1342 * 1343 * Unless required by applicable law or agreed to in writing, software 1344 * distributed under the License is distributed on an "AS IS" BASIS, 1345 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1346 * See the License for the specific language governing permissions and 1347 * limitations under the License. 1348 */let tc;const PS=()=>(tc||(tc=new Mt(dI)),tc);class Ke{static fromObject(e){let n=new Ke(null);return Ft(e,(s,r)=>{n=n.set(new Ve(s),r)}),n}constructor(e,n=PS()){this.value=e,this.children=n}isEmpty(){return this.value===null&&this.children.isEmpty()}findRootMostMatchingPathAndValue(e,n){if(this.value!=null&&n(this.value))return{path:Oe(),value:this.value};if(Ee(e))return null;{const s=ve(e),r=this.children.get(s);if(r!==null){const a=r.findRootMostMatchingPathAndValue(qe(e),n);return a!=null?{path:lt(new Ve(s),a.path),value:a.value}:null}else return null}}findRootMostValueAndPath(e){return this.findRootMostMatchingPathAndValue(e,()=>!0)}subtree(e){if(Ee(e))return this;{const n=ve(e),s=this.children.get(n);return s!==null?s.subtree(qe(e)):new Ke(null)}}set(e,n){if(Ee(e))return new Ke(n,this.children);{const s=ve(e),a=(this.children.get(s)||new Ke(null)).set(qe(e),n),l=this.children.insert(s,a);return new Ke(this.value,l)}}remove(e){if(Ee(e))return this.children.isEmpty()?new Ke(null):new Ke(null,this.children);{const n=ve(e),s=this.children.get(n);if(s){const r=s.remove(qe(e));let a;return r.isEmpty()?a=this.children.remove(n):a=this.children.insert(n,r),this.value===null&&a.isEmpty()?new Ke(null):new Ke(this.value,a)}else return this}}get(e){if(Ee(e))return this.value;{const n=ve(e),s=this.children.get(n);return s?s.get(qe(e)):null}}setTree(e,n){if(Ee(e))return n;{const s=ve(e),a=(this.children.get(s)||new Ke(null)).setTree(qe(e),n);let l;return a.isEmpty()?l=this.children.remove(s):l=this.children.insert(s,a),new Ke(this.value,l)}}fold(e){return this.fold_(Oe(),e)}fold_(e,n){const s={};return this.children.inorderTraversal((r,a)=>{s[r]=a.fold_(lt(e,r),n)}),n(e,this.value,s)}findOnPath(e,n){return this.findOnPath_(e,Oe(),n)}findOnPath_(e,n,s){const r=this.value?s(n,this.value):!1;if(r)return r;if(Ee(e))return null;{const a=ve(e),l=this.children.get(a);return l?l.findOnPath_(qe(e),lt(n,a),s):null}}foreachOnPath(e,n){return this.foreachOnPath_(e,Oe(),n)}foreachOnPath_(e,n,s){if(Ee(e))return this;{this.value&&s(n,this.value);const r=ve(e),a=this.children.get(r);return a?a.foreachOnPath_(qe(e),lt(n,r),s):new Ke(null)}}foreach(e){this.foreach_(Oe(),e)}foreach_(e,n){this.children.inorderTraversal((s,r)=>{r.foreach_(lt(e,s),n)}),this.value&&n(e,this.value)}foreachChild(e){this.children.inorderTraversal((n,s)=>{s.value&&e(n,s.value)})}}/** 1349 * @license 1350 * Copyright 2017 Google LLC 1351 * 1352 * Licensed under the Apache License, Version 2.0 (the "License"); 1353 * you may not use this file except in compliance with the License. 1354 * You may obtain a copy of the License at 1355 * 1356 * http://www.apache.org/licenses/LICENSE-2.0 1357 * 1358 * Unless required by applicable law or agreed to in writing, software 1359 * distributed under the License is distributed on an "AS IS" BASIS, 1360 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1361 * See the License for the specific language governing permissions and 1362 * limitations under the License. 1363 */class un{constructor(e){this.writeTree_=e}static empty(){return new un(new Ke(null))}}function Nr(t,e,n){if(Ee(e))return new un(new Ke(n));{const s=t.writeTree_.findRootMostValueAndPath(e);if(s!=null){const r=s.path;let a=s.value;const l=Nt(r,e);return a=a.updateChild(l,n),new un(t.writeTree_.set(r,a))}else{const r=new Ke(n),a=t.writeTree_.setTree(e,r);return new un(a)}}}function Mf(t,e,n){let s=t;return Ft(n,(r,a)=>{s=Nr(s,lt(e,r),a)}),s}function Df(t,e){if(Ee(e))return un.empty();{const n=t.writeTree_.setTree(e,new Ke(null));return new un(n)}}function Ac(t,e){return ns(t,e)!=null}function ns(t,e){const n=t.writeTree_.findRootMostValueAndPath(e);return n!=null?t.writeTree_.get(n.path).getChild(Nt(n.path,e)):null}function Ff(t){const e=[],n=t.writeTree_.value;
1363return n!=null?n.isLeafNode()||n.forEachChild(Xe,(s,r)=>{e.push(new ye(s,r))}):t.writeTree_.children.inorderTraversal((s,r)=>{r.value!=null&&e.push(new ye(s,r.value))}),e}function gi(t,e){if(Ee(e))return t;{const n=ns(t,e);return n!=null?new un(new Ke(n)):new un(t.writeTree_.subtree(e))}}function kc(t){return t.writeTree_.isEmpty()}function Us(t,e){return Gm(Oe(),t.writeTree_,e)}function Gm(t,e,n){if(e.value!=null)return n.updateChild(t,e.value);{let s=null;return e.children.inorderTraversal((r,a)=>{r===".priority"?(H(a.value!==null,"Priority writes must always be leaf nodes"),s=a.value):n=Gm(lt(t,r),a,n)}),!n.getChild(t).isEmpty()&&s!==null&&(n=n.updateChild(lt(t,".priority"),s)),n}}/** 1364 * @license 1365 * Copyright 2017 Google LLC 1366 * 1367 * Licensed under the Apache License, Version 2.0 (the "License"); 1368 * you may not use this file except in compliance with the License. 1369 * You may obtain a copy of the License at 1370 * 1371 * http://www.apache.org/licenses/LICENSE-2.0 1372 * 1373 * Unless required by applicable law or agreed to in writing, software 1374 * distributed under the License is distributed on an "AS IS" BASIS, 1375 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1376 * See the License for the specific language governing permissions and 1377 * limitations under the License. 1378 */function Pu(t,e){return Qm(e,t)}function xS(t,e,n,s,r){H(s>t.lastWriteId,"Stacking an older write on top of newer ones"),r===void 0&&(r=!0),t.allWrites.push({path:e,snap:n,writeId:s,visible:r}),r&&(t.visibleWrites=Nr(t.visibleWrites,e,n)),t.lastWriteId=s}function LS(t,e){for(let n=0;n<t.allWrites.length;n++){const s=t.allWrites[n];if(s.writeId===e)return s}return null}function RS(t,e){const n=t.allWrites.findIndex(u=>u.writeId===e);H(n>=0,"removeWrite called with nonexistent writeId.");const s=t.allWrites[n];t.allWrites.splice(n,1);let r=s.visible,a=!1,l=t.allWrites.length-1;for(;r&&l>=0;){const u=t.allWrites[l];u.visible&&(l>=n&&AS(u,s.path)?r=!1:rn(s.path,u.path)&&(a=!0)),l--}if(r){if(a)return kS(t),!0;if(s.snap)t.visibleWrites=Df(t.visibleWrites,s.path);else{const u=s.children;Ft(u,d=>{t.visibleWrites=Df(t.visibleWrites,lt(s.path,d))})}return!0}else return!1}function AS(t,e){if(t.snap)return rn(t.path,e);for(const n in t.children)if(t.children.hasOwnProperty(n)&&rn(lt(t.path,n),e))return!0;return!1}function kS(t){t.visibleWrites=Km(t.allWrites,OS,Oe()),t.allWrites.length>0?t.lastWriteId=t.allWrites[t.allWrites.length-1].writeId:t.lastWriteId=-1}function OS(t){return t.visible}function Km(t,e,n){let s=un.empty();for(let r=0;r<t.length;++r){const a=t[r];if(e(a)){const l=a.path;let u;if(a.snap)rn(n,l)?(u=Nt(n,l),s=Nr(s,u,a.snap)):rn(l,n)&&(u=Nt(l,n),s=Nr(s,Oe(),a.snap.getChild(u)));else if(a.children){if(rn(n,l))u=Nt(n,l),s=Mf(s,u,a.children);else if(rn(l,n))if(u=Nt(l,n),Ee(u))s=Mf(s,Oe(),a.children);else{const d=Ms(a.children,ve(u));if(d){const f=d.getChild(qe(u));s=Nr(s,Oe(),f)}}}else throw qs("WriteRecord should have .snap or .children")}}return s}function Ym(t,e,n,s,r){if(!s&&!r){const a=ns(t.visibleWrites,e);if(a!=null)return a;{const l=gi(t.visibleWrites,e);if(kc(l))return n;if(n==null&&!Ac(l,Oe()))return null;{const u=n||oe.EMPTY_NODE;return Us(l,u)}}}else{const a=gi(t.visibleWrites,e);if(!r&&kc(a))return n;if(!r&&n==null&&!Ac(a,Oe()))return null;{const l=function(f){return(f.visible||r)&&(!s||!~s.indexOf(f.writeId))&&(rn(f.path,e)||rn(e,f.path))},u=Km(t.allWrites,l,e),d=n||oe.EMPTY_NODE;return Us(u,d)}}}function NS(t,e,n){let s=oe.EMPTY_NODE;const r=ns(t.visibleWrites,e);if(r)return r.isLeafNode()||r.forEachChild(Xe,(a,l)=>{s=s.updateImmediateChild(a,l)}),s;if(n){const a=gi(t.visibleWrites,e);return n.forEachChild(Xe,(l,u)=>{const d=Us(gi(a,new Ve(l)),u);s=s.updateImmediateChild(l,d)}),Ff(a).forEach(l=>{s=s.updateImmediateChild(l.name,l.node)}),s}else{const a=gi(t.visibleWrites,e);return Ff(a).forEach(l=>{s=s.updateImmediateChild(l.name,l.node)}),s}}function MS(t,e,n,s,r){H(s||r,"Either existingEventSnap or existingServerSnap must exist");const a=lt(e,n);if(Ac(t.visibleWrites,a))return null;{const l=gi(t.visibleWrites,a);return kc(l)?r.getChild(n):Us(l,r.getChild(n))}}function DS(t,e,n,s){const r=lt(e,n),a=ns(t.visibleWrites,r);if(a!=null)return a;
1378if(s.isCompleteForChild(n)){const l=gi(t.visibleWrites,r);return Us(l,s.getNode().getImmediateChild(n))}else return null}function FS(t,e){return ns(t.visibleWrites,e)}function BS(t,e,n,s,r,a,l){let u;const d=gi(t.visibleWrites,e),f=ns(d,Oe());if(f!=null)u=f;else if(n!=null)u=Us(d,n);else return[];if(u=u.withIndex(l),!u.isEmpty()&&!u.isLeafNode()){const m=[],_=l.getCompare(),v=a?u.getReverseIteratorFrom(s,l):u.getIteratorFrom(s,l);let y=v.getNext();for(;y&&m.length<r;)_(y,s)!==0&&m.push(y),y=v.getNext();return m}else return[]}function US(){return{visibleWrites:un.empty(),allWrites:[],lastWriteId:-1}}function ya(t,e,n,s){return Ym(t.writeTree,t.treePath,e,n,s)}function xu(t,e){return NS(t.writeTree,t.treePath,e)}function Bf(t,e,n,s){return MS(t.writeTree,t.treePath,e,n,s)}function wa(t,e){return FS(t.writeTree,lt(t.treePath,e))}function zS(t,e,n,s,r,a){return BS(t.writeTree,t.treePath,e,n,s,r,a)}function Lu(t,e,n){return DS(t.writeTree,t.treePath,e,n)}function Jm(t,e){return Qm(lt(t.treePath,e),t.writeTree)}function Qm(t,e){return{treePath:t,writeTree:e}}/** 1379 * @license 1380 * Copyright 2017 Google LLC 1381 * 1382 * Licensed under the Apache License, Version 2.0 (the "License"); 1383 * you may not use this file except in compliance with the License. 1384 * You may obtain a copy of the License at 1385 * 1386 * http://www.apache.org/licenses/LICENSE-2.0 1387 * 1388 * Unless required by applicable law or agreed to in writing, software 1389 * distributed under the License is distributed on an "AS IS" BASIS, 1390 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1391 * See the License for the specific language governing permissions and 1392 * limitations under the License. 1393 */class HS{constructor(){this.changeMap=new Map}trackChildChange(e){const n=e.type,s=e.childName;H(n==="child_added"||n==="child_changed"||n==="child_removed","Only child changes supported for tracking"),H(s!==".priority","Only non-priority child changes can be tracked.");const r=this.changeMap.get(s);if(r){const a=r.type;if(n==="child_added"&&a==="child_removed")this.changeMap.set(s,Gr(s,e.snapshotNode,r.snapshotNode));else if(n==="child_removed"&&a==="child_added")this.changeMap.delete(s);else if(n==="child_removed"&&a==="child_changed")this.changeMap.set(s,qr(s,r.oldSnap));else if(n==="child_changed"&&a==="child_added")this.changeMap.set(s,Bs(s,e.snapshotNode));else if(n==="child_changed"&&a==="child_changed")this.changeMap.set(s,Gr(s,e.snapshotNode,r.oldSnap));else throw qs("Illegal combination of changes: "+e+" occurred after "+r)}else this.changeMap.set(s,e)}getChanges(){return Array.from(this.changeMap.values())}}/** 1394 * @license 1395 * Copyright 2017 Google LLC 1396 * 1397 * Licensed under the Apache License, Version 2.0 (the "License"); 1398 * you may not use this file except in compliance with the License. 1399 * You may obtain a copy of the License at 1400 * 1401 * http://www.apache.org/licenses/LICENSE-2.0 1402 * 1403 * Unless required by applicable law or agreed to in writing, software 1404 * distributed under the License is distributed on an "AS IS" BASIS, 1405 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1406 * See the License for the specific language governing permissions and 1407 * limitations under the License. 1408 */class WS{getCompleteChild(e){return null}getChildAfterChild(e,n,s){return null}}const Xm=new WS;class Ru{constructor(e,n,s=null){this.writes_=e,this.viewCache_=n,this.optCompleteServerCache_=s}getCompleteChild(e){const n=this.viewCache_.eventCache;if(n.isCompleteForChild(e))return n.getNode().getImmediateChild(e);{const s=this.optCompleteServerCache_!=null?new Gi(this.optCompleteServerCache_,!0,!1):this.viewCache_.serverCache;return Lu(this.writes_,e,s)}}getChildAfterChild(e,n,s){const r=this.optCompleteServerCache_!=null?this.optCompleteServerCache_:Ki(this.viewCache_),a=zS(this.writes_,r,n,1,s,e);return a.length===0?null:a[0]}}/** 1409 * @license 1410 * Copyright 2017 Google LLC 1411 * 1412 * Licensed under the Apache License, Version 2.0 (the "License"); 1413 * you may not use this file except in compliance with the License. 1414 * You may obtain a copy of the License at 1415 * 1416 * http://www.apache.org/licenses/LICENSE-2.0 1417 * 1418 * Unless required by applicable law or agreed to in writing, softw
1418are 1419 * distributed under the License is distributed on an "AS IS" BASIS, 1420 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1421 * See the License for the specific language governing permissions and 1422 * limitations under the License. 1423 */function VS(t){return{filter:t}}function $S(t,e){H(e.eventCache.getNode().isIndexed(t.filter.getIndex()),"Event snap not indexed"),H(e.serverCache.getNode().isIndexed(t.filter.getIndex()),"Server snap not indexed")}function jS(t,e,n,s,r){const a=new HS;let l,u;if(n.type===on.OVERWRITE){const f=n;f.source.fromUser?l=Oc(t,e,f.path,f.snap,s,r,a):(H(f.source.fromServer,"Unknown source."),u=f.source.tagged||e.serverCache.isFiltered()&&!Ee(f.path),l=ba(t,e,f.path,f.snap,s,r,u,a))}else if(n.type===on.MERGE){const f=n;f.source.fromUser?l=qS(t,e,f.path,f.children,s,r,a):(H(f.source.fromServer,"Unknown source."),u=f.source.tagged||e.serverCache.isFiltered(),l=Nc(t,e,f.path,f.children,s,r,u,a))}else if(n.type===on.ACK_USER_WRITE){const f=n;f.revert?l=YS(t,e,f.path,s,r,a):l=GS(t,e,f.path,f.affectedTree,s,r,a)}else if(n.type===on.LISTEN_COMPLETE)l=KS(t,e,n.path,s,a);else throw qs("Unknown operation type: "+n.type);const d=a.getChanges();return ZS(e,l,d),{viewCache:l,changes:d}}function ZS(t,e,n){const s=e.eventCache;if(s.isFullyInitialized()){const r=s.getNode().isLeafNode()||s.getNode().isEmpty(),a=Rc(t);(n.length>0||!t.eventCache.isFullyInitialized()||r&&!s.getNode().equals(a)||!s.getNode().getPriority().equals(a.getPriority()))&&n.push($m(Rc(e)))}}function eg(t,e,n,s,r,a){const l=e.eventCache;if(wa(s,n)!=null)return e;{let u,d;if(Ee(n))if(H(e.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),e.serverCache.isFiltered()){const f=Ki(e),m=f instanceof oe?f:oe.EMPTY_NODE,_=xu(s,m);u=t.filter.updateFullNode(e.eventCache.getNode(),_,a)}else{const f=ya(s,Ki(e));u=t.filter.updateFullNode(e.eventCache.getNode(),f,a)}else{const f=ve(n);if(f===".priority"){H(yi(n)===1,"Can't have a priority with additional path components");const m=l.getNode();d=e.serverCache.getNode();const _=Bf(s,n,m,d);_!=null?u=t.filter.updatePriority(m,_):u=l.getNode()}else{const m=qe(n);let _;if(l.isCompleteForChild(f)){d=e.serverCache.getNode();const v=Bf(s,n,l.getNode(),d);v!=null?_=l.getNode().getImmediateChild(f).updateChild(m,v):_=l.getNode().getImmediateChild(f)}else _=Lu(s,f,e.serverCache);_!=null?u=t.filter.updateChild(l.getNode(),f,_,m,r,a):u=l.getNode()}}return Or(e,u,l.isFullyInitialized()||Ee(n),t.filter.filtersNodes())}}function ba(t,e,n,s,r,a,l,u){const d=e.serverCache;let f;const m=l?t.filter:t.filter.getIndexedFilter();if(Ee(n))f=m.updateFullNode(d.getNode(),s,null);else if(m.filtersNodes()&&!d.isFiltered()){const y=d.getNode().updateChild(n,s);f=m.updateFullNode(d.getNode(),y,null)}else{const y=ve(n);if(!d.isCompleteForPath(n)&&yi(n)>1)return e;const P=qe(n),O=d.getNode().getImmediateChild(y).updateChild(P,s);y===".priority"?f=m.updatePriority(d.getNode(),O):f=m.updateChild(d.getNode(),y,O,P,Xm,null)}const _=qm(e,f,d.isFullyInitialized()||Ee(n),m.filtersNodes()),v=new Ru(r,_,a);return eg(t,_,n,r,v,u)}
1423function Oc(t,e,n,s,r,a,l){const u=e.eventCache;let d,f;const m=new Ru(r,e,a);if(Ee(n))f=t.filter.updateFullNode(e.eventCache.getNode(),s,l),d=Or(e,f,!0,t.filter.filtersNodes());else{const _=ve(n);if(_===".priority")f=t.filter.updatePriority(e.eventCache.getNode(),s),d=Or(e,f,u.isFullyInitialized(),u.isFiltered());else{const v=qe(n),y=u.getNode().getImmediateChild(_);let P;if(Ee(v))P=s;else{const T=m.getCompleteChild(_);T!=null?Mm(v)===".priority"&&T.getChild(Fm(v)).isEmpty()?P=T:P=T.updateChild(v,s):P=oe.EMPTY_NODE}if(y.equals(P))d=e;else{const T=t.filter.updateChild(u.getNode(),_,P,v,m,l);d=Or(e,T,u.isFullyInitialized(),t.filter.filtersNodes())}}}return d}function Uf(t,e){return t.eventCache.isCompleteForChild(e)}function qS(t,e,n,s,r,a,l){let u=e;return s.foreach((d,f)=>{const m=lt(n,d);Uf(e,ve(m))&&(u=Oc(t,u,m,f,r,a,l))}),s.foreach((d,f)=>{const m=lt(n,d);Uf(e,ve(m))||(u=Oc(t,u,m,f,r,a,l))}),u}function zf(t,e,n){return n.foreach((s,r)=>{e=e.updateChild(s,r)}),e}function Nc(t,e,n,s,r,a,l,u){if(e.serverCache.getNode().isEmpty()&&!e.serverCache.isFullyInitialized())return e;let d=e,f;Ee(n)?f=s:f=new Ke(null).setTree(n,s);const m=e.serverCache.getNode();return f.children.inorderTraversal((_,v)=>{if(m.hasChild(_)){const y=e.serverCache.getNode().getImmediateChild(_),P=zf(t,y,v);d=ba(t,d,new Ve(_),P,r,a,l,u)}}),f.children.inorderTraversal((_,v)=>{const y=!e.serverCache.isCompleteForChild(_)&&v.value===null;if(!m.hasChild(_)&&!y){const P=e.serverCache.getNode().getImmediateChild(_),T=zf(t,P,v);d=ba(t,d,new Ve(_),T,r,a,l,u)}}),d}function GS(t,e,n,s,r,a,l){if(wa(r,n)!=null)return e;const u=e.serverCache.isFiltered(),d=e.serverCache;if(s.value!=null){if(Ee(n)&&d.isFullyInitialized()||d.isCompleteForPath(n))return ba(t,e,n,d.getNode().getChild(n),r,a,u,l);if(Ee(n)){let f=new Ke(null);return d.getNode().forEachChild(Ps,(m,_)=>{f=f.set(new Ve(m),_)}),Nc(t,e,n,f,r,a,u,l)}else return e}else{let f=new Ke(null);return s.foreach((m,_)=>{const v=lt(n,m);d.isCompleteForPath(v)&&(f=f.set(m,d.getNode().getChild(v)))}),Nc(t,e,n,f,r,a,u,l)}}function KS(t,e,n,s,r){const a=e.serverCache,l=qm(e,a.getNode(),a.isFullyInitialized()||Ee(n),a.isFiltered());return eg(t,l,n,s,Xm,r)}function YS(t,e,n,s,r,a){let l;if(wa(s,n)!=null)return e;{const u=new Ru(s,e,r),d=e.eventCache.getNode();let f;if(Ee(n)||ve(n)===".priority"){let m;if(e.serverCache.isFullyInitialized())m=ya(s,Ki(e));else{const _=e.serverCache.getNode();H(_ instanceof oe,"serverChildren would be complete if leaf node"),m=xu(s,_)}m=m,f=t.filter.updateFullNode(d,m,a)}else{const m=ve(n);let _=Lu(s,m,e.serverCache);_==null&&e.serverCache.isCompleteForChild(m)&&(_=d.getImmediateChild(m)),_!=null?f=t.filter.updateChild(d,m,_,qe(n),u,a):e.eventCache.getNode().hasChild(m)?f=t.filter.updateChild(d,m,oe.EMPTY_NODE,qe(n),u,a):f=d,f.isEmpty()&&e.serverCache.isFullyInitialized()&&(l=ya(s,Ki(e)),l.isLeafNode()&&(f=t.filter.updateFullNode(f,l,a)))}return l=e.serverCache.isFullyInitialized()||wa(s,Oe())!=null,Or(e,f,l,t.filter.filtersNodes())}}/** 1424 * @license 1425 * Copyright 2017 Google LLC 1426 * 1427 * Licensed under the Apache License, Version 2.0 (the "License"); 1428 * you may not use this file except in compliance with the License. 1429 * You may obtain a copy of the License at 1430 * 1431 * http://www.apache.org/licenses/LICENSE-2.0 1432 * 1433 * Unless required by applicable law or agreed to in writing, software 1434 * distributed under the License is distributed on an "AS IS" BASIS, 1435 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1436 * See the License for the specific language governing permissions and 1437 * limitations under the License. 1438 */class JS{constructor(e,n){this.query_=e,this.eventRegistrations_=[];const s=this.query_._queryParams,r=new Tu(s.getIndex()),a=mS(s);this.processor_=VS(a);const l=n.serverCache,u=n.eventCache,d=r.updateFullNode(oe.EMPTY_NODE,l.getNode(),null),f=a.updateFullNode(oe.EMPTY_NODE,u.getNode(),null),m=new Gi(d,l.isFullyInitialized(),r.filtersNodes()),_=new Gi(f,u.isFullyInitialized(),a.filtersNodes());this.viewCache_=Ja(_,m),this.eventGenerator_=new TS(this.query_)}get query(){return this.query_}}function QS(t){return t.viewCache_.serverCache.getNode()}function XS(t,e){const n=Ki(t.viewCache_);return n&&(t.query._queryParams.loadsAllData()||!Ee(e)&&!n.getImmediateChild(ve(e)).isEmpty())?n.getChild(e):null}function Hf(t){return t.eventRegistrations_.length===0}function e0(t,e){t.eventRegistrations_.push(e)}function Wf(t,e,n){const s=[];if(n){H(e==null,"A cancel should cancel all event registrations.");const r=t.query._path;t.eventRegistrations_.forEach(a=>{const l=a.createCancelEvent(n,r);l&&s.push(l)})}if(e){let r=[];for(let a=0;a<t.eventRegistrations_.length;++a){const l=t.eventRegistrations_[a];if(!l.matches(e))r.push(l);else if(e.hasAnyCallback()){r=r.concat(t.eventRegistrations_.slice(a+1));break}}t.eventRegistrations_=r}else t.eventRegistrations_=[];return s}function Vf(t,e,n,s){e.type===on.MERGE&&e.source.queryId!==null&&(H(Ki(t.viewCache_),"We should always have a full c
1438ache before handling merges"),H(Rc(t.viewCache_),"Missing event cache, even though we have a server cache"));const r=t.viewCache_,a=jS(t.processor_,r,e,n,s);return $S(t.processor_,a.viewCache),H(a.viewCache.serverCache.isFullyInitialized()||!r.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),t.viewCache_=a.viewCache,tg(t,a.changes,a.viewCache.eventCache.getNode(),null)}function t0(t,e){const n=t.viewCache_.eventCache,s=[];return n.getNode().isLeafNode()||n.getNode().forEachChild(Xe,(a,l)=>{s.push(Bs(a,l))}),n.isFullyInitialized()&&s.push($m(n.getNode())),tg(t,s,n.getNode(),e)}function tg(t,e,n,s){const r=s?[s]:t.eventRegistrations_;return CS(t.eventGenerator_,e,n,r)}/** 1439 * @license 1440 * Copyright 2017 Google LLC 1441 * 1442 * Licensed under the Apache License, Version 2.0 (the "License"); 1443 * you may not use this file except in compliance with the License. 1444 * You may obtain a copy of the License at 1445 * 1446 * http://www.apache.org/licenses/LICENSE-2.0 1447 * 1448 * Unless required by applicable law or agreed to in writing, software 1449 * distributed under the License is distributed on an "AS IS" BASIS, 1450 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1451 * See the License for the specific language governing permissions and 1452 * limitations under the License. 1453 */let Ea;class n0{constructor(){this.views=new Map}}function i0(t){H(!Ea,"__referenceConstructor has already been defined"),Ea=t}function s0(){return H(Ea,"Reference.ts has not been loaded"),Ea}function r0(t){return t.views.size===0}function Au(t,e,n,s){const r=e.source.queryId;if(r!==null){const a=t.views.get(r);return H(a!=null,"SyncTree gave us an op for an invalid query."),Vf(a,e,n,s)}else{let a=[];for(const l of t.views.values())a=a.concat(Vf(l,e,n,s));return a}}function o0(t,e,n,s,r){const a=e._queryIdentifier,l=t.views.get(a);if(!l){let u=ya(n,r?s:null),d=!1;u?d=!0:s instanceof oe?(u=xu(n,s),d=!1):(u=oe.EMPTY_NODE,d=!1);const f=Ja(new Gi(u,d,!1),new Gi(s,r,!1));return new JS(e,f)}return l}function a0(t,e,n,s,r,a){const l=o0(t,e,s,r,a);return t.views.has(e._queryIdentifier)||t.views.set(e._queryIdentifier,l),e0(l,n),t0(l,n)}function l0(t,e,n,s){const r=e._queryIdentifier,a=[];let l=[];const u=wi(t);if(r==="default")for(const[d,f]of t.views.entries())l=l.concat(Wf(f,n,s)),Hf(f)&&(t.views.delete(d),f.query._queryParams.loadsAllData()||a.push(f.query));else{const d=t.views.get(r);d&&(l=l.concat(Wf(d,n,s)),Hf(d)&&(t.views.delete(r),d.query._queryParams.loadsAllData()||a.push(d.query)))}return u&&!wi(t)&&a.push(new(s0())(e._repo,e._path)),{removed:a,events:l}}function ng(t){const e=[];for(const n of t.views.values())n.query._queryParams.loadsAllData()||e.push(n);return e}function xs(t,e){let n=null;for(const s of t.views.values())n=n||XS(s,e);return n}function ig(t,e){if(e._queryParams.loadsAllData())return Qa(t);{const s=e._queryIdentifier;return t.views.get(s)}}function sg(t,e){return ig(t,e)!=null}function wi(t){return Qa(t)!=null}function Qa(t){for(const e of t.views.values())if(e.query._queryParams.loadsAllData())return e;return null}/** 1454 * @license 1455 * Copyright 2017 Google LLC 1456 * 1457 * Licensed under the Apache License, Version 2.0 (the "License"); 1458 * you may not use this file except in compliance with the License. 1459 * You may obtain a copy of the License at 1460 * 1461 * http://www.apache.org/licenses/LICENSE-2.0 1462 * 1463 * Unless required by applicable law or agreed to in writing, software 1464 * distributed under the License is distributed on an "AS IS" BASIS, 1465 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1466 * See the License for the specific language governing permissions and 1467 * limitations under the License. 1468 */let Ta;function c0(t){H(!Ta,"__referenceConstructor has already been defined"),Ta=t}function u0(){return H(Ta,"Reference.ts has not been loaded"),Ta}let h0=1;class $f{constructor(e){this.listenProvider_=e,this.syncPointTree_=new Ke(null),this.pendingWriteTree_=US(),this.tagToQueryMap=new Map,this.queryToTagMap=new Map}}function rg(t,e,n,s,r){return xS(t.pendingWriteTree_,e,n,s,r),r?uo(t,new qi(Zm(),e,n)):[]}function Fi(t,e,n=!1){const s=LS(t.pendingWriteTree_,e);if(RS(t.pendingWriteTree_,e)){let a=new Ke(null);return s.snap!=null?a=a.set(Oe(),!0):Ft(s.children,l=>{a=a.set(new Ve(l),!0)}),uo(t,new va(s.path,a,n))}else return[]}function Xa(t,e,n){return uo(t,new qi(Iu(),e,n))}function d0(t,e,n){const s=Ke.fromObject(n);return uo(t,new Jr(Iu(),e,s))}function f0(t,e){return uo(t,new Yr(Iu(),e))}function p0(t,e,n){const s=Ou(t,n);if(s){const r=Nu(s),a=r.path,l=r.queryId,u=Nt(a,e),d=new Yr(Su(l),u);return Mu(t,a,d)}else return[]}function Mc(t,e,n,s,r=!1){const a=e._path,l=t.syncPointTree_.get(a);let u=[];
1468if(l&&(e._queryIdentifier==="default"||sg(l,e))){const d=l0(l,e,n,s);r0(l)&&(t.syncPointTree_=t.syncPointTree_.remove(a));const f=d.removed;if(u=d.events,!r){const m=f.findIndex(v=>v._queryParams.loadsAllData())!==-1,_=t.syncPointTree_.findOnPath(a,(v,y)=>wi(y));if(m&&!_){const v=t.syncPointTree_.subtree(a);if(!v.isEmpty()){const y=g0(v);for(let P=0;P<y.length;++P){const T=y[P],O=T.query,z=lg(t,T);t.listenProvider_.startListening(Mr(O),Ca(t,O),z.hashFn,z.onComplete)}}}!_&&f.length>0&&!s&&(m?t.listenProvider_.stopListening(Mr(e),null):f.forEach(v=>{const y=t.queryToTagMap.get(el(v));t.listenProvider_.stopListening(Mr(v),y)}))}v0(t,f)}return u}function _0(t,e,n,s){const r=Ou(t,s);if(r!=null){const a=Nu(r),l=a.path,u=a.queryId,d=Nt(l,e),f=new qi(Su(u),d,n);return Mu(t,l,f)}else return[]}function m0(t,e,n,s){const r=Ou(t,s);if(r){const a=Nu(r),l=a.path,u=a.queryId,d=Nt(l,e),f=Ke.fromObject(n),m=new Jr(Su(u),d,f);return Mu(t,l,m)}else return[]}function jf(t,e,n,s=!1){const r=e._path;let a=null,l=!1;t.syncPointTree_.foreachOnPath(r,(v,y)=>{const P=Nt(v,r);a=a||xs(y,P),l=l||wi(y)});let u=t.syncPointTree_.get(r);u?(l=l||wi(u),a=a||xs(u,Oe())):(u=new n0,t.syncPointTree_=t.syncPointTree_.set(r,u));let d;a!=null?d=!0:(d=!1,a=oe.EMPTY_NODE,t.syncPointTree_.subtree(r).foreachChild((y,P)=>{const T=xs(P,Oe());T&&(a=a.updateImmediateChild(y,T))}));const f=sg(u,e);if(!f&&!e._queryParams.loadsAllData()){const v=el(e);H(!t.queryToTagMap.has(v),"View does not exist, but we have a tag");const y=y0();t.queryToTagMap.set(v,y),t.tagToQueryMap.set(y,v)}const m=Pu(t.pendingWriteTree_,r);let _=a0(u,e,n,m,a,d);if(!f&&!l&&!s){const v=ig(u,e);_=_.concat(w0(t,e,v))}return _}function ku(t,e,n){const r=t.pendingWriteTree_,a=t.syncPointTree_.findOnPath(e,(l,u)=>{const d=Nt(l,e),f=xs(u,d);if(f)return f});return Ym(r,e,a,n,!0)}function uo(t,e){return og(e,t.syncPointTree_,null,Pu(t.pendingWriteTree_,Oe()))}function og(t,e,n,s){if(Ee(t.path))return ag(t,e,n,s);{const r=e.get(Oe());n==null&&r!=null&&(n=xs(r,Oe()));let a=[];const l=ve(t.path),u=t.operationForChild(l),d=e.children.get(l);if(d&&u){const f=n?n.getImmediateChild(l):null,m=Jm(s,l);a=a.concat(og(u,d,f,m))}return r&&(a=a.concat(Au(r,t,s,n))),a}}function ag(t,e,n,s){const r=e.get(Oe());n==null&&r!=null&&(n=xs(r,Oe()));let a=[];return e.children.inorderTraversal((l,u)=>{const d=n?n.getImmediateChild(l):null,f=Jm(s,l),m=t.operationForChild(l);m&&(a=a.concat(ag(m,u,d,f)))}),r&&(a=a.concat(Au(r,t,s,n))),a}function lg(t,e){const n=e.query,s=Ca(t,n);return{hashFn:()=>(QS(e)||oe.EMPTY_NODE).hash(),onComplete:r=>{if(r==="ok")return s?p0(t,n._path,s):f0(t,n._path);{const a=_I(r,n);return Mc(t,n,null,a)}}}}function Ca(t,e){const n=el(e);return t.queryToTagMap.get(n)}function el(t){return t._path.toString()+"$"+t._queryIdentifier}function Ou(t,e){return t.tagToQueryMap.get(e)}function Nu(t){const e=t.indexOf("$");return H(e!==-1&&e<t.length-1,"Bad queryKey."),{queryId:t.substr(e+1),path:new Ve(t.substr(0,e))}}function Mu(t,e,n){const s=t.syncPointTree_.get(e);H(s,"Missing sync point for query tag that we're tracking");const r=Pu(t.pendingWriteTree_,e);return Au(s,n,r,null)}function g0(t){return t.fold((e,n,s)=>{if(n&&wi(n))return[Qa(n)];{let r=[];return n&&(r=ng(n)),Ft(s,(a,l)=>{r=r.concat(l)}),r}})}
1468function Mr(t){return t._queryParams.loadsAllData()&&!t._queryParams.isDefault()?new(u0())(t._repo,t._path):t}function v0(t,e){for(let n=0;n<e.length;++n){const s=e[n];if(!s._queryParams.loadsAllData()){const r=el(s),a=t.queryToTagMap.get(r);t.queryToTagMap.delete(r),t.tagToQueryMap.delete(a)}}}function y0(){return h0++}function w0(t,e,n){const s=e._path,r=Ca(t,e),a=lg(t,n),l=t.listenProvider_.startListening(Mr(e),r,a.hashFn,a.onComplete),u=t.syncPointTree_.subtree(s);if(r)H(!wi(u.value),"If we're adding a query, it shouldn't be shadowed");else{const d=u.fold((f,m,_)=>{if(!Ee(f)&&m&&wi(m))return[Qa(m).query];{let v=[];return m&&(v=v.concat(ng(m).map(y=>y.query))),Ft(_,(y,P)=>{v=v.concat(P)}),v}});for(let f=0;f<d.length;++f){const m=d[f];t.listenProvider_.stopListening(Mr(m),Ca(t,m))}}return l}/** 1469 * @license 1470 * Copyright 2017 Google LLC 1471 * 1472 * Licensed under the Apache License, Version 2.0 (the "License"); 1473 * you may not use this file except in compliance with the License. 1474 * You may obtain a copy of the License at 1475 * 1476 * http://www.apache.org/licenses/LICENSE-2.0 1477 * 1478 * Unless required by applicable law or agreed to in writing, software 1479 * distributed under the License is distributed on an "AS IS" BASIS, 1480 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1481 * See the License for the specific language governing permissions and 1482 * limitations under the License. 1483 */class Du{constructor(e){this.node_=e}getImmediateChild(e){const n=this.node_.getImmediateChild(e);return new Du(n)}node(){return this.node_}}class Fu{constructor(e,n){this.syncTree_=e,this.path_=n}getImmediateChild(e){const n=lt(this.path_,e);return new Fu(this.syncTree_,n)}node(){return ku(this.syncTree_,this.path_)}}const b0=function(t){return t=t||{},t.timestamp=t.timestamp||new Date().getTime(),t},Zf=function(t,e,n){if(!t||typeof t!="object")return t;if(H(".sv"in t,"Unexpected leaf node or priority contents"),typeof t[".sv"]=="string")return E0(t[".sv"],e,n);if(typeof t[".sv"]=="object")return T0(t[".sv"],e);H(!1,"Unexpected server value: "+JSON.stringify(t,null,2))},E0=function(t,e,n){switch(t){case"timestamp":return n.timestamp;default:H(!1,"Unexpected server value: "+t)}},T0=function(t,e,n){t.hasOwnProperty("increment")||H(!1,"Unexpected server value: "+JSON.stringify(t,null,2));const s=t.increment;typeof s!="number"&&H(!1,"Unexpected increment value: "+s);const r=e.node();if(H(r!==null&&typeof r<"u","Expected ChildrenNode.EMPTY_NODE for nulls"),!r.isLeafNode())return s;const l=r.getValue();return typeof l!="number"?s:l+s},C0=function(t,e,n,s){return Bu(e,new Fu(n,t),s)},cg=function(t,e,n){return Bu(t,new Du(e),n)};function Bu(t,e,n){const s=t.getPriority().val(),r=Zf(s,e.getImmediateChild(".priority"),n);let a;if(t.isLeafNode()){const l=t,u=Zf(l.getValue(),e,n);return u!==l.getValue()||r!==l.getPriority().val()?new ut(u,mt(r)):t}else{const l=t;return a=l,r!==l.getPriority().val()&&(a=a.updatePriority(new ut(r))),l.forEachChild(Xe,(u,d)=>{const f=Bu(d,e.getImmediateChild(u),n);f!==d&&(a=a.updateImmediateChild(u,f))}),a}}/** 1484 * @license 1485 * Copyright 2017 Google LLC 1486 * 1487 * Licensed under the Apache License, Version 2.0 (the "License"); 1488 * you may not use this file except in compliance with the License. 1489 * You may obtain a copy of the License at 1490 * 1491 * http://www.apache.org/licenses/LICENSE-2.0 1492 * 1493 * Unless required by applicable law or agreed to in writing, software 1494 * distributed under the License is distributed on an "AS IS" BASIS, 1495 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1496 * See the License for the specific language governing permissions and 1497 * limitations under the License. 1498 */class Uu{constructor(e="",n=null,s={children:{},childCount:0}){this.name=e,this.parent=n,this.node=s}}function zu(t,e){let n=e instanceof Ve?e:new Ve(e),s=t,r=ve(n);for(;r!==null;){const a=Ms(s.node.children,r)||{children:{},childCount:0};s=new Uu(r,s,a),n=qe(n),r=ve(n)}return s}function Qs(t){return t.node.value}function ug(t,e){t.node.value=e,Dc(t)}function hg(t){return t.node.childCount>0}function I0(t){return Qs(t)===void 0&&!hg(t)}function tl(t,e){Ft(t.node.children,(n,s)=>
vendor: 4,402 bytes, lines 1498-1532
1498{e(new Uu(n,t,s))})}function dg(t,e,n,s){n&&e(t),tl(t,r=>{dg(r,e,!0)})}function S0(t,e,n){let s=t.parent;for(;s!==null;){if(e(s))return!0;s=s.parent}return!1}function ho(t){return new Ve(t.parent===null?t.name:ho(t.parent)+"/"+t.name)}function Dc(t){t.parent!==null&&P0(t.parent,t.name,t)}function P0(t,e,n){const s=I0(n),r=Yn(t.node.children,e);s&&r?(delete t.node.children[e],t.node.childCount--,Dc(t)):!s&&!r&&(t.node.children[e]=n.node,t.node.childCount++,Dc(t))}/** 1499 * @license 1500 * Copyright 2017 Google LLC 1501 * 1502 * Licensed under the Apache License, Version 2.0 (the "License"); 1503 * you may not use this file except in compliance with the License. 1504 * You may obtain a copy of the License at 1505 * 1506 * http://www.apache.org/licenses/LICENSE-2.0 1507 * 1508 * Unless required by applicable law or agreed to in writing, software 1509 * distributed under the License is distributed on an "AS IS" BASIS, 1510 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1511 * See the License for the specific language governing permissions and 1512 * limitations under the License. 1513 */const x0=/[\[\].#$\/\u0000-\u001F\u007F]/,L0=/[\[\].#$\u0000-\u001F\u007F]/,nc=10*1024*1024,fg=function(t){return typeof t=="string"&&t.length!==0&&!x0.test(t)},pg=function(t){return typeof t=="string"&&t.length!==0&&!L0.test(t)},R0=function(t){return t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),pg(t)},A0=function(t,e,n,s){Hu(du(t,"value"),e,n)},Hu=function(t,e,n){const s=n instanceof Ve?new GI(n,t):n;if(e===void 0)throw new Error(t+"contains undefined "+Ni(s));if(typeof e=="function")throw new Error(t+"contains a function "+Ni(s)+" with contents = "+e.toString());if(pm(e))throw new Error(t+"contains "+e.toString()+" "+Ni(s));if(typeof e=="string"&&e.length>nc/3&&Ga(e)>nc)throw new Error(t+"contains a string greater than "+nc+" utf8 bytes "+Ni(s)+" ('"+e.substring(0,50)+"...')");if(e&&typeof e=="object"){let r=!1,a=!1;if(Ft(e,(l,u)=>{if(l===".value")r=!0;else if(l!==".priority"&&l!==".sv"&&(a=!0,!fg(l)))throw new Error(t+" contains an invalid key ("+l+") "+Ni(s)+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`);KI(s,l),Hu(t,u,s),YI(s)}),r&&a)throw new Error(t+' contains ".value" child '+Ni(s)+" in addition to actual children.")}},_g=function(t,e,n,s){if(!pg(n))throw new Error(du(t,e)+'was an invalid path = "'+n+`". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]"`)},k0=function(t,e,n,s){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),_g(t,e,n)},O0=function(t,e){if(ve(e)===".info")throw new Error(t+" failed = Can't modify data under /.info/")},N0=function(t,e){const n=e.path.toString();if(typeof e.repoInfo.host!="string"||e.repoInfo.host.length===0||!fg(e.repoInfo.namespace)&&e.repoInfo.host.split(":")[0]!=="localhost"||n.length!==0&&!R0(n))throw new Error(du(t,"url")+`must be a valid firebase URL and the path can't contain ".", "#", "$", "[", or "]".`)};/** 1514 * @license 1515 * Copyright 2017 Google LLC 1516 * 1517 * Licensed under the Apache License, Version 2.0 (the "License"); 1518 * you may not use this file except in compliance with the License. 1519 * You may obtain a copy of the License at 1520 * 1521 * http://www.apache.org/licenses/LICENSE-2.0 1522 * 1523 * Unless required by applicable law or agreed to in writing, software 1524 * distributed under the License is distributed on an "AS IS" BASIS, 1525 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1526 * See the License for the specific language governing permissions and 1527 * limitations under the License. 1528 */class M0{constructor(){this.eventLists_=[],this.recursionDepth_=0}}function Wu(t,e){let n=null;for(let s=0;s<e.length;s++){const r=e[s],a=r.getPath();n!==null&&!wu(a,n.path)&&(t.eventLists_.push(n),n=null),n===null&&(n={events:[],path:a}),n.events.push(r)}n&&t.eventLists_.push(n)}function mg(t,e,n){Wu(t,n),gg(t,s=>wu(s,e))}function jn(t,e,n){Wu(t,n),gg(t,s=>rn(s,e)||rn(e,s))}function gg(t,e){t.recursionDepth_++;let n=!0;for(let s=0;s<t.eventLists_.length;s++){const r=t.eventLists_[s];if(r){const a=r.path;e(a)?(D0(t.eventLists_[s]),t.eventLists_[s]=null):n=!1}}n&&(t.eventLists_=[]),t.recursionDepth_--}function D0(t){for(let e=0;e<t.events.length;e++){const n=t.events[e];if(n!==null){t.events[e]=null;const s=n.getEventRunner();Ar&&Tt("event: "+n.toString()),Js(s)}}}/** 1529 * @license 1530 * Copyright 2017 Google LLC 1531 * 1532 * Licensed under the Apache License, Version 2.0 (the "License");
1533 * you may not use this file except in compliance with the License. 1534 * You may obtain a copy of the License at 1535 * 1536 * http://www.apache.org/licenses/LICENSE-2.0 1537 * 1538 * Unless required by applicable law or agreed to in writing, software 1539 * distributed under the License is distributed on an "AS IS" BASIS, 1540 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1541 * See the License for the specific language governing permissions and 1542 * limitations under the License. 1543 */const F0="repo_interrupt",B0=25;class U0{constructor(e,n,s,r){this.repoInfo_=e,this.forceRestClient_=n,this.authTokenProvider_=s,this.appCheckProvider_=r,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new M0,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=ga(),this.transactionQueueTree_=new Uu,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}toString(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host}}function z0(t,e,n){if(t.stats_=vu(t.repoInfo_),t.forceRestClient_||yI())t.server_=new ma(t.repoInfo_,(s,r,a,l)=>{qf(t,s,r,a,l)},t.authTokenProvider_,t.appCheckProvider_),setTimeout(()=>Gf(t,!0),0);else{if(typeof n<"u"&&n!==null){if(typeof n!="object")throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{dt(n)}catch(s){throw new Error("Invalid authOverride provided: "+s)}}t.persistentConnection_=new Wn(t.repoInfo_,e,(s,r,a,l)=>{qf(t,s,r,a,l)},s=>{Gf(t,s)},s=>{W0(t,s)},t.authTokenProvider_,t.appCheckProvider_,n),t.server_=t.persistentConnection_}t.authTokenProvider_.addTokenChangeListener(s=>{t.server_.refreshAuthToken(s)}),t.appCheckProvider_.addTokenChangeListener(s=>{t.server_.refreshAppCheckToken(s.token)}),t.statsReporter_=CI(t.repoInfo_,()=>new ES(t.stats_,t.server_)),t.infoData_=new gS,t.infoSyncTree_=new $f({startListening:(s,r,a,l)=>{let u=[];const d=t.infoData_.getNode(s._path);return d.isEmpty()||(u=Xa(t.infoSyncTree_,s._path,d),setTimeout(()=>{l("ok")},0)),u},stopListening:()=>{}}),$u(t,"connected",!1),t.serverSyncTree_=new $f({startListening:(s,r,a,l)=>(t.server_.listen(s,a,r,(u,d)=>{const f=l(u,d);jn(t.eventQueue_,s._path,f)}),[]),stopListening:(s,r)=>{t.server_.unlisten(s,r)}})}function H0(t){const n=t.infoData_.getNode(new Ve(".info/serverTimeOffset")).val()||0;return new Date().getTime()+n}function Vu(t){return b0({timestamp:H0(t)})}function qf(t,e,n,s,r){t.dataUpdateCount++;const a=new Ve(e);n=t.interceptServerDataCallback_?t.interceptServerDataCallback_(e,n):n;let l=[];if(r)if(s){const d=ha(n,f=>mt(f));l=m0(t.serverSyncTree_,a,d,r)}else{const d=mt(n);l=_0(t.serverSyncTree_,a,d,r)}else if(s){const d=ha(n,f=>mt(f));l=d0(t.serverSyncTree_,a,d)}else{const d=mt(n);l=Xa(t.serverSyncTree_,a,d)}let u=a;l.length>0&&(u=nl(t,a)),jn(t.eventQueue_,u,l)}function Gf(t,e){$u(t,"connected",e),e===!1&&$0(t)}function W0(t,e){Ft(e,(n,s)=>{$u(t,n,s)})}function $u(t,e,n){const s=new Ve("/.info/"+e),r=mt(n);t.infoData_.updateSnapshot(s,r);const a=Xa(t.infoSyncTree_,s,r);jn(t.eventQueue_,s,a)}function vg(t){return t.nextWriteId_++}function V0(t,e,n,s,r){ju(t,"set",{path:e.toString(),value:n,priority:s});const a=Vu(t),l=mt(n,s),u=ku(t.serverSyncTree_,e),d=cg(l,u,a),f=vg(t),m=rg(t.serverSyncTree_,e,d,f,!0);Wu(t.eventQueue_,m),t.server_.put(e.toString(),l.val(!0),(v,y)=>{const P=v==="ok";P||Dt("set at "+e+" failed: "+v);const T=Fi(t.serverSyncTree_,f,!P);jn(t.eventQueue_,e,T),q0(t,r,v,y)});const _=Tg(t,e);nl(t,_),jn(t.eventQueue_,_,[])}function $0(t){ju(t,"onDisconnectEvents");const e=Vu(t),n=ga();Lc(t.onDisconnect_,Oe(),(r,a)=>{const l=C0(r,a,t.serverSyncTree_,e);jm(n,r,l)});let s=[];Lc(n,Oe(),(r,a)=>{s=s.concat(Xa(t.serverSyncTree_,r,a));const l=Tg(t,r);nl(t,l)}),t.onDisconnect_=ga(),jn(t.eventQueue_,Oe(),s)}function j0(t,e,n){let s;ve(e._path)===".info"?s=jf(t.infoSyncTree_,e,n):s=jf(t.serverSyncTree_,e,n),mg(t.eventQueue_,e._path,s)}function Kf(t,e,n){let s;ve(e._path)===".info"?s=Mc(t.infoSyncTree_,e,n):s=Mc(t.serverSyncTree_,e,n),mg(t.eventQueue_,e._path,s)}function Z0(t){t.persistentConnection_&&t.persistentConnection_.interrupt(F0)}function ju(t,...e){let n="";t.persistentConnection_&&(n=t.persistentConnection_.id+":"),Tt(n,...e)}function q0(t,e,n,s){e&&Js(()=>
1543{if(n==="ok")e(null);else{const r=(n||"error").toUpperCase();let a=r;s&&(a+=": "+s);const l=new Error(a);l.code=r,e(l)}})}function yg(t,e,n){return ku(t.serverSyncTree_,e,n)||oe.EMPTY_NODE}function Zu(t,e=t.transactionQueueTree_){if(e||il(t,e),Qs(e)){const n=bg(t,e);H(n.length>0,"Sending zero length transaction queue"),n.every(r=>r.status===0)&&G0(t,ho(e),n)}else hg(e)&&tl(e,n=>{Zu(t,n)})}function G0(t,e,n){const s=n.map(f=>f.currentWriteId),r=yg(t,e,s);let a=r;const l=r.hash();for(let f=0;f<n.length;f++){const m=n[f];H(m.status===0,"tryToSendTransactionQueue_: items in queue should all be run."),m.status=1,m.retryCount++;const _=Nt(e,m.path);a=a.updateChild(_,m.currentOutputSnapshotRaw)}const u=a.val(!0),d=e;t.server_.put(d.toString(),u,f=>{ju(t,"transaction put response",{path:d.toString(),status:f});let m=[];if(f==="ok"){const _=[];for(let v=0;v<n.length;v++)n[v].status=2,m=m.concat(Fi(t.serverSyncTree_,n[v].currentWriteId)),n[v].onComplete&&_.push(()=>n[v].onComplete(null,!0,n[v].currentOutputSnapshotResolved)),n[v].unwatcher();il(t,zu(t.transactionQueueTree_,e)),Zu(t,t.transactionQueueTree_),jn(t.eventQueue_,e,m);for(let v=0;v<_.length;v++)Js(_[v])}else{if(f==="datastale")for(let _=0;_<n.length;_++)n[_].status===3?n[_].status=4:n[_].status=0;else{Dt("transaction at "+d.toString()+" failed: "+f);for(let _=0;_<n.length;_++)n[_].status=4,n[_].abortReason=f}nl(t,e)}},l)}function nl(t,e){const n=wg(t,e),s=ho(n),r=bg(t,n);return K0(t,r,s),s}function K0(t,e,n){if(e.length===0)return;const s=[];let r=[];const l=e.filter(u=>u.status===0).map(u=>u.currentWriteId);for(let u=0;u<e.length;u++){const d=e[u],f=Nt(n,d.path);let m=!1,_;if(H(f!==null,"rerunTransactionsUnderNode_: relativePath should not be null."),d.status===4)m=!0,_=d.abortReason,r=r.concat(Fi(t.serverSyncTree_,d.currentWriteId,!0));else if(d.status===0)if(d.retryCount>=B0)m=!0,_="maxretry",r=r.concat(Fi(t.serverSyncTree_,d.currentWriteId,!0));else{const v=yg(t,d.path,l);d.currentInputSnapshot=v;const y=e[u].update(v.val());if(y!==void 0){Hu("transaction failed: Data returned ",y,d.path);let P=mt(y);typeof y=="object"&&y!=null&&Yn(y,".priority")||(P=P.updatePriority(v.getPriority()));const O=d.currentWriteId,z=Vu(t),B=cg(P,v,z);d.currentOutputSnapshotRaw=P,d.currentOutputSnapshotResolved=B,d.currentWriteId=vg(t),l.splice(l.indexOf(O),1),r=r.concat(rg(t.serverSyncTree_,d.path,B,d.currentWriteId,d.applyLocally)),r=r.concat(Fi(t.serverSyncTree_,O,!0))}else m=!0,_="nodata",r=r.concat(Fi(t.serverSyncTree_,d.currentWriteId,!0))}jn(t.eventQueue_,n,r),r=[],m&&(e[u].status=2,function(v){setTimeout(v,Math.floor(0))}(e[u].unwatcher),e[u].onComplete&&(_==="nodata"?s.push(()=>e[u].onComplete(null,!1,e[u].currentInputSnapshot)):s.push(()=>e[u].onComplete(new Error(_),!1,null))))}il(t,t.transactionQueueTree_);for(let u=0;u<s.length;u++)Js(s[u]);Zu(t,t.transactionQueueTree_)}function wg(t,e){let n,s=t.transactionQueueTree_;for(n=ve(e);n!==null&&Qs(s)===void 0;)s=zu(s,n),e=qe(e),n=ve(e);return s}function bg(t,e){const n=[];return Eg(t,e,n),n.sort((s,r)=>s.order-r.order),n}function Eg(t,e,n){const s=Qs(e);if(s)for(let r=0;r<s.length;r++)n.push(s[r]);tl(e,r=>{Eg(t,r,n)})}function il(t,e){const n=Qs(e);if(n){let s=0;for(let r=0;r<n.length;r++)n[r].status!==2&&(n[s]=n[r],s++);n.length=s,ug(e,n.length>0?n:void 0)}tl(e,s=>{il(t,s)})}function Tg(t,e){const n=ho(wg(t,e)),s=zu(t.transactionQueueTree_,e);return S0(s,r=>{ic(t,r)}),ic(t,s),dg(s,r=>{ic(t,r)}),n}function ic(t,e){const n=Qs(e);if(n){const s=[];let r=[],a=-1;for(let l=0;l<n.length;l++)n[l].status===3||(n[l].status===1?(H(a===l-1,"All SENT items should be at beginning of queue."),a=l,n[l].status=3,n[l].abortReason="set"):(H(n[l].status===0,"Unexpected transaction status in abort"),n[l].unwatcher(),r=r.concat(Fi(t.serverSyncTree_,n[l].currentWriteId,!0)),n[l].onComplete&&s.push(n[l].onComplete.bind(null,new Error("set"),!1,null))));a===-1?ug(e,void 0):n.length=a+1,jn(t.eventQueue_,ho(e),r);for(let l=0;l<s.length;l++)Js(s[l])}}/** 1544 * @license 1545 * Copyright 2017 Google LLC 1546 * 1547 * Licensed under the Apache License, Version 2.0 (the "License");
1548 * you may not use this file except in compliance with the License. 1549 * You may obtain a copy of the License at 1550 * 1551 * http://www.apache.org/licenses/LICENSE-2.0 1552 * 1553 * Unless required by applicable law or agreed to in writing, software 1554 * distributed under the License is distributed on an "AS IS" BASIS, 1555 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1556 * See the License for the specific language governing permissions and 1557 * limitations under the License. 1558 */function Y0(t){let e="";const n=t.split("/");for(let s=0;s<n.length;s++)if(n[s].length>0){let r=n[s];try{r=decodeURIComponent(r.replace(/\+/g," "))}catch{}e+="/"+r}return e}function J0(t){const e={};t.charAt(0)==="?"&&(t=t.substring(1));for(const n of t.split("&")){if(n.length===0)continue;const s=n.split("=");s.length===2?e[decodeURIComponent(s[0])]=decodeURIComponent(s[1]):Dt(`Invalid query segment '${n}' in query '${t}'`)}return e}const Yf=function(t,e){const n=Q0(t),s=n.namespace;n.domain==="firebase.com"&&$n(n.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),(!s||s==="undefined")&&n.domain!=="localhost"&&$n("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),n.secure||uI();const r=n.scheme==="ws"||n.scheme==="wss";return{repoInfo:new Sm(n.host,n.secure,s,r,e,"",s!==n.subdomain),path:new Ve(n.pathString)}},Q0=function(t){let e="",n="",s="",r="",a="",l=!0,u="https",d=443;if(typeof t=="string"){let f=t.indexOf("//");f>=0&&(u=t.substring(0,f-1),t=t.substring(f+2));let m=t.indexOf("/");m===-1&&(m=t.length);let _=t.indexOf("?");_===-1&&(_=t.length),e=t.substring(0,Math.min(m,_)),m<_&&(r=Y0(t.substring(m,_)));const v=J0(t.substring(Math.min(t.length,_)));f=e.indexOf(":"),f>=0?(l=u==="https"||u==="wss",d=parseInt(e.substring(f+1),10)):f=e.length;const y=e.slice(0,f);if(y.toLowerCase()==="localhost")n="localhost";else if(y.split(".").length<=2)n=y;else{const P=e.indexOf(".");s=e.substring(0,P).toLowerCase(),n=e.substring(P+1),a=s}"ns"in v&&(a=v.ns)}return{host:e,port:d,domain:n,subdomain:s,secure:l,scheme:u,pathString:r,namespace:a}};/** 1559 * @license 1560 * Copyright 2017 Google LLC 1561 * 1562 * Licensed under the Apache License, Version 2.0 (the "License"); 1563 * you may not use this file except in compliance with the License. 1564 * You may obtain a copy of the License at 1565 * 1566 * http://www.apache.org/licenses/LICENSE-2.0 1567 * 1568 * Unless required by applicable law or agreed to in writing, software 1569 * distributed under the License is distributed on an "AS IS" BASIS, 1570 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1571 * See the License for the specific language governing permissions and 1572 * limitations under the License. 1573 */class X0{constructor(e,n,s,r){this.eventType=e,this.eventRegistration=n,this.snapshot=s,this.prevName=r}getPath(){const e=this.snapshot.ref;return this.eventType==="value"?e._path:e.parent._path}getEventType(){return this.eventType}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.getPath().toString()+":"+this.eventType+":"+dt(this.snapshot.exportVal())}}class eP{constructor(e,n,s){this.eventRegistration=e,this.error=n,this.path=s}getPath(){return this.path}getEventType(){return"cancel"}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.path.toString()+":cancel"}}/** 1574 * @license 1575 * Copyright 2017 Google LLC 1576 * 1577 * Licensed under the Apache License, Version 2.0 (the "License"); 1578 * you may not use this file except in compliance with the License. 1579 * You may obtain a copy of the License at 1580 * 1581 * http://www.apache.org/licenses/LICENSE-2.0 1582 * 1583 * Unless required by applicable law or agreed to in writing, software 1584 * distributed under the License is distributed on an "AS IS" BASIS, 1585 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1586 * See the License for the specific language governing permissions and 1587 * limitations under the License. 1588 */class tP{constructor(e,n){this.snapshotCallback=e,this.cancelCallback=n}onValue(e,n){this.snapshotCallback.call(null,e,n)}onCancel(e){return H(this.hasCancelCallback,"Raising a cancel event on a listener with no cancel callback"),this.cancelCallback.call(null,e)}get hasCancelCallback(){return!!this.cancelCallback}matches(e){return this.snapshotCallback===e.snapshotCallback||this.snapshotCallback.userCallback!==void 0&&this.snapshotCallback.userCallback===e.snapshotCallback.userCallback&&this.snapshotCallback.context===e.snapshotCallback.context}}/** 1589 * @license 1590 * Copyright 2020 Google LLC 1591 * 1592 * Licensed under the Apache License, Version 2.0 (the "License");
1593 * you may not use this file except in compliance with the License. 1594 * You may obtain a copy of the License at 1595 * 1596 * http://www.apache.org/licenses/LICENSE-2.0 1597 * 1598 * Unless required by applicable law or agreed to in writing, software 1599 * distributed under the License is distributed on an "AS IS" BASIS, 1600 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1601 * See the License for the specific language governing permissions and 1602 * limitations under the License. 1603 */class qu{constructor(e,n,s,r){this._repo=e,this._path=n,this._queryParams=s,this._orderByCalled=r}get key(){return Ee(this._path)?null:Mm(this._path)}get ref(){return new Ci(this._repo,this._path)}get _queryIdentifier(){const e=Of(this._queryParams),n=mu(e);return n==="{}"?"default":n}get _queryObject(){return Of(this._queryParams)}isEqual(e){if(e=pn(e),!(e instanceof qu))return!1;const n=this._repo===e._repo,s=wu(this._path,e._path),r=this._queryIdentifier===e._queryIdentifier;return n&&s&&r}toJSON(){return this.toString()}toString(){return this._repo.toString()+qI(this._path)}}class Ci extends qu{constructor(e,n){super(e,n,new Cu,!1)}get parent(){const e=Fm(this._path);return e===null?null:new Ci(this._repo,e)}get root(){let e=this;for(;e.parent!==null;)e=e.parent;return e}}class Ia{constructor(e,n,s){this._node=e,this.ref=n,this._index=s}get priority(){return this._node.getPriority().val()}get key(){return this.ref.key}get size(){return this._node.numChildren()}child(e){const n=new Ve(e),s=Fc(this.ref,e);return new Ia(this._node.getChild(n),s,Xe)}exists(){return!this._node.isEmpty()}exportVal(){return this._node.val(!0)}forEach(e){return this._node.isLeafNode()?!1:!!this._node.forEachChild(this._index,(s,r)=>e(new Ia(r,Fc(this.ref,s),Xe)))}hasChild(e){const n=new Ve(e);return!this._node.getChild(n).isEmpty()}hasChildren(){return this._node.isLeafNode()?!1:!this._node.isEmpty()}toJSON(){return this.exportVal()}val(){return this._node.val()}}function zs(t,e){return t=pn(t),t._checkNotDeleted("ref"),e!==void 0?Fc(t._root,e):t._root}function Fc(t,e){return t=pn(t),ve(t._path)===null?k0("child","path",e):_g("child","path",e),new Ci(t._repo,lt(t._path,e))}function Sa(t,e){t=pn(t),O0("set",t._path),A0("set",e,t._path);const n=new qa;return V0(t._repo,t._path,e,null,n.wrapCallback(()=>{})),n.promise}class Gu{constructor(e){this.callbackContext=e}respondsTo(e){return e==="value"}createEvent(e,n){const s=n._queryParams.getIndex();return new X0("value",this,new Ia(e.snapshotNode,new Ci(n._repo,n._path),s))}getEventRunner(e){return e.getEventType()==="cancel"?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,null)}createCancelEvent(e,n){return this.callbackContext.hasCancelCallback?new eP(this,e,n):null}matches(e){return e instanceof Gu?!e.callbackContext||!this.callbackContext?!0:e.callbackContext.matches(this.callbackContext):!1}hasAnyCallback(){return this.callbackContext!==null}}function nP(t,e,n,s,r){let a;if(typeof s=="object"&&(a=void 0,r=s),typeof s=="function"&&(a=s),r&&r.onlyOnce){const d=n,f=(m,_)=>{Kf(t._repo,t,u),d(m,_)};f.userCallback=n.userCallback,f.context=n.context,n=f}const l=new tP(n,a||void 0),u=new Gu(l);return j0(t._repo,t,u),()=>Kf(t._repo,t,u)}function Hs(t,e,n,s){return nP(t,"value",e,n,s)}i0(Ci);c0(Ci);/** 1604 * @license 1605 * Copyright 2020 Google LLC 1606 * 1607 * Licensed under the Apache License, Version 2.0 (the "License"); 1608 * you may not use this file except in compliance with the License. 1609 * You may obtain a copy of the License at 1610 * 1611 * http://www.apache.org/licenses/LICENSE-2.0 1612 * 1613 * Unless required by applicable law or agreed to in writing, software 1614 * distributed under the License is distributed on an "AS IS" BASIS, 1615 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1616 * See the License for the specific language governing permissions and 1617 * limitations under the License. 1618 */const iP="FIREBASE_DATABASE_EMULATOR_HOST",Bc={};let sP=!1;function rP(t,e,n,s){const r=e.lastIndexOf(":"),a=e.substring(0,r),l=Ka(a);t.repoInfo_=new Sm(e,l,t.repoInfo_.namespace,t.repoInfo_.webSocketOnly,t.repoInfo_.nodeAdmin,t.repoInfo_.persistenceKey,t.repoInfo_.includeNamespaceInQueryParams,!0,n),s&&(t.authTokenProvider_=s)}function oP(t,e,n,s,r){let a=s||t.options.databaseURL;a===void 0&&(t.options.projectId||$n("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),Tt("Using default host for project ",t.options.projectId),a=`${t.options.projectId}-default-rtdb.firebaseio.com`);let l=Yf(a,r),u=l.repoInfo,d;typeof process<"u"&&_f&&(d=_f[iP]),d?(a=`http://${d}?ns=${u.namespace}`,l=Yf(a,r),u=l.repoInfo):l.repoInfo.secure;const f=new bI(t.name,t.options,e);N0("Invalid Firebase Database URL",l),Ee(l.path)||$n("Database URL must point to the root of a Firebase Database (not including a child path).");const m=lP(u,t,f,new wI(t,n));return new cP(m,t)}function aP(t,e){const n=Bc[e];(!n||n[t.key]!==t)&&$n(`Database ${e}(${t.repoInfo_}) has already been deleted.`),Z0(t),delete n[t.key]}function lP(t,e,n,s){let r=Bc[e.name];r||(r={},Bc[e.name]=r);let a=r[t.toURLString()];return a&&$n("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),a=new U0(t,sP,n,s),r[t.toURLString()]=a,a}class cP{constructor(e,n){this._repoInternal=e,this.app=n,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(z0(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new Ci(this._repo,Oe())),this._rootInternal}_delete(){return this._rootInternal!==null&&(aP(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){this._rootInternal===null&&$n("Cannot call "+e+" on a deleted database.")}}function uP(t=lm(),e){const n=_u(t,"database").getImmediate({identifier:e});if(!n._instanceStarted){const s=RT("database");
1618s&&hP(n,...s)}return n}function hP(t,e,n,s={}){t=pn(t),t._checkNotDeleted("useEmulator");const r=`${e}:${n}`,a=t._repoInternal;if(t._instanceStarted){if(r===t._repoInternal.repoInfo_.host&&$i(s,a.repoInfo_.emulatorOptions))return;$n("connectDatabaseEmulator() cannot initialize or alter the emulator configuration after the database instance has started.")}let l;if(a.repoInfo_.nodeAdmin)s.mockUserToken&&$n('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'),l=new Zo(Zo.OWNER);else if(s.mockUserToken){const u=typeof s.mockUserToken=="string"?s.mockUserToken:AT(s.mockUserToken,t.app.options.projectId);l=new Zo(u)}Ka(e)&&sm(e),rP(a,r,s,l)}/** 1619 * @license 1620 * Copyright 2021 Google LLC 1621 * 1622 * Licensed under the Apache License, Version 2.0 (the "License"); 1623 * you may not use this file except in compliance with the License. 1624 * You may obtain a copy of the License at 1625 * 1626 * http://www.apache.org/licenses/LICENSE-2.0 1627 * 1628 * Unless required by applicable law or agreed to in writing, software 1629 * distributed under the License is distributed on an "AS IS" BASIS, 1630 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1631 * See the License for the specific language governing permissions and 1632 * limitations under the License. 1633 */function dP(t){sI(Ks),Ds(new ji("database",(e,{instanceIdentifier:n})=>{const s=e.getProvider("app").getImmediate(),r=e.getProvider("auth-internal"),a=e.getProvider("app-check-internal");return oP(s,r,a,n)},"PUBLIC").setMultipleInstances(!0)),mi(mf,gf,t),mi(mf,gf,"esm2017")}Wn.prototype.simpleListen=function(t,e){this.sendRequest("q",{p:t},e)};Wn.prototype.echo=function(t,e){this.sendRequest("echo",{d:t},e)};dP();function Ku(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]]);return n}function Cg(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const fP=Cg,Ig=new oo("auth","Firebase",Cg());/** 1634 * @license 1635 * Copyright 2020 Google LLC 1636 * 1637 * Licensed under the Apache License, Version 2.0 (the "License"); 1638 * you may not use this file except in compliance with the License. 1639 * You may obtain a copy of the License at 1640 * 1641 * http://www.apache.org/licenses/LICENSE-2.0 1642 * 1643 * Unless required by applicable law or agreed to in writing, software 1644 * distributed under the License is distributed on an "AS IS" BASIS, 1645 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1646 * See the License for the specific language governing permissions and 1647 * limitations under the License. 1648 */const Pa=new fu("@firebase/auth");function pP(t,...e){Pa.logLevel<=ze.WARN&&Pa.warn(`Auth (${Ks}): ${t}`,...e)}function qo(t,...e){Pa.logLevel<=ze.ERROR&&Pa.error(`Auth (${Ks}): ${t}`,...e)}/** 1649 * @license 1650 * Copyright 2020 Google LLC 1651 * 1652 * Licensed under the Apache License, Version 2.0 (the "License"); 1653 * you may not use this file except in compliance with the License. 1654 * You may obtain a copy of the License at 1655 * 1656 * http://www.apache.org/licenses/LICENSE-2.0 1657 * 1658 * Unless required by applicable law or agreed to in writing, software 1659 * distributed under the License is distributed on an "AS IS" BASIS, 1660 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1661 * See the License for the specific language governing permissions and 1662 * limitations under the License. 1663 */function Zn(t,...e){throw Yu(t,...e)}function Cn(t,...e){return Yu(t,...e)}function Sg(t,e,n){const s=Object.assign(Object.assign({},fP()),{[e]:n});return new oo("auth","Firebase",s).create(e,{appName:t.name})}function zi(t){return Sg(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Yu(t,...e){if(typeof t!="string"){const n=e[0],s=[...e.slice(1)];return s[0]&&(s[0].appName=t.name),t._errorFactory.create(n,...s)}return Ig.create(t,...e)}function ue(t,e,...n){if(!t)throw Yu(e,...n)}function Un(t){const e="INTERNAL ASSERTION FAILED: "+t;throw qo(e),new Error(e)}function qn(t,e){t||Un(e)}/** 1664 * @license 1665 * Copyright 2020 Google LLC 1666 * 1667 * Licensed under the Apache License, Version 2.0 (the "License");
1668 * you may not use this file except in compliance with the License. 1669 * You may obtain a copy of the License at 1670 * 1671 * http://www.apache.org/licenses/LICENSE-2.0 1672 * 1673 * Unless required by applicable law or agreed to in writing, software 1674 * distributed under the License is distributed on an "AS IS" BASIS, 1675 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1676 * See the License for the specific language governing permissions and 1677 * limitations under the License. 1678 */function Uc(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.href)||""}function _P(){return Jf()==="http:"||Jf()==="https:"}function Jf(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.protocol)||null}/** 1679 * @license 1680 * Copyright 2020 Google LLC 1681 * 1682 * Licensed under the Apache License, Version 2.0 (the "License"); 1683 * you may not use this file except in compliance with the License. 1684 * You may obtain a copy of the License at 1685 * 1686 * http://www.apache.org/licenses/LICENSE-2.0 1687 * 1688 * Unless required by applicable law or agreed to in writing, software 1689 * distributed under the License is distributed on an "AS IS" BASIS, 1690 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1691 * See the License for the specific language governing permissions and 1692 * limitations under the License. 1693 */function mP(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(_P()||OT()||"connection"in navigator)?navigator.onLine:!0}function gP(){if(typeof navigator>"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}/** 1694 * @license 1695 * Copyright 2020 Google LLC 1696 * 1697 * Licensed under the Apache License, Version 2.0 (the "License"); 1698 * you may not use this file except in compliance with the License. 1699 * You may obtain a copy of the License at 1700 * 1701 * http://www.apache.org/licenses/LICENSE-2.0 1702 * 1703 * Unless required by applicable law or agreed to in writing, software 1704 * distributed under the License is distributed on an "AS IS" BASIS, 1705 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1706 * See the License for the specific language governing permissions and 1707 * limitations under the License. 1708 */class fo{constructor(e,n){this.shortDelay=e,this.longDelay=n,qn(n>e,"Short delay should be less than long delay!"),this.isMobile=hu()||nm()}get(){return mP()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/** 1709 * @license 1710 * Copyright 2020 Google LLC 1711 * 1712 * Licensed under the Apache License, Version 2.0 (the "License"); 1713 * you may not use this file except in compliance with the License. 1714 * You may obtain a copy of the License at 1715 * 1716 * http://www.apache.org/licenses/LICENSE-2.0 1717 * 1718 * Unless required by applicable law or agreed to in writing, software 1719 * distributed under the License is distributed on an "AS IS" BASIS, 1720 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1721 * See the License for the specific language governing permissions and 1722 * limitations under the License. 1723 */function Ju(t,e){qn(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}/** 1724 * @license 1725 * Copyright 2020 Google LLC 1726 * 1727 * Licensed under the Apache License, Version 2.0 (the "License"); 1728 * you may not use this file except in compliance with the License. 1729 * You may obtain a copy of the License at 1730 * 1731 * http://www.apache.org/licenses/LICENSE-2.0 1732 * 1733 * Unless required by applicable law or agreed to in writing, software 1734 * distributed under the License is distributed on an "AS IS" BASIS, 1735 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1736 * See the License for the specific language governing permissions and 1737 * limitations under the License. 1738 */class Pg{static initialize(e,n,s){this.fetchImpl=e,n&&(this.headersImpl=n),s&&(this.responseImpl=s)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;Un("Could not find fetch implementation, make sure you call FetchProvi
1738der.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;Un("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;Un("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** 1739 * @license 1740 * Copyright 2020 Google LLC 1741 * 1742 * Licensed under the Apache License, Version 2.0 (the "License"); 1743 * you may not use this file except in compliance with the License. 1744 * You may obtain a copy of the License at 1745 * 1746 * http://www.apache.org/licenses/LICENSE-2.0 1747 * 1748 * Unless required by applicable law or agreed to in writing, software 1749 * distributed under the License is distributed on an "AS IS" BASIS, 1750 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1751 * See the License for the specific language governing permissions and 1752 * limitations under the License. 1753 */const vP={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",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",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/** 1754 * @license 1755 * Copyright 2020 Google LLC 1756 * 1757 * Licensed under the Apache License, Version 2.0 (the "License"); 1758 * you may not use this file except in compliance with the License. 1759 * You may obtain a copy of the License at 1760 * 1761 * http://www.apache.org/licenses/LICENSE-2.0 1762 * 1763 * Unless required by applicable law or agreed to in writing, software 1764 * distributed under the License is distributed on an "AS IS" BASIS, 1765 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1766 * See the License for the specific language governing permissions and 1767 * limitations under the License. 1768 */const yP=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],wP=new fo(3e4,6e4);function Qu(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function Xs(t,e,n,s,r={}){return xg(t,r,async()=>{let a={},l={};s&&(e==="GET"?l=s:a={body:JSON.stringify(s)});const u=Gs(Object.assign({key:t.config.apiKey},l)).slice(1),d=await t._getAdditionalHeaders();d["Content-Type"]="application/json",t.languageCode&&(d["X-Firebase-Locale"]=t.languageCode);const f=Object.assign({method:e,headers:d},a);return kT()||(f.referrerPolicy="no-referrer"),t.emulatorConfig&&Ka(t.emulatorConfig.host)&&(f.credentials="include"),Pg.fetch()(await Lg(t,t.config.apiHost,n,u),f)}
1768)}async function xg(t,e,n){t._canInitEmulator=!1;const s=Object.assign(Object.assign({},vP),e);try{const r=new EP(t),a=await Promise.race([n(),r.promise]);r.clearNetworkTimeout();const l=await a.json();if("needConfirmation"in l)throw Ho(t,"account-exists-with-different-credential",l);if(a.ok&&!("errorMessage"in l))return l;{const u=a.ok?l.errorMessage:l.error.message,[d,f]=u.split(" : ");if(d==="FEDERATED_USER_ID_ALREADY_LINKED")throw Ho(t,"credential-already-in-use",l);if(d==="EMAIL_EXISTS")throw Ho(t,"email-already-in-use",l);if(d==="USER_DISABLED")throw Ho(t,"user-disabled",l);const m=s[d]||d.toLowerCase().replace(/[_\s]+/g,"-");if(f)throw Sg(t,m,f);Zn(t,m)}}catch(r){if(r instanceof Ti)throw r;Zn(t,"network-request-failed",{message:String(r)})}}async function bP(t,e,n,s,r={}){const a=await Xs(t,e,n,s,r);return"mfaPendingCredential"in a&&Zn(t,"multi-factor-auth-required",{_serverResponse:a}),a}async function Lg(t,e,n,s){const r=`${e}${n}?${s}`,a=t,l=a.config.emulator?Ju(t.config,r):`${t.config.apiScheme}://${r}`;return yP.includes(n)&&(await a._persistenceManagerAvailable,a._getPersistenceType()==="COOKIE")?a._getPersistence()._getFinalTarget(l).toString():l}class EP{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,s)=>{this.timer=setTimeout(()=>s(Cn(this.auth,"network-request-failed")),wP.get())})}}function Ho(t,e,n){const s={appName:t.name};n.email&&(s.email=n.email),n.phoneNumber&&(s.phoneNumber=n.phoneNumber);const r=Cn(t,e,s);return r.customData._tokenResponse=n,r}/** 1769 * @license 1770 * Copyright 2020 Google LLC 1771 * 1772 * Licensed under the Apache License, Version 2.0 (the "License"); 1773 * you may not use this file except in compliance with the License. 1774 * You may obtain a copy of the License at 1775 * 1776 * http://www.apache.org/licenses/LICENSE-2.0 1777 * 1778 * Unless required by applicable law or agreed to in writing, software 1779 * distributed under the License is distributed on an "AS IS" BASIS, 1780 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1781 * See the License for the specific language governing permissions and 1782 * limitations under the License. 1783 */async function TP(t,e){return Xs(t,"POST","/v1/accounts:delete",e)}async function xa(t,e){return Xs(t,"POST","/v1/accounts:lookup",e)}/** 1784 * @license 1785 * Copyright 2020 Google LLC 1786 * 1787 * Licensed under the Apache License, Version 2.0 (the "License"); 1788 * you may not use this file except in compliance with the License. 1789 * You may obtain a copy of the License at 1790 * 1791 * http://www.apache.org/licenses/LICENSE-2.0 1792 * 1793 * Unless required by applicable law or agreed to in writing, software 1794 * distributed under the License is distributed on an "AS IS" BASIS, 1795 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1796 * See the License for the specific language governing permissions and 1797 * limitations under the License. 1798 */function Dr(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function CP(t,e=!1){const n=pn(t),s=await n.getIdToken(e),r=Xu(s);ue(r&&r.exp&&r.auth_time&&r.iat,n.auth,"internal-error");const a=typeof r.firebase=="object"?r.firebase:void 0,l=a==null?void 0:a.sign_in_provider;return{claims:r,token:s,authTime:Dr(sc(r.auth_time)),issuedAtTime:Dr(sc(r.iat)),expirationTime:Dr(sc(r.exp)),signInProvider:l||null,signInSecondFactor:(a==null?void 0:a.sign_in_second_factor)||null}}function sc(t){return Number(t)*1e3}function Xu(t){const[e,n,s]=t.split(".");if(e===void 0||n===void 0||s===void 0)return qo("JWT malformed, contained fewer than 3 sections"),null;try{const r=ua(n);return r?JSON.parse(r):(qo("Failed to decode base64 JWT payload"),null)}catch(r){return qo("Caught error parsing JWT payload as JSON",r==null?void 0:r.toString()),null}}function Qf(t){const e=Xu(t);return ue(e,"internal-error"),ue(typeof e.exp<"u","internal-error"),ue(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/** 1799 * @license 1800 * Copyright 2020 Google LLC 1801 * 1802 * Licensed under the Apache License, Version 2.0 (the "License"); 1803 * you may not use this file except in compliance with the License. 1804 * You may obtain a copy of the License at 1805 * 1806 * http://www.apache.org/licenses/LICENSE-2.0 1807 * 1808 * Unless required by applicable law or agreed to in writing, softw
1808are 1809 * distributed under the License is distributed on an "AS IS" BASIS, 1810 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1811 * See the License for the specific language governing permissions and 1812 * limitations under the License. 1813 */async function Qr(t,e,n=!1){if(n)return e;try{return await e}catch(s){throw s instanceof Ti&&IP(s)&&t.auth.currentUser===t&&await t.auth.signOut(),s}}function IP({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}/** 1814 * @license 1815 * Copyright 2020 Google LLC 1816 * 1817 * Licensed under the Apache License, Version 2.0 (the "License"); 1818 * you may not use this file except in compliance with the License. 1819 * You may obtain a copy of the License at 1820 * 1821 * http://www.apache.org/licenses/LICENSE-2.0 1822 * 1823 * Unless required by applicable law or agreed to in writing, software 1824 * distributed under the License is distributed on an "AS IS" BASIS, 1825 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1826 * See the License for the specific language governing permissions and 1827 * limitations under the License. 1828 */class SP{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var n;if(e){const s=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),s}else{this.errorBackoff=3e4;const r=((n=this.user.stsTokenManager.expirationTime)!==null&&n!==void 0?n:0)-Date.now()-3e5;return Math.max(0,r)}}schedule(e=!1){if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/** 1829 * @license 1830 * Copyright 2020 Google LLC 1831 * 1832 * Licensed under the Apache License, Version 2.0 (the "License"); 1833 * you may not use this file except in compliance with the License. 1834 * You may obtain a copy of the License at 1835 * 1836 * http://www.apache.org/licenses/LICENSE-2.0 1837 * 1838 * Unless required by applicable law or agreed to in writing, software 1839 * distributed under the License is distributed on an "AS IS" BASIS, 1840 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1841 * See the License for the specific language governing permissions and 1842 * limitations under the License. 1843 */class zc{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Dr(this.lastLoginAt),this.creationTime=Dr(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/** 1844 * @license 1845 * Copyright 2019 Google LLC 1846 * 1847 * Licensed under the Apache License, Version 2.0 (the "License"); 1848 * you may not use this file except in compliance with the License. 1849 * You may obtain a copy of the License at 1850 * 1851 * http://www.apache.org/licenses/LICENSE-2.0 1852 * 1853 * Unless required by applicable law or agreed to in writing, software 1854 * distributed under the License is distributed on an "AS IS" BASIS, 1855 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1856 * See the License for the specific language governing permissions and 1857 * limitations under the License. 1858 */async function La(t){var e;const n=t.auth,s=await t.getIdToken(),r=await Qr(t,xa(n,{idToken:s}));ue(r==null?void 0:r.users.length,n,"internal-error");const a=r.users[0];t._notifyReloadListener(a);const l=!((e=a.providerUserInfo)===null||e===void 0)&&e.length?Rg(a.providerUserInfo):[],u=xP(t.providerData,l),d=t.isAnonymous,f=!(t.email&&a.passwordHash)&&!(u!=null&&u.length),m=d?f:!1,_={uid:a.localId,displayName:a.displayName||null,photoURL:a.photoUrl||null,email:a.email||null,emailVerified:a.emailVerified||!1,phoneNumber:a.phoneNumber||null,tenantId:a.tenantId||null,providerData:u,metadata:new zc(a.createdAt,a.lastLoginAt),isAnonymous:m};Object.assign(t,_)}async function PP(t){const e=pn(t);await La(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function xP(t,e){return[...t.filter(s=>
1858!e.some(r=>r.providerId===s.providerId)),...e]}function Rg(t){return t.map(e=>{var{providerId:n}=e,s=Ku(e,["providerId"]);return{providerId:n,uid:s.rawId||"",displayName:s.displayName||null,email:s.email||null,phoneNumber:s.phoneNumber||null,photoURL:s.photoUrl||null}})}/** 1859 * @license 1860 * Copyright 2020 Google LLC 1861 * 1862 * Licensed under the Apache License, Version 2.0 (the "License"); 1863 * you may not use this file except in compliance with the License. 1864 * You may obtain a copy of the License at 1865 * 1866 * http://www.apache.org/licenses/LICENSE-2.0 1867 * 1868 * Unless required by applicable law or agreed to in writing, software 1869 * distributed under the License is distributed on an "AS IS" BASIS, 1870 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1871 * See the License for the specific language governing permissions and 1872 * limitations under the License. 1873 */async function LP(t,e){const n=await xg(t,{},async()=>{const s=Gs({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:r,apiKey:a}=t.config,l=await Lg(t,r,"/v1/token",`key=${a}`),u=await t._getAdditionalHeaders();return u["Content-Type"]="application/x-www-form-urlencoded",Pg.fetch()(l,{method:"POST",headers:u,body:s})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function RP(t,e){return Xs(t,"POST","/v2/accounts:revokeToken",Qu(t,e))}/** 1874 * @license 1875 * Copyright 2020 Google LLC 1876 * 1877 * Licensed under the Apache License, Version 2.0 (the "License"); 1878 * you may not use this file except in compliance with the License. 1879 * You may obtain a copy of the License at 1880 * 1881 * http://www.apache.org/licenses/LICENSE-2.0 1882 * 1883 * Unless required by applicable law or agreed to in writing, software 1884 * distributed under the License is distributed on an "AS IS" BASIS, 1885 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1886 * See the License for the specific language governing permissions and 1887 * limitations under the License. 1888 */class Ls{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){ue(e.idToken,"internal-error"),ue(typeof e.idToken<"u","internal-error"),ue(typeof e.refreshToken<"u","internal-error");const n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):Qf(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){ue(e.length!==0,"internal-error");const n=Qf(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(ue(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){const{accessToken:s,refreshToken:r,expiresIn:a}=await LP(e,n);this.updateTokensAndExpiration(s,r,Number(a))}updateTokensAndExpiration(e,n,s){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+s*1e3}static fromJSON(e,n){const{refreshToken:s,accessToken:r,expirationTime:a}=n,l=new Ls;return s&&(ue(typeof s=="string","internal-error",{appName:e}),l.refreshToken=s),r&&(ue(typeof r=="string","internal-error",{appName:e}),l.accessToken=r),a&&(ue(typeof a=="number","internal-error",{appName:e}),l.expirationTime=a),l}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Ls,this.toJSON())}_performRefresh(){return Un("not implemented")}}/** 1889 * @license 1890 * Copyright 2020 Google LLC 1891 * 1892 * Licensed under the Apache License, Version 2.0 (the "License"); 1893 * you may not use this file except in compliance with the License. 1894 * You may obtain a copy of the License at 1895 * 1896 * http://www.apache.org/licenses/LICENSE-2.0 1897 * 1898 * Unless required by applicable law or agreed to in writing, software 1899 * distributed under the License is distributed on an "AS IS" BASIS, 1900 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1901 * See the License for the specific language governing permissions and 1902 * limitations under the License. 1903 */function ii(t,e){ue(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class an{constructor(e){var{uid:n,auth:s,stsTokenManager:r}=e,a=Ku(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new SP(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=s,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=a.displayName||null,this.email=a.email||null,this.emailVerified=a.emailVerified||!1,this.phoneNumber=a.phoneNumber||null,this.photoURL=a.photoURL||null,this.isAnonymous=a.isAnonymous||!1,this.tenantId=a.tenantId||null,this.providerData=a.providerData?[...a.providerData]:[],this.metadata=new zc(a.createdAt||void 0,a.lastLoginAt||void 0)}async getIdToken(e){const n=await Qr(this,this.stsTokenManager.getToken(this.auth,e));return ue(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return CP(this,e)}reload(){return PP(this)}_assign(e){this!==e&&(ue(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.ph
1903otoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(n=>Object.assign({},n)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const n=new an(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(e){ue(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,n=!1){let s=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),s=!0),n&&await La(this),await this.auth._persistUserIfCurrent(this),s&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(En(this.auth.app))return Promise.reject(zi(this.auth));const e=await this.getIdToken();return await Qr(this,TP(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,n){var s,r,a,l,u,d,f,m;const _=(s=n.displayName)!==null&&s!==void 0?s:void 0,v=(r=n.email)!==null&&r!==void 0?r:void 0,y=(a=n.phoneNumber)!==null&&a!==void 0?a:void 0,P=(l=n.photoURL)!==null&&l!==void 0?l:void 0,T=(u=n.tenantId)!==null&&u!==void 0?u:void 0,O=(d=n._redirectEventId)!==null&&d!==void 0?d:void 0,z=(f=n.createdAt)!==null&&f!==void 0?f:void 0,B=(m=n.lastLoginAt)!==null&&m!==void 0?m:void 0,{uid:A,emailVerified:R,isAnonymous:j,providerData:J,stsTokenManager:Ae}=n;ue(A&&Ae,e,"internal-error");const et=Ls.fromJSON(this.name,Ae);ue(typeof A=="string",e,"internal-error"),ii(_,e.name),ii(v,e.name),ue(typeof R=="boolean",e,"internal-error"),ue(typeof j=="boolean",e,"internal-error"),ii(y,e.name),ii(P,e.name),ii(T,e.name),ii(O,e.name),ii(z,e.name),ii(B,e.name);const ie=new an({uid:A,auth:e,email:v,emailVerified:R,displayName:_,isAnonymous:j,photoURL:P,phoneNumber:y,tenantId:T,stsTokenManager:et,createdAt:z,lastLoginAt:B});return J&&Array.isArray(J)&&(ie.providerData=J.map(we=>Object.assign({},we))),O&&(ie._redirectEventId=O),ie}static async _fromIdTokenResponse(e,n,s=!1){const r=new Ls;r.updateFromServerResponse(n);const a=new an({uid:n.localId,auth:e,stsTokenManager:r,isAnonymous:s});return await La(a),a}static async _fromGetAccountInfoResponse(e,n,s){const r=n.users[0];ue(r.localId!==void 0,"internal-error");const a=r.providerUserInfo!==void 0?Rg(r.providerUserInfo):[],l=!(r.email&&r.passwordHash)&&!(a!=null&&a.length),u=new Ls;u.updateFromIdToken(s);const d=new an({uid:r.localId,auth:e,stsTokenManager:u,isAnonymous:l}),f={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:a,metadata:new zc(r.createdAt,r.lastLoginAt),isAnonymous:!(r.email&&r.passwordHash)&&!(a!=null&&a.length)};return Object.assign(d,f),d}}/** 1904 * @license 1905 * Copyright 2020 Google LLC 1906 * 1907 * Licensed under the Apache License, Version 2.0 (the "License"); 1908 * you may not use this file except in compliance with the License. 1909 * You may obtain a copy of the License at 1910 * 1911 * http://www.apache.org/licenses/LICENSE-2.0 1912 * 1913 * Unless required by applicable law or agreed to in writing, softw
1913are 1914 * distributed under the License is distributed on an "AS IS" BASIS, 1915 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1916 * See the License for the specific language governing permissions and 1917 * limitations under the License. 1918 */const Xf=new Map;function zn(t){qn(t instanceof Function,"Expected a class definition");let e=Xf.get(t);return e?(qn(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,Xf.set(t,e),e)}/** 1919 * @license 1920 * Copyright 2019 Google LLC 1921 * 1922 * Licensed under the Apache License, Version 2.0 (the "License"); 1923 * you may not use this file except in compliance with the License. 1924 * You may obtain a copy of the License at 1925 * 1926 * http://www.apache.org/licenses/LICENSE-2.0 1927 * 1928 * Unless required by applicable law or agreed to in writing, software 1929 * distributed under the License is distributed on an "AS IS" BASIS, 1930 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1931 * See the License for the specific language governing permissions and 1932 * limitations under the License. 1933 */class Ag{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){const n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}}Ag.type="NONE";const ep=Ag;/** 1934 * @license 1935 * Copyright 2019 Google LLC 1936 * 1937 * Licensed under the Apache License, Version 2.0 (the "License"); 1938 * you may not use this file except in compliance with the License. 1939 * You may obtain a copy of the License at 1940 * 1941 * http://www.apache.org/licenses/LICENSE-2.0 1942 * 1943 * Unless required by applicable law or agreed to in writing, software 1944 * distributed under the License is distributed on an "AS IS" BASIS, 1945 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1946 * See the License for the specific language governing permissions and 1947 * limitations under the License. 1948 */function Go(t,e,n){return`firebase:${t}:${e}:${n}`}class Rs{constructor(e,n,s){this.persistence=e,this.auth=n,this.userKey=s;const{config:r,name:a}=this.auth;this.fullUserKey=Go(this.userKey,r.apiKey,a),this.fullPersistenceKey=Go("persistence",r.apiKey,a),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){const n=await xa(this.auth,{idToken:e}).catch(()=>{});return n?an._fromGetAccountInfoResponse(this.auth,n,e):null}return an._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,s="authUser"){if(!n.length)return new Rs(zn(ep),e,s);const r=(await Promise.all(n.map(async f=>{if(await f._isAvailable())return f}))).filter(f=>f);let a=r[0]||zn(ep);const l=Go(s,e.config.apiKey,e.name);let u=null;for(const f of n)try{const m=await f._get(l);if(m){let _;if(typeof m=="string"){const v=await xa(e,{idToken:m}).catch(()=>{});if(!v)break;_=await an._fromGetAccountInfoResponse(e,v,m)}else _=an._fromJSON(e,m);f!==a&&(u=_),a=f;break}}catch{}const d=r.filter(f=>f._shouldAllowMigration);return!a._shouldAllowMigration||!d.length?new Rs(a,e,s):(a=d[0],u&&await a._set(l,u.toJSON()),await Promise.all(n.map(async f=>{if(f!==a)try{await f._remove(l)}catch{}})),new Rs(a,e,s))}}/** 1949 * @license 1950 * Copyright 2020 Google LLC 1951 * 1952 * Licensed under the Apache License, Version 2.0 (the "License"); 1953 * you may not use this file except in compliance with the License. 1954 * You may obtain a copy of the License at 1955 * 1956 * http://www.apache.org/licenses/LICENSE-2.0 1957 * 1958 * Unless required by applicable law or agreed to in writing, softw
1958are 1959 * distributed under the License is distributed on an "AS IS" BASIS, 1960 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1961 * See the License for the specific language governing permissions and 1962 * limitations under the License. 1963 */function tp(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(Mg(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(kg(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(Fg(e))return"Blackberry";if(Bg(e))return"Webos";if(Og(e))return"Safari";if((e.includes("chrome/")||Ng(e))&&!e.includes("edge/"))return"Chrome";if(Dg(e))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,s=t.match(n);if((s==null?void 0:s.length)===2)return s[1]}return"Other"}function kg(t=kt()){return/firefox\//i.test(t)}function Og(t=kt()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function Ng(t=kt()){return/crios\//i.test(t)}function Mg(t=kt()){return/iemobile/i.test(t)}function Dg(t=kt()){return/android/i.test(t)}function Fg(t=kt()){return/blackberry/i.test(t)}function Bg(t=kt()){return/webos/i.test(t)}function eh(t=kt()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function AP(t=kt()){var e;return eh(t)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function kP(){return NT()&&document.documentMode===10}function Ug(t=kt()){return eh(t)||Dg(t)||Bg(t)||Fg(t)||/windows phone/i.test(t)||Mg(t)}/** 1964 * @license 1965 * Copyright 2020 Google LLC 1966 * 1967 * Licensed under the Apache License, Version 2.0 (the "License"); 1968 * you may not use this file except in compliance with the License. 1969 * You may obtain a copy of the License at 1970 * 1971 * http://www.apache.org/licenses/LICENSE-2.0 1972 * 1973 * Unless required by applicable law or agreed to in writing, software 1974 * distributed under the License is distributed on an "AS IS" BASIS, 1975 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1976 * See the License for the specific language governing permissions and 1977 * limitations under the License. 1978 */function zg(t,e=[]){let n;switch(t){case"Browser":n=tp(kt());break;case"Worker":n=`${tp(kt())}-${t}`;break;default:n=t}const s=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${Ks}/${s}`}/** 1979 * @license 1980 * Copyright 2022 Google LLC 1981 * 1982 * Licensed under the Apache License, Version 2.0 (the "License"); 1983 * you may not use this file except in compliance with the License. 1984 * You may obtain a copy of the License at 1985 * 1986 * http://www.apache.org/licenses/LICENSE-2.0 1987 * 1988 * Unless required by applicable law or agreed to in writing, software 1989 * distributed under the License is distributed on an "AS IS" BASIS, 1990 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1991 * See the License for the specific language governing permissions and 1992 * limitations under the License. 1993 */class OP{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){const s=a=>new Promise((l,u)=>{try{const d=e(a);l(d)}catch(d){u(d)}});s.onAbort=n,this.queue.push(s);const r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const n=[];try{for(const s of this.queue)await s(e),s.onAbort&&n.push(s.onAbort)}catch(s){n.reverse();for(const r of n)try{r()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:s==null?void 0:s.message})}}}/** 1994 * @license 1995 * Copyright 2023 Google LLC 1996 * 1997 * Licensed under the Apache License, Version 2.0 (the "License"); 1998 * you may not use this file except in compliance with the License. 1999 * You may obtain a copy of the License at 2000 * 2001 * http://www.apache.org/licenses/LICENSE-2.0 2002 * 2003 * Unless required by applicable law or agreed to in writing, software 2004 * distributed under the License is distributed on an "AS IS" BASIS, 2005 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2006 * See the License for the specific language governing permissions and 2007 * limitations under the License. 2008 */async function NP(t,e={}){return Xs(t,"GET","/v2/passwordPolicy",Qu(t,e))}/** 2009 * @license 2010 * Copyright 2023 Google LLC 2011 * 2012 * Licensed under the Apache License, Version 2.0 (the "License");
2013 * you may not use this file except in compliance with the License. 2014 * You may obtain a copy of the License at 2015 * 2016 * http://www.apache.org/licenses/LICENSE-2.0 2017 * 2018 * Unless required by applicable law or agreed to in writing, software 2019 * distributed under the License is distributed on an "AS IS" BASIS, 2020 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2021 * See the License for the specific language governing permissions and 2022 * limitations under the License. 2023 */const MP=6;class DP{constructor(e){var n,s,r,a;const l=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(n=l.minPasswordLength)!==null&&n!==void 0?n:MP,l.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=l.maxPasswordLength),l.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=l.containsLowercaseCharacter),l.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=l.containsUppercaseCharacter),l.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=l.containsNumericCharacter),l.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=l.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(r=(s=e.allowedNonAlphanumericCharacters)===null||s===void 0?void 0:s.join(""))!==null&&r!==void 0?r:"",this.forceUpgradeOnSignin=(a=e.forceUpgradeOnSignin)!==null&&a!==void 0?a:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var n,s,r,a,l,u;const d={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,d),this.validatePasswordCharacterOptions(e,d),d.isValid&&(d.isValid=(n=d.meetsMinPasswordLength)!==null&&n!==void 0?n:!0),d.isValid&&(d.isValid=(s=d.meetsMaxPasswordLength)!==null&&s!==void 0?s:!0),d.isValid&&(d.isValid=(r=d.containsLowercaseLetter)!==null&&r!==void 0?r:!0),d.isValid&&(d.isValid=(a=d.containsUppercaseLetter)!==null&&a!==void 0?a:!0),d.isValid&&(d.isValid=(l=d.containsNumericCharacter)!==null&&l!==void 0?l:!0),d.isValid&&(d.isValid=(u=d.containsNonAlphanumericCharacter)!==null&&u!==void 0?u:!0),d}validatePasswordLengthOptions(e,n){const s=this.customStrengthOptions.minPasswordLength,r=this.customStrengthOptions.maxPasswordLength;s&&(n.meetsMinPasswordLength=e.length>=s),r&&(n.meetsMaxPasswordLength=e.length<=r)}validatePasswordCharacterOptions(e,n){this.updatePasswordCharacterOptionsStatuses(n,!1,
2023!1,!1,!1);let s;for(let r=0;r<e.length;r++)s=e.charAt(r),this.updatePasswordCharacterOptionsStatuses(n,s>="a"&&s<="z",s>="A"&&s<="Z",s>="0"&&s<="9",this.allowedNonAlphanumericCharacters.includes(s))}updatePasswordCharacterOptionsStatuses(e,n,s,r,a){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=s)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=r)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=a))}}/** 2024 * @license 2025 * Copyright 2020 Google LLC 2026 * 2027 * Licensed under the Apache License, Version 2.0 (the "License"); 2028 * you may not use this file except in compliance with the License. 2029 * You may obtain a copy of the License at 2030 * 2031 * http://www.apache.org/licenses/LICENSE-2.0 2032 * 2033 * Unless required by applicable law or agreed to in writing, software 2034 * distributed under the License is distributed on an "AS IS" BASIS, 2035 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2036 * See the License for the specific language governing permissions and 2037 * limitations under the License. 2038 */class FP{constructor(e,n,s,r){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=s,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new np(this),this.idTokenSubscription=new np(this),this.beforeStateQueue=new OP(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Ig,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion,this._persistenceManagerAvailable=new Promise(a=>this._resolvePersistenceManagerAvailable=a)}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=zn(n)),this._initializationPromise=this.queue(async()=>{var s,r,a;if(!this._deleted&&(this.persistenceManager=await Rs.create(this,e),(s=this._resolvePersistenceManagerAvailable)===null||s===void 0||s.call(this),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((a=this.currentUser)===null||a===void 0?void 0:a.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const n=await xa(this,{idToken:e}),s=await an._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(s)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var n;if(En(this.app)){const l=this.app.settings.authIdToken;return l?new Promise(u=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(l).then(u,u))}):this.directlySetCurrentUser(null)}const s=await this.assertedPersistence.getCurrentUser();let r=s,a=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const l=(n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId,u=r==null?void 0:r._redirectEventId,d=await this.tryRedirectSignIn(e);(!l||l===u)&&(d!=null&&d.user)&&(r=d.user,a=!0)}if(!r)return this.directlySetCurrentUser(null);
2038if(!r._redirectEventId){if(a)try{await this.beforeStateQueue.runMiddleware(r)}catch(l){r=s,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(l))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return ue(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await La(e)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=gP()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(En(this.app))return Promise.reject(zi(this));const n=e?pn(e):null;return n&&ue(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&ue(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return En(this.app)?Promise.reject(zi(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return En(this.app)?Promise.reject(zi(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(zn(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await NP(this),n=new DP(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new oo("auth","Firebase",e())}onAuthStateChanged(e,n,s){return this.registerStateListener(this.authStateSubscription,e,n,s)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,s){return this.registerStateListener(this.idTokenSubscription,e,n,s)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{const s=this.onAuthStateChanged(()=>{s(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){const n=await this.currentUser.getIdToken(),s={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(s.tenantId=this.tenantId),await RP(this,s)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,n){const s=await this.getOrInitRedirectPersistenceManager(n);return e===null?s.removeCurrentUser():s.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const n=e&&zn(e)||this._popupRedirectResolver;ue(n,this,"argument-error"),this.redirectPersistenceManager=await Rs.create(this,[zn(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var n,s;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)===null||n===void 0?void 0:n._redirectEventId)===e?this._currentUser:((s=this.redirectUser)===null||s===void 0?void 0:s._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const s=(n=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&n!==void 0?n:null;this.lastNotifiedUid!==s&&(this.lastNotifiedUid=s,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,s,r){if(this._deleted)return()=>{};const a=typeof n=="function"?n:n.next.bind(n);let l=!1;const u=this._isInitialized?Promise.resolve():this._initializationPromise;if(ue(u,this,"internal-error"),u.then(()=>{l||a(this.currentUser)}),typeof n=="function"){const d=e.addObserver(n,s,r);return()=>{l=!0,d()}}else{const d=e.addObserver(n);return()=>{l=!0,d()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return ue(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=zg(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);const s=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());s&&(n["X-Firebase-Client"]=s);const r=await this._getAppCheckToken();return r&&(n["X-Firebase-AppCheck"]=r),n}async _getAppCheckToken(){var e;if(En(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const n=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return n!=null&&n.error&&pP(`Error while retrieving App Check token: ${n.error}`),n==null?void 0:n.token}}function th(t){return pn(t)}class np{constructor(e){this.auth=e,this.observer=null,this.addObserver=$T(n=>this.observer=n)}get next(){return ue(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** 2039 * @license 2040 * Copyright 2020 Google LLC 2041 * 2042 * Licensed under the Apache License, Version 2.0 (the "License");
2043 * you may not use this file except in compliance with the License. 2044 * You may obtain a copy of the License at 2045 * 2046 * http://www.apache.org/licenses/LICENSE-2.0 2047 * 2048 * Unless required by applicable law or agreed to in writing, software 2049 * distributed under the License is distributed on an "AS IS" BASIS, 2050 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2051 * See the License for the specific language governing permissions and 2052 * limitations under the License. 2053 */let nh={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function BP(t){nh=t}function UP(t){return nh.loadJS(t)}function zP(){return nh.gapiScript}function HP(t){return`__${t}${Math.floor(Math.random()*1e6)}`}/** 2054 * @license 2055 * Copyright 2020 Google LLC 2056 * 2057 * Licensed under the Apache License, Version 2.0 (the "License"); 2058 * you may not use this file except in compliance with the License. 2059 * You may obtain a copy of the License at 2060 * 2061 * http://www.apache.org/licenses/LICENSE-2.0 2062 * 2063 * Unless required by applicable law or agreed to in writing, software 2064 * distributed under the License is distributed on an "AS IS" BASIS, 2065 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2066 * See the License for the specific language governing permissions and 2067 * limitations under the License. 2068 */function WP(t,e){const n=_u(t,"auth");if(n.isInitialized()){const r=n.getImmediate(),a=n.getOptions();if($i(a,e??{}))return r;Zn(r,"already-initialized")}return n.initialize({options:e})}function VP(t,e){const n=(e==null?void 0:e.persistence)||[],s=(Array.isArray(n)?n:[n]).map(zn);e!=null&&e.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(s,e==null?void 0:e.popupRedirectResolver)}function $P(t,e,n){const s=th(t);ue(/^https?:\/\//.test(e),s,"invalid-emulator-scheme");const r=!1,a=Hg(e),{host:l,port:u}=jP(e),d=u===null?"":`:${u}`,f={url:`${a}//${l}${d}/`},m=Object.freeze({host:l,port:u,protocol:a.replace(":",""),options:Object.freeze({disableWarnings:r})});if(!s._canInitEmulator){ue(s.config.emulator&&s.emulatorConfig,s,"emulator-config-failed"),ue($i(f,s.config.emulator)&&$i(m,s.emulatorConfig),s,"emulator-config-failed");return}s.config.emulator=f,s.emulatorConfig=m,s.settings.appVerificationDisabledForTesting=!0,ZP(),Ka(l)&&sm(`${a}//${l}${d}`)}function Hg(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function jP(t){const e=Hg(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const s=n[2].split("@").pop()||"",r=/^(\[[^\]]+\])(:|$)/.exec(s);if(r){const a=r[1];return{host:a,port:ip(s.substr(a.length+1))}}else{const[a,l]=s.split(":");return{host:a,port:ip(l)}}}function ip(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function ZP(){function t(){const e=document.createElement("p"),n=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t())}/** 2069 * @license 2070 * Copyright 2020 Google LLC 2071 * 2072 * Licensed under the Apache License, Version 2.0 (the "License"); 2073 * you may not use this file except in compliance with the License. 2074 * You may obtain a copy of the License at 2075 * 2076 * http://www.apache.org/licenses/LICENSE-2.0 2077 * 2078 * Unless required by applicable law or agreed to in writing, software 2079 * distributed under the License is distributed on an "AS IS" BASIS, 2080 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2081 * See the License for the specific language governing permissions and 2082 * limitations under the License. 2083 */class Wg{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return Un("not implemented")}_getIdTokenResponse(e){return Un("not implemented")}_linkToIdToken(e,n){return Un("not implemented")}_getReauthenticationResolver(e){return Un("not implemented")}}/** 2084 * @license 2085 * Copyright 2020 Google LLC 2086 * 2087 * Licensed under the Apache License, Version 2.0 (the "License");
2088 * you may not use this file except in compliance with the License. 2089 * You may obtain a copy of the License at 2090 * 2091 * http://www.apache.org/licenses/LICENSE-2.0 2092 * 2093 * Unless required by applicable law or agreed to in writing, software 2094 * distributed under the License is distributed on an "AS IS" BASIS, 2095 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2096 * See the License for the specific language governing permissions and 2097 * limitations under the License. 2098 */async function As(t,e){return bP(t,"POST","/v1/accounts:signInWithIdp",Qu(t,e))}/** 2099 * @license 2100 * Copyright 2020 Google LLC 2101 * 2102 * Licensed under the Apache License, Version 2.0 (the "License"); 2103 * you may not use this file except in compliance with the License. 2104 * You may obtain a copy of the License at 2105 * 2106 * http://www.apache.org/licenses/LICENSE-2.0 2107 * 2108 * Unless required by applicable law or agreed to in writing, software 2109 * distributed under the License is distributed on an "AS IS" BASIS, 2110 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2111 * See the License for the specific language governing permissions and 2112 * limitations under the License. 2113 */const qP="http://localhost";class Yi extends Wg{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const n=new Yi(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):Zn("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
2113once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e,{providerId:s,signInMethod:r}=n,a=Ku(n,["providerId","signInMethod"]);if(!s||!r)return null;const l=new Yi(s,r);return l.idToken=a.idToken||void 0,l.accessToken=a.accessToken||void 0,l.secret=a.secret,l.nonce=a.nonce,l.pendingToken=a.pendingToken||null,l}_getIdTokenResponse(e){const n=this.buildRequest();return As(e,n)}_linkToIdToken(e,n){const s=this.buildRequest();return s.idToken=n,As(e,s)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,As(e,n)}buildRequest(){const e={requestUri:qP,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),e.postBody=Gs(n)}return e}}/** 2114 * @license 2115 * Copyright 2020 Google LLC 2116 * 2117 * Licensed under the Apache License, Version 2.0 (the "License"); 2118 * you may not use this file except in compliance with the License. 2119 * You may obtain a copy of the License at 2120 * 2121 * http://www.apache.org/licenses/LICENSE-2.0 2122 * 2123 * Unless required by applicable law or agreed to in writing, software 2124 * distributed under the License is distributed on an "AS IS" BASIS, 2125 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2126 * See the License for the specific language governing permissions and 2127 * limitations under the License. 2128 */class Vg{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/** 2129 * @license 2130 * Copyright 2019 Google LLC 2131 * 2132 * Licensed under the Apache License, Version 2.0 (the "License"); 2133 * you may not use this file except in compliance with the License. 2134 * You may obtain a copy of the License at 2135 * 2136 * http://www.apache.org/licenses/LICENSE-2.0 2137 * 2138 * Unless required by applicable law or agreed to in writing, software 2139 * distributed under the License is distributed on an "AS IS" BASIS, 2140 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2141 * See the License for the specific language governing permissions and 2142 * limitations under the License. 2143 */class po extends Vg{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/** 2144 * @license 2145 * Copyright 2020 Google LLC 2146 * 2147 * Licensed under the Apache License, Version 2.0 (the "License"); 2148 * you may not use this file except in compliance with the License. 2149 * You may obtain a copy of the License at 2150 * 2151 * http://www.apache.org/licenses/LICENSE-2.0 2152 * 2153 * Unless required by applicable law or agreed to in writing, software 2154 * distributed under the License is distributed on an "AS IS" BASIS, 2155 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2156 * See the License for the specific language governing permissions and 2157 * limitations under the License. 2158 */class li extends po{constructor(){super("facebook.com")}static credential(e){return Yi._fromParams({providerId:li.PROVIDER_ID,signInMethod:li.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return li.credentialFromTaggedObject(e)}static credentialFromError(e){return li.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return li.credential(e.oauthAccessToken)}catch{return null}}}li.FACEBOOK_SIGN_IN_METHOD="facebook.com";li.PROVIDER_ID="facebook.com";/** 2159 * @license 2160 * Copyright 2020 Google LLC 2161 * 2162 * Licensed under the Apache License, Version 2.0 (the "License"); 2163 * you may not use this file except in compliance with the License. 2164 * You may obtain a copy of the License at 2165 * 2166 * http://www.apache.org/licenses/LICENSE-2.0 2167 * 2168 * Unless required by applicable law or agreed to in writing, softw
2168are 2169 * distributed under the License is distributed on an "AS IS" BASIS, 2170 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2171 * See the License for the specific language governing permissions and 2172 * limitations under the License. 2173 */class ci extends po{constructor(){super("google.com"),this.addScope("profile")}static credential(e,n){return Yi._fromParams({providerId:ci.PROVIDER_ID,signInMethod:ci.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})}static credentialFromResult(e){return ci.credentialFromTaggedObject(e)}static credentialFromError(e){return ci.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:n,oauthAccessToken:s}=e;if(!n&&!s)return null;try{return ci.credential(n,s)}catch{return null}}}ci.GOOGLE_SIGN_IN_METHOD="google.com";ci.PROVIDER_ID="google.com";/** 2174 * @license 2175 * Copyright 2020 Google LLC 2176 * 2177 * Licensed under the Apache License, Version 2.0 (the "License"); 2178 * you may not use this file except in compliance with the License. 2179 * You may obtain a copy of the License at 2180 * 2181 * http://www.apache.org/licenses/LICENSE-2.0 2182 * 2183 * Unless required by applicable law or agreed to in writing, software 2184 * distributed under the License is distributed on an "AS IS" BASIS, 2185 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2186 * See the License for the specific language governing permissions and 2187 * limitations under the License. 2188 */class ui extends po{constructor(){super("github.com")}static credential(e){return Yi._fromParams({providerId:ui.PROVIDER_ID,signInMethod:ui.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return ui.credentialFromTaggedObject(e)}static credentialFromError(e){return ui.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return ui.credential(e.oauthAccessToken)}catch{return null}}}ui.GITHUB_SIGN_IN_METHOD="github.com";ui.PROVIDER_ID="github.com";/** 2189 * @license 2190 * Copyright 2020 Google LLC 2191 * 2192 * Licensed under the Apache License, Version 2.0 (the "License"); 2193 * you may not use this file except in compliance with the License. 2194 * You may obtain a copy of the License at 2195 * 2196 * http://www.apache.org/licenses/LICENSE-2.0 2197 * 2198 * Unless required by applicable law or agreed to in writing, software 2199 * distributed under the License is distributed on an "AS IS" BASIS, 2200 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2201 * See the License for the specific language governing permissions and 2202 * limitations under the License. 2203 */class hi extends po{constructor(){super("twitter.com")}static credential(e,n){return Yi._fromParams({providerId:hi.PROVIDER_ID,signInMethod:hi.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})}static credentialFromResult(e){return hi.credentialFromTaggedObject(e)}static credentialFromError(e){return hi.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:n,oauthTokenSecret:s}=e;if(!n||!s)return null;try{return hi.credential(n,s)}catch{return null}}}hi.TWITTER_SIGN_IN_METHOD="twitter.com";hi.PROVIDER_ID="twitter.com";/** 2204 * @license 2205 * Copyright 2020 Google LLC 2206 * 2207 * Licensed under the Apache License, Version 2.0 (the "License"); 2208 * you may not use this file except in compliance with the License. 2209 * You may obtain a copy of the License at 2210 * 2211 * http://www.apache.org/licenses/LICENSE-2.0 2212 * 2213 * Unless required by applicable law or agreed to in writing, software 2214 * distributed under the License is distributed on an "AS IS" BASIS, 2215 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2216 * See the License for the specific language governing permissions and 2217 * limitations under the License. 2218 */class Ws{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,s,r=!1){const a=await an._fromIdTokenResponse(e,s,r),l=sp(s);return new Ws({user:a,providerId:l,_tokenResponse:s,operationType:n})}static async _forOperation(e,n,s){await e._updateTokensIfNecessary(s,!0);const r=sp(s);
2218return new Ws({user:e,providerId:r,_tokenResponse:s,operationType:n})}}function sp(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}/** 2219 * @license 2220 * Copyright 2020 Google LLC 2221 * 2222 * Licensed under the Apache License, Version 2.0 (the "License"); 2223 * you may not use this file except in compliance with the License. 2224 * You may obtain a copy of the License at 2225 * 2226 * http://www.apache.org/licenses/LICENSE-2.0 2227 * 2228 * Unless required by applicable law or agreed to in writing, software 2229 * distributed under the License is distributed on an "AS IS" BASIS, 2230 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2231 * See the License for the specific language governing permissions and 2232 * limitations under the License. 2233 */class Ra extends Ti{constructor(e,n,s,r){var a;super(n.code,n.message),this.operationType=s,this.user=r,Object.setPrototypeOf(this,Ra.prototype),this.customData={appName:e.name,tenantId:(a=e.tenantId)!==null&&a!==void 0?a:void 0,_serverResponse:n.customData._serverResponse,operationType:s}}static _fromErrorAndOperation(e,n,s,r){return new Ra(e,n,s,r)}}function $g(t,e,n,s){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(a=>{throw a.code==="auth/multi-factor-auth-required"?Ra._fromErrorAndOperation(t,a,e,s):a})}async function GP(t,e,n=!1){const s=await Qr(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return Ws._forOperation(t,"link",s)}/** 2234 * @license 2235 * Copyright 2019 Google LLC 2236 * 2237 * Licensed under the Apache License, Version 2.0 (the "License"); 2238 * you may not use this file except in compliance with the License. 2239 * You may obtain a copy of the License at 2240 * 2241 * http://www.apache.org/licenses/LICENSE-2.0 2242 * 2243 * Unless required by applicable law or agreed to in writing, software 2244 * distributed under the License is distributed on an "AS IS" BASIS, 2245 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2246 * See the License for the specific language governing permissions and 2247 * limitations under the License. 2248 */async function KP(t,e,n=!1){const{auth:s}=t;if(En(s.app))return Promise.reject(zi(s));const r="reauthenticate";try{const a=await Qr(t,$g(s,r,e,t),n);ue(a.idToken,s,"internal-error");const l=Xu(a.idToken);ue(l,s,"internal-error");const{sub:u}=l;return ue(t.uid===u,s,"user-mismatch"),Ws._forOperation(t,r,a)}catch(a){throw(a==null?void 0:a.code)==="auth/user-not-found"&&Zn(s,"user-mismatch"),a}}/** 2249 * @license 2250 * Copyright 2020 Google LLC 2251 * 2252 * Licensed under the Apache License, Version 2.0 (the "License"); 2253 * you may not use this file except in compliance with the License. 2254 * You may obtain a copy of the License at 2255 * 2256 * http://www.apache.org/licenses/LICENSE-2.0 2257 * 2258 * Unless required by applicable law or agreed to in writing, software 2259 * distributed under the License is distributed on an "AS IS" BASIS, 2260 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2261 * See the License for the specific language governing permissions and 2262 * limitations under the License. 2263 */async function YP(t,e,n=!1){if(En(t.app))return Promise.reject(zi(t));const s="signIn",r=await $g(t,s,e),a=await Ws._fromIdTokenResponse(t,s,r);return n||await t._updateCurrentUser(a.user),a}function JP(t,e,n,s){return pn(t).onIdTokenChanged(e,n,s)}function QP(t,e,n){return pn(t).beforeAuthStateChanged(e,n)}const Aa="__sak";/** 2264 * @license 2265 * Copyright 2019 Google LLC 2266 * 2267 * Licensed under the Apache License, Version 2.0 (the "License"); 2268 * you may not use this file except in compliance with the License. 2269 * You may obtain a copy of the License at 2270 * 2271 * http://www.apache.org/licenses/LICENSE-2.0 2272 * 2273 * Unless required by applicable law or agreed to in writing, software 2274 * distributed under the License is distributed on an "AS IS" BASIS, 2275 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2276 * See the License for the specific language governing permissions and 2277 * limitations under the License. 2278 */class jg{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Aa,"1"),this.storage.removeItem(Aa),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){const n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/** 2279 * @license 2280 * Copyright 2020 Google LLC 2281 * 2282 * Licensed under the Apache License, Version 2.0 (the "License");
2283 * you may not use this file except in compliance with the License. 2284 * You may obtain a copy of the License at 2285 * 2286 * http://www.apache.org/licenses/LICENSE-2.0 2287 * 2288 * Unless required by applicable law or agreed to in writing, software 2289 * distributed under the License is distributed on an "AS IS" BASIS, 2290 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2291 * See the License for the specific language governing permissions and 2292 * limitations under the License. 2293 */const XP=1e3,ex=10;class Zg extends jg{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Ug(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const n of Object.keys(this.listeners)){const s=this.storage.getItem(n),r=this.localCache[n];s!==r&&e(n,r,s)}}onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((l,u,d)=>{this.notifyListeners(l,d)});return}const s=e.key;n?this.detachListener():this.stopPolling();const r=()=>{const l=this.storage.getItem(s);!n&&this.localCache[s]===l||this.notifyListeners(s,l)},a=this.storage.getItem(s);kP()&&a!==e.newValue&&e.newValue!==e.oldValue?setTimeout(r,ex):r()}notifyListeners(e,n){this.localCache[e]=n;const s=this.listeners[e];if(s)for(const r of Array.from(s))r(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,s)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:s}),!0)})},XP)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Ob
2293ject.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){const n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}}Zg.type="LOCAL";const tx=Zg;/** 2294 * @license 2295 * Copyright 2020 Google LLC 2296 * 2297 * Licensed under the Apache License, Version 2.0 (the "License"); 2298 * you may not use this file except in compliance with the License. 2299 * You may obtain a copy of the License at 2300 * 2301 * http://www.apache.org/licenses/LICENSE-2.0 2302 * 2303 * Unless required by applicable law or agreed to in writing, software 2304 * distributed under the License is distributed on an "AS IS" BASIS, 2305 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2306 * See the License for the specific language governing permissions and 2307 * limitations under the License. 2308 */class qg extends jg{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}}qg.type="SESSION";const Gg=qg;/** 2309 * @license 2310 * Copyright 2019 Google LLC 2311 * 2312 * Licensed under the Apache License, Version 2.0 (the "License"); 2313 * you may not use this file except in compliance with the License. 2314 * You may obtain a copy of the License at 2315 * 2316 * http://www.apache.org/licenses/LICENSE-2.0 2317 * 2318 * Unless required by applicable law or agreed to in writing, software 2319 * distributed under the License is distributed on an "AS IS" BASIS, 2320 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2321 * See the License for the specific language governing permissions and 2322 * limitations under the License. 2323 */function nx(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}/** 2324 * @license 2325 * Copyright 2019 Google LLC 2326 * 2327 * Licensed under the Apache License, Version 2.0 (the "License"); 2328 * you may not use this file except in compliance with the License. 2329 * You may obtain a copy of the License at 2330 * 2331 * http://www.apache.org/licenses/LICENSE-2.0 2332 * 2333 * Unless required by applicable law or agreed to in writing, software 2334 * distributed under the License is distributed on an "AS IS" BASIS, 2335 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2336 * See the License for the specific language governing permissions and 2337 * limitations under the License. 2338 */class sl{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const n=this.receivers.find(r=>r.isListeningto(e));if(n)return n;const s=new sl(e);return this.receivers.push(s),s}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const n=e,{eventId:s,eventType:r,data:a}=n.data,l=this.handlersMap[r];if(!(l!=null&&l.size))return;n.ports[0].postMessage({status:"ack",eventId:s,eventType:r});const u=Array.from(l).map(async f=>f(n.origin,a)),d=await nx(u);n.ports[0].postMessage({status:"done",eventId:s,eventType:r,response:d})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}sl.receivers=[];/** 2339 * @license 2340 * Copyright 2020 Google LLC 2341 * 2342 * Licensed under the Apache License, Version 2.0 (the "License"); 2343 * you may not use this file except in compliance with the License. 2344 * You may obtain a copy of the License at 2345 * 2346 * http://www.apache.org/licenses/LICENSE-2.0 2347 * 2348 * Unless required by applicable law or agreed to in writing, software 2349 * distributed under the License is distributed on an "AS IS" BASIS, 2350 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2351 * See the License for the specific language governing permissions and 2352 * limitations under the License. 2353 */function ih(t="",e=10){let n="";for(let s=0;s<e;s++)n+=Math.floor(Math.random()*10);return t+n}/** 2354 * @license 2355 * Copyright 2019 Google LLC 2356 * 2357 * Licensed under the Apache License, Version 2.0 (the "License");
2358 * you may not use this file except in compliance with the License. 2359 * You may obtain a copy of the License at 2360 * 2361 * http://www.apache.org/licenses/LICENSE-2.0 2362 * 2363 * Unless required by applicable law or agreed to in writing, software 2364 * distributed under the License is distributed on an "AS IS" BASIS, 2365 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2366 * See the License for the specific language governing permissions and 2367 * limitations under the License. 2368 */class ix{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,n,s=50){const r=typeof MessageChannel<"u"?new MessageChannel:null;if(!r)throw new Error("connection_unavailable");let a,l;return new Promise((u,d)=>{const f=ih("",20);r.port1.start();const m=setTimeout(()=>{d(new Error("unsupported_event"))},s);l={messageChannel:r,onMessage(_){const v=_;if(v.data.eventId===f)switch(v.data.status){case"ack":clearTimeout(m),a=setTimeout(()=>{d(new Error("timeout"))},3e3);break;case"done":clearTimeout(a),u(v.data.response);break;default:clearTimeout(m),clearTimeout(a),d(new Error("invalid_response"));break}}},this.handlers.add(l),r.port1.addEventListener("message",l.onMessage),this.target.postMessage({eventType:e,eventId:f,data:n},[r.port2])}).finally(()=>{l&&this.removeMessageHandler(l)})}}/** 2369 * @license 2370 * Copyright 2020 Google LLC 2371 * 2372 * Licensed under the Apache License, Version 2.0 (the "License"); 2373 * you may not use this file except in compliance with the License. 2374 * You may obtain a copy of the License at 2375 * 2376 * http://www.apache.org/licenses/LICENSE-2.0 2377 * 2378 * Unless required by applicable law or agreed to in writing, software 2379 * distributed under the License is distributed on an "AS IS" BASIS, 2380 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2381 * See the License for the specific language governing permissions and 2382 * limitations under the License. 2383 */function In(){return window}function sx(t){In().location.href=t}/** 2384 * @license 2385 * Copyright 2020 Google LLC. 2386 * 2387 * Licensed under the Apache License, Version 2.0 (the "License"); 2388 * you may not use this file except in compliance with the License. 2389 * You may obtain a copy of the License at 2390 * 2391 * http://www.apache.org/licenses/LICENSE-2.0 2392 * 2393 * Unless required by applicable law or agreed to in writing, software 2394 * distributed under the License is distributed on an "AS IS" BASIS, 2395 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2396 * See the License for the specific language governing permissions and 2397 * limitations under the License. 2398 */function Kg(){return typeof In().WorkerGlobalScope<"u"&&typeof In().importScripts=="function"}async function rx(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function ox(){var t;return((t=navigator==null?void 0:navigator.serviceWorker)===null||t===void 0?void 0:t.controller)||null}function ax(){return Kg()?self:null}/** 2399 * @license 2400 * Copyright 2019 Google LLC 2401 * 2402 * Licensed under the Apache License, Version 2.0 (the "License"); 2403 * you may not use this file except in compliance with the License. 2404 * You may obtain a copy of the License at 2405 * 2406 * http://www.apache.org/licenses/LICENSE-2.0 2407 * 2408 * Unless required by applicable law or agreed to in writing, software 2409 * distributed under the License is distributed on an "AS IS" BASIS, 2410 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2411 * See the License for the specific language governing permissions and 2412 * limitations under the License. 2413 */const Yg="firebaseLocalStorageDb",lx=1,ka="firebaseLocalStorage",Jg="fbase_key";class _o{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function rl(t,e){return t.transaction([ka],e?"readwrite":"readonly").objectStore(ka)}function cx(){const t=indexedDB.deleteDatabase(Yg);
2413return new _o(t).toPromise()}function Hc(){const t=indexedDB.open(Yg,lx);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const s=t.result;try{s.createObjectStore(ka,{keyPath:Jg})}catch(r){n(r)}}),t.addEventListener("success",async()=>{const s=t.result;s.objectStoreNames.contains(ka)?e(s):(s.close(),await cx(),e(await Hc()))})})}async function rp(t,e,n){const s=rl(t,!0).put({[Jg]:e,value:n});return new _o(s).toPromise()}async function ux(t,e){const n=rl(t,!1).get(e),s=await new _o(n).toPromise();return s===void 0?null:s.value}function op(t,e){const n=rl(t,!0).delete(e);return new _o(n).toPromise()}const hx=800,dx=3;class Qg{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:(this.db=await Hc(),this.db)}async _withRetries(e){let n=0;for(;;)try{const s=await this._openDb();return await e(s)}catch(s){if(n++>dx)throw s;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Kg()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=sl._getInstance(ax()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)}
2413)),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){var e,n;if(this.activeServiceWorker=await rx(),!this.activeServiceWorker)return;this.sender=new ix(this.activeServiceWorker);const s=await this.sender._send("ping",{},800);s&&!((e=s[0])===null||e===void 0)&&e.fulfilled&&!((n=s[0])===null||n===void 0)&&n.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||ox()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await Hc();return await rp(e,Aa,"1"),await op(e,Aa),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(s=>rp(s,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){const n=await this._withRetries(s=>ux(s,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>op(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(r=>{const a=rl(r,!1).getAll();return new _o(a).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const n=[],s=new Set;if(e.length!==0)for(const{fbase_key:r,value:a}of e)s.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(a)&&(this.notifyListeners(r,a),n.push(r));for(const r of Object.keys(this.localCache))this.localCache[r]&&!s.has(r)&&(this.notifyListeners(r,null),n.push(r));return n}notifyListeners(e,n){this.localCache[e]=n;const s=this.listeners[e];if(s)for(const r of Array.from(s))r(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),hx)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Ob
2413ject.keys(this.listeners).length===0&&this.stopPolling()}}Qg.type="LOCAL";const fx=Qg;new fo(3e4,6e4);/** 2414 * @license 2415 * Copyright 2021 Google LLC 2416 * 2417 * Licensed under the Apache License, Version 2.0 (the "License"); 2418 * you may not use this file except in compliance with the License. 2419 * You may obtain a copy of the License at 2420 * 2421 * http://www.apache.org/licenses/LICENSE-2.0 2422 * 2423 * Unless required by applicable law or agreed to in writing, software 2424 * distributed under the License is distributed on an "AS IS" BASIS, 2425 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2426 * See the License for the specific language governing permissions and 2427 * limitations under the License. 2428 */function px(t,e){return e?zn(e):(ue(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}/** 2429 * @license 2430 * Copyright 2019 Google LLC 2431 * 2432 * Licensed under the Apache License, Version 2.0 (the "License"); 2433 * you may not use this file except in compliance with the License. 2434 * You may obtain a copy of the License at 2435 * 2436 * http://www.apache.org/licenses/LICENSE-2.0 2437 * 2438 * Unless required by applicable law or agreed to in writing, software 2439 * distributed under the License is distributed on an "AS IS" BASIS, 2440 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2441 * See the License for the specific language governing permissions and 2442 * limitations under the License. 2443 */class sh extends Wg{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return As(e,this._buildIdpRequest())}_linkToIdToken(e,n){return As(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return As(e,this._buildIdpRequest())}_buildIdpRequest(e){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(n.idToken=e),n}}function _x(t){return YP(t.auth,new sh(t),t.bypassAuthState)}function mx(t){const{auth:e,user:n}=t;return ue(n,e,"internal-error"),KP(n,new sh(t),t.bypassAuthState)}async function gx(t){const{auth:e,user:n}=t;return ue(n,e,"internal-error"),GP(n,new sh(t),t.bypassAuthState)}/** 2444 * @license 2445 * Copyright 2020 Google LLC 2446 * 2447 * Licensed under the Apache License, Version 2.0 (the "License"); 2448 * you may not use this file except in compliance with the License. 2449 * You may obtain a copy of the License at 2450 * 2451 * http://www.apache.org/licenses/LICENSE-2.0 2452 * 2453 * Unless required by applicable law or agreed to in writing, software 2454 * distributed under the License is distributed on an "AS IS" BASIS, 2455 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2456 * See the License for the specific language governing permissions and 2457 * limitations under the License. 2458 */class Xg{constructor(e,n,s,r,a=!1){this.auth=e,this.resolver=s,this.user=r,this.bypassAuthState=a,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(e,n)=>{this.pendingPromise={resolve:e,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(s){this.reject(s)}})}async onAuthEvent(e){const{urlResponse:n,sessionId:s,postBody:r,tenantId:a,error:l,type:u}=e;if(l){this.reject(l);return}const d={auth:this.auth,requestUri:n,sessionId:s,tenantId:a||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(u)(d))}catch(f){this.reject(f)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return _x;case"linkViaPopup":case"linkViaRedirect":return gx;case"reauthViaPopup":case"reauthViaRedirect":return mx;default:Zn(this.auth,"internal-error")}}resolve(e){qn(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){qn(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/** 2459 * @license 2460 * Copyright 2020 Google LLC 2461 * 2462 * Licensed under the Apache License, Version 2.0 (the "License");
2463 * you may not use this file except in compliance with the License. 2464 * You may obtain a copy of the License at 2465 * 2466 * http://www.apache.org/licenses/LICENSE-2.0 2467 * 2468 * Unless required by applicable law or agreed to in writing, software 2469 * distributed under the License is distributed on an "AS IS" BASIS, 2470 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2471 * See the License for the specific language governing permissions and 2472 * limitations under the License. 2473 */const vx=new fo(2e3,1e4);class ys extends Xg{constructor(e,n,s,r,a){super(e,n,r,a),this.provider=s,this.authWindow=null,this.pollId=null,ys.currentPopupAction&&ys.currentPopupAction.cancel(),ys.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return ue(e,this.auth,"internal-error"),e}async onExecution(){qn(this.filter.length===1,"Popup operations only handle one event");const e=ih();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(Cn(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(Cn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,ys.currentPopupAction=null}pollUserCancellation(){const e=()=>{var n,s;if(!((s=(n=this.authWindow)===null||n===void 0?void 0:n.window)===null||s===void 0)&&s.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Cn(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,vx.get())};e()}}ys.currentPopupAction=null;/** 2474 * @license 2475 * Copyright 2020 Google LLC 2476 * 2477 * Licensed under the Apache License, Version 2.0 (the "License"); 2478 * you may not use this file except in compliance with the License. 2479 * You may obtain a copy of the License at 2480 * 2481 * http://www.apache.org/licenses/LICENSE-2.0 2482 * 2483 * Unless required by applicable law or agreed to in writing, software 2484 * distributed under the License is distributed on an "AS IS" BASIS, 2485 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2486 * See the License for the specific language governing permissions and 2487 * limitations under the License. 2488 */const yx="pendingRedirect",Ko=new Map;class wx extends Xg{constructor(e,n,s=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,s),this.eventId=null}async execute(){let e=Ko.get(this.auth._key());if(!e){try{const s=await bx(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(s)}catch(n){e=()=>Promise.reject(n)}Ko.set(this.auth._key(),e)}return this.bypassAuthState||Ko.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function bx(t,e){const n=Cx(e),s=Tx(t);if(!await s._isAvailable())return!1;const r=await s._get(n)==="true";return await s._remove(n),r}function Ex(t,e){Ko.set(t._key(),e)}function Tx(t){return zn(t._redirectPersistence)}function Cx(t){return Go(yx,t.config.apiKey,t.name)}async function Ix(t,e,n=!1){if(En(t.app))return Promise.reject(zi(t));const s=th(t),r=px(s,e),l=await new wx(s,r,n).execute();return l&&!n&&(delete l.user._redirectEventId,await s._persistUserIfCurrent(l.user),await s._setRedirectUser(null,e)),l}/** 2489 * @license 2490 * Copyright 2020 Google LLC 2491 * 2492 * Licensed under the Apache License, Version 2.0 (the "License"); 2493 * you may not use this file except in compliance with the License. 2494 * You may obtain a copy of the License at 2495 * 2496 * http://www.apache.org/licenses/LICENSE-2.0 2497 * 2498 * Unless required by applicable law or agreed to in writing, softw
2498are 2499 * distributed under the License is distributed on an "AS IS" BASIS, 2500 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2501 * See the License for the specific language governing permissions and 2502 * limitations under the License. 2503 */const Sx=10*60*1e3;class Px{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let n=!1;return this.consumers.forEach(s=>{this.isEventForConsumer(e,s)&&(n=!0,this.sendToConsumer(e,s),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!xx(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){var s;if(e.error&&!ev(e)){const r=((s=e.error.code)===null||s===void 0?void 0:s.split("auth/")[1])||"internal-error";n.onError(Cn(this.auth,r))}else n.onAuthEvent(e)}isEventForConsumer(e,n){const s=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&s}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=Sx&&this.cachedEventUids.clear(),this.cachedEventUids.has(ap(e))}saveEventToCache(e){this.cachedEventUids.add(ap(e)),this.lastProcessedEventTime=Date.now()}}function ap(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function ev({type:t,error:e}){return t==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function xx(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return ev(t);default:return!1}}/** 2504 * @license 2505 * Copyright 2020 Google LLC 2506 * 2507 * Licensed under the Apache License, Version 2.0 (the "License"); 2508 * you may not use this file except in compliance with the License. 2509 * You may obtain a copy of the License at 2510 * 2511 * http://www.apache.org/licenses/LICENSE-2.0 2512 * 2513 * Unless required by applicable law or agreed to in writing, software 2514 * distributed under the License is distributed on an "AS IS" BASIS, 2515 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2516 * See the License for the specific language governing permissions and 2517 * limitations under the License. 2518 */async function Lx(t,e={}){return Xs(t,"GET","/v1/projects",e)}/** 2519 * @license 2520 * Copyright 2020 Google LLC 2521 * 2522 * Licensed under the Apache License, Version 2.0 (the "License"); 2523 * you may not use this file except in compliance with the License. 2524 * You may obtain a copy of the License at 2525 * 2526 * http://www.apache.org/licenses/LICENSE-2.0 2527 * 2528 * Unless required by applicable law or agreed to in writing, software 2529 * distributed under the License is distributed on an "AS IS" BASIS, 2530 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2531 * See the License for the specific language governing permissions and 2532 * limitations under the License. 2533 */const Rx=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Ax=/^https?/;async function kx(t){if(t.config.emulator)return;const{authorizedDomains:e}=await Lx(t);for(const n of e)try{if(Ox(n))return}catch{}Zn(t,"unauthorized-domain")}function Ox(t){const e=Uc(),{protocol:n,hostname:s}=new URL(e);if(t.startsWith("chrome-extension://")){const l=new URL(t);return l.hostname===""&&s===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&l.hostname===s}if(!Ax.test(n))return!1;if(Rx.test(t))return s===t;const r=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+r+"|"+r+")$","i").test(s)}/** 2534 * @license 2535 * Copyright 2020 Google LLC. 2536 * 2537 * Licensed under the Apache License, Version 2.0 (the "License"); 2538 * you may not use this file except in compliance with the License. 2539 * You may obtain a copy of the License at 2540 * 2541 * http://www.apache.org/licenses/LICENSE-2.0 2542 * 2543 * Unless required by applicable law or agreed to in writing, softw
2543are 2544 * distributed under the License is distributed on an "AS IS" BASIS, 2545 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2546 * See the License for the specific language governing permissions and 2547 * limitations under the License. 2548 */const Nx=new fo(3e4,6e4);function lp(){const t=In().___jsl;if(t!=null&&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 n=0;n<t.CP.length;n++)t.CP[n]=null}}function Mx(t){return new Promise((e,n)=>{var s,r,a;function l(){lp(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{lp(),n(Cn(t,"network-request-failed"))},timeout:Nx.get()})}if(!((r=(s=In().gapi)===null||s===void 0?void 0:s.iframes)===null||r===void 0)&&r.Iframe)e(gapi.iframes.getContext());else if(!((a=In().gapi)===null||a===void 0)&&a.load)l();else{const u=HP("iframefcb");return In()[u]=()=>{gapi.load?l():n(Cn(t,"network-request-failed"))},UP(`${zP()}?onload=${u}`).catch(d=>n(d))}}).catch(e=>{throw Yo=null,e})}let Yo=null;function Dx(t){return Yo=Yo||Mx(t),Yo}/** 2549 * @license 2550 * Copyright 2020 Google LLC. 2551 * 2552 * Licensed under the Apache License, Version 2.0 (the "License"); 2553 * you may not use this file except in compliance with the License. 2554 * You may obtain a copy of the License at 2555 * 2556 * http://www.apache.org/licenses/LICENSE-2.0 2557 * 2558 * Unless required by applicable law or agreed to in writing, software 2559 * distributed under the License is distributed on an "AS IS" BASIS, 2560 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2561 * See the License for the specific language governing permissions and 2562 * limitations under the License. 2563 */const Fx=new fo(5e3,15e3),Bx="__/auth/iframe",Ux="emulator/auth/iframe",zx={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Hx=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Wx(t){const e=t.config;ue(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?Ju(e,Ux):`https://${t.config.authDomain}/${Bx}`,s={apiKey:e.apiKey,appName:t.name,v:Ks},r=Hx.get(t.config.apiHost);r&&(s.eid=r);const a=t._getFrameworks();return a.length&&(s.fw=a.join(",")),`${n}?${Gs(s).slice(1)}`}async function Vx(t){const e=await Dx(t),n=In().gapi;return ue(n,t,"internal-error"),e.open({where:document.body,url:Wx(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:zx,dontclear:!0},s=>new Promise(async(r,a)=>{await s.restyle({setHideOnLeave:!1});const l=Cn(t,"network-request-failed"),u=In().setTimeout(()=>{a(l)},Fx.get());function d(){In().clearTimeout(u),r(s)}s.ping(d).then(d,()=>{a(l)})}))}/** 2564 * @license 2565 * Copyright 2020 Google LLC. 2566 * 2567 * Licensed under the Apache License, Version 2.0 (the "License"); 2568 * you may not use this file except in compliance with the License. 2569 * You may obtain a copy of the License at 2570 * 2571 * http://www.apache.org/licenses/LICENSE-2.0 2572 * 2573 * Unless required by applicable law or agreed to in writing, software 2574 * distributed under the License is distributed on an "AS IS" BASIS, 2575 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2576 * See the License for the specific language governing permissions and 2577 * limitations under the License. 2578 */const $x={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},jx=500,Zx=600,qx="_blank",Gx="http://localhost";class cp{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Kx(t,e,n,s=jx,r=Zx){const a=Math.max((window.screen.availHeight-r)/2,0).toString(),l=Math.max((window.screen.availWidth-s)/2,0).toString();let u="";const d=Object.assign(Object.assign({},$x),{width:s.toString(),height:r.toString(),top:a,left:l}),f=kt().toLowerCase();n&&(u=Ng(f)?qx:n),kg(f)&&(e=e||Gx,d.scrollbars="yes");const m=Object.entries(d).reduce((v,[y,P])=>`${v}${y}=${P},`,"");if(AP(f)&&u!=="_self")return Yx(e||"",u),new cp(null);const _=window.open(e||"",u,m);ue(_,t,"popup-blocked");try{_.focus()}catch{}return new cp(_)}function Yx(t,e){const n=document.createElement("a");n.href=t,n.target=e;const s=document.createEvent("MouseEvent");
2578s.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(s)}/** 2579 * @license 2580 * Copyright 2021 Google LLC 2581 * 2582 * Licensed under the Apache License, Version 2.0 (the "License"); 2583 * you may not use this file except in compliance with the License. 2584 * You may obtain a copy of the License at 2585 * 2586 * http://www.apache.org/licenses/LICENSE-2.0 2587 * 2588 * Unless required by applicable law or agreed to in writing, software 2589 * distributed under the License is distributed on an "AS IS" BASIS, 2590 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2591 * See the License for the specific language governing permissions and 2592 * limitations under the License. 2593 */const Jx="__/auth/handler",Qx="emulator/auth/handler",Xx=encodeURIComponent("fac");async function up(t,e,n,s,r,a){ue(t.config.authDomain,t,"auth-domain-config-required"),ue(t.config.apiKey,t,"invalid-api-key");const l={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:s,v:Ks,eventId:r};if(e instanceof Vg){e.setDefaultLanguage(t.languageCode),l.providerId=e.providerId||"",wc(e.getCustomParameters())||(l.customParameters=JSON.stringify(e.getCustomParameters()));for(const[m,_]of Object.entries({}))l[m]=_}if(e instanceof po){const m=e.getScopes().filter(_=>_!=="");m.length>0&&(l.scopes=m.join(","))}t.tenantId&&(l.tid=t.tenantId);const u=l;for(const m of Object.keys(u))u[m]===void 0&&delete u[m];const d=await t._getAppCheckToken(),f=d?`#${Xx}=${encodeURIComponent(d)}`:"";return`${eL(t)}?${Gs(u).slice(1)}${f}`}function eL({config:t}){return t.emulator?Ju(t,Qx):`https://${t.authDomain}/${Jx}`}/** 2594 * @license 2595 * Copyright 2020 Google LLC 2596 * 2597 * Licensed under the Apache License, Version 2.0 (the "License"); 2598 * you may not use this file except in compliance with the License. 2599 * You may obtain a copy of the License at 2600 * 2601 * http://www.apache.org/licenses/LICENSE-2.0 2602 * 2603 * Unless required by applicable law or agreed to in writing, software 2604 * distributed under the License is distributed on an "AS IS" BASIS, 2605 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2606 * See the License for the specific language governing permissions and 2607 * limitations under the License. 2608 */const rc="webStorageSupport";class tL{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Gg,this._completeRedirectFn=Ix,this._overrideRedirectResult=Ex}async _openPopup(e,n,s,r){var a;qn((a=this.eventManagers[e._key()])===null||a===void 0?void 0:a.manager,"_initialize() not called before _openPopup()");const l=await up(e,n,s,Uc(),r);return Kx(e,l,ih())}async _openRedirect(e,n,s,r){await this._originValidation(e);const a=await up(e,n,s,Uc(),r);return sx(a),new Promise(()=>{})}_initialize(e){const n=e._key();if(this.eventManagers[n]){const{manager:r,promise:a}=this.eventManagers[n];return r?Promise.resolve(r):(qn(a,"If manager is not set, promise should be"),a)}const s=this.initAndGetManager(e);return this.eventManagers[n]={promise:s},s.catch(()=>{delete this.eventManagers[n]}),s}async initAndGetManager(e){const n=await Vx(e),s=new Px(e);return n.register("authEvent",r=>(ue(r==null?void 0:r.authEvent,e,"invalid-auth-event"),{status:s.onEvent(r.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:s},this.iframes[e._key()]=n,s}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(rc,{type:rc},r=>{var a;const l=(a=r==null?void 0:r[0])===null||a===void 0?void 0:a[rc];l!==void 0&&n(!!l),Zn(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=kx(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return Ug()||Og()||eh()}}const nL=tL;var hp="@firebase/auth",dp="1.10.2";/** 2609 * @license 2610 * Copyright 2020 Google LLC 2611 * 2612 * Licensed under the Apache License, Version 2.0 (the "License"); 2613 * you may not use this file except in compliance with the License. 2614 * You may obtain a copy of the License at 2615 * 2616 * http://www.apache.org/licenses/LICENSE-2.0 2617 * 2618 * Unless required by applicable law or agreed to in writing, softw
2618are 2619 * distributed under the License is distributed on an "AS IS" BASIS, 2620 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2621 * See the License for the specific language governing permissions and 2622 * limitations under the License. 2623 */class iL{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const n=this.auth.onIdTokenChanged(s=>{e((s==null?void 0:s.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){ue(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/** 2624 * @license 2625 * Copyright 2020 Google LLC 2626 * 2627 * Licensed under the Apache License, Version 2.0 (the "License"); 2628 * you may not use this file except in compliance with the License. 2629 * You may obtain a copy of the License at 2630 * 2631 * http://www.apache.org/licenses/LICENSE-2.0 2632 * 2633 * Unless required by applicable law or agreed to in writing, software 2634 * distributed under the License is distributed on an "AS IS" BASIS, 2635 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2636 * See the License for the specific language governing permissions and 2637 * limitations under the License. 2638 */function sL(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function rL(t){Ds(new ji("auth",(e,{options:n})=>{const s=e.getProvider("app").getImmediate(),r=e.getProvider("heartbeat"),a=e.getProvider("app-check-internal"),{apiKey:l,authDomain:u}=s.options;ue(l&&!l.includes(":"),"invalid-api-key",{appName:s.name});const d={apiKey:l,authDomain:u,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:zg(t)},f=new FP(s,r,a,d);return VP(f,n),f},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,s)=>{e.getProvider("auth-internal").initialize()})),Ds(new ji("auth-internal",e=>{const n=th(e.getProvider("auth").getImmediate());return(s=>new iL(s))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),mi(hp,dp,sL(t)),mi(hp,dp,"esm2017")}/** 2639 * @license 2640 * Copyright 2021 Google LLC 2641 * 2642 * Licensed under the Apache License, Version 2.0 (the "License"); 2643 * you may not use this file except in compliance with the License. 2644 * You may obtain a copy of the License at 2645 * 2646 * http://www.apache.org/licenses/LICENSE-2.0 2647 * 2648 * Unless required by applicable law or agreed to in writing, software 2649 * distributed under the License is distributed on an "AS IS" BASIS, 2650 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 2651 * See the License for the specific language governing permissions and 2652 * limitations under the License. 2653 */const oL=5*60,aL=tm("authIdTokenMaxAge")||oL;let fp=null;const lL=t=>async e=>{const n=e&&await e.getIdTokenResult(),s=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(s&&s>aL)return;const r=n==null?void 0:n.token;fp!==r&&(fp=r,await fetch(t,{method:r?"POST":"DELETE",headers:r?{Authorization:`Bearer ${r}`}:{}}))};function cL(t=lm()){const e=_u(t,"auth");if(e.isInitialized())return e.getImmediate();const n=WP(t,{popupRedirectResolver:nL,persistence:[fx,tx,Gg]}),s=tm("authTokenSyncURL");if(s&&typeof isSecureContext=="boolean"&&isSecureContext){const a=new URL(s,location.origin);if(location.origin===a.origin){const l=lL(a.toString());QP(n,l,()=>l(n.currentUser)),JP(n,u=>l(u))}}const r=X_("auth");return r&&$P(n,`http://${r}`),n}function uL(){var t,e;return(e=(t=document.getElementsByTagName("head"))===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:document}
2653BP({loadJS(t){return new Promise((e,n)=>{const s=document.createElement("script");s.setAttribute("src",t),s.onload=e,s.onerror=r=>{const a=Cn("internal-error");a.customData=r,n(a)},s.type="text/javascript",s.charset="UTF-8",uL().appendChild(s)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});rL("Browser");const hL={apiKey:"AIzaSyA33TjfaprwOUgYGaXrMaFsWzhsw7dRCRA",authDomain:"start-vue.firebaseapp.com",databaseURL:"https://start-vue.firebaseio.com",projectId:"start-vue",storageBucket:"start-vue.firebasestorage.app",messagingSenderId:"1094423879350",appId:"1:1094423879350:web:5ef0a1bfc24e51a2bc5017"},tv=am(hL),Vs=uP(tv);cL(tv);const rh=zs(Vs,"web_stores"),oh=zs(Vs,"physical_stores"),dL={class:"gf-map-page"},fL={class:"gf-controls-bar"},pL={class:"controls-row"},_L={key:0,class:"count-chip"},mL={class:"gf-map-area"},gL={class:"gf-popup-card"},vL={class:"popup-title"},yL={class:"popup-rows"},wL={key:0,class:"popup-row"},bL=["href"],EL={key:1,class:"popup-row"},TL={class:"popup-row"},CL={class:"gf-badge"},IL={key:2,class:"popup-row"},SL={key:3,class:"popup-row"},PL={key:4,class:"popup-row"},xL={key:5,class:"popup-row"},LL={key:6,class:"popup-row"},RL={key:7,class:"popup-row"},AL=["href"],kL=Bt({__name:"GF_TW_View",setup(t){function e(_){const v=_.replace(/</g,"<").replace(/>/g,">");return jo.divIcon({className:"gf-marker",html:` 2654 <div class="gf-pin-wrap"> 2655 <div class="gf-pin-label">${v}</div> 2656 <svg xmlns="http://www.w3.org/2000/svg" width="28" height="40" viewBox="0 0 28 40"> 2657 <path d="M14 2C8.48 2 4 6.48 4 12c0 8.5 10 26 10 26s10-17.5 10-26C24 6.48 19.52 2 14 2z" 2658 fill="#40916c" stroke="#1e4d32" stroke-width="1.5"/> 2659 <circle cx="14" cy="12" r="5.8" fill="white" opacity="0.93"/> 2660 <path d="M14 7.5 C17 9.5 17 12.2 14 15.8 C11 12.2 11 9.5 14 7.5Z" fill="#2d6a4f" opacity="0.85"/> 2661 </svg> 2662 </div> 2663 `,iconSize:[28,40],iconAnchor:[14,40],popupAnchor:[0,-44]})}delete jo.Icon.Default.prototype._getIconUrl,jo.Icon.Default.mergeOptions({iconRetinaUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon-2x.png",iconUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-shadow.png"});function n(){return{name:"",address:"",phone:"",businessHours:"",glutenFree:"",vegetarian:"",category:"",menu:"",notes:"",latlng:[0,0]}}const s=be([23.5,121]),r=be(7),a=be([]),l=be(""),u=be(""),d=gt(()=>a.value.filter(_=>!(l.value&&!_.name.toLowerCase().includes(l.value.toLowerCase())&&!_.address.toLowerCase().includes(l.value.toLowerCase())&&!_.category.toLowerCase().includes(l.value.toLowerCase())&&!_.menu.toLowerCase().includes(l.value.toLowerCase())&&!_.notes.toLowerCase().includes(l.value.toLowerCase())&&!_.phone.toLowerCase().includes(l.value.toLowerCase())&&!_.businessHours.toLowerCase().includes(l.value.toLowerCase())&&!_.glutenFree.toLowerCase().includes(l.value.toLowerCase())||u.value&&u.value!==_.vegetarian)));function f(){Hs(oh,_=>{const v=_.val();v&&(a.value=Object.values(v).map(y=>({...n(),...y})))},_=>{console.error("Error loading markers:",_)})}function m(){f()}return fn(()=>{}),(_,v)=>(fe(),_e("div",dL,[C("div",fL,[C("div",pL,[C("div",{class:Wt(["search-wrap",{active:l.value}])},[v[3]||(v[3]=C("svg",{class:"search-svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round"},[C("circle",{cx:"11",cy:"11",r:"7"}),C("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),se(C("input",{type:"text","onUpdate:modelValue":v[0]||(v[0]=y=>l.value=y),placeholder:"æå°åºåãå°åãæçé¡åâ¦",class:"search-input"},null,512),[[Ye,l.value]]),l.value?(fe(),_e("button",{key:0,class:"clear-btn",onClick:v[1]||(v[1]=y=>l.value=""),"aria-label":"æ¸ é¤"},"â")):ot("",!0)],2),se(C("select",{"onUpdate:modelValue":v[2]||(v[2]=y=>u.value=y),class:"veg-filter"},v[4]||(v[4]=[C("option",{value:""},"è·ç´ çå¯",-1),C("option",{value:"å ¨åº"},"ð¥¬ å ¨åºç´ é£",-1),C("option",{value:"é¨ä»½"},"ð¥ é¨ä»½ç´ é£",-1),C("option",{value:"ç¡"},"ð ç¡ç´ é£",-1)]),512),[[Ui,u.value]]),d.value.length>0?(fe(),_e("span",_L,Me(d.value.length)+" å®¶ ",1)):ot("",!0)])]),C("div",mL,[Qe(_t(nT),{style:{height:"100%",width:"100%"},zoom:r.value,center:s.value,onReady:m},{default:Fn(()=>[Qe(_t(mT),{url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",attribution:"© OpenStreetMap contributors"}),(fe(!0),_e(Et,null,na(d.value,(y,P)=>(fe(),f_(_t(lT),{key:P,"lat-lng":y.latlng,options:{icon:e(y.name)}},{default:Fn(()=>[Qe(_t(pT),null,{default:Fn(()=>
2663[C("div",gL,[C("div",vL,Me(y.name||"æªå½å"),1),C("div",yL,[y.address?(fe(),_e("div",wL,[v[5]||(v[5]=C("span",{class:"popup-tag"},"ð",-1)),C("a",{href:`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(y.address)}`,target:"_blank",rel:"noopener noreferrer",class:"popup-link"},Me(y.address),9,bL)])):ot("",!0),y.phone?(fe(),_e("div",EL,[v[6]||(v[6]=C("span",{class:"popup-tag"},"â",-1)),C("span",null,Me(y.phone),1)])):ot("",!0),C("div",TL,[v[7]||(v[7]=C("span",{class:"popup-tag"},"â",-1)),C("span",CL,"ç¡éº©è³ªï¼"+Me(y.glutenFree||"ç¡è³æ"),1)]),y.vegetarian?(fe(),_e("div",IL,[v[8]||(v[8]=C("span",{class:"popup-tag"},"ð¥¬",-1)),C("span",null,"ç´ é£ï¼"+Me(y.vegetarian),1)])):ot("",!0),y.menu?(fe(),_e("div",SL,[v[9]||(v[9]=C("span",{class:"popup-tag"},"ð½",-1)),C("span",null,Me(y.menu),1)])):ot("",!0),y.businessHours?(fe(),_e("div",PL,[v[10]||(v[10]=C("span",{class:"popup-tag"},"â°",-1)),C("span",null,Me(y.businessHours),1)])):ot("",!0),y.category?(fe(),_e("div",xL,[v[11]||(v[11]=C("span",{class:"popup-tag"},"ð·",-1)),C("span",null,Me(y.category),1)])):ot("",!0),y.notes?(fe(),_e("div",LL,[v[12]||(v[12]=C("span",{class:"popup-tag"},"ð",-1)),C("span",null,Me(y.notes),1)])):ot("",!0),y.url?(fe(),_e("div",RL,[v[13]||(v[13]=C("span",{class:"popup-tag"},"ð",-1)),C("a",{href:y.url,target:"_blank",rel:"noopener noreferrer",class:"popup-link"}," 宿¹ç¶²ç« â ",8,AL)])):ot("",!0)])])]),_:2},1024)]),_:2},1032,["lat-lng","options"]))),128))]),_:1},8,["zoom","center"])])]))}}),OL={class:"gf-stores-page"},NL={class:"search-bar"},ML={key:0,class:"stores-grid"},DL=["href"],FL={class:"card-top"},BL={class:"store-name"},UL={class:"card-badges"},zL={class:"badge badge-type"},HL={key:0,class:"badge badge-safe"},WL={key:1,class:"badge badge-warn"},VL={key:0,class:"card-notes"},$L={key:1,class:"empty-state"},jL=Bt({__name:"WebStoresView",setup(t){const e=be([]),n=be(""),s=gt(()=>{const r=n.value.toLowerCase().trim();return(r?e.value.filter(l=>(l.name||"").toLowerCase().includes(r)||(l.product_type||"").toLowerCase().includes(r)):e.value).sort((l,u)=>l.shared_line!==u.shared_line?l.shared_line==="å¦"?-1:1:(l.name||"").localeCompare(u.name||"","zh-TW"))});return fn(()=>{Hs(rh,r=>{const a=r.val();a&&(e.value=Object.values(a))},r=>{console.error("Error loading web stores:",r)})}),(r,a)=>(fe(),_e("div",OL,[a[4]||(a[4]=C("div",{class:"page-header"},[C("h1",{class:"page-title"},"ç¡éº©è³ªç¶²è·¯åºå®¶"),C("p",{class:"page-subtitle"},"ç²¾é¸å°ç£ç¡éº©è³ªåå網路賣家")],-1)),C("div",NL,[a[1]||(a[1]=C("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round",class:"search-icon-svg"},[C("circle",{cx:"11",cy:"11",r:"7"}),C("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})],-1)),se(C("input",{class:"search-input",type:"text","onUpdate:modelValue":a[0]||(a[0]=l=>n.value=l),placeholder:"æå°åºåãç¢åé¡åâ¦"},null,512),[[Ye,n.value]])]),s.value.length>0?(fe(),_e("div",ML,[(fe(!0),_e(Et,null,na(s.value,l=>(fe(),_e("a",{key:l.name,href:l.url,target:"_blank",rel:"noopener noreferrer",class:"store-card"},[C("div",FL,[C("span",BL,Me(l.name),1),a[2]||(a[2]=C("span",{class:"card-arrow"},"â",-1))]),C("div",UL,[C("span",zL,Me(l.product_type),1),l.shared_line==="å¦"?(fe(),_e("span",HL," â å°ç¨çç¢ç· ")):l.shared_line==="æ¯"?(fe(),_e("span",WL," â å
±ç¨çç¢ç· ")):ot("",!0)]),l.notes?(fe(),_e("p",VL,Me(l.notes),1)):ot("",!0)],8,DL))),128))])):(fe(),_e("div",$L,[a[3]||(a[3]=C("span",{class:"empty-icon"},"ð",-1)),C("p",null,"æ²æç¬¦åã"+Me(n.value)+"ãçåºå®¶",1)]))]))}}),ZL=Za(jL,[["__scopeId","data-v-32767d95"]]),qL={class:"collaboration-container"},GL={class:"ui top attached tabular menu"},KL={class:"restaurant-form"},YL={class:"form-collapsed-hint"},JL={class:"form-group"},QL={class:"form-group"},XL={class:"form-group"},eR={class:"form-group"},tR={class:"form-group"},nR={class:"form-group"},iR={class:"form-group"},sR={class:"form-group"},rR={class:"form-group"},oR={class:"form-group"},aR={class:"restaurant-form"},lR={class:"form-collapsed-hint"},cR={class:"form-group"},uR={class:"form-group"},hR={class:"form-group"},dR={class:"form-group"},fR={class:"form-group"},pR={key:2,class:"success-message"},_R={key:3,class:"error-message"},mR=Bt({__name:"CollaborationView",setup(t){const e=be("physical"),n=be(!1),s=be(!1);fi(e,()=>{n.value=!1,s.value=!1});const r=be([]),a=be([]);Hs(oh,P=>{const T=P.val();T&&(r.value=Object.values(T))}),Hs(rh,P=>{const T=P.val();T&&(a.value=Object.values(T))});const l=Hi({name:"",address:"",phone:"",businessHours:"",glutenFree:"",vegetarian:"",category:"",menu:"",notes:"",url:""}),u=Hi({name:"",url:"",product_type:"",shared_line:"",notes:""}),d=be(!1),f=be(!1),m=be("");async function _(P){try{const O=`https://api.geoapify.com/v1/geocode/search?text=${encodeURIComponent(P)}&apiKey=8ec79654fd464538b929d9bf0bec0929`,B=await(await fetch(O)).json();if(console.log("Geoapify API response:",B),B.features&&B.features.length>0){const[A,R]=B.features[0].geometry.coordinates;return console.log(`Found coordinates for ${P}:`,[R,A]),[R,A]}return console.log("No coordinates found for:",P),null}catch(T){return console.error("Error fetching coordinates:",T),null}}async function v(){try{const P=await _(l.address);if(!P){f.value=!0,m.value="ç¡æ³ç²åå°å座æ¨ï¼è«ç¢ºèªå°åæ¯å¦æ£ç¢º";return}const T={...l,latlng:P,timestamp:new Date().toISOString()},O=r.value.length;await Sa(zs(Vs,"physical_stores/"+O),T),d.value=!0,n.value=!1,Object.assign(l,{name:"",address:"",phone:"",businessHours:"",glutenFree:"",vegetarian:"",category:"",menu:"",notes:"",url:"",latlng:void 0}),setTimeout(()=>{d.value=!1},3e3)}catch(P){console.error("Error submitting physical store form:",P),f.value=!0,m.value="æäº¤è³ææç¼çé¯èª¤"}}
2663async function y(){try{const P={...u,timestamp:new Date().toISOString()},T=a.value.length;await Sa(zs(Vs,"web_stores/"+T),P),d.value=!0,s.value=!1,Object.assign(u,{name:"",url:"",product_type:"",shared_line:"",notes:""}),setTimeout(()=>{d.value=!1},3e3)}catch(P){console.error("Error submitting web store form:",P),f.value=!0,m.value="æäº¤è³ææç¼çé¯èª¤"}}return(P,T)=>(fe(),_e("div",qL,[T[39]||(T[39]=C("h1",null,"æ°å¢ç¡éº©è³ªåºå®¶",-1)),C("div",GL,[C("a",{class:Wt(["item",{active:e.value==="physical"}]),onClick:T[0]||(T[0]=O=>e.value="physical")}," ä¸å³å¯¦é«åºé¢ ",2),C("a",{class:Wt(["item",{active:e.value==="web"}]),onClick:T[1]||(T[1]=O=>e.value="web")}," ä¸å³ç¶²è·¯åºé¢ ",2)]),e.value==="physical"?(fe(),_e("div",{key:0,class:Wt(["ui bottom attached tab segment",{active:e.value==="physical"}])},[C("div",KL,[se(C("p",YL," è«å
é»ã編輯ãåå¡«å¯«è³æï¼ä»¥éä½èªååæ¿«å¡«ã ",512),[[Re,!n.value]]),se(C("button",{type:"button",class:"submit-btn edit-entry-btn",onClick:T[2]||(T[2]=O=>n.value=!0)}," 編輯 ",512),[[Re,!n.value]]),se(C("form",{onSubmit:Od(v,["prevent"])},[C("div",JL,[T[19]||(T[19]=C("label",{for:"name"},"é¤å»³å稱 *",-1)),se(C("input",{type:"text",id:"name","onUpdate:modelValue":T[3]||(T[3]=O=>l.name=O),required:"",placeholder:"è«è¼¸å
¥é¤å»³å稱"},null,512),[[Ye,l.name]])]),C("div",QL,[T[20]||(T[20]=C("label",{for:"address"},"å°å *",-1)),se(C("input",{type:"text",id:"address","onUpdate:modelValue":T[4]||(T[4]=O=>l.address=O),required:"",placeholder:"è«è¼¸å
¥å®æ´å°å"},null,512),[[Ye,l.address]])]),C("div",XL,[T[21]||(T[21]=C("label",{for:"phone"},"é»è©±",-1)),se(C("input",{type:"tel",id:"phone","onUpdate:modelValue":T[5]||(T[5]=O=>l.phone=O),placeholder:"è«è¼¸å
¥é»è©±è碼"},null,512),[[Ye,l.phone]])]),C("div",eR,[T[22]||(T[22]=C("label",{for:"businessHours"},"çæ¥æé",-1)),se(C("input",{type:"text",id:"businessHours","onUpdate:modelValue":T[6]||(T[6]=O=>l.businessHours=O),placeholder:"ä¾å¦ï¼11:00-21:00"},null,512),[[Ye,l.businessHours]])]),C("div",tR,[T[23]||(T[23]=C("label",{for:"url"},"ç¶²å",-1)),se(C("input",{type:"url",id:"url","onUpdate:modelValue":T[7]||(T[7]=O=>l.url=O),placeholder:"https://..."},null,512),[[Ye,l.url]])]),C("div",nR,[T[25]||(T[25]=C("label",{for:"glutenFree"},"ç¡éº©è³ªé¸é
*",-1)),se(C("select",{id:"glutenFree","onUpdate:modelValue":T[8]||(T[8]=O=>l.glutenFree=O),required:""},T[24]||(T[24]=[C("option",{value:"å
¨"},"å
¨åºç¡éº©è³ª",-1),C("option",{value:"é¨ä»½"},"é¨åé¤é»ç¡éº©è³ª",-1),C("option",{value:"æä¾ç¡éº©è³ªèå®"},"æä¾ç¡éº©è³ªèå®",-1)]),512),[[Ui,l.glutenFree]])]),C("div",iR,[T[27]||(T[27]=C("label",{for:"vegetarian"},"ç´ é£é¸é
*",-1)),se(C("select",{id:"vegetarian","onUpdate:modelValue":T[9]||(T[9]=O=>l.vegetarian=O),required:""},T[26]||(T[26]=[C("option",{value:"å
¨åº"},"å
¨åºç´ é£",-1),C("option",{value:"é¨ä»½"},"é¨åé¤é»ç´ é£",-1),C("option",{value:"ç¡"},"ç¡ç´ é£",-1)]),512),[[Ui,l.vegetarian]])]),C("div",sR,[T[28]||(T[28]=C("label",{for:"category"},"é¤å»³é¡å",-1)),se(C("input",{type:"text",id:"category","onUpdate:modelValue":T[10]||(T[10]=O=>l.category=O),placeholder:"ä¾å¦ï¼è¥¿å¼ãä¸å¼ãçé»åºç"},null,512),[[Ye,l.category]])]),C("div",rR,[T[29]||(T[29]=C("label",{for:"menu"},"ç¡éº©è³ªé¤é»",-1)),se(C("textarea",{id:"menu","onUpdate:modelValue":T[11]||(T[11]=O=>l.menu=O),placeholder:"è«ååºç¡éº©è³ªé¤é»é¸é
",rows:"3"},null,512),[[Ye,l.menu]])]),C("div",oR,[T[30]||(T[30]=C("label",{for:"notes"},"å註",-1)),se(C("textarea",{id:"notes","onUpdate:modelValue":T[12]||(T[12]=O=>l.notes=O),placeholder:"å
¶ä»æ³è£å
çè³è¨",rows:"3"},null,512),[[Ye,l.notes]])]),T[31]||(T[31]=C("button",{type:"submit",class:"submit-btn"},"å²å",-1))],544),[[Re,n.value]])])],2)):ot("",!0),e.value==="web"?(fe(),_e("div",{key:1,class:Wt(["ui bottom attached tab segment",{active:e.value==="web"}])},[C("div",aR,[se(C("p",lR," è«å
é»ã編輯ãåå¡«å¯«è³æï¼ä»¥éä½èªååæ¿«å¡«ã ",512),[[Re,!s.value]]),se(C("button",{type:"button",class:"submit-btn edit-entry-btn",onClick:T[13]||(T[13]=O=>s.value=!0)}," 編輯 ",512),[[Re,!s.value]]),se(C("form",{onSubmit:Od(y,["prevent"])},[C("div",cR,[T[32]||(T[32]=C("label",{for:"webName"},"ååºå稱 *",-1)),se(C("input",{type:"text",id:"webName","onUpdate:modelValue":T[14]||(T[14]=O=>u.name=O),required:"",placeholder:"è«è¼¸å
¥ååºå稱"},null,512),[[Ye,u.name]])]),C("div",uR,[T[33]||(T[33]=C("label",{for:"url"},"ååºç¶²å *",-1)),se(C("input",{type:"url",id:"url","onUpdate:modelValue":T[15]||(T[15]=O=>u.url=O),required:"",placeholder:"è«è¼¸å
¥ååºç¶²å"},null,512),[[Ye,u.url]])]),C("div",hR,[T[34]||(T[34]=C("label",{for:"productType"},"ç¢åé¡å *",-1)),se(C("input",{type:"text",id:"productType","onUpdate:modelValue":T[16]||(T[16]=O=>
2663u.product_type=O),required:"",placeholder:"ä¾å¦ï¼éºµå
ãçé»ãé¶é£ç"},null,512),[[Ye,u.product_type]])]),C("div",dR,[T[36]||(T[36]=C("label",{for:"sharedLine"},"çç¢ç·çæ
*",-1)),se(C("select",{id:"sharedLine","onUpdate:modelValue":T[17]||(T[17]=O=>u.shared_line=O),required:""},T[35]||(T[35]=[C("option",{value:"å¦"},"ç¡éº©è³ªå°ç¨çç¢ç·",-1),C("option",{value:"æ¯"},"è麩質ç¢åå
±ç¨çç¢ç·",-1)]),512),[[Ui,u.shared_line]])]),C("div",fR,[T[37]||(T[37]=C("label",{for:"webNotes"},"å註",-1)),se(C("textarea",{id:"webNotes","onUpdate:modelValue":T[18]||(T[18]=O=>u.notes=O),placeholder:"å
¶ä»æ³è£å
çè³è¨",rows:"3"},null,512),[[Ye,u.notes]])]),T[38]||(T[38]=C("button",{type:"submit",class:"submit-btn"},"å²å",-1))],544),[[Re,s.value]])])],2)):ot("",!0),d.value?(fe(),_e("div",pR," è³æå·²æåå²åï¼ ")):ot("",!0),f.value?(fe(),_e("div",_R,Me(m.value),1)):ot("",!0)]))}}),gR=Za(mR,[["__scopeId","data-v-f387a722"]]),vR={class:"data-review-container"},yR={class:"ui top attached tabular menu"},wR={class:"ui stackable table"},bR=["onUpdate:modelValue"],ER=["onUpdate:modelValue"],TR=["onUpdate:modelValue"],CR=["onUpdate:modelValue"],IR=["onUpdate:modelValue"],SR=["onUpdate:modelValue"],PR=["onUpdate:modelValue"],xR=["onUpdate:modelValue"],LR={class:"cell-actions"},RR=["onClick"],AR=["onClick"],kR={class:"ui stackable table"},OR=["onUpdate:modelValue"],NR=["onUpdate:modelValue"],MR=["onUpdate:modelValue"],DR=["onUpdate:modelValue"],FR=["onUpdate:modelValue"],BR={class:"cell-actions"},UR=["onClick"],zR=["onClick"],HR={class:"content"},WR=Bt({__name:"DataReviewView",setup(t){const e=be("physical"),n=be(null),s=be(null);fi(e,()=>{n.value=null,s.value=null});const r={å
¨:"å
¨åºç¡éº©è³ª",é¨ä»½:"é¨åé¤é»ç¡éº©è³ª",æä¾ç¡éº©è³ªèå®:"æä¾ç¡éº©è³ªèå®"},a={å
¨åº:"å
¨åºç´ é£",é¨ä»½:"é¨åé¤é»ç´ é£",ç¡:"ç¡ç´ é£"},l={å¦:"ç¡éº©è³ªå°ç¨çç¢ç·",æ¯:"è麩質ç¢åå
±ç¨çç¢ç·"},u=be([]),d=be([]),f=be(!1),m=be(""),_=be("success");fn(()=>{v(),y()});function v(){Hs(oh,B=>{const A=B.val();A&&(u.value=Object.values(A))})}function y(){Hs(rh,B=>{const A=B.val();A&&(d.value=Object.values(A))})}async function P(B){try{const A=u.value[B];await Sa(zs(Vs,`physical_stores/${B}`),{...A,timestamp:new Date().toISOString()}),O("實é«åºé¢è³æå·²æ´æ°")}catch(A){console.error("Error saving physical store:",A),z("å²å實é«åºé¢è³ææç¼çé¯èª¤")}}async function T(B){try{const A=d.value[B];await Sa(zs(Vs,`web_stores/${B}`),{...A,timestamp:new Date().toISOString()}),O("網路åºé¢è³æå·²æ´æ°"),s.value=null}catch(A){console.error("Error saving web store:",A),z("å²å網路åºé¢è³ææç¼çé¯èª¤")}}function O(B){m.value=B,_.value="success",f.value=!0,setTimeout(()=>{f.value=!1},3e3)}function z(B){m.value=B,_.value="error",f.value=!0,setTimeout(()=>{f.value=!1},3e3)}return(B,A)=>(fe(),_e("div",vR,[A[9]||(A[9]=C("h1",null,"æ ¡å°åºå®¶è³æ",-1)),C("div",yR,[C("a",{class:Wt(["item",{active:e.value==="physical"}]),onClick:A[0]||(A[0]=R=>e.value="physical")}," 實é«åºé¢ ",2),C("a",{class:Wt(["item",{active:e.value==="web"}]),onClick:A[1]||(A[1]=R=>e.value="web")}," 網路åºé¢ ",2)]),e.value==="physical"?(fe(),_e("div",{key:0,class:Wt(["ui bottom attached tab segment",{active:e.value==="physical"}])},[C("div",wR,[C("table",null,[A[6]||(A[6]=C("thead",null,[C("tr",null,[C("th",null,"é¤å»³å稱"),C("th",null,"å°å"),C("th",null,"é»è©±"),C("th",null,"çæ¥æé"),C("th",null,"ç¶²å"),C("th",null,"ç¡éº©è³ªé¸é
"),C("th",null,"ç´ é£é¸é
"),C("th",null,"é¡å"),C("th",null,"æä½")])],-1)),C("tbody",null,[(fe(!0),_e(Et,null,na(u.value,(R,j)=>(fe(),_e("tr",{key:j},[C("td",null,[se(C("span",{class:"cell-readonly"},Me(R.name||"â"),513),[[Re,n.value!==j]]),se(C("input",{type:"text","onUpdate:modelValue":J=>R.name=J,class:"ui input"},null,8,bR),[[Re,n.value===j],[Ye,R.name]])]),C("td",null,[se(C("span",{class:"cell-readonly"},Me(R.address||"â"),513),[[Re,n.value!==j]]),se(C("input",{type:"text","onUpdate:modelValue":J=>R.address=J,class:"ui input"},null,8,ER),[[Re,n.value===j],[Ye,R.address]])]),C("td",null,[se(C("span",{class:"cell-readonly"},Me(R.phone||"â"),513),[[Re,n.value!==j]]),se(C("input",{type:"text","onUpdate:modelValue":J=>R.phone=J,class:"ui input"},null,8,TR),[[Re,n.value===j],[Ye,R.phone]])]),C("td",null,[se(C("span",{class:"cell-readonly"},Me(R.businessHours||"â"),513),[[Re,n.value!==j]]),se(C("input",{type:"text","onUpdate:modelValue":J=>R.businessHours=J,class:"ui input"},null,8,CR),[[Re,n.value===j],[Ye,R.businessHours]])]),C("td",null,[se(C("span",{class:"cell-readonly cell-break"},Me(R.url||"â"),513),[[Re,n.value!==j]]),se(C("input",{type:"url","onUpdate:modelValue":J=>R.url=J,class:"ui input",placeholder:"https://..."},null,8,IR),[[Re,n.value===j],[Ye,R.url]])]),C("td",null,[se(C("span",{class:"cell-readonly"},Me((r[R.glutenFree]??R.glutenFree)||"â"),513),[[Re,n.value!==j]]),se(C("select",{"onUpdate:modelValue":J=>R.glutenFree=J,class:"ui dropdown"},A[4]||(A[4]=[C("option",{value:"å
¨"},"å
¨åºç¡éº©è³ª",-1),C("option",{value:"é¨ä»½"},"é¨åé¤é»ç¡éº©è³ª",-1),C("option",{value:"æä¾ç¡éº©è³ªèå®"}
2663,"æä¾ç¡éº©è³ªèå®",-1)]),8,SR),[[Re,n.value===j],[Ui,R.glutenFree]])]),C("td",null,[se(C("span",{class:"cell-readonly"},Me((a[R.vegetarian]??R.vegetarian)||"â"),513),[[Re,n.value!==j]]),se(C("select",{"onUpdate:modelValue":J=>R.vegetarian=J,class:"ui dropdown"},A[5]||(A[5]=[C("option",{value:"å
¨åº"},"å
¨åºç´ é£",-1),C("option",{value:"é¨ä»½"},"é¨åé¤é»ç´ é£",-1),C("option",{value:"ç¡"},"ç¡ç´ é£",-1)]),8,PR),[[Re,n.value===j],[Ui,R.vegetarian]])]),C("td",null,[se(C("span",{class:"cell-readonly"},Me(R.category||"â"),513),[[Re,n.value!==j]]),se(C("input",{type:"text","onUpdate:modelValue":J=>R.category=J,class:"ui input"},null,8,xR),[[Re,n.value===j],[Ye,R.category]])]),C("td",LR,[n.value!==j?(fe(),_e("button",{key:0,type:"button",class:"ui button",onClick:J=>n.value=j},"編輯",8,RR)):(fe(),_e(Et,{key:1},[C("button",{type:"button",class:"ui primary button",onClick:J=>P(j)},"å²å",8,AR),C("button",{type:"button",class:"ui button",onClick:A[2]||(A[2]=J=>n.value=null)},"åæ¶")],64))])]))),128))])])])],2)):ot("",!0),e.value==="web"?(fe(),_e("div",{key:1,class:Wt(["ui bottom attached tab segment",{active:e.value==="web"}])},[C("div",kR,[C("table",null,[A[8]||(A[8]=C("thead",null,[C("tr",null,[C("th",null,"ååºå稱"),C("th",null,"ç¶²å"),C("th",null,"ç¢åé¡å"),C("th",null,"çç¢ç·çæ
"),C("th",null,"å註"),C("th",null,"æä½")])],-1)),C("tbody",null,[(fe(!0),_e(Et,null,na(d.value,(R,j)=>(fe(),_e("tr",{key:j},[C("td",null,[se(C("span",{class:"cell-readonly"},Me(R.name||"â"),513),[[Re,s.value!==j]]),se(C("input",{type:"text","onUpdate:modelValue":J=>R.name=J,class:"ui input"},null,8,OR),[[Re,s.value===j],[Ye,R.name]])]),C("td",null,[se(C("span",{class:"cell-readonly cell-break"},Me(R.url||"â"),513),[[Re,s.value!==j]]),se(C("input",{type:"url","onUpdate:modelValue":J=>R.url=J,class:"ui input"},null,8,NR),[[Re,s.value===j],[Ye,R.url]])]),C("td",null,[se(C("span",{class:"cell-readonly"},Me(R.product_type||"â"),513),[[Re,s.value!==j]]),se(C("input",{type:"text","onUpdate:modelValue":J=>R.product_type=J,class:"ui input"},null,8,MR),[[Re,s.value===j],[Ye,R.product_type]])]),C("td",null,[se(C("span",{class:"cell-readonly"},Me((l[R.shared_line]??R.shared_line)||"â"),513),[[Re,s.value!==j]]),se(C("select",{"onUpdate:modelValue":J=>R.shared_line=J,class:"ui dropdown"},A[7]||(A[7]=[C("option",{value:"å¦"},"ç¡éº©è³ªå°ç¨çç¢ç·",-1),C("option",{value:"æ¯"},"è麩質ç¢åå
±ç¨çç¢ç·",-1)]),8,DR),[[Re,s.value===j],[Ui,R.shared_line]])]),C("td",null,[se(C("span",{class:"cell-readonly cell-break"},Me(R.notes||"â"),513),[[Re,s.value!==j]]),se(C("input",{type:"text","onUpdate:modelValue":J=>R.notes=J,class:"ui input"},null,8,FR),[[Re,s.value===j],[Ye,R.notes]])]),C("td",BR,[s.value!==j?(fe(),_e("button",{key:0,type:"button",class:"ui button",onClick:J=>s.value=j},"編輯",8,UR)):(fe(),_e(Et,{key:1},[C("button",{type:"button",class:"ui primary button",onClick:J=>T(j)},"å²å",8,zR),C("button",{type:"button",class:"ui button",onClick:A[3]||(A[3]=J=>s.value=null)},"åæ¶")],64))])]))),128))])])])],2)):ot("",!0),f.value?(fe(),_e("div",{key:2,class:Wt(["ui message",_.value])},[C("div",HR,[C("p",null,Me(m.value),1)])],2)):ot("",!0)]))}}),VR=Za(WR,[["__scopeId","data-v-e84915c1"]]),$R=ME({history:dE("/"),routes:[{path:"/",name:"home",component:kL},{path:"/web-stores",name:"web-stores",component:ZL},{path:"/collaborate",name:"collaborate",component:gR},{path:"/review",name:"review",component:VR},{path:"/about",name:"about",component:()=>en(()=>import("./AboutView--ScQy70s.js"),__vite__mapDeps([0,1]))}]}),nv=Ob(WE);nv.use($R);nv.mount("#app");export{Za as _,C as a,_e as c,fe as o};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.