Files
PilotVault/Web App/server/dist/assets/index-DLbqB6QP.js
T
tajniak81andClaude Opus 4.8 e9b27530ec Add drone-pilot logbook system (BEK 1649 §5)
Model Denmark's Dronebekendtgørelsen § 5 (on top of EU 2019/947) across all
three tiers: schema, API Server, and Web App.

Schema (migration 1720300700_add_logbook.js): two collections — `drones`
(classification inputs: mtom, is_toy, autologs, c_class, operator no.) and
`flights` (§5 minimum content + category/purpose/logging-path + operational
maturity + a retention_until computed as operation_date + 5y). Locked API
rules; access flows through the service account like users/orgs.

API Server (logbook.go, logbook_export.go): /api/drones and /api/flights CRUD
with per-role scoping in Go (user→own, admin→org, superadmin→all), plus
GET /api/logbook/export (CSV — the "readable electronic format" for
Trafikstyrelsen / pending police disclosure). Compliance is computed
server-side per flight: exemption (toy / club-area / <250 g hobby), effective
logging path, and red flags (autologs-without-FDR, specific-category-without-
authorisation, missing §5 fields, past retention). Manual-path saves missing a
§5 field are blocked (422).

Web App: BFF proxies (export preserves the CSV Content-Type/Disposition),
api.js client fns, and a Logbook.vue view (Flights/Drones tabs, inline forms,
compliance badges + expandable detail, Export CSV) wired into Dashboard.vue,
replacing the placeholder. Includes the rebuilt embedded dist bundle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-13 13:11:39 +02:00

21 lines
371 KiB
JavaScript

(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const d of l)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&a(h)}).observe(document,{childList:!0,subtree:!0});function o(l){const d={};return l.integrity&&(d.integrity=l.integrity),l.referrerPolicy&&(d.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?d.credentials="include":l.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function a(l){if(l.ep)return;l.ep=!0;const d=o(l);fetch(l.href,d)}})();/**
* @vue/shared v3.5.39
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function ya(e){const i=Object.create(null);for(const o of e.split(","))i[o]=1;return o=>o in i}const ue={},vs=[],Zn=()=>{},su=()=>!1,ur=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),cr=e=>e.startsWith("onUpdate:"),Oe=Object.assign,ba=(e,i)=>{const o=e.indexOf(i);o>-1&&e.splice(o,1)},Qc=Object.prototype.hasOwnProperty,ee=(e,i)=>Qc.call(e,i),wt=Array.isArray,ys=e=>po(e)==="[object Map]",Ls=e=>po(e)==="[object Set]",sl=e=>po(e)==="[object Date]",Dt=e=>typeof e=="function",be=e=>typeof e=="string",Cn=e=>typeof e=="symbol",ne=e=>e!==null&&typeof e=="object",ou=e=>(ne(e)||Dt(e))&&Dt(e.then)&&Dt(e.catch),ru=Object.prototype.toString,po=e=>ru.call(e),td=e=>po(e).slice(8,-1),au=e=>po(e)==="[object Object]",xa=e=>be(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Xs=ya(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),dr=e=>{const i=Object.create(null);return(o=>i[o]||(i[o]=e(o)))},ed=/-\w/g,Tn=dr(e=>e.replace(ed,i=>i.slice(1).toUpperCase())),nd=/\B([A-Z])/g,Li=dr(e=>e.replace(nd,"-$1").toLowerCase()),lu=dr(e=>e.charAt(0).toUpperCase()+e.slice(1)),Wr=dr(e=>e?`on${lu(e)}`:""),Vn=(e,i)=>!Object.is(e,i),qo=(e,...i)=>{for(let o=0;o<e.length;o++)e[o](...i)},uu=(e,i,o,a=!1)=>{Object.defineProperty(e,i,{configurable:!0,enumerable:!1,writable:a,value:o})},fr=e=>{const i=parseFloat(e);return isNaN(i)?e:i},id=e=>{const i=be(e)?Number(e):NaN;return isNaN(i)?e:i};let ol;const hr=()=>ol||(ol=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ss(e){if(wt(e)){const i={};for(let o=0;o<e.length;o++){const a=e[o],l=be(a)?ad(a):Ss(a);if(l)for(const d in l)i[d]=l[d]}return i}else if(be(e)||ne(e))return e}const sd=/;(?![^(]*\))/g,od=/:([^]+)/,rd=/\/\*[^]*?\*\//g;function ad(e){const i={};return e.replace(rd,"").split(sd).forEach(o=>{if(o){const a=o.split(od);a.length>1&&(i[a[0].trim()]=a[1].trim())}}),i}function Ct(e){let i="";if(be(e))i=e;else if(wt(e))for(let o=0;o<e.length;o++){const a=Ct(e[o]);a&&(i+=a+" ")}else if(ne(e))for(const o in e)e[o]&&(i+=o+" ");return i.trim()}const ld="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ud=ya(ld);function cu(e){return!!e||e===""}function cd(e,i){if(e.length!==i.length)return!1;let o=!0;for(let a=0;o&&a<e.length;a++)o=Si(e[a],i[a]);return o}function Si(e,i){if(e===i)return!0;let o=sl(e),a=sl(i);if(o||a)return o&&a?e.getTime()===i.getTime():!1;if(o=Cn(e),a=Cn(i),o||a)return e===i;if(o=wt(e),a=wt(i),o||a)return o&&a?cd(e,i):!1;if(o=ne(e),a=ne(i),o||a){if(!o||!a)return!1;const l=Object.keys(e).length,d=Object.keys(i).length;if(l!==d)return!1;for(const h in e){const _=e.hasOwnProperty(h),y=i.hasOwnProperty(h);if(_&&!y||!_&&y||!Si(e[h],i[h]))return!1}}return String(e)===String(i)}function wa(e,i){return e.findIndex(o=>Si(o,i))}const du=e=>!!(e&&e.__v_isRef===!0),P=e=>be(e)?e:e==null?"":wt(e)||ne(e)&&(e.toString===ru||!Dt(e.toString))?du(e)?P(e.value):JSON.stringify(e,fu,2):String(e),fu=(e,i)=>du(i)?fu(e,i.value):ys(i)?{[`Map(${i.size})`]:[...i.entries()].reduce((o,[a,l],d)=>(o[Kr(a,d)+" =>"]=l,o),{})}:Ls(i)?{[`Set(${i.size})`]:[...i.values()].map(o=>Kr(o))}:Cn(i)?Kr(i):ne(i)&&!wt(i)&&!au(i)?String(i):i,Kr=(e,i="")=>{var o;return Cn(e)?`Symbol(${(o=e.description)!=null?o:i})`:e};/**
* @vue/reactivity v3.5.39
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Ae;class dd{constructor(i=!1){this.detached=i,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!i&&Ae&&(Ae.active?(this.parent=Ae,this.index=(Ae.scopes||(Ae.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let i,o;if(this.scopes)for(i=0,o=this.scopes.length;i<o;i++)this.scopes[i].pause();for(i=0,o=this.effects.length;i<o;i++)this.effects[i].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let i,o;if(this.scopes)for(i=0,o=this.scopes.length;i<o;i++)this.scopes[i].resume();for(i=0,o=this.effects.length;i<o;i++)this.effects[i].resume()}}run(i){if(this._active){const o=Ae;try{return Ae=this,i()}finally{Ae=o}}}on(){++this._on===1&&(this.prevScope=Ae,Ae=this)}off(){if(this._on>0&&--this._on===0){if(Ae===this)Ae=this.prevScope;else{let i=Ae;for(;i;){if(i.prevScope===this){i.prevScope=this.prevScope;break}i=i.prevScope}}this.prevScope=void 0}}stop(i){if(this._active){this._active=!1;let o,a;for(o=0,a=this.effects.length;o<a;o++)this.effects[o].stop();for(this.effects.length=0,o=0,a=this.cleanups.length;o<a;o++)this.cleanups[o]();if(this.cleanups.length=0,this.scopes){for(o=0,a=this.scopes.length;o<a;o++)this.scopes[o].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!i){const l=this.parent.scopes.pop();l&&l!==this&&(this.parent.scopes[this.index]=l,l.index=this.index)}this.parent=void 0}}}function fd(){return Ae}let fe;const Gr=new WeakSet;class hu{constructor(i){this.fn=i,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ae&&(Ae.active?Ae.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Gr.has(this)&&(Gr.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||mu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,rl(this),gu(this);const i=fe,o=Ln;fe=this,Ln=!0;try{return this.fn()}finally{_u(this),fe=i,Ln=o,this.flags&=-3}}stop(){if(this.flags&1){for(let i=this.deps;i;i=i.nextDep)Pa(i);this.deps=this.depsTail=void 0,rl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Gr.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){sa(this)&&this.run()}get dirty(){return sa(this)}}let pu=0,Qs,to;function mu(e,i=!1){if(e.flags|=8,i){e.next=to,to=e;return}e.next=Qs,Qs=e}function ka(){pu++}function Sa(){if(--pu>0)return;if(to){let i=to;for(to=void 0;i;){const o=i.next;i.next=void 0,i.flags&=-9,i=o}}let e;for(;Qs;){let i=Qs;for(Qs=void 0;i;){const o=i.next;if(i.next=void 0,i.flags&=-9,i.flags&1)try{i.trigger()}catch(a){e||(e=a)}i=o}}if(e)throw e}function gu(e){for(let i=e.deps;i;i=i.nextDep)i.version=-1,i.prevActiveLink=i.dep.activeLink,i.dep.activeLink=i}function _u(e){let i,o=e.depsTail,a=o;for(;a;){const l=a.prevDep;a.version===-1?(a===o&&(o=l),Pa(a),hd(a)):i=a,a.dep.activeLink=a.prevActiveLink,a.prevActiveLink=void 0,a=l}e.deps=i,e.depsTail=o}function sa(e){for(let i=e.deps;i;i=i.nextDep)if(i.dep.version!==i.version||i.dep.computed&&(vu(i.dep.computed)||i.dep.version!==i.version))return!0;return!!e._dirty}function vu(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===oo)||(e.globalVersion=oo,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!sa(e))))return;e.flags|=2;const i=e.dep,o=fe,a=Ln;fe=e,Ln=!0;try{gu(e);const l=e.fn(e._value);(i.version===0||Vn(l,e._value))&&(e.flags|=128,e._value=l,i.version++)}catch(l){throw i.version++,l}finally{fe=o,Ln=a,_u(e),e.flags&=-3}}function Pa(e,i=!1){const{dep:o,prevSub:a,nextSub:l}=e;if(a&&(a.nextSub=l,e.prevSub=void 0),l&&(l.prevSub=a,e.nextSub=void 0),o.subs===e&&(o.subs=a,!a&&o.computed)){o.computed.flags&=-5;for(let d=o.computed.deps;d;d=d.nextDep)Pa(d,!0)}!i&&!--o.sc&&o.map&&o.map.delete(o.key)}function hd(e){const{prevDep:i,nextDep:o}=e;i&&(i.nextDep=o,e.prevDep=void 0),o&&(o.prevDep=i,e.nextDep=void 0)}let Ln=!0;const yu=[];function Un(){yu.push(Ln),Ln=!1}function Hn(){const e=yu.pop();Ln=e===void 0?!0:e}function rl(e){const{cleanup:i}=e;if(e.cleanup=void 0,i){const o=fe;fe=void 0;try{i()}finally{fe=o}}}let oo=0;class pd{constructor(i,o){this.sub=i,this.dep=o,this.version=o.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ta{constructor(i){this.computed=i,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(i){if(!fe||!Ln||fe===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==fe)o=this.activeLink=new pd(fe,this),fe.deps?(o.prevDep=fe.depsTail,fe.depsTail.nextDep=o,fe.depsTail=o):fe.deps=fe.depsTail=o,bu(o);else if(o.version===-1&&(o.version=this.version,o.nextDep)){const a=o.nextDep;a.prevDep=o.prevDep,o.prevDep&&(o.prevDep.nextDep=a),o.prevDep=fe.depsTail,o.nextDep=void 0,fe.depsTail.nextDep=o,fe.depsTail=o,fe.deps===o&&(fe.deps=a)}return o}trigger(i){this.version++,oo++,this.notify(i)}notify(i){ka();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{Sa()}}}function bu(e){if(e.dep.sc++,e.sub.flags&4){const i=e.dep.computed;if(i&&!e.dep.subs){i.flags|=20;for(let a=i.deps;a;a=a.nextDep)bu(a)}const o=e.dep.subs;o!==e&&(e.prevSub=o,o&&(o.nextSub=e)),e.dep.subs=e}}const oa=new WeakMap,Ki=Symbol(""),ra=Symbol(""),ro=Symbol("");function De(e,i,o){if(Ln&&fe){let a=oa.get(e);a||oa.set(e,a=new Map);let l=a.get(o);l||(a.set(o,l=new Ta),l.map=a,l.key=o),l.track()}}function oi(e,i,o,a,l,d){const h=oa.get(e);if(!h){oo++;return}const _=y=>{y&&y.trigger()};if(ka(),i==="clear")h.forEach(_);else{const y=wt(e),T=y&&xa(o);if(y&&o==="length"){const w=Number(a);h.forEach((A,U)=>{(U==="length"||U===ro||!Cn(U)&&U>=w)&&_(A)})}else switch((o!==void 0||h.has(void 0))&&_(h.get(o)),T&&_(h.get(ro)),i){case"add":y?T&&_(h.get("length")):(_(h.get(Ki)),ys(e)&&_(h.get(ra)));break;case"delete":y||(_(h.get(Ki)),ys(e)&&_(h.get(ra)));break;case"set":ys(e)&&_(h.get(Ki));break}}Sa()}function gs(e){const i=Xt(e);return i===e?i:(De(i,"iterate",ro),mn(e)?i:i.map(Mn))}function pr(e){return De(e=Xt(e),"iterate",ro),e}function Fn(e,i){return li(e)?Ps(Gi(e)?Mn(i):i):Mn(i)}const md={__proto__:null,[Symbol.iterator](){return qr(this,Symbol.iterator,e=>Fn(this,e))},concat(...e){return gs(this).concat(...e.map(i=>wt(i)?gs(i):i))},entries(){return qr(this,"entries",e=>(e[1]=Fn(this,e[1]),e))},every(e,i){return ei(this,"every",e,i,void 0,arguments)},filter(e,i){return ei(this,"filter",e,i,o=>o.map(a=>Fn(this,a)),arguments)},find(e,i){return ei(this,"find",e,i,o=>Fn(this,o),arguments)},findIndex(e,i){return ei(this,"findIndex",e,i,void 0,arguments)},findLast(e,i){return ei(this,"findLast",e,i,o=>Fn(this,o),arguments)},findLastIndex(e,i){return ei(this,"findLastIndex",e,i,void 0,arguments)},forEach(e,i){return ei(this,"forEach",e,i,void 0,arguments)},includes(...e){return Yr(this,"includes",e)},indexOf(...e){return Yr(this,"indexOf",e)},join(e){return gs(this).join(e)},lastIndexOf(...e){return Yr(this,"lastIndexOf",e)},map(e,i){return ei(this,"map",e,i,void 0,arguments)},pop(){return js(this,"pop")},push(...e){return js(this,"push",e)},reduce(e,...i){return al(this,"reduce",e,i)},reduceRight(e,...i){return al(this,"reduceRight",e,i)},shift(){return js(this,"shift")},some(e,i){return ei(this,"some",e,i,void 0,arguments)},splice(...e){return js(this,"splice",e)},toReversed(){return gs(this).toReversed()},toSorted(e){return gs(this).toSorted(e)},toSpliced(...e){return gs(this).toSpliced(...e)},unshift(...e){return js(this,"unshift",e)},values(){return qr(this,"values",e=>Fn(this,e))}};function qr(e,i,o){const a=pr(e),l=a[i]();return a!==e&&!mn(e)&&(l._next=l.next,l.next=()=>{const d=l._next();return d.done||(d.value=o(d.value)),d}),l}const gd=Array.prototype;function ei(e,i,o,a,l,d){const h=pr(e),_=h!==e&&!mn(e),y=h[i];if(y!==gd[i]){const A=y.apply(e,d);return _?Mn(A):A}let T=o;h!==e&&(_?T=function(A,U){return o.call(this,Fn(e,A),U,e)}:o.length>2&&(T=function(A,U){return o.call(this,A,U,e)}));const w=y.call(h,T,a);return _&&l?l(w):w}function al(e,i,o,a){const l=pr(e),d=l!==e&&!mn(e);let h=o,_=!1;l!==e&&(d?(_=a.length===0,h=function(T,w,A){return _&&(_=!1,T=Fn(e,T)),o.call(this,T,Fn(e,w),A,e)}):o.length>3&&(h=function(T,w,A){return o.call(this,T,w,A,e)}));const y=l[i](h,...a);return _?Fn(e,y):y}function Yr(e,i,o){const a=Xt(e);De(a,"iterate",ro);const l=a[i](...o);return(l===-1||l===!1)&&Ma(o[0])?(o[0]=Xt(o[0]),a[i](...o)):l}function js(e,i,o=[]){Un(),ka();const a=Xt(e)[i].apply(e,o);return Sa(),Hn(),a}const _d=ya("__proto__,__v_isRef,__isVue"),xu=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Cn));function vd(e){Cn(e)||(e=String(e));const i=Xt(this);return De(i,"has",e),i.hasOwnProperty(e)}class wu{constructor(i=!1,o=!1){this._isReadonly=i,this._isShallow=o}get(i,o,a){if(o==="__v_skip")return i.__v_skip;const l=this._isReadonly,d=this._isShallow;if(o==="__v_isReactive")return!l;if(o==="__v_isReadonly")return l;if(o==="__v_isShallow")return d;if(o==="__v_raw")return a===(l?d?Cd:Tu:d?Pu:Su).get(i)||Object.getPrototypeOf(i)===Object.getPrototypeOf(a)?i:void 0;const h=wt(i);if(!l){let y;if(h&&(y=md[o]))return y;if(o==="hasOwnProperty")return vd}const _=Reflect.get(i,o,Fe(i)?i:a);if((Cn(o)?xu.has(o):_d(o))||(l||De(i,"get",o),d))return _;if(Fe(_)){const y=h&&xa(o)?_:_.value;return l&&ne(y)?la(y):y}return ne(_)?l?la(_):xe(_):_}}class ku extends wu{constructor(i=!1){super(!1,i)}set(i,o,a,l){let d=i[o];const h=wt(i)&&xa(o);if(!this._isShallow){const T=li(d);if(!mn(a)&&!li(a)&&(d=Xt(d),a=Xt(a)),!h&&Fe(d)&&!Fe(a))return T||(d.value=a),!0}const _=h?Number(o)<i.length:ee(i,o),y=Reflect.set(i,o,a,Fe(i)?i:l);return i===Xt(l)&&y&&(_?Vn(a,d)&&oi(i,"set",o,a):oi(i,"add",o,a)),y}deleteProperty(i,o){const a=ee(i,o);i[o];const l=Reflect.deleteProperty(i,o);return l&&a&&oi(i,"delete",o,void 0),l}has(i,o){const a=Reflect.has(i,o);return(!Cn(o)||!xu.has(o))&&De(i,"has",o),a}ownKeys(i){return De(i,"iterate",wt(i)?"length":Ki),Reflect.ownKeys(i)}}class yd extends wu{constructor(i=!1){super(!0,i)}set(i,o){return!0}deleteProperty(i,o){return!0}}const bd=new ku,xd=new yd,wd=new ku(!0);const aa=e=>e,Uo=e=>Reflect.getPrototypeOf(e);function kd(e,i,o){return function(...a){const l=this.__v_raw,d=Xt(l),h=ys(d),_=e==="entries"||e===Symbol.iterator&&h,y=e==="keys"&&h,T=l[e](...a),w=o?aa:i?Ps:Mn;return!i&&De(d,"iterate",y?ra:Ki),Oe(Object.create(T),{next(){const{value:A,done:U}=T.next();return U?{value:A,done:U}:{value:_?[w(A[0]),w(A[1])]:w(A),done:U}}})}}function Ho(e){return function(...i){return e==="delete"?!1:e==="clear"?void 0:this}}function Sd(e,i){const o={get(l){const d=this.__v_raw,h=Xt(d),_=Xt(l);e||(Vn(l,_)&&De(h,"get",l),De(h,"get",_));const{has:y}=Uo(h),T=i?aa:e?Ps:Mn;if(y.call(h,l))return T(d.get(l));if(y.call(h,_))return T(d.get(_));d!==h&&d.get(l)},get size(){const l=this.__v_raw;return!e&&De(Xt(l),"iterate",Ki),l.size},has(l){const d=this.__v_raw,h=Xt(d),_=Xt(l);return e||(Vn(l,_)&&De(h,"has",l),De(h,"has",_)),l===_?d.has(l):d.has(l)||d.has(_)},forEach(l,d){const h=this,_=h.__v_raw,y=Xt(_),T=i?aa:e?Ps:Mn;return!e&&De(y,"iterate",Ki),_.forEach((w,A)=>l.call(d,T(w),T(A),h))}};return Oe(o,e?{add:Ho("add"),set:Ho("set"),delete:Ho("delete"),clear:Ho("clear")}:{add(l){const d=Xt(this),h=Uo(d),_=Xt(l),y=!i&&!mn(l)&&!li(l)?_:l;return h.has.call(d,y)||Vn(l,y)&&h.has.call(d,l)||Vn(_,y)&&h.has.call(d,_)||(d.add(y),oi(d,"add",y,y)),this},set(l,d){!i&&!mn(d)&&!li(d)&&(d=Xt(d));const h=Xt(this),{has:_,get:y}=Uo(h);let T=_.call(h,l);T||(l=Xt(l),T=_.call(h,l));const w=y.call(h,l);return h.set(l,d),T?Vn(d,w)&&oi(h,"set",l,d):oi(h,"add",l,d),this},delete(l){const d=Xt(this),{has:h,get:_}=Uo(d);let y=h.call(d,l);y||(l=Xt(l),y=h.call(d,l)),_&&_.call(d,l);const T=d.delete(l);return y&&oi(d,"delete",l,void 0),T},clear(){const l=Xt(this),d=l.size!==0,h=l.clear();return d&&oi(l,"clear",void 0,void 0),h}}),["keys","values","entries",Symbol.iterator].forEach(l=>{o[l]=kd(l,e,i)}),o}function La(e,i){const o=Sd(e,i);return(a,l,d)=>l==="__v_isReactive"?!e:l==="__v_isReadonly"?e:l==="__v_raw"?a:Reflect.get(ee(o,l)&&l in a?o:a,l,d)}const Pd={get:La(!1,!1)},Td={get:La(!1,!0)},Ld={get:La(!0,!1)};const Su=new WeakMap,Pu=new WeakMap,Tu=new WeakMap,Cd=new WeakMap;function Md(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function xe(e){return li(e)?e:Ca(e,!1,bd,Pd,Su)}function Od(e){return Ca(e,!1,wd,Td,Pu)}function la(e){return Ca(e,!0,xd,Ld,Tu)}function Ca(e,i,o,a,l){if(!ne(e)||e.__v_raw&&!(i&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const d=l.get(e);if(d)return d;const h=Md(td(e));if(h===0)return e;const _=new Proxy(e,h===2?a:o);return l.set(e,_),_}function Gi(e){return li(e)?Gi(e.__v_raw):!!(e&&e.__v_isReactive)}function li(e){return!!(e&&e.__v_isReadonly)}function mn(e){return!!(e&&e.__v_isShallow)}function Ma(e){return e?!!e.__v_raw:!1}function Xt(e){const i=e&&e.__v_raw;return i?Xt(i):e}function Ed(e){return!ee(e,"__v_skip")&&Object.isExtensible(e)&&uu(e,"__v_skip",!0),e}const Mn=e=>ne(e)?xe(e):e,Ps=e=>ne(e)?la(e):e;function Fe(e){return e?e.__v_isRef===!0:!1}function G(e){return zd(e,!1)}function zd(e,i){return Fe(e)?e:new Ad(e,i)}class Ad{constructor(i,o){this.dep=new Ta,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?i:Xt(i),this._value=o?i:Mn(i),this.__v_isShallow=o}get value(){return this.dep.track(),this._value}set value(i){const o=this._rawValue,a=this.__v_isShallow||mn(i)||li(i);i=a?i:Xt(i),Vn(i,o)&&(this._rawValue=i,this._value=a?i:Mn(i),this.dep.trigger())}}function $t(e){return Fe(e)?e.value:e}const Id={get:(e,i,o)=>i==="__v_raw"?e:$t(Reflect.get(e,i,o)),set:(e,i,o,a)=>{const l=e[i];return Fe(l)&&!Fe(o)?(l.value=o,!0):Reflect.set(e,i,o,a)}};function Lu(e){return Gi(e)?e:new Proxy(e,Id)}class $d{constructor(i,o,a){this.fn=i,this.setter=o,this._value=void 0,this.dep=new Ta(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=oo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=a}notify(){if(this.flags|=16,!(this.flags&8)&&fe!==this)return mu(this,!0),!0}get value(){const i=this.dep.track();return vu(this),i&&(i.version=this.dep.version),this._value}set value(i){this.setter&&this.setter(i)}}function Dd(e,i,o=!1){let a,l;return Dt(e)?a=e:(a=e.get,l=e.set),new $d(a,l,o)}const jo={},Jo=new WeakMap;let ji;function Nd(e,i=!1,o=ji){if(o){let a=Jo.get(o);a||Jo.set(o,a=[]),a.push(e)}}function Rd(e,i,o=ue){const{immediate:a,deep:l,once:d,scheduler:h,augmentJob:_,call:y}=o,T=it=>l?it:mn(it)||l===!1||l===0?ri(it,1):ri(it);let w,A,U,V,rt=!1,Q=!1;if(Fe(e)?(A=()=>e.value,rt=mn(e)):Gi(e)?(A=()=>T(e),rt=!0):wt(e)?(Q=!0,rt=e.some(it=>Gi(it)||mn(it)),A=()=>e.map(it=>{if(Fe(it))return it.value;if(Gi(it))return T(it);if(Dt(it))return y?y(it,2):it()})):Dt(e)?i?A=y?()=>y(e,2):e:A=()=>{if(U){Un();try{U()}finally{Hn()}}const it=ji;ji=w;try{return y?y(e,3,[V]):e(V)}finally{ji=it}}:A=Zn,i&&l){const it=A,ht=l===!0?1/0:l;A=()=>ri(it(),ht)}const Ot=fd(),Mt=()=>{w.stop(),Ot&&Ot.active&&ba(Ot.effects,w)};if(d&&i){const it=i;i=(...ht)=>{const Kt=it(...ht);return Mt(),Kt}}let q=Q?new Array(e.length).fill(jo):jo;const dt=it=>{if(!(!(w.flags&1)||!w.dirty&&!it))if(i){const ht=w.run();if(it||l||rt||(Q?ht.some((Kt,he)=>Vn(Kt,q[he])):Vn(ht,q))){U&&U();const Kt=ji;ji=w;try{const he=[ht,q===jo?void 0:Q&&q[0]===jo?[]:q,V];q=ht,y?y(i,3,he):i(...he)}finally{ji=Kt}}}else w.run()};return _&&_(dt),w=new hu(A),w.scheduler=h?()=>h(dt,!1):dt,V=it=>Nd(it,!1,w),U=w.onStop=()=>{const it=Jo.get(w);if(it){if(y)y(it,4);else for(const ht of it)ht();Jo.delete(w)}},i?a?dt(!0):q=w.run():h?h(dt.bind(null,!0),!0):w.run(),Mt.pause=w.pause.bind(w),Mt.resume=w.resume.bind(w),Mt.stop=Mt,Mt}function ri(e,i=1/0,o){if(i<=0||!ne(e)||e.__v_skip||(o=o||new Map,(o.get(e)||0)>=i))return e;if(o.set(e,i),i--,Fe(e))ri(e.value,i,o);else if(wt(e))for(let a=0;a<e.length;a++)ri(e[a],i,o);else if(Ls(e)||ys(e))e.forEach(a=>{ri(a,i,o)});else if(au(e)){for(const a in e)ri(e[a],i,o);for(const a of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,a)&&ri(e[a],i,o)}return e}/**
* @vue/runtime-core v3.5.39
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function mo(e,i,o,a){try{return a?e(...a):e()}catch(l){mr(l,i,o)}}function _n(e,i,o,a){if(Dt(e)){const l=mo(e,i,o,a);return l&&ou(l)&&l.catch(d=>{mr(d,i,o)}),l}if(wt(e)){const l=[];for(let d=0;d<e.length;d++)l.push(_n(e[d],i,o,a));return l}}function mr(e,i,o,a=!0){const l=i?i.vnode:null,{errorHandler:d,throwUnhandledErrorInProduction:h}=i&&i.appContext.config||ue;if(i){let _=i.parent;const y=i.proxy,T=`https://vuejs.org/error-reference/#runtime-${o}`;for(;_;){const w=_.ec;if(w){for(let A=0;A<w.length;A++)if(w[A](e,y,T)===!1)return}_=_.parent}if(d){Un(),mo(d,null,10,[e,y,T]),Hn();return}}Fd(e,o,l,a,h)}function Fd(e,i,o,a=!0,l=!1){if(l)throw e;console.error(e)}const We=[];let Rn=-1;const bs=[];let ki=null,_s=0;const Cu=Promise.resolve();let Xo=null;function Mu(e){const i=Xo||Cu;return e?i.then(this?e.bind(this):e):i}function Bd(e){let i=Rn+1,o=We.length;for(;i<o;){const a=i+o>>>1,l=We[a],d=ao(l);d<e||d===e&&l.flags&2?i=a+1:o=a}return i}function Oa(e){if(!(e.flags&1)){const i=ao(e),o=We[We.length-1];!o||!(e.flags&2)&&i>=ao(o)?We.push(e):We.splice(Bd(i),0,e),e.flags|=1,Ou()}}function Ou(){Xo||(Xo=Cu.then(zu))}function Vd(e){wt(e)?bs.push(...e):ki&&e.id===-1?ki.splice(_s+1,0,e):e.flags&1||(bs.push(e),e.flags|=1),Ou()}function ll(e,i,o=Rn+1){for(;o<We.length;o++){const a=We[o];if(a&&a.flags&2){if(e&&a.id!==e.uid)continue;We.splice(o,1),o--,a.flags&4&&(a.flags&=-2),a(),a.flags&4||(a.flags&=-2)}}}function Eu(e){if(bs.length){const i=[...new Set(bs)].sort((o,a)=>ao(o)-ao(a));if(bs.length=0,ki){ki.push(...i);return}for(ki=i,_s=0;_s<ki.length;_s++){const o=ki[_s];o.flags&4&&(o.flags&=-2),o.flags&8||o(),o.flags&=-2}ki=null,_s=0}}const ao=e=>e.id==null?e.flags&2?-1:1/0:e.id;function zu(e){try{for(Rn=0;Rn<We.length;Rn++){const i=We[Rn];i&&!(i.flags&8)&&(i.flags&4&&(i.flags&=-2),mo(i,i.i,i.i?15:14),i.flags&4||(i.flags&=-2))}}finally{for(;Rn<We.length;Rn++){const i=We[Rn];i&&(i.flags&=-2)}Rn=-1,We.length=0,Eu(),Xo=null,(We.length||bs.length)&&zu()}}let Re=null,Au=null;function Qo(e){const i=Re;return Re=e,Au=e&&e.type.__scopeId||null,i}function mt(e,i=Re,o){if(!i||e._n)return e;const a=(...l)=>{a._d&&nr(-1);const d=Qo(i);let h;try{h=e(...l)}finally{Qo(d),a._d&&nr(1)}return h};return a._n=!0,a._c=!0,a._d=!0,a}function ot(e,i){if(Re===null)return e;const o=xr(Re),a=e.dirs||(e.dirs=[]);for(let l=0;l<i.length;l++){let[d,h,_,y=ue]=i[l];d&&(Dt(d)&&(d={mounted:d,updated:d}),d.deep&&ri(h),a.push({dir:d,instance:o,value:h,oldValue:void 0,arg:_,modifiers:y}))}return e}function Vi(e,i,o,a){const l=e.dirs,d=i&&i.dirs;for(let h=0;h<l.length;h++){const _=l[h];d&&(_.oldValue=d[h].value);let y=_.dir[a];y&&(Un(),_n(y,o,8,[e.el,_,e,i]),Hn())}}function Iu(e,i){if(Ke){let o=Ke.provides;const a=Ke.parent&&Ke.parent.provides;a===o&&(o=Ke.provides=Object.create(a)),o[e]=i}}function eo(e,i,o=!1){const a=fc();if(a||ws){let l=ws?ws._context.provides:a?a.parent==null||a.ce?a.vnode.appContext&&a.vnode.appContext.provides:a.parent.provides:void 0;if(l&&e in l)return l[e];if(arguments.length>1)return o&&Dt(i)?i.call(a&&a.proxy):i}}const Zd=Symbol.for("v-scx"),Ud=()=>eo(Zd);function Qe(e,i,o){return $u(e,i,o)}function $u(e,i,o=ue){const{immediate:a,deep:l,flush:d,once:h}=o,_=Oe({},o),y=i&&a||!i&&d!=="post";let T;if(fo){if(d==="sync"){const V=Ud();T=V.__watcherHandles||(V.__watcherHandles=[])}else if(!y){const V=()=>{};return V.stop=Zn,V.resume=Zn,V.pause=Zn,V}}const w=Ke;_.call=(V,rt,Q)=>_n(V,w,rt,Q);let A=!1;d==="post"?_.scheduler=V=>{Xe(V,w&&w.suspense)}:d!=="sync"&&(A=!0,_.scheduler=(V,rt)=>{rt?V():Oa(V)}),_.augmentJob=V=>{i&&(V.flags|=4),A&&(V.flags|=2,w&&(V.id=w.uid,V.i=w))};const U=Rd(e,i,_);return fo&&(T?T.push(U):y&&U()),U}function Hd(e,i,o){const a=this.proxy,l=be(e)?e.includes(".")?Du(a,e):()=>a[e]:e.bind(a,a);let d;Dt(i)?d=i:(d=i.handler,o=i);const h=go(this),_=$u(l,d.bind(a),o);return h(),_}function Du(e,i){const o=i.split(".");return()=>{let a=e;for(let l=0;l<o.length&&a;l++)a=a[o[l]];return a}}const jd=Symbol("_vte"),Nu=e=>e.__isTeleport,pn=Symbol("_leaveCb"),Ws=Symbol("_enterCb");function Wd(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Yi(()=>{e.isMounted=!0}),vr(()=>{e.isUnmounting=!0}),e}const fn=[Function,Array],Ru={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:fn,onEnter:fn,onAfterEnter:fn,onEnterCancelled:fn,onBeforeLeave:fn,onLeave:fn,onAfterLeave:fn,onLeaveCancelled:fn,onBeforeAppear:fn,onAppear:fn,onAfterAppear:fn,onAppearCancelled:fn},Fu=e=>{const i=e.subTree;return i.component?Fu(i.component):i},Kd={name:"BaseTransition",props:Ru,setup(e,{slots:i}){const o=fc(),a=Wd();return()=>{const l=i.default&&Zu(i.default(),!0),d=l&&l.length?Bu(l):o.subTree?N():void 0;if(!d)return;const h=Xt(e),{mode:_}=h;if(a.isLeaving)return Jr(d);const y=ul(d);if(!y)return Jr(d);let T=ua(y,h,a,o,A=>T=A);y.type!==Ne&&lo(y,T);let w=o.subTree&&ul(o.subTree);if(w&&w.type!==Ne&&!Wi(w,y)&&Fu(o).type!==Ne){let A=ua(w,h,a,o);if(lo(w,A),_==="out-in"&&y.type!==Ne)return a.isLeaving=!0,A.afterLeave=()=>{a.isLeaving=!1,o.job.flags&8||o.update(),delete A.afterLeave,w=void 0},Jr(d);_==="in-out"&&y.type!==Ne?A.delayLeave=(U,V,rt)=>{const Q=Vu(a,w);Q[String(w.key)]=w,U[pn]=()=>{V(),U[pn]=void 0,delete T.delayedLeave,w=void 0},T.delayedLeave=()=>{rt(),delete T.delayedLeave,w=void 0}}:w=void 0}else w&&(w=void 0);return d}}};function Bu(e){let i=e[0];if(e.length>1){for(const o of e)if(o.type!==Ne){i=o;break}}return i}const Gd=Kd;function Vu(e,i){const{leavingVNodes:o}=e;let a=o.get(i.type);return a||(a=Object.create(null),o.set(i.type,a)),a}function ua(e,i,o,a,l){const{appear:d,mode:h,persisted:_=!1,onBeforeEnter:y,onEnter:T,onAfterEnter:w,onEnterCancelled:A,onBeforeLeave:U,onLeave:V,onAfterLeave:rt,onLeaveCancelled:Q,onBeforeAppear:Ot,onAppear:Mt,onAfterAppear:q,onAppearCancelled:dt}=i,it=String(e.key),ht=Vu(o,e),Kt=(St,Nt)=>{St&&_n(St,a,9,Nt)},he=(St,Nt)=>{const Et=Nt[1];Kt(St,Nt),wt(St)?St.every(nt=>nt.length<=1)&&Et():St.length<=1&&Et()},pe={mode:h,persisted:_,beforeEnter(St){let Nt=y;if(!o.isMounted)if(d)Nt=Ot||y;else return;St[pn]&&St[pn](!0);const Et=ht[it];Et&&Wi(e,Et)&&Et.el[pn]&&Et.el[pn](),Kt(Nt,[St])},enter(St){if(ht[it]===e)return;let Nt=T,Et=w,nt=A;if(!o.isMounted)if(d)Nt=Mt||T,Et=q||w,nt=dt||A;else return;let ut=!1;St[Ws]=Ft=>{ut||(ut=!0,Ft?Kt(nt,[St]):Kt(Et,[St]),pe.delayedLeave&&pe.delayedLeave(),St[Ws]=void 0)};const zt=St[Ws].bind(null,!1);Nt?he(Nt,[St,zt]):zt()},leave(St,Nt){const Et=String(e.key);if(St[Ws]&&St[Ws](!0),o.isUnmounting)return Nt();Kt(U,[St]);let nt=!1;St[pn]=zt=>{nt||(nt=!0,Nt(),zt?Kt(Q,[St]):Kt(rt,[St]),St[pn]=void 0,ht[Et]===e&&delete ht[Et])};const ut=St[pn].bind(null,!1);ht[Et]=e,V?he(V,[St,ut]):ut()},clone(St){const Nt=ua(St,i,o,a,l);return l&&l(Nt),Nt}};return pe}function Jr(e){if(gr(e))return e=Pi(e),e.children=null,e}function ul(e){if(!gr(e))return Nu(e.type)&&e.children?Bu(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:i,children:o}=e;if(o){if(i&16)return o[0];if(i&32&&Dt(o.default))return o.default()}}function lo(e,i){e.shapeFlag&6&&e.component?(e.transition=i,lo(e.component.subTree,i)):e.shapeFlag&128?(e.ssContent.transition=i.clone(e.ssContent),e.ssFallback.transition=i.clone(e.ssFallback)):e.transition=i}function Zu(e,i=!1,o){let a=[],l=0;for(let d=0;d<e.length;d++){let h=e[d];const _=o==null?h.key:String(o)+String(h.key!=null?h.key:d);h.type===ct?(h.patchFlag&128&&l++,a=a.concat(Zu(h.children,i,_))):(i||h.type!==Ne)&&a.push(_!=null?Pi(h,{key:_}):h)}if(l>1)for(let d=0;d<a.length;d++)a[d].patchFlag=-2;return a}function Uu(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function cl(e,i){let o;return!!((o=Object.getOwnPropertyDescriptor(e,i))&&!o.configurable)}const tr=new WeakMap;function no(e,i,o,a,l=!1){if(wt(e)){e.forEach((Q,Ot)=>no(Q,i&&(wt(i)?i[Ot]:i),o,a,l));return}if(xs(a)&&!l){a.shapeFlag&512&&a.type.__asyncResolved&&a.component.subTree.component&&no(e,i,o,a.component.subTree);return}const d=a.shapeFlag&4?xr(a.component):a.el,h=l?null:d,{i:_,r:y}=e,T=i&&i.r,w=_.refs===ue?_.refs={}:_.refs,A=_.setupState,U=Xt(A),V=A===ue?su:Q=>cl(w,Q)?!1:ee(U,Q),rt=(Q,Ot)=>!(Ot&&cl(w,Ot));if(T!=null&&T!==y){if(dl(i),be(T))w[T]=null,V(T)&&(A[T]=null);else if(Fe(T)){const Q=i;rt(T,Q.k)&&(T.value=null),Q.k&&(w[Q.k]=null)}}if(Dt(y)){Un();try{mo(y,_,12,[h,w])}finally{Hn()}}else{const Q=be(y),Ot=Fe(y);if(Q||Ot){const Mt=()=>{if(e.f){const q=Q?V(y)?A[y]:w[y]:rt()||!e.k?y.value:w[e.k];if(l)wt(q)&&ba(q,d);else if(wt(q))q.includes(d)||q.push(d);else if(Q)w[y]=[d],V(y)&&(A[y]=w[y]);else{const dt=[d];rt(y,e.k)&&(y.value=dt),e.k&&(w[e.k]=dt)}}else Q?(w[y]=h,V(y)&&(A[y]=h)):Ot&&(rt(y,e.k)&&(y.value=h),e.k&&(w[e.k]=h))};if(h){const q=()=>{Mt(),tr.delete(e)};q.id=-1,tr.set(e,q),Xe(q,o)}else dl(e),Mt()}}}function dl(e){const i=tr.get(e);i&&(i.flags|=8,tr.delete(e))}hr().requestIdleCallback;hr().cancelIdleCallback;const xs=e=>!!e.type.__asyncLoader,gr=e=>e.type.__isKeepAlive;function qd(e,i){Hu(e,"a",i)}function Yd(e,i){Hu(e,"da",i)}function Hu(e,i,o=Ke){const a=e.__wdc||(e.__wdc=()=>{let l=o;for(;l;){if(l.isDeactivated)return;l=l.parent}return e()});if(_r(i,a,o),o){let l=o.parent;for(;l&&l.parent;)gr(l.parent.vnode)&&Jd(a,i,o,l),l=l.parent}}function Jd(e,i,o,a){const l=_r(i,e,a,!0);ju(()=>{ba(a[i],l)},o)}function _r(e,i,o=Ke,a=!1){if(o){const l=o[e]||(o[e]=[]),d=i.__weh||(i.__weh=(...h)=>{Un();const _=go(o),y=_n(i,o,e,h);return _(),Hn(),y});return a?l.unshift(d):l.push(d),d}}const ui=e=>(i,o=Ke)=>{(!fo||e==="sp")&&_r(e,(...a)=>i(...a),o)},Xd=ui("bm"),Yi=ui("m"),Qd=ui("bu"),tf=ui("u"),vr=ui("bum"),ju=ui("um"),ef=ui("sp"),nf=ui("rtg"),sf=ui("rtc");function of(e,i=Ke){_r("ec",e,i)}const rf=Symbol.for("v-ndc");function Wt(e,i,o,a){let l;const d=o,h=wt(e);if(h||be(e)){const _=h&&Gi(e);let y=!1,T=!1;_&&(y=!mn(e),T=li(e),e=pr(e)),l=new Array(e.length);for(let w=0,A=e.length;w<A;w++)l[w]=i(y?T?Ps(Mn(e[w])):Mn(e[w]):e[w],w,void 0,d)}else if(typeof e=="number"){l=new Array(e);for(let _=0;_<e;_++)l[_]=i(_+1,_,void 0,d)}else if(ne(e))if(e[Symbol.iterator])l=Array.from(e,(_,y)=>i(_,y,void 0,d));else{const _=Object.keys(e);l=new Array(_.length);for(let y=0,T=_.length;y<T;y++){const w=_[y];l[y]=i(e[w],w,y,d)}}else l=[];return l}function af(e,i,o={},a,l){if(Re.ce||Re.parent&&xs(Re.parent)&&Re.parent.ce){const T=Object.keys(o).length>0;return g(),ie(ct,null,[O("slot",o,a)],T?-2:64)}let d=e[i];d&&d._c&&(d._d=!1),g();const h=d&&Wu(d(o)),_=o.key||h&&h.key,y=ie(ct,{key:(_&&!Cn(_)?_:`_${i}`)+(!h&&a?"_fb":"")},h||[],h&&e._===1?64:-2);return y.scopeId&&(y.slotScopeIds=[y.scopeId+"-s"]),d&&d._c&&(d._d=!0),y}function Wu(e){return e.some(i=>co(i)?!(i.type===Ne||i.type===ct&&!Wu(i.children)):!0)?e:null}const ca=e=>e?hc(e)?xr(e):ca(e.parent):null,io=Oe(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ca(e.parent),$root:e=>ca(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Gu(e),$forceUpdate:e=>e.f||(e.f=()=>{Oa(e.update)}),$nextTick:e=>e.n||(e.n=Mu.bind(e.proxy)),$watch:e=>Hd.bind(e)}),Xr=(e,i)=>e!==ue&&!e.__isScriptSetup&&ee(e,i),lf={get({_:e},i){if(i==="__v_skip")return!0;const{ctx:o,setupState:a,data:l,props:d,accessCache:h,type:_,appContext:y}=e;if(i[0]!=="$"){const U=h[i];if(U!==void 0)switch(U){case 1:return a[i];case 2:return l[i];case 4:return o[i];case 3:return d[i]}else{if(Xr(a,i))return h[i]=1,a[i];if(l!==ue&&ee(l,i))return h[i]=2,l[i];if(ee(d,i))return h[i]=3,d[i];if(o!==ue&&ee(o,i))return h[i]=4,o[i];da&&(h[i]=0)}}const T=io[i];let w,A;if(T)return i==="$attrs"&&De(e.attrs,"get",""),T(e);if((w=_.__cssModules)&&(w=w[i]))return w;if(o!==ue&&ee(o,i))return h[i]=4,o[i];if(A=y.config.globalProperties,ee(A,i))return A[i]},set({_:e},i,o){const{data:a,setupState:l,ctx:d}=e;return Xr(l,i)?(l[i]=o,!0):a!==ue&&ee(a,i)?(a[i]=o,!0):ee(e.props,i)||i[0]==="$"&&i.slice(1)in e?!1:(d[i]=o,!0)},has({_:{data:e,setupState:i,accessCache:o,ctx:a,appContext:l,props:d,type:h}},_){let y;return!!(o[_]||e!==ue&&_[0]!=="$"&&ee(e,_)||Xr(i,_)||ee(d,_)||ee(a,_)||ee(io,_)||ee(l.config.globalProperties,_)||(y=h.__cssModules)&&y[_])},defineProperty(e,i,o){return o.get!=null?e._.accessCache[i]=0:ee(o,"value")&&this.set(e,i,o.value,null),Reflect.defineProperty(e,i,o)}};function fl(e){return wt(e)?e.reduce((i,o)=>(i[o]=null,i),{}):e}let da=!0;function uf(e){const i=Gu(e),o=e.proxy,a=e.ctx;da=!1,i.beforeCreate&&hl(i.beforeCreate,e,"bc");const{data:l,computed:d,methods:h,watch:_,provide:y,inject:T,created:w,beforeMount:A,mounted:U,beforeUpdate:V,updated:rt,activated:Q,deactivated:Ot,beforeDestroy:Mt,beforeUnmount:q,destroyed:dt,unmounted:it,render:ht,renderTracked:Kt,renderTriggered:he,errorCaptured:pe,serverPrefetch:St,expose:Nt,inheritAttrs:Et,components:nt,directives:ut,filters:zt}=i;if(T&&cf(T,a,null),h)for(const At in h){const et=h[At];Dt(et)&&(a[At]=et.bind(o))}if(l){const At=l.call(o,o);ne(At)&&(e.data=xe(At))}if(da=!0,d)for(const At in d){const et=d[At],ce=Dt(et)?et.bind(o,o):Dt(et.get)?et.get.bind(o,o):Zn,pt=!Dt(et)&&Dt(et.set)?et.set.bind(o):Zn,kt=xt({get:ce,set:pt});Object.defineProperty(a,At,{enumerable:!0,configurable:!0,get:()=>kt.value,set:Yt=>kt.value=Yt})}if(_)for(const At in _)Ku(_[At],a,o,At);if(y){const At=Dt(y)?y.call(o):y;Reflect.ownKeys(At).forEach(et=>{Iu(et,At[et])})}w&&hl(w,e,"c");function lt(At,et){wt(et)?et.forEach(ce=>At(ce.bind(o))):et&&At(et.bind(o))}if(lt(Xd,A),lt(Yi,U),lt(Qd,V),lt(tf,rt),lt(qd,Q),lt(Yd,Ot),lt(of,pe),lt(sf,Kt),lt(nf,he),lt(vr,q),lt(ju,it),lt(ef,St),wt(Nt))if(Nt.length){const At=e.exposed||(e.exposed={});Nt.forEach(et=>{Object.defineProperty(At,et,{get:()=>o[et],set:ce=>o[et]=ce,enumerable:!0})})}else e.exposed||(e.exposed={});ht&&e.render===Zn&&(e.render=ht),Et!=null&&(e.inheritAttrs=Et),nt&&(e.components=nt),ut&&(e.directives=ut),St&&Uu(e)}function cf(e,i,o=Zn){wt(e)&&(e=fa(e));for(const a in e){const l=e[a];let d;ne(l)?"default"in l?d=eo(l.from||a,l.default,!0):d=eo(l.from||a):d=eo(l),Fe(d)?Object.defineProperty(i,a,{enumerable:!0,configurable:!0,get:()=>d.value,set:h=>d.value=h}):i[a]=d}}function hl(e,i,o){_n(wt(e)?e.map(a=>a.bind(i.proxy)):e.bind(i.proxy),i,o)}function Ku(e,i,o,a){let l=a.includes(".")?Du(o,a):()=>o[a];if(be(e)){const d=i[e];Dt(d)&&Qe(l,d)}else if(Dt(e))Qe(l,e.bind(o));else if(ne(e))if(wt(e))e.forEach(d=>Ku(d,i,o,a));else{const d=Dt(e.handler)?e.handler.bind(o):i[e.handler];Dt(d)&&Qe(l,d,e)}}function Gu(e){const i=e.type,{mixins:o,extends:a}=i,{mixins:l,optionsCache:d,config:{optionMergeStrategies:h}}=e.appContext,_=d.get(i);let y;return _?y=_:!l.length&&!o&&!a?y=i:(y={},l.length&&l.forEach(T=>er(y,T,h,!0)),er(y,i,h)),ne(i)&&d.set(i,y),y}function er(e,i,o,a=!1){const{mixins:l,extends:d}=i;d&&er(e,d,o,!0),l&&l.forEach(h=>er(e,h,o,!0));for(const h in i)if(!(a&&h==="expose")){const _=df[h]||o&&o[h];e[h]=_?_(e[h],i[h]):i[h]}return e}const df={data:pl,props:ml,emits:ml,methods:qs,computed:qs,beforeCreate:je,created:je,beforeMount:je,mounted:je,beforeUpdate:je,updated:je,beforeDestroy:je,beforeUnmount:je,destroyed:je,unmounted:je,activated:je,deactivated:je,errorCaptured:je,serverPrefetch:je,components:qs,directives:qs,watch:hf,provide:pl,inject:ff};function pl(e,i){return i?e?function(){return Oe(Dt(e)?e.call(this,this):e,Dt(i)?i.call(this,this):i)}:i:e}function ff(e,i){return qs(fa(e),fa(i))}function fa(e){if(wt(e)){const i={};for(let o=0;o<e.length;o++)i[e[o]]=e[o];return i}return e}function je(e,i){return e?[...new Set([].concat(e,i))]:i}function qs(e,i){return e?Oe(Object.create(null),e,i):i}function ml(e,i){return e?wt(e)&&wt(i)?[...new Set([...e,...i])]:Oe(Object.create(null),fl(e),fl(i??{})):i}function hf(e,i){if(!e)return i;if(!i)return e;const o=Oe(Object.create(null),e);for(const a in i)o[a]=je(e[a],i[a]);return o}function qu(){return{app:null,config:{isNativeTag:su,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 pf=0;function mf(e,i){return function(a,l=null){Dt(a)||(a=Oe({},a)),l!=null&&!ne(l)&&(l=null);const d=qu(),h=new WeakSet,_=[];let y=!1;const T=d.app={_uid:pf++,_component:a,_props:l,_container:null,_context:d,_instance:null,version:Kf,get config(){return d.config},set config(w){},use(w,...A){return h.has(w)||(w&&Dt(w.install)?(h.add(w),w.install(T,...A)):Dt(w)&&(h.add(w),w(T,...A))),T},mixin(w){return d.mixins.includes(w)||d.mixins.push(w),T},component(w,A){return A?(d.components[w]=A,T):d.components[w]},directive(w,A){return A?(d.directives[w]=A,T):d.directives[w]},mount(w,A,U){if(!y){const V=T._ceVNode||O(a,l);return V.appContext=d,U===!0?U="svg":U===!1&&(U=void 0),e(V,w,U),y=!0,T._container=w,w.__vue_app__=T,xr(V.component)}},onUnmount(w){_.push(w)},unmount(){y&&(_n(_,T._instance,16),e(null,T._container),delete T._container.__vue_app__)},provide(w,A){return d.provides[w]=A,T},runWithContext(w){const A=ws;ws=T;try{return w()}finally{ws=A}}};return T}}let ws=null;const gf=(e,i)=>i==="modelValue"||i==="model-value"?e.modelModifiers:e[`${i}Modifiers`]||e[`${Tn(i)}Modifiers`]||e[`${Li(i)}Modifiers`];function _f(e,i,...o){if(e.isUnmounted)return;const a=e.vnode.props||ue;let l=o;const d=i.startsWith("update:"),h=d&&gf(a,i.slice(7));h&&(h.trim&&(l=o.map(w=>be(w)?w.trim():w)),h.number&&(l=o.map(fr)));let _,y=a[_=Wr(i)]||a[_=Wr(Tn(i))];!y&&d&&(y=a[_=Wr(Li(i))]),y&&_n(y,e,6,l);const T=a[_+"Once"];if(T){if(!e.emitted)e.emitted={};else if(e.emitted[_])return;e.emitted[_]=!0,_n(T,e,6,l)}}const vf=new WeakMap;function Yu(e,i,o=!1){const a=o?vf:i.emitsCache,l=a.get(e);if(l!==void 0)return l;const d=e.emits;let h={},_=!1;if(!Dt(e)){const y=T=>{const w=Yu(T,i,!0);w&&(_=!0,Oe(h,w))};!o&&i.mixins.length&&i.mixins.forEach(y),e.extends&&y(e.extends),e.mixins&&e.mixins.forEach(y)}return!d&&!_?(ne(e)&&a.set(e,null),null):(wt(d)?d.forEach(y=>h[y]=null):Oe(h,d),ne(e)&&a.set(e,h),h)}function yr(e,i){return!e||!ur(i)?!1:(i=i.slice(2),i=i==="Once"?i:i.replace(/Once$/,""),ee(e,i[0].toLowerCase()+i.slice(1))||ee(e,Li(i))||ee(e,i))}function gl(e){const{type:i,vnode:o,proxy:a,withProxy:l,propsOptions:[d],slots:h,attrs:_,emit:y,render:T,renderCache:w,props:A,data:U,setupState:V,ctx:rt,inheritAttrs:Q}=e,Ot=Qo(e);let Mt,q;try{if(o.shapeFlag&4){const it=l||a,ht=it;Mt=Bn(T.call(ht,it,w,A,V,U,rt)),q=_}else{const it=i;Mt=Bn(it.length>1?it(A,{attrs:_,slots:h,emit:y}):it(A,null)),q=i.props?_:yf(_)}}catch(it){so.length=0,mr(it,e,1),Mt=O(Ne)}let dt=Mt;if(q&&Q!==!1){const it=Object.keys(q),{shapeFlag:ht}=dt;it.length&&ht&7&&(d&&it.some(cr)&&(q=bf(q,d)),dt=Pi(dt,q,!1,!0))}return o.dirs&&(dt=Pi(dt,null,!1,!0),dt.dirs=dt.dirs?dt.dirs.concat(o.dirs):o.dirs),o.transition&&lo(dt,o.transition),Mt=dt,Qo(Ot),Mt}const yf=e=>{let i;for(const o in e)(o==="class"||o==="style"||ur(o))&&((i||(i={}))[o]=e[o]);return i},bf=(e,i)=>{const o={};for(const a in e)(!cr(a)||!(a.slice(9)in i))&&(o[a]=e[a]);return o};function xf(e,i,o){const{props:a,children:l,component:d}=e,{props:h,children:_,patchFlag:y}=i,T=d.emitsOptions;if(i.dirs||i.transition)return!0;if(o&&y>=0){if(y&1024)return!0;if(y&16)return a?_l(a,h,T):!!h;if(y&8){const w=i.dynamicProps;for(let A=0;A<w.length;A++){const U=w[A];if(Ju(h,a,U)&&!yr(T,U))return!0}}}else return(l||_)&&(!_||!_.$stable)?!0:a===h?!1:a?h?_l(a,h,T):!0:!!h;return!1}function _l(e,i,o){const a=Object.keys(i);if(a.length!==Object.keys(e).length)return!0;for(let l=0;l<a.length;l++){const d=a[l];if(Ju(i,e,d)&&!yr(o,d))return!0}return!1}function Ju(e,i,o){const a=e[o],l=i[o];return o==="style"&&ne(a)&&ne(l)?!Si(a,l):a!==l}function wf({vnode:e,parent:i,suspense:o},a){for(;i;){const l=i.subTree;if(l.suspense&&l.suspense.activeBranch===e&&(l.suspense.vnode.el=l.el=a,e=l),l===e)(e=i.vnode).el=a,i=i.parent;else break}o&&o.activeBranch===e&&(o.vnode.el=a)}const Xu={},Qu=()=>Object.create(Xu),tc=e=>Object.getPrototypeOf(e)===Xu;function kf(e,i,o,a=!1){const l={},d=Qu();e.propsDefaults=Object.create(null),ec(e,i,l,d);for(const h in e.propsOptions[0])h in l||(l[h]=void 0);o?e.props=a?l:Od(l):e.type.props?e.props=l:e.props=d,e.attrs=d}function Sf(e,i,o,a){const{props:l,attrs:d,vnode:{patchFlag:h}}=e,_=Xt(l),[y]=e.propsOptions;let T=!1;if((a||h>0)&&!(h&16)){if(h&8){const w=e.vnode.dynamicProps;for(let A=0;A<w.length;A++){let U=w[A];if(yr(e.emitsOptions,U))continue;const V=i[U];if(y)if(ee(d,U))V!==d[U]&&(d[U]=V,T=!0);else{const rt=Tn(U);l[rt]=ha(y,_,rt,V,e,!1)}else V!==d[U]&&(d[U]=V,T=!0)}}}else{ec(e,i,l,d)&&(T=!0);let w;for(const A in _)(!i||!ee(i,A)&&((w=Li(A))===A||!ee(i,w)))&&(y?o&&(o[A]!==void 0||o[w]!==void 0)&&(l[A]=ha(y,_,A,void 0,e,!0)):delete l[A]);if(d!==_)for(const A in d)(!i||!ee(i,A))&&(delete d[A],T=!0)}T&&oi(e.attrs,"set","")}function ec(e,i,o,a){const[l,d]=e.propsOptions;let h=!1,_;if(i)for(let y in i){if(Xs(y))continue;const T=i[y];let w;l&&ee(l,w=Tn(y))?!d||!d.includes(w)?o[w]=T:(_||(_={}))[w]=T:yr(e.emitsOptions,y)||(!(y in a)||T!==a[y])&&(a[y]=T,h=!0)}if(d){const y=Xt(o),T=_||ue;for(let w=0;w<d.length;w++){const A=d[w];o[A]=ha(l,y,A,T[A],e,!ee(T,A))}}return h}function ha(e,i,o,a,l,d){const h=e[o];if(h!=null){const _=ee(h,"default");if(_&&a===void 0){const y=h.default;if(h.type!==Function&&!h.skipFactory&&Dt(y)){const{propsDefaults:T}=l;if(o in T)a=T[o];else{const w=go(l);a=T[o]=y.call(null,i),w()}}else a=y;l.ce&&l.ce._setProp(o,a)}h[0]&&(d&&!_?a=!1:h[1]&&(a===""||a===Li(o))&&(a=!0))}return a}const Pf=new WeakMap;function nc(e,i,o=!1){const a=o?Pf:i.propsCache,l=a.get(e);if(l)return l;const d=e.props,h={},_=[];let y=!1;if(!Dt(e)){const w=A=>{y=!0;const[U,V]=nc(A,i,!0);Oe(h,U),V&&_.push(...V)};!o&&i.mixins.length&&i.mixins.forEach(w),e.extends&&w(e.extends),e.mixins&&e.mixins.forEach(w)}if(!d&&!y)return ne(e)&&a.set(e,vs),vs;if(wt(d))for(let w=0;w<d.length;w++){const A=Tn(d[w]);vl(A)&&(h[A]=ue)}else if(d)for(const w in d){const A=Tn(w);if(vl(A)){const U=d[w],V=h[A]=wt(U)||Dt(U)?{type:U}:Oe({},U),rt=V.type;let Q=!1,Ot=!0;if(wt(rt))for(let Mt=0;Mt<rt.length;++Mt){const q=rt[Mt],dt=Dt(q)&&q.name;if(dt==="Boolean"){Q=!0;break}else dt==="String"&&(Ot=!1)}else Q=Dt(rt)&&rt.name==="Boolean";V[0]=Q,V[1]=Ot,(Q||ee(V,"default"))&&_.push(A)}}const T=[h,_];return ne(e)&&a.set(e,T),T}function vl(e){return e[0]!=="$"&&!Xs(e)}const Ea=e=>e==="_"||e==="_ctx"||e==="$stable",za=e=>wt(e)?e.map(Bn):[Bn(e)],Tf=(e,i,o)=>{if(i._n)return i;const a=mt((...l)=>za(i(...l)),o);return a._c=!1,a},ic=(e,i,o)=>{const a=e._ctx;for(const l in e){if(Ea(l))continue;const d=e[l];if(Dt(d))i[l]=Tf(l,d,a);else if(d!=null){const h=za(d);i[l]=()=>h}}},sc=(e,i)=>{const o=za(i);e.slots.default=()=>o},oc=(e,i,o)=>{for(const a in i)(o||!Ea(a))&&(e[a]=i[a])},Lf=(e,i,o)=>{const a=e.slots=Qu();if(e.vnode.shapeFlag&32){const l=i._;l?(oc(a,i,o),o&&uu(a,"_",l,!0)):ic(i,a)}else i&&sc(e,i)},Cf=(e,i,o)=>{const{vnode:a,slots:l}=e;let d=!0,h=ue;if(a.shapeFlag&32){const _=i._;_?o&&_===1?d=!1:oc(l,i,o):(d=!i.$stable,ic(i,l)),h=i}else i&&(sc(e,i),h={default:1});if(d)for(const _ in l)!Ea(_)&&h[_]==null&&delete l[_]},Xe=Af;function Mf(e){return Of(e)}function Of(e,i){const o=hr();o.__VUE__=!0;const{insert:a,remove:l,patchProp:d,createElement:h,createText:_,createComment:y,setText:T,setElementText:w,parentNode:A,nextSibling:U,setScopeId:V=Zn,insertStaticContent:rt}=e,Q=(v,m,M,F=null,R=null,B=null,J=void 0,D=null,K=!!m.dynamicChildren)=>{if(v===m)return;v&&!Wi(v,m)&&(F=C(v),Yt(v,R,B,!0),v=null),m.patchFlag===-2&&(K=!1,m.dynamicChildren=null);const{type:Z,ref:yt,shapeFlag:st}=m;switch(Z){case br:Ot(v,m,M,F);break;case Ne:Mt(v,m,M,F);break;case ta:v==null&&q(m,M,F,J);break;case ct:nt(v,m,M,F,R,B,J,D,K);break;default:st&1?ht(v,m,M,F,R,B,J,D,K):st&6?ut(v,m,M,F,R,B,J,D,K):(st&64||st&128)&&Z.process(v,m,M,F,R,B,J,D,K,se)}yt!=null&&R?no(yt,v&&v.ref,B,m||v,!m):yt==null&&v&&v.ref!=null&&no(v.ref,null,B,v,!0)},Ot=(v,m,M,F)=>{if(v==null)a(m.el=_(m.children),M,F);else{const R=m.el=v.el;m.children!==v.children&&T(R,m.children)}},Mt=(v,m,M,F)=>{v==null?a(m.el=y(m.children||""),M,F):m.el=v.el},q=(v,m,M,F)=>{[v.el,v.anchor]=rt(v.children,m,M,F,v.el,v.anchor)},dt=({el:v,anchor:m},M,F)=>{let R;for(;v&&v!==m;)R=U(v),a(v,M,F),v=R;a(m,M,F)},it=({el:v,anchor:m})=>{let M;for(;v&&v!==m;)M=U(v),l(v),v=M;l(m)},ht=(v,m,M,F,R,B,J,D,K)=>{if(m.type==="svg"?J="svg":m.type==="math"&&(J="mathml"),v==null)Kt(m,M,F,R,B,J,D,K);else{const Z=v.el&&v.el._isVueCE?v.el:null;try{Z&&Z._beginPatch(),St(v,m,R,B,J,D,K)}finally{Z&&Z._endPatch()}}},Kt=(v,m,M,F,R,B,J,D)=>{let K,Z;const{props:yt,shapeFlag:st,transition:tt,dirs:bt}=v;if(K=v.el=h(v.type,B,yt&&yt.is,yt),st&8?w(K,v.children):st&16&&pe(v.children,K,null,F,R,Qr(v,B),J,D),bt&&Vi(v,null,F,"created"),he(K,v,v.scopeId,J,F),yt){for(const gt in yt)gt!=="value"&&!Xs(gt)&&d(K,gt,null,yt[gt],B,F);"value"in yt&&d(K,"value",null,yt.value,B),(Z=yt.onVnodeBeforeMount)&&Nn(Z,F,v)}bt&&Vi(v,null,F,"beforeMount");const Rt=Ef(R,tt);Rt&&tt.beforeEnter(K),a(K,m,M),((Z=yt&&yt.onVnodeMounted)||Rt||bt)&&Xe(()=>{try{Z&&Nn(Z,F,v),Rt&&tt.enter(K),bt&&Vi(v,null,F,"mounted")}finally{}},R)},he=(v,m,M,F,R)=>{if(M&&V(v,M),F)for(let B=0;B<F.length;B++)V(v,F[B]);if(R){let B=R.subTree;if(m===B||uc(B.type)&&(B.ssContent===m||B.ssFallback===m)){const J=R.vnode;he(v,J,J.scopeId,J.slotScopeIds,R.parent)}}},pe=(v,m,M,F,R,B,J,D,K=0)=>{for(let Z=K;Z<v.length;Z++){const yt=v[Z]=D?si(v[Z]):Bn(v[Z]);Q(null,yt,m,M,F,R,B,J,D)}},St=(v,m,M,F,R,B,J)=>{const D=m.el=v.el;let{patchFlag:K,dynamicChildren:Z,dirs:yt}=m;K|=v.patchFlag&16;const st=v.props||ue,tt=m.props||ue;let bt;if(M&&Zi(M,!1),(bt=tt.onVnodeBeforeUpdate)&&Nn(bt,M,m,v),yt&&Vi(m,v,M,"beforeUpdate"),M&&Zi(M,!0),Z&&(!v.dynamicChildren||v.dynamicChildren.length!==Z.length)&&(K=0,J=!1,Z=null),(st.innerHTML&&tt.innerHTML==null||st.textContent&&tt.textContent==null)&&w(D,""),Z?Nt(v.dynamicChildren,Z,D,M,F,Qr(m,R),B):J||et(v,m,D,null,M,F,Qr(m,R),B,!1),K>0){if(K&16)Et(D,st,tt,M,R);else if(K&2&&st.class!==tt.class&&d(D,"class",null,tt.class,R),K&4&&d(D,"style",st.style,tt.style,R),K&8){const Rt=m.dynamicProps;for(let gt=0;gt<Rt.length;gt++){const Ht=Rt[gt],le=st[Ht],me=tt[Ht];(me!==le||Ht==="value")&&d(D,Ht,le,me,R,M)}}K&1&&v.children!==m.children&&w(D,m.children)}else!J&&Z==null&&Et(D,st,tt,M,R);((bt=tt.onVnodeUpdated)||yt)&&Xe(()=>{bt&&Nn(bt,M,m,v),yt&&Vi(m,v,M,"updated")},F)},Nt=(v,m,M,F,R,B,J)=>{for(let D=0;D<m.length;D++){const K=v[D],Z=m[D],yt=K.el&&(K.type===ct||!Wi(K,Z)||K.shapeFlag&198)?A(K.el):M;Q(K,Z,yt,null,F,R,B,J,!0)}},Et=(v,m,M,F,R)=>{if(m!==M){if(m!==ue)for(const B in m)!Xs(B)&&!(B in M)&&d(v,B,m[B],null,R,F);for(const B in M){if(Xs(B))continue;const J=M[B],D=m[B];J!==D&&B!=="value"&&d(v,B,D,J,R,F)}"value"in M&&d(v,"value",m.value,M.value,R)}},nt=(v,m,M,F,R,B,J,D,K)=>{const Z=m.el=v?v.el:_(""),yt=m.anchor=v?v.anchor:_("");let{patchFlag:st,dynamicChildren:tt,slotScopeIds:bt}=m;bt&&(D=D?D.concat(bt):bt),v==null?(a(Z,M,F),a(yt,M,F),pe(m.children||[],M,yt,R,B,J,D,K)):st>0&&st&64&&tt&&v.dynamicChildren&&v.dynamicChildren.length===tt.length?(Nt(v.dynamicChildren,tt,M,R,B,J,D),(m.key!=null||R&&m===R.subTree)&&rc(v,m,!0)):et(v,m,M,yt,R,B,J,D,K)},ut=(v,m,M,F,R,B,J,D,K)=>{m.slotScopeIds=D,v==null?m.shapeFlag&512?R.ctx.activate(m,M,F,J,K):zt(m,M,F,R,B,J,K):Ft(v,m,K)},zt=(v,m,M,F,R,B,J)=>{const D=v.component=Bf(v,F,R);if(gr(v)&&(D.ctx.renderer=se),Vf(D,!1,J),D.asyncDep){if(R&&R.registerDep(D,lt,J),!v.el){const K=D.subTree=O(Ne);Mt(null,K,m,M),v.placeholder=K.el}}else lt(D,v,m,M,R,B,J)},Ft=(v,m,M)=>{const F=m.component=v.component;if(xf(v,m,M))if(F.asyncDep&&!F.asyncResolved){At(F,m,M);return}else F.next=m,F.update();else m.el=v.el,F.vnode=m},lt=(v,m,M,F,R,B,J)=>{const D=()=>{if(v.isMounted){let{next:st,bu:tt,u:bt,parent:Rt,vnode:gt}=v;{const Te=ac(v);if(Te){st&&(st.el=gt.el,At(v,st,J)),Te.asyncDep.then(()=>{Xe(()=>{v.isUnmounted||Z()},R)});return}}let Ht=st,le;Zi(v,!1),st?(st.el=gt.el,At(v,st,J)):st=gt,tt&&qo(tt),(le=st.props&&st.props.onVnodeBeforeUpdate)&&Nn(le,Rt,st,gt),Zi(v,!0);const me=gl(v),ve=v.subTree;v.subTree=me,Q(ve,me,A(ve.el),C(ve),v,R,B),st.el=me.el,Ht===null&&wf(v,me.el),bt&&Xe(bt,R),(le=st.props&&st.props.onVnodeUpdated)&&Xe(()=>Nn(le,Rt,st,gt),R)}else{let st;const{el:tt,props:bt}=m,{bm:Rt,m:gt,parent:Ht,root:le,type:me}=v,ve=xs(m);Zi(v,!1),Rt&&qo(Rt),!ve&&(st=bt&&bt.onVnodeBeforeMount)&&Nn(st,Ht,m),Zi(v,!0);{le.ce&&le.ce._hasShadowRoot()&&le.ce._injectChildStyle(me,v.parent?v.parent.type:void 0);const Te=v.subTree=gl(v);Q(null,Te,M,F,v,R,B),m.el=Te.el}if(gt&&Xe(gt,R),!ve&&(st=bt&&bt.onVnodeMounted)){const Te=m;Xe(()=>Nn(st,Ht,Te),R)}(m.shapeFlag&256||Ht&&xs(Ht.vnode)&&Ht.vnode.shapeFlag&256)&&v.a&&Xe(v.a,R),v.isMounted=!0,m=M=F=null}};v.scope.on();const K=v.effect=new hu(D);v.scope.off();const Z=v.update=K.run.bind(K),yt=v.job=K.runIfDirty.bind(K);yt.i=v,yt.id=v.uid,K.scheduler=()=>Oa(yt),Zi(v,!0),Z()},At=(v,m,M)=>{m.component=v;const F=v.vnode.props;v.vnode=m,v.next=null,Sf(v,m.props,F,M),Cf(v,m.children,M),Un(),ll(v),Hn()},et=(v,m,M,F,R,B,J,D,K=!1)=>{const Z=v&&v.children,yt=v?v.shapeFlag:0,st=m.children,{patchFlag:tt,shapeFlag:bt}=m;if(tt>0){if(tt&128){pt(Z,st,M,F,R,B,J,D,K);return}else if(tt&256){ce(Z,st,M,F,R,B,J,D,K);return}}bt&8?(yt&16&&j(Z,R,B),st!==Z&&w(M,st)):yt&16?bt&16?pt(Z,st,M,F,R,B,J,D,K):j(Z,R,B,!0):(yt&8&&w(M,""),bt&16&&pe(st,M,F,R,B,J,D,K))},ce=(v,m,M,F,R,B,J,D,K)=>{v=v||vs,m=m||vs;const Z=v.length,yt=m.length,st=Math.min(Z,yt);let tt;for(tt=0;tt<st;tt++){const bt=m[tt]=K?si(m[tt]):Bn(m[tt]);Q(v[tt],bt,M,null,R,B,J,D,K)}Z>yt?j(v,R,B,!0,!1,st):pe(m,M,F,R,B,J,D,K,st)},pt=(v,m,M,F,R,B,J,D,K)=>{let Z=0;const yt=m.length;let st=v.length-1,tt=yt-1;for(;Z<=st&&Z<=tt;){const bt=v[Z],Rt=m[Z]=K?si(m[Z]):Bn(m[Z]);if(Wi(bt,Rt))Q(bt,Rt,M,null,R,B,J,D,K);else break;Z++}for(;Z<=st&&Z<=tt;){const bt=v[st],Rt=m[tt]=K?si(m[tt]):Bn(m[tt]);if(Wi(bt,Rt))Q(bt,Rt,M,null,R,B,J,D,K);else break;st--,tt--}if(Z>st){if(Z<=tt){const bt=tt+1,Rt=bt<yt?m[bt].el:F;for(;Z<=tt;)Q(null,m[Z]=K?si(m[Z]):Bn(m[Z]),M,Rt,R,B,J,D,K),Z++}}else if(Z>tt)for(;Z<=st;)Yt(v[Z],R,B,!0),Z++;else{const bt=Z,Rt=Z,gt=new Map;for(Z=Rt;Z<=tt;Z++){const ke=m[Z]=K?si(m[Z]):Bn(m[Z]);ke.key!=null&&gt.set(ke.key,Z)}let Ht,le=0;const me=tt-Rt+1;let ve=!1,Te=0;const vn=new Array(me);for(Z=0;Z<me;Z++)vn[Z]=0;for(Z=bt;Z<=st;Z++){const ke=v[Z];if(le>=me){Yt(ke,R,B,!0);continue}let Ie;if(ke.key!=null)Ie=gt.get(ke.key);else for(Ht=Rt;Ht<=tt;Ht++)if(vn[Ht-Rt]===0&&Wi(ke,m[Ht])){Ie=Ht;break}Ie===void 0?Yt(ke,R,B,!0):(vn[Ie-Rt]=Z+1,Ie>=Te?Te=Ie:ve=!0,Q(ke,m[Ie],M,null,R,B,J,D,K),le++)}const ci=ve?zf(vn):vs;for(Ht=ci.length-1,Z=me-1;Z>=0;Z--){const ke=Rt+Z,Ie=m[ke],On=m[ke+1],Be=ke+1<yt?On.el||lc(On):F;vn[Z]===0?Q(null,Ie,M,Be,R,B,J,D,K):ve&&(Ht<0||Z!==ci[Ht]?kt(Ie,M,Be,2):Ht--)}}},kt=(v,m,M,F,R=null)=>{const{el:B,type:J,transition:D,children:K,shapeFlag:Z}=v;if(Z&6){kt(v.component.subTree,m,M,F);return}if(Z&128){v.suspense.move(m,M,F);return}if(Z&64){J.move(v,m,M,se);return}if(J===ct){a(B,m,M);for(let st=0;st<K.length;st++)kt(K[st],m,M,F);a(v.anchor,m,M);return}if(J===ta){dt(v,m,M);return}if(F!==2&&Z&1&&D)if(F===0)D.persisted&&!B[pn]?a(B,m,M):(D.beforeEnter(B),a(B,m,M),Xe(()=>D.enter(B),R));else{const{leave:st,delayLeave:tt,afterLeave:bt}=D,Rt=()=>{v.ctx.isUnmounted?l(B):a(B,m,M)},gt=()=>{const Ht=B._isLeaving||!!B[pn];B._isLeaving&&B[pn](!0),D.persisted&&!Ht?Rt():st(B,()=>{Rt(),bt&&bt()})};tt?tt(B,Rt,gt):gt()}else a(B,m,M)},Yt=(v,m,M,F=!1,R=!1)=>{const{type:B,props:J,ref:D,children:K,dynamicChildren:Z,shapeFlag:yt,patchFlag:st,dirs:tt,cacheIndex:bt,memo:Rt}=v;if(st===-2&&(R=!1),D!=null&&(Un(),no(D,null,M,v,!0),Hn()),bt!=null&&(m.renderCache[bt]=void 0),yt&256){m.ctx.deactivate(v);return}const gt=yt&1&&tt,Ht=!xs(v);let le;if(Ht&&(le=J&&J.onVnodeBeforeUnmount)&&Nn(le,m,v),yt&6)Bt(v.component,M,F);else{if(yt&128){v.suspense.unmount(M,F);return}gt&&Vi(v,null,m,"beforeUnmount"),yt&64?v.type.remove(v,m,M,se,F):Z&&!Z.hasOnce&&(B!==ct||st>0&&st&64)?j(Z,m,M,!1,!0):(B===ct&&st&384||!R&&yt&16)&&j(K,m,M),F&&ae(v)}const me=Rt!=null&&bt==null;(Ht&&(le=J&&J.onVnodeUnmounted)||gt||me)&&Xe(()=>{le&&Nn(le,m,v),gt&&Vi(v,null,m,"unmounted"),me&&(v.el=null)},M)},ae=v=>{const{type:m,el:M,anchor:F,transition:R}=v;if(m===ct){Jt(M,F);return}if(m===ta){it(v);return}const B=()=>{l(M),R&&!R.persisted&&R.afterLeave&&R.afterLeave()};if(v.shapeFlag&1&&R&&!R.persisted){const{leave:J,delayLeave:D}=R,K=()=>J(M,B);D?D(v.el,B,K):K()}else B()},Jt=(v,m)=>{let M;for(;v!==m;)M=U(v),l(v),v=M;l(m)},Bt=(v,m,M)=>{const{bum:F,scope:R,job:B,subTree:J,um:D,m:K,a:Z}=v;yl(K),yl(Z),F&&qo(F),R.stop(),B&&(B.flags|=8,Yt(J,v,m,M)),D&&Xe(D,m),Xe(()=>{v.isUnmounted=!0},m)},j=(v,m,M,F=!1,R=!1,B=0)=>{for(let J=B;J<v.length;J++)Yt(v[J],m,M,F,R)},C=v=>{if(v.shapeFlag&6)return C(v.component.subTree);if(v.shapeFlag&128)return v.suspense.next();const m=U(v.anchor||v.el),M=m&&m[jd];return M?U(M):m};let E=!1;const _e=(v,m,M)=>{let F;v==null?m._vnode&&(Yt(m._vnode,null,null,!0),F=m._vnode.component):Q(m._vnode||null,v,m,null,null,null,M),m._vnode=v,E||(E=!0,ll(F),Eu(),E=!1)},se={p:Q,um:Yt,m:kt,r:ae,mt:zt,mc:pe,pc:et,pbc:Nt,n:C,o:e};return{render:_e,hydrate:void 0,createApp:mf(_e)}}function Qr({type:e,props:i},o){return o==="svg"&&e==="foreignObject"||o==="mathml"&&e==="annotation-xml"&&i&&i.encoding&&i.encoding.includes("html")?void 0:o}function Zi({effect:e,job:i},o){o?(e.flags|=32,i.flags|=4):(e.flags&=-33,i.flags&=-5)}function Ef(e,i){return(!e||e&&!e.pendingBranch)&&i&&!i.persisted}function rc(e,i,o=!1){const a=e.children,l=i.children;if(wt(a)&&wt(l))for(let d=0;d<a.length;d++){const h=a[d];let _=l[d];_.shapeFlag&1&&!_.dynamicChildren&&((_.patchFlag<=0||_.patchFlag===32)&&(_=l[d]=si(l[d]),_.el=h.el),!o&&_.patchFlag!==-2&&rc(h,_)),_.type===br&&(_.patchFlag===-1&&(_=l[d]=si(_)),_.el=h.el),_.type===Ne&&!_.el&&(_.el=h.el)}}function zf(e){const i=e.slice(),o=[0];let a,l,d,h,_;const y=e.length;for(a=0;a<y;a++){const T=e[a];if(T!==0){if(l=o[o.length-1],e[l]<T){i[a]=l,o.push(a);continue}for(d=0,h=o.length-1;d<h;)_=d+h>>1,e[o[_]]<T?d=_+1:h=_;T<e[o[d]]&&(d>0&&(i[a]=o[d-1]),o[d]=a)}}for(d=o.length,h=o[d-1];d-- >0;)o[d]=h,h=i[h];return o}function ac(e){const i=e.subTree.component;if(i)return i.asyncDep&&!i.asyncResolved?i:ac(i)}function yl(e){if(e)for(let i=0;i<e.length;i++)e[i].flags|=8}function lc(e){if(e.placeholder)return e.placeholder;const i=e.component;return i?lc(i.subTree):null}const uc=e=>e.__isSuspense;function Af(e,i){i&&i.pendingBranch?wt(e)?i.effects.push(...e):i.effects.push(e):Vd(e)}const ct=Symbol.for("v-fgt"),br=Symbol.for("v-txt"),Ne=Symbol.for("v-cmt"),ta=Symbol.for("v-stc"),so=[];let on=null;function g(e=!1){so.push(on=e?null:[])}function If(){so.pop(),on=so[so.length-1]||null}let uo=1;function nr(e,i=!1){uo+=e,e<0&&on&&i&&(on.hasOnce=!0)}function cc(e){return e.dynamicChildren=uo>0?on||vs:null,If(),uo>0&&on&&on.push(e),e}function x(e,i,o,a,l,d){return cc(u(e,i,o,a,l,d,!0))}function ie(e,i,o,a,l){return cc(O(e,i,o,a,l,!0))}function co(e){return e?e.__v_isVNode===!0:!1}function Wi(e,i){return e.type===i.type&&e.key===i.key}const dc=({key:e})=>e??null,Yo=({ref:e,ref_key:i,ref_for:o})=>(typeof e=="number"&&(e=""+e),e!=null?be(e)||Fe(e)||Dt(e)?{i:Re,r:e,k:i,f:!!o}:e:null);function u(e,i=null,o=null,a=0,l=null,d=e===ct?0:1,h=!1,_=!1){const y={__v_isVNode:!0,__v_skip:!0,type:e,props:i,key:i&&dc(i),ref:i&&Yo(i),scopeId:Au,slotScopeIds:null,children:o,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:d,patchFlag:a,dynamicProps:l,dynamicChildren:null,appContext:null,ctx:Re};return _?(ir(y,o),d&128&&e.normalize(y)):o&&(y.shapeFlag|=be(o)?8:16),uo>0&&!h&&on&&(y.patchFlag>0||d&6)&&y.patchFlag!==32&&on.push(y),y}const O=$f;function $f(e,i=null,o=null,a=0,l=null,d=!1){if((!e||e===rf)&&(e=Ne),co(e)){const _=Pi(e,i,!0);return o&&ir(_,o),uo>0&&!d&&on&&(_.shapeFlag&6?on[on.indexOf(e)]=_:on.push(_)),_.patchFlag=-2,_}if(jf(e)&&(e=e.__vccOpts),i){i=Df(i);let{class:_,style:y}=i;_&&!be(_)&&(i.class=Ct(_)),ne(y)&&(Ma(y)&&!wt(y)&&(y=Oe({},y)),i.style=Ss(y))}const h=be(e)?1:uc(e)?128:Nu(e)?64:ne(e)?4:Dt(e)?2:0;return u(e,i,o,a,l,h,d,!0)}function Df(e){return e?Ma(e)||tc(e)?Oe({},e):e:null}function Pi(e,i,o=!1,a=!1){const{props:l,ref:d,patchFlag:h,children:_,transition:y}=e,T=i?Nf(l||{},i):l,w={__v_isVNode:!0,__v_skip:!0,type:e.type,props:T,key:T&&dc(T),ref:i&&i.ref?o&&d?wt(d)?d.concat(Yo(i)):[d,Yo(i)]:Yo(i):d,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:_,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:i&&e.type!==ct?h===-1?16:h|16:h,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:y,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Pi(e.ssContent),ssFallback:e.ssFallback&&Pi(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return y&&a&&lo(w,y.clone(w)),w}function $(e=" ",i=0){return O(br,null,e,i)}function N(e="",i=!1){return i?(g(),ie(Ne,null,e)):O(Ne,null,e)}function Bn(e){return e==null||typeof e=="boolean"?O(Ne):wt(e)?O(ct,null,e.slice()):co(e)?si(e):O(br,null,String(e))}function si(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Pi(e)}function ir(e,i){let o=0;const{shapeFlag:a}=e;if(i==null)i=null;else if(wt(i))o=16;else if(typeof i=="object")if(a&65){const l=i.default;l&&(l._c&&(l._d=!1),ir(e,l()),l._c&&(l._d=!0));return}else{o=32;const l=i._;!l&&!tc(i)?i._ctx=Re:l===3&&Re&&(Re.slots._===1?i._=1:(i._=2,e.patchFlag|=1024))}else if(Dt(i)){if(a&65){ir(e,{default:i});return}i={default:i,_ctx:Re},o=32}else i=String(i),a&64?(o=16,i=[$(i)]):o=8;e.children=i,e.shapeFlag|=o}function Nf(...e){const i={};for(let o=0;o<e.length;o++){const a=e[o];for(const l in a)if(l==="class")i.class!==a.class&&(i.class=Ct([i.class,a.class]));else if(l==="style")i.style=Ss([i.style,a.style]);else if(ur(l)){const d=i[l],h=a[l];h&&d!==h&&!(wt(d)&&d.includes(h))?i[l]=d?[].concat(d,h):h:h==null&&d==null&&!cr(l)&&(i[l]=h)}else l!==""&&(i[l]=a[l])}return i}function Nn(e,i,o,a=null){_n(e,i,7,[o,a])}const Rf=qu();let Ff=0;function Bf(e,i,o){const a=e.type,l=(i?i.appContext:e.appContext)||Rf,d={uid:Ff++,vnode:e,type:a,parent:i,appContext:l,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new dd(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:i?i.provides:Object.create(l.provides),ids:i?i.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:nc(a,l),emitsOptions:Yu(a,l),emit:null,emitted:null,propsDefaults:ue,inheritAttrs:a.inheritAttrs,ctx:ue,data:ue,props:ue,attrs:ue,slots:ue,refs:ue,setupState:ue,setupContext:null,suspense:o,suspenseId:o?o.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,sp:null};return d.ctx={_:d},d.root=i?i.root:d,d.emit=_f.bind(null,d),e.ce&&e.ce(d),d}let Ke=null;const fc=()=>Ke||Re;let sr,pa;{const e=hr(),i=(o,a)=>{let l;return(l=e[o])||(l=e[o]=[]),l.push(a),d=>{l.length>1?l.forEach(h=>h(d)):l[0](d)}};sr=i("__VUE_INSTANCE_SETTERS__",o=>Ke=o),pa=i("__VUE_SSR_SETTERS__",o=>fo=o)}const go=e=>{const i=Ke;return sr(e),e.scope.on(),()=>{e.scope.off(),sr(i)}},bl=()=>{Ke&&Ke.scope.off(),sr(null)};function hc(e){return e.vnode.shapeFlag&4}let fo=!1;function Vf(e,i=!1,o=!1){i&&pa(i);const{props:a,children:l}=e.vnode,d=hc(e);kf(e,a,d,i),Lf(e,l,o||i);const h=d?Zf(e,i):void 0;return i&&pa(!1),h}function Zf(e,i){const o=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,lf);const{setup:a}=o;if(a){Un();const l=e.setupContext=a.length>1?Hf(e):null,d=go(e),h=mo(a,e,0,[e.props,l]),_=ou(h);if(Hn(),d(),(_||e.sp)&&!xs(e)&&Uu(e),_){if(h.then(bl,bl),i)return h.then(y=>{xl(e,y)}).catch(y=>{mr(y,e,0)});e.asyncDep=h}else xl(e,h)}else pc(e)}function xl(e,i,o){Dt(i)?e.type.__ssrInlineRender?e.ssrRender=i:e.render=i:ne(i)&&(e.setupState=Lu(i)),pc(e)}function pc(e,i,o){const a=e.type;e.render||(e.render=a.render||Zn);{const l=go(e);Un();try{uf(e)}finally{Hn(),l()}}}const Uf={get(e,i){return De(e,"get",""),e[i]}};function Hf(e){const i=o=>{e.exposed=o||{}};return{attrs:new Proxy(e.attrs,Uf),slots:e.slots,emit:e.emit,expose:i}}function xr(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Lu(Ed(e.exposed)),{get(i,o){if(o in i)return i[o];if(o in io)return io[o](e)},has(i,o){return o in i||o in io}})):e.proxy}function jf(e){return Dt(e)&&"__vccOpts"in e}const xt=(e,i)=>Dd(e,i,fo);function Wf(e,i,o){try{nr(-1);const a=arguments.length;return a===2?ne(i)&&!wt(i)?co(i)?O(e,null,[i]):O(e,i):O(e,null,i):(a>3?o=Array.prototype.slice.call(arguments,2):a===3&&co(o)&&(o=[o]),O(e,i,o))}finally{nr(1)}}const Kf="3.5.39";/**
* @vue/runtime-dom v3.5.39
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let ma;const wl=typeof window<"u"&&window.trustedTypes;if(wl)try{ma=wl.createPolicy("vue",{createHTML:e=>e})}catch{}const mc=ma?e=>ma.createHTML(e):e=>e,Gf="http://www.w3.org/2000/svg",qf="http://www.w3.org/1998/Math/MathML",ii=typeof document<"u"?document:null,kl=ii&&ii.createElement("template"),Yf={insert:(e,i,o)=>{i.insertBefore(e,o||null)},remove:e=>{const i=e.parentNode;i&&i.removeChild(e)},createElement:(e,i,o,a)=>{const l=i==="svg"?ii.createElementNS(Gf,e):i==="mathml"?ii.createElementNS(qf,e):o?ii.createElement(e,{is:o}):ii.createElement(e);return e==="select"&&a&&a.multiple!=null&&l.setAttribute("multiple",a.multiple),l},createText:e=>ii.createTextNode(e),createComment:e=>ii.createComment(e),setText:(e,i)=>{e.nodeValue=i},setElementText:(e,i)=>{e.textContent=i},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ii.querySelector(e),setScopeId(e,i){e.setAttribute(i,"")},insertStaticContent(e,i,o,a,l,d){const h=o?o.previousSibling:i.lastChild;if(l&&(l===d||l.nextSibling))for(;i.insertBefore(l.cloneNode(!0),o),!(l===d||!(l=l.nextSibling)););else{kl.innerHTML=mc(a==="svg"?`<svg>${e}</svg>`:a==="mathml"?`<math>${e}</math>`:e);const _=kl.content;if(a==="svg"||a==="mathml"){const y=_.firstChild;for(;y.firstChild;)_.appendChild(y.firstChild);_.removeChild(y)}i.insertBefore(_,o)}return[h?h.nextSibling:i.firstChild,o?o.previousSibling:i.lastChild]}},wi="transition",Ks="animation",ho=Symbol("_vtc"),gc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Jf=Oe({},Ru,gc),Xf=e=>(e.displayName="Transition",e.props=Jf,e),Qf=Xf((e,{slots:i})=>Wf(Gd,th(e),i)),Ui=(e,i=[])=>{wt(e)?e.forEach(o=>o(...i)):e&&e(...i)},Sl=e=>e?wt(e)?e.some(i=>i.length>1):e.length>1:!1;function th(e){const i={};for(const nt in e)nt in gc||(i[nt]=e[nt]);if(e.css===!1)return i;const{name:o="v",type:a,duration:l,enterFromClass:d=`${o}-enter-from`,enterActiveClass:h=`${o}-enter-active`,enterToClass:_=`${o}-enter-to`,appearFromClass:y=d,appearActiveClass:T=h,appearToClass:w=_,leaveFromClass:A=`${o}-leave-from`,leaveActiveClass:U=`${o}-leave-active`,leaveToClass:V=`${o}-leave-to`}=e,rt=eh(l),Q=rt&&rt[0],Ot=rt&&rt[1],{onBeforeEnter:Mt,onEnter:q,onEnterCancelled:dt,onLeave:it,onLeaveCancelled:ht,onBeforeAppear:Kt=Mt,onAppear:he=q,onAppearCancelled:pe=dt}=i,St=(nt,ut,zt,Ft)=>{nt._enterCancelled=Ft,Hi(nt,ut?w:_),Hi(nt,ut?T:h),zt&&zt()},Nt=(nt,ut)=>{nt._isLeaving=!1,Hi(nt,A),Hi(nt,V),Hi(nt,U),ut&&ut()},Et=nt=>(ut,zt)=>{const Ft=nt?he:q,lt=()=>St(ut,nt,zt);Ui(Ft,[ut,lt]),Pl(()=>{Hi(ut,nt?y:d),ni(ut,nt?w:_),Sl(Ft)||Tl(ut,a,Q,lt)})};return Oe(i,{onBeforeEnter(nt){Ui(Mt,[nt]),ni(nt,d),ni(nt,h)},onBeforeAppear(nt){Ui(Kt,[nt]),ni(nt,y),ni(nt,T)},onEnter:Et(!1),onAppear:Et(!0),onLeave(nt,ut){nt._isLeaving=!0;const zt=()=>Nt(nt,ut);ni(nt,A),nt._enterCancelled?(ni(nt,U),Ml(nt)):(Ml(nt),ni(nt,U)),Pl(()=>{nt._isLeaving&&(Hi(nt,A),ni(nt,V),Sl(it)||Tl(nt,a,Ot,zt))}),Ui(it,[nt,zt])},onEnterCancelled(nt){St(nt,!1,void 0,!0),Ui(dt,[nt])},onAppearCancelled(nt){St(nt,!0,void 0,!0),Ui(pe,[nt])},onLeaveCancelled(nt){Nt(nt),Ui(ht,[nt])}})}function eh(e){if(e==null)return null;if(ne(e))return[ea(e.enter),ea(e.leave)];{const i=ea(e);return[i,i]}}function ea(e){return id(e)}function ni(e,i){i.split(/\s+/).forEach(o=>o&&e.classList.add(o)),(e[ho]||(e[ho]=new Set)).add(i)}function Hi(e,i){i.split(/\s+/).forEach(a=>a&&e.classList.remove(a));const o=e[ho];o&&(o.delete(i),o.size||(e[ho]=void 0))}function Pl(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let nh=0;function Tl(e,i,o,a){const l=e._endId=++nh,d=()=>{l===e._endId&&a()};if(o!=null)return setTimeout(d,o);const{type:h,timeout:_,propCount:y}=ih(e,i);if(!h)return a();const T=h+"end";let w=0;const A=()=>{e.removeEventListener(T,U),d()},U=V=>{V.target===e&&++w>=y&&A()};setTimeout(()=>{w<y&&A()},_+1),e.addEventListener(T,U)}function ih(e,i){const o=window.getComputedStyle(e),a=rt=>(o[rt]||"").split(", "),l=a(`${wi}Delay`),d=a(`${wi}Duration`),h=Ll(l,d),_=a(`${Ks}Delay`),y=a(`${Ks}Duration`),T=Ll(_,y);let w=null,A=0,U=0;i===wi?h>0&&(w=wi,A=h,U=d.length):i===Ks?T>0&&(w=Ks,A=T,U=y.length):(A=Math.max(h,T),w=A>0?h>T?wi:Ks:null,U=w?w===wi?d.length:y.length:0);const V=w===wi&&/\b(?:transform|all)(?:,|$)/.test(a(`${wi}Property`).toString());return{type:w,timeout:A,propCount:U,hasTransform:V}}function Ll(e,i){for(;e.length<i.length;)e=e.concat(e);return Math.max(...i.map((o,a)=>Cl(o)+Cl(e[a])))}function Cl(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Ml(e){return(e?e.ownerDocument:document).body.offsetHeight}function sh(e,i,o){const a=e[ho];a&&(i=(i?[i,...a]:[...a]).join(" ")),i==null?e.removeAttribute("class"):o?e.setAttribute("class",i):e.className=i}const or=Symbol("_vod"),_c=Symbol("_vsh"),oh={name:"show",beforeMount(e,{value:i},{transition:o}){e[or]=e.style.display==="none"?"":e.style.display,o&&i?o.beforeEnter(e):Gs(e,i)},mounted(e,{value:i},{transition:o}){o&&i&&o.enter(e)},updated(e,{value:i,oldValue:o},{transition:a}){!i!=!o&&(a?i?(a.beforeEnter(e),Gs(e,!0),a.enter(e)):a.leave(e,()=>{Gs(e,!1)}):Gs(e,i))},beforeUnmount(e,{value:i}){Gs(e,i)}};function Gs(e,i){e.style.display=i?e[or]:"none",e[_c]=!i}const rh=Symbol(""),ah=/(?:^|;)\s*display\s*:/;function lh(e,i,o){const a=e.style,l=be(o);let d=!1;if(o&&!l){if(i)if(be(i))for(const h of i.split(";")){const _=h.slice(0,h.indexOf(":")).trim();o[_]==null&&Ys(a,_,"")}else for(const h in i)o[h]==null&&Ys(a,h,"");for(const h in o){h==="display"&&(d=!0);const _=o[h];_!=null?ch(e,h,!be(i)&&i?i[h]:void 0,_)||Ys(a,h,_):Ys(a,h,"")}}else if(l){if(i!==o){const h=a[rh];h&&(o+=";"+h),a.cssText=o,d=ah.test(o)}}else i&&e.removeAttribute("style");or in e&&(e[or]=d?a.display:"",e[_c]&&(a.display="none"))}const Ol=/\s*!important$/;function Ys(e,i,o){if(wt(o))o.forEach(a=>Ys(e,i,a));else if(o==null&&(o=""),i.startsWith("--"))e.setProperty(i,o);else{const a=uh(e,i);Ol.test(o)?e.setProperty(Li(a),o.replace(Ol,""),"important"):e[a]=o}}const El=["Webkit","Moz","ms"],na={};function uh(e,i){const o=na[i];if(o)return o;let a=Tn(i);if(a!=="filter"&&a in e)return na[i]=a;a=lu(a);for(let l=0;l<El.length;l++){const d=El[l]+a;if(d in e)return na[i]=d}return i}function ch(e,i,o,a){return e.tagName==="TEXTAREA"&&(i==="width"||i==="height")&&be(a)&&o===a}const zl="http://www.w3.org/1999/xlink";function Al(e,i,o,a,l,d=ud(i)){a&&i.startsWith("xlink:")?o==null?e.removeAttributeNS(zl,i.slice(6,i.length)):e.setAttributeNS(zl,i,o):o==null||d&&!cu(o)?e.removeAttribute(i):e.setAttribute(i,d?"":Cn(o)?String(o):o)}function Il(e,i,o,a,l){if(i==="innerHTML"||i==="textContent"){o!=null&&(e[i]=i==="innerHTML"?mc(o):o);return}const d=e.tagName;if(i==="value"&&d!=="PROGRESS"&&!d.includes("-")){const _=d==="OPTION"?e.getAttribute("value")||"":e.value,y=o==null?e.type==="checkbox"?"on":"":String(o);(_!==y||!("_value"in e))&&(e.value=y),o==null&&e.removeAttribute(i),e._value=o;return}let h=!1;if(o===""||o==null){const _=typeof e[i];_==="boolean"?o=cu(o):o==null&&_==="string"?(o="",h=!0):_==="number"&&(o=0,h=!0)}try{e[i]=o}catch{}h&&e.removeAttribute(l||i)}function ai(e,i,o,a){e.addEventListener(i,o,a)}function dh(e,i,o,a){e.removeEventListener(i,o,a)}const $l=Symbol("_vei");function fh(e,i,o,a,l=null){const d=e[$l]||(e[$l]={}),h=d[i];if(a&&h)h.value=a;else{const[_,y]=mh(i);if(a){const T=d[i]=vh(a,l);ai(e,_,T,y)}else h&&(dh(e,_,h,y),d[i]=void 0)}}const hh=/(Once|Passive|Capture)$/,ph=/^on:?(?:Once|Passive|Capture)$/;function mh(e){let i,o;for(;(o=e.match(hh))&&!ph.test(e);)i||(i={}),e=e.slice(0,e.length-o[1].length),i[o[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):Li(e.slice(2)),i]}let ia=0;const gh=Promise.resolve(),_h=()=>ia||(gh.then(()=>ia=0),ia=Date.now());function vh(e,i){const o=a=>{if(!a._vts)a._vts=Date.now();else if(a._vts<=o.attached)return;const l=o.value;if(wt(l)){const d=a.stopImmediatePropagation;a.stopImmediatePropagation=()=>{d.call(a),a._stopped=!0};const h=l.slice(),_=[a];for(let y=0;y<h.length&&!a._stopped;y++){const T=h[y];T&&_n(T,i,5,_)}}else _n(l,i,5,[a])};return o.value=e,o.attached=_h(),o}const Dl=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,yh=(e,i,o,a,l,d)=>{const h=l==="svg";i==="class"?sh(e,a,h):i==="style"?lh(e,o,a):ur(i)?cr(i)||fh(e,i,o,a,d):(i[0]==="."?(i=i.slice(1),!0):i[0]==="^"?(i=i.slice(1),!1):bh(e,i,a,h))?(Il(e,i,a),!e.tagName.includes("-")&&(i==="value"||i==="checked"||i==="selected")&&Al(e,i,a,h,d,i!=="value")):e._isVueCE&&(xh(e,i)||e._def.__asyncLoader&&(/[A-Z]/.test(i)||!be(a)))?Il(e,Tn(i),a,d,i):(i==="true-value"?e._trueValue=a:i==="false-value"&&(e._falseValue=a),Al(e,i,a,h))};function bh(e,i,o,a){if(a)return!!(i==="innerHTML"||i==="textContent"||i in e&&Dl(i)&&Dt(o));if(i==="spellcheck"||i==="draggable"||i==="translate"||i==="autocorrect"||i==="sandbox"&&e.tagName==="IFRAME"||i==="form"||i==="list"&&e.tagName==="INPUT"||i==="type"&&e.tagName==="TEXTAREA")return!1;if(i==="width"||i==="height"){const l=e.tagName;if(l==="IMG"||l==="VIDEO"||l==="CANVAS"||l==="SOURCE")return!1}return Dl(i)&&be(o)?!1:i in e}function xh(e,i){const o=e._def.props;if(!o)return!1;const a=Tn(i);return Array.isArray(o)?o.some(l=>Tn(l)===a):Object.keys(o).some(l=>Tn(l)===a)}const Ti=e=>{const i=e.props["onUpdate:modelValue"]||!1;return wt(i)?o=>qo(i,o):i};function wh(e){e.target.composing=!0}function Nl(e){const i=e.target;i.composing&&(i.composing=!1,i.dispatchEvent(new Event("input")))}const gn=Symbol("_assign");function Rl(e,i,o){return i&&(e=e.trim()),o&&(e=fr(e)),e}const vt={created(e,{modifiers:{lazy:i,trim:o,number:a}},l){e[gn]=Ti(l);const d=a||l.props&&l.props.type==="number";ai(e,i?"change":"input",h=>{h.target.composing||e[gn](Rl(e.value,o,d))}),(o||d)&&ai(e,"change",()=>{e.value=Rl(e.value,o,d)}),i||(ai(e,"compositionstart",wh),ai(e,"compositionend",Nl),ai(e,"change",Nl))},mounted(e,{value:i}){e.value=i??""},beforeUpdate(e,{value:i,oldValue:o,modifiers:{lazy:a,trim:l,number:d}},h){if(e[gn]=Ti(h),e.composing)return;const _=(d||e.type==="number")&&!/^0\d/.test(e.value)?fr(e.value):e.value,y=i??"";if(_===y)return;const T=e.getRootNode();(T instanceof Document||T instanceof ShadowRoot)&&T.activeElement===e&&e.type!=="range"&&(a&&i===o||l&&e.value.trim()===y)||(e.value=y)}},rr={deep:!0,created(e,i,o){e[gn]=Ti(o),ai(e,"change",()=>{const a=e._modelValue,l=Ts(e),d=e.checked,h=e[gn];if(wt(a)){const _=wa(a,l),y=_!==-1;if(d&&!y)h(a.concat(l));else if(!d&&y){const T=[...a];T.splice(_,1),h(T)}}else if(Ls(a)){const _=new Set(a);d?_.add(l):_.delete(l),h(_)}else h(vc(e,d))})},mounted:Fl,beforeUpdate(e,i,o){e[gn]=Ti(o),Fl(e,i,o)}};function Fl(e,{value:i,oldValue:o},a){e._modelValue=i;let l;if(wt(i))l=wa(i,a.props.value)>-1;else if(Ls(i))l=i.has(a.props.value);else{if(i===o)return;l=Si(i,vc(e,!0))}e.checked!==l&&(e.checked=l)}const kh={created(e,{value:i},o){e.checked=Si(i,o.props.value),e[gn]=Ti(o),ai(e,"change",()=>{e[gn](Ts(e))})},beforeUpdate(e,{value:i,oldValue:o},a){e[gn]=Ti(a),i!==o&&(e.checked=Si(i,a.props.value))}},sn={deep:!0,created(e,{value:i,modifiers:{number:o}},a){const l=Ls(i);ai(e,"change",()=>{const d=Array.prototype.filter.call(e.options,h=>h.selected).map(h=>o?fr(Ts(h)):Ts(h));e[gn](e.multiple?l?new Set(d):d:d[0]),e._assigning=!0,Mu(()=>{e._assigning=!1})}),e[gn]=Ti(a)},mounted(e,{value:i}){Bl(e,i)},beforeUpdate(e,i,o){e[gn]=Ti(o)},updated(e,{value:i}){e._assigning||Bl(e,i)}};function Bl(e,i){const o=e.multiple,a=wt(i);if(!(o&&!a&&!Ls(i))){for(let l=0,d=e.options.length;l<d;l++){const h=e.options[l],_=Ts(h);if(o)if(a){const y=typeof _;y==="string"||y==="number"?h.selected=i.some(T=>String(T)===String(_)):h.selected=wa(i,_)>-1}else h.selected=i.has(_);else if(Si(Ts(h),i)){e.selectedIndex!==l&&(e.selectedIndex=l);return}}!o&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ts(e){return"_value"in e?e._value:e.value}function vc(e,i){const o=i?"_trueValue":"_falseValue";return o in e?e[o]:i}const Sh={created(e,i,o){Wo(e,i,o,null,"created")},mounted(e,i,o){Wo(e,i,o,null,"mounted")},beforeUpdate(e,i,o,a){Wo(e,i,o,a,"beforeUpdate")},updated(e,i,o,a){Wo(e,i,o,a,"updated")}};function Ph(e,i){switch(e){case"SELECT":return sn;case"TEXTAREA":return vt;default:switch(i){case"checkbox":return rr;case"radio":return kh;default:return vt}}}function Wo(e,i,o,a,l){const h=Ph(e.tagName,o.props&&o.props.type)[l];h&&h(e,i,o,a)}const Th=["ctrl","shift","alt","meta"],Lh={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,i)=>Th.some(o=>e[`${o}Key`]&&!i.includes(o))},yc=(e,i)=>{if(!e)return e;const o=e._withMods||(e._withMods={}),a=i.join(".");return o[a]||(o[a]=((l,...d)=>{for(let h=0;h<i.length;h++){const _=Lh[i[h]];if(_&&_(l,i))return}return e(l,...d)}))},Ch={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Vl=(e,i)=>{const o=e._withKeys||(e._withKeys={}),a=i.join(".");return o[a]||(o[a]=(l=>{if(!("key"in l))return;const d=Li(l.key);if(i.some(h=>h===d||Ch[h]===d))return e(l)}))},Mh=Oe({patchProp:yh},Yf);let Zl;function Oh(){return Zl||(Zl=Mf(Mh))}const Eh=((...e)=>{const i=Oh().createApp(...e),{mount:o}=i;return i.mount=a=>{const l=Ah(a);if(!l)return;const d=i._component;!Dt(d)&&!d.render&&!d.template&&(d.template=l.innerHTML),l.nodeType===1&&(l.textContent="");const h=o(l,!1,zh(l));return l instanceof Element&&(l.removeAttribute("v-cloak"),l.setAttribute("data-v-app","")),h},i});function zh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ah(e){return be(e)?document.querySelector(e):e}const bc="pv_theme",Ul={light:"#EEF0F3",dark:"#0B1730"},ar=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;function xc(){return ar&&ar.matches?"dark":"light"}function Ih(){try{return localStorage.getItem(bc)||"light"}catch{return"light"}}function wc(e){return e==="system"?xc():e}function kc(e){const i=document.documentElement;i.setAttribute("data-theme",e),i.style.backgroundColor=Ul[e]||Ul.light}const qi=G(Ih()),ks=G(wc(qi.value));function lr(e){qi.value=e;const i=wc(e);ks.value=i,kc(i);try{localStorage.setItem(bc,e)}catch{}}function Hl(){lr(ks.value==="dark"?"light":"dark")}ar&&ar.addEventListener("change",()=>{if(qi.value==="system"){const e=xc();ks.value=e,kc(e)}});async function $h(){try{const e=await fetch("/bff/config");return e.ok?await e.json():{apiBase:""}}catch{return{apiBase:""}}}async function jl(){try{const e=await fetch("/bff/me");return e.ok?await e.json():null}catch{return null}}async function Dh(e,i,o){const a=await fetch("/bff/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:i,apiBase:o})});return{ok:a.ok,status:a.status,body:await a.json().catch(()=>({}))}}async function Nh(){try{await fetch("/bff/logout",{method:"POST"})}catch{}}async function Rh(){try{const e=await fetch("/bff/devices");return e.ok?await e.json():[]}catch{return[]}}async function Fh(){try{const e=await fetch("/bff/users");return e.ok?{ok:!0,status:200,users:(await e.json()).users||[]}:{ok:!1,status:e.status,users:[]}}catch{return{ok:!1,status:0,users:[]}}}async function Bh(e,i,o,a){const l=await fetch("/bff/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:i,role:o,organization:a})});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function Vh(e,i){const o=await fetch(`/bff/users/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function Zh(e){const i=await fetch(`/bff/users/${encodeURIComponent(e)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Uh(){try{const e=await fetch("/bff/orgs");return e.ok?{ok:!0,status:200,organizations:(await e.json()).organizations||[]}:{ok:!1,status:e.status,organizations:[]}}catch{return{ok:!1,status:0,organizations:[]}}}async function Hh(e){const i=await fetch("/bff/orgs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function jh(e,i){const o=await fetch(`/bff/orgs/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function Wh(e){const i=await fetch(`/bff/orgs/${encodeURIComponent(e)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Kh(){try{const e=await fetch("/bff/preferences");if(!e.ok)return null;const i=await e.json();return i&&typeof i.preferences=="object"?i.preferences:null}catch{return null}}async function Gh(e){try{return(await fetch("/bff/preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({preferences:e})})).ok}catch{return!1}}async function qh(){try{const e=await fetch("/bff/integrations/opensky");return e.ok?{ok:!0,status:200,body:await e.json()}:{ok:!1,status:e.status,body:await e.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function Wl(e){const i=await fetch("/bff/integrations/opensky",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Yh(){const e=await fetch("/bff/integrations/opensky/health",{method:"POST"});return{ok:e.ok,status:e.status,body:await e.json().catch(()=>({}))}}async function Jh(){try{const e=await fetch("/bff/integrations/filetransfer");return e.ok?{ok:!0,status:200,body:await e.json()}:{ok:!1,status:e.status,body:await e.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function Kl(e){const i=await fetch("/bff/integrations/filetransfer",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Xh(){const e=await fetch("/bff/integrations/filetransfer/health",{method:"POST"});return{ok:e.ok,status:e.status,body:await e.json().catch(()=>({}))}}async function Qh(){try{const e=await fetch("/bff/integrations/localstorage");return e.ok?{ok:!0,status:200,body:await e.json()}:{ok:!1,status:e.status,body:await e.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function Ko(e){const i=await fetch("/bff/integrations/localstorage",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function tp(){const e=await fetch("/bff/integrations/localstorage/health",{method:"POST"});return{ok:e.ok,status:e.status,body:await e.json().catch(()=>({}))}}async function ep(){try{const e=await fetch("/bff/integrations/webdav");return e.ok?{ok:!0,status:200,body:await e.json()}:{ok:!1,status:e.status,body:await e.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function Gl(e){const i=await fetch("/bff/integrations/webdav",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function np(){const e=await fetch("/bff/integrations/webdav/health",{method:"POST"});return{ok:e.ok,status:e.status,body:await e.json().catch(()=>({}))}}async function ip(){try{const e=await fetch("/bff/drones");return e.ok?{ok:!0,status:200,drones:(await e.json()).drones||[]}:{ok:!1,status:e.status,drones:[]}}catch{return{ok:!1,status:0,drones:[]}}}async function sp(e){const i=await fetch("/bff/drones",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function op(e,i){const o=await fetch(`/bff/drones/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function rp(e){const i=await fetch(`/bff/drones/${encodeURIComponent(e)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function ap(){try{const e=await fetch("/bff/flights");return e.ok?{ok:!0,status:200,flights:(await e.json()).flights||[]}:{ok:!1,status:e.status,flights:[]}}catch{return{ok:!1,status:0,flights:[]}}}async function lp(e){const i=await fetch("/bff/flights",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function up(e,i){const o=await fetch(`/bff/flights/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:o.ok,status:o.status,body:await o.json().catch(()=>({}))}}async function cp(e){const i=await fetch(`/bff/flights/${encodeURIComponent(e)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function dp(){return"/bff/logbook/export"}async function fp(e,i,o){const a=await fetch(`/bff/devices/${encodeURIComponent(e)}/command`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:i,payload:o})});return{ok:a.ok,body:await a.json().catch(()=>({}))}}const Sc="pv_prefs",ga={name:"",username:"",displayName:"",bio:"",avatar:"",showEmail:!1,fontSize:"md",language:"en",region:"US",dateFormat:"MDY",timeFormat:"24",reduceMotion:!1,twoFactor:!1};function hp(){try{return{...ga,...JSON.parse(localStorage.getItem(Sc)||"{}")||{}}}catch{return{...ga}}}const Tt=xe(hp());function Pc(){try{localStorage.setItem(Sc,JSON.stringify(Tt))}catch{}}function Tc(e){if(!e||typeof e!="object")return!1;for(const i of Object.keys(ga))i in e&&(Tt[i]=e[i]);return!0}const pp={sm:15,md:16,lg:18};function Aa(e){document.documentElement.style.fontSize=(pp[e]||16)+"px"}function Ia(e){document.documentElement.classList.toggle("reduce-motion",!!e)}function Lc(e){const i=new Date(e),o=i.getFullYear(),a=String(i.getMonth()+1).padStart(2,"0"),l=String(i.getDate()).padStart(2,"0");let d;switch(Tt.dateFormat){case"DMY":d=`${l}/${a}/${o}`;break;case"YMD":d=`${o}/${a}/${l}`;break;case"ISO":d=`${o}-${a}-${l}`;break;default:d=`${a}/${l}/${o}`}let h;return Tt.timeFormat==="12"?h=i.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}):h=`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}:${String(i.getSeconds()).padStart(2,"0")}`,{date:d,time:h}}function ql(e){return Lc(e).time}function Yl(e){const i=Lc(e);return`${i.date} ${i.time}`}let $a=!1,_a=!1,va=null;function mp(){return{...JSON.parse(JSON.stringify(Tt)),themeMode:qi.value}}function Da(){!$a||_a||(clearTimeout(va),va=setTimeout(()=>{Gh(mp())},600))}function gp(e){_a=!0;try{Tc(e),e.themeMode&&lr(e.themeMode),Aa(Tt.fontSize),Ia(Tt.reduceMotion),Pc()}finally{_a=!1}}async function Jl(){$a=!0;const e=await Kh();e&&Object.keys(e).length?gp(e):Da()}function _p(){$a=!1,clearTimeout(va)}Qe(Tt,()=>{Pc(),Da()},{deep:!0});Qe(qi,Da);Qe(()=>Tt.fontSize,Aa,{immediate:!0});Qe(()=>Tt.reduceMotion,Ia,{immediate:!0});const vp=["width","height"],Cc={__name:"BrandMark",props:{size:{type:[Number,String],default:28}},setup(e){return(i,o)=>(g(),x("svg",{width:e.size,height:e.size,viewBox:"0 0 48 48",fill:"none","aria-hidden":"true"},[...o[0]||(o[0]=[u("g",{"stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"},[u("polyline",{points:"8,30 19,17 30,30",stroke:"var(--accent)"}),u("polyline",{points:"18,33 29,20 40,33",stroke:"currentColor"})],-1)])],8,vp))}},yp=["title","aria-label"],bp={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},xp={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},wp={__name:"ThemeToggle",setup(e){return(i,o)=>(g(),x("button",{class:"btn-icon",type:"button",title:$t(ks)==="dark"?"Switch to light":"Switch to dark","aria-label":$t(ks)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:o[0]||(o[0]=(...a)=>$t(Hl)&&$t(Hl)(...a))},[$t(ks)==="dark"?(g(),x("svg",bp,[...o[1]||(o[1]=[u("circle",{cx:"12",cy:"12",r:"4"},null,-1),u("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"},null,-1)])])):(g(),x("svg",xp,[...o[2]||(o[2]=[u("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z"},null,-1)])]))],8,yp))}},kp={class:"relative grid h-full place-items-center p-5"},Sp={class:"absolute right-5 top-5"},Pp={class:"mb-6 flex items-center gap-3 text-ink"},Tp={class:"relative mb-1"},Lp=["type"],Cp=["aria-label","title"],Mp={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-[18px] w-[18px]"},Op={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"h-[18px] w-[18px]"},Ep={key:0,class:"mt-4"},zp={key:1,class:"mt-4 rounded border border-line bg-danger-soft px-3 py-2 text-sm text-danger-fg"},Ap=["disabled"],Ip={__name:"LoginView",props:{defaultApiBase:{type:String,default:""}},emits:["signed-in"],setup(e,{emit:i}){const o=e,a=i,l=G(""),d=G(""),h=G(localStorage.getItem("api_url")||o.defaultApiBase||"http://localhost:8080"),_=G(!1),y=G(!1),T=G(!1),w=G("");async function A(){T.value=!0,w.value="",localStorage.setItem("api_url",h.value.trim());const{ok:U,status:V,body:rt}=await Dh(l.value.trim(),d.value,h.value.trim());if(T.value=!1,U){a("signed-in",rt.email);return}w.value=V===400?"Invalid email or password.":V===502?"API server can't reach PocketBase.":rt.message||rt.error||"Cannot reach the API server."}return(U,V)=>(g(),x("div",kp,[u("div",Sp,[O(wp)]),u("form",{class:"panel w-[380px] p-8 shadow-md",onSubmit:yc(A,["prevent"])},[u("div",Pp,[O(Cc,{size:34}),V[5]||(V[5]=u("div",{class:"leading-tight"},[u("div",{class:"text-mode"},"PilotVault"),u("div",{class:"eyebrow mt-0.5"},"Control panel")],-1))]),V[9]||(V[9]=u("label",{class:"eyebrow mb-1.5 block"},"Email",-1)),ot(u("input",{"onUpdate:modelValue":V[0]||(V[0]=rt=>l.value=rt),type:"email",autocomplete:"username",required:"",class:"field mb-4",placeholder:"you@example.com"},null,512),[[vt,l.value]]),V[10]||(V[10]=u("label",{class:"eyebrow mb-1.5 block"},"Password",-1)),u("div",Tp,[ot(u("input",{"onUpdate:modelValue":V[1]||(V[1]=rt=>d.value=rt),type:y.value?"text":"password",autocomplete:"current-password",required:"",class:"field w-full pr-10",placeholder:"••••••••"},null,8,Lp),[[Sh,d.value]]),u("button",{type:"button",class:"absolute inset-y-0 right-0 grid w-10 place-items-center text-ink-muted transition hover:text-ink-secondary","aria-label":y.value?"Hide password":"Show password",title:y.value?"Hide password":"Show password",onClick:V[2]||(V[2]=rt=>y.value=!y.value)},[y.value?(g(),x("svg",Mp,[...V[6]||(V[6]=[u("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},null,-1),u("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])])):(g(),x("svg",Op,[...V[7]||(V[7]=[u("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),u("circle",{cx:"12",cy:"12",r:"3"},null,-1)])]))],8,Cp)]),_.value?(g(),x("div",Ep,[V[8]||(V[8]=u("label",{class:"eyebrow mb-1.5 block"},"API Server",-1)),ot(u("input",{"onUpdate:modelValue":V[3]||(V[3]=rt=>h.value=rt),type:"text",class:"field font-mono",placeholder:"10.2.1.101:8080"},null,512),[[vt,h.value]])])):N("",!0),w.value?(g(),x("p",zp,P(w.value),1)):N("",!0),u("button",{type:"submit",class:"btn-accent mt-6 w-full",disabled:T.value},P(T.value?"Signing in…":"Sign in"),9,Ap),u("button",{type:"button",class:"mx-auto mt-3 block text-xs text-ink-muted transition hover:text-ink-secondary",onClick:V[4]||(V[4]=rt=>_.value=!_.value)},P(_.value?"Hide server settings":"Server settings"),1)],32)]))}};function $p(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Js={exports:{}};/* @preserve
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
*/var Dp=Js.exports,Xl;function Np(){return Xl||(Xl=1,(function(e,i){(function(o,a){a(i)})(Dp,(function(o){var a="1.9.4";function l(t){var n,s,r,c;for(s=1,r=arguments.length;s<r;s++){c=arguments[s];for(n in c)t[n]=c[n]}return t}var d=Object.create||(function(){function t(){}return function(n){return t.prototype=n,new t}})();function h(t,n){var s=Array.prototype.slice;if(t.bind)return t.bind.apply(t,s.call(arguments,1));var r=s.call(arguments,2);return function(){return t.apply(n,r.length?r.concat(s.call(arguments)):arguments)}}var _=0;function y(t){return"_leaflet_id"in t||(t._leaflet_id=++_),t._leaflet_id}function T(t,n,s){var r,c,p,S;return S=function(){r=!1,c&&(p.apply(s,c),c=!1)},p=function(){r?c=arguments:(t.apply(s,arguments),setTimeout(S,n),r=!0)},p}function w(t,n,s){var r=n[1],c=n[0],p=r-c;return t===r&&s?t:((t-c)%p+p)%p+c}function A(){return!1}function U(t,n){if(n===!1)return t;var s=Math.pow(10,n===void 0?6:n);return Math.round(t*s)/s}function V(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function rt(t){return V(t).split(/\s+/)}function Q(t,n){Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?d(t.options):{});for(var s in n)t.options[s]=n[s];return t.options}function Ot(t,n,s){var r=[];for(var c in t)r.push(encodeURIComponent(s?c.toUpperCase():c)+"="+encodeURIComponent(t[c]));return(!n||n.indexOf("?")===-1?"?":"&")+r.join("&")}var Mt=/\{ *([\w_ -]+) *\}/g;function q(t,n){return t.replace(Mt,function(s,r){var c=n[r];if(c===void 0)throw new Error("No value provided for variable "+s);return typeof c=="function"&&(c=c(n)),c})}var dt=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function it(t,n){for(var s=0;s<t.length;s++)if(t[s]===n)return s;return-1}var ht="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function Kt(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var he=0;function pe(t){var n=+new Date,s=Math.max(0,16-(n-he));return he=n+s,window.setTimeout(t,s)}var St=window.requestAnimationFrame||Kt("RequestAnimationFrame")||pe,Nt=window.cancelAnimationFrame||Kt("CancelAnimationFrame")||Kt("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function Et(t,n,s){if(s&&St===pe)t.call(n);else return St.call(window,h(t,n))}function nt(t){t&&Nt.call(window,t)}var ut={__proto__:null,extend:l,create:d,bind:h,get lastId(){return _},stamp:y,throttle:T,wrapNum:w,falseFn:A,formatNum:U,trim:V,splitWords:rt,setOptions:Q,getParamString:Ot,template:q,isArray:dt,indexOf:it,emptyImageUrl:ht,requestFn:St,cancelFn:Nt,requestAnimFrame:Et,cancelAnimFrame:nt};function zt(){}zt.extend=function(t){var n=function(){Q(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},s=n.__super__=this.prototype,r=d(s);r.constructor=n,n.prototype=r;for(var c in this)Object.prototype.hasOwnProperty.call(this,c)&&c!=="prototype"&&c!=="__super__"&&(n[c]=this[c]);return t.statics&&l(n,t.statics),t.includes&&(Ft(t.includes),l.apply(null,[r].concat(t.includes))),l(r,t),delete r.statics,delete r.includes,r.options&&(r.options=s.options?d(s.options):{},l(r.options,t.options)),r._initHooks=[],r.callInitHooks=function(){if(!this._initHooksCalled){s.callInitHooks&&s.callInitHooks.call(this),this._initHooksCalled=!0;for(var p=0,S=r._initHooks.length;p<S;p++)r._initHooks[p].call(this)}},n},zt.include=function(t){var n=this.prototype.options;return l(this.prototype,t),t.options&&(this.prototype.options=n,this.mergeOptions(t.options)),this},zt.mergeOptions=function(t){return l(this.prototype.options,t),this},zt.addInitHook=function(t){var n=Array.prototype.slice.call(arguments,1),s=typeof t=="function"?t:function(){this[t].apply(this,n)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(s),this};function Ft(t){if(!(typeof L>"u"||!L||!L.Mixin)){t=dt(t)?t:[t];for(var n=0;n<t.length;n++)t[n]===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 lt={on:function(t,n,s){if(typeof t=="object")for(var r in t)this._on(r,t[r],n);else{t=rt(t);for(var c=0,p=t.length;c<p;c++)this._on(t[c],n,s)}return this},off:function(t,n,s){if(!arguments.length)delete this._events;else if(typeof t=="object")for(var r in t)this._off(r,t[r],n);else{t=rt(t);for(var c=arguments.length===1,p=0,S=t.length;p<S;p++)c?this._off(t[p]):this._off(t[p],n,s)}return this},_on:function(t,n,s,r){if(typeof n!="function"){console.warn("wrong listener type: "+typeof n);return}if(this._listens(t,n,s)===!1){s===this&&(s=void 0);var c={fn:n,ctx:s};r&&(c.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(c)}},_off:function(t,n,s){var r,c,p;if(this._events&&(r=this._events[t],!!r)){if(arguments.length===1){if(this._firingCount)for(c=0,p=r.length;c<p;c++)r[c].fn=A;delete this._events[t];return}if(typeof n!="function"){console.warn("wrong listener type: "+typeof n);return}var S=this._listens(t,n,s);if(S!==!1){var z=r[S];this._firingCount&&(z.fn=A,this._events[t]=r=r.slice()),r.splice(S,1)}}},fire:function(t,n,s){if(!this.listens(t,s))return this;var r=l({},n,{type:t,target:this,sourceTarget:n&&n.sourceTarget||this});if(this._events){var c=this._events[t];if(c){this._firingCount=this._firingCount+1||1;for(var p=0,S=c.length;p<S;p++){var z=c[p],I=z.fn;z.once&&this.off(t,I,z.ctx),I.call(z.ctx||this,r)}this._firingCount--}}return s&&this._propagateEvent(r),this},listens:function(t,n,s,r){typeof t!="string"&&console.warn('"string" type argument expected');var c=n;typeof n!="function"&&(r=!!n,c=void 0,s=void 0);var p=this._events&&this._events[t];if(p&&p.length&&this._listens(t,c,s)!==!1)return!0;if(r){for(var S in this._eventParents)if(this._eventParents[S].listens(t,n,s,r))return!0}return!1},_listens:function(t,n,s){if(!this._events)return!1;var r=this._events[t]||[];if(!n)return!!r.length;s===this&&(s=void 0);for(var c=0,p=r.length;c<p;c++)if(r[c].fn===n&&r[c].ctx===s)return c;return!1},once:function(t,n,s){if(typeof t=="object")for(var r in t)this._on(r,t[r],n,!0);else{t=rt(t);for(var c=0,p=t.length;c<p;c++)this._on(t[c],n,s,!0)}return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[y(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[y(t)],this},_propagateEvent:function(t){for(var n in this._eventParents)this._eventParents[n].fire(t.type,l({layer:t.target,propagatedFrom:t.target},t),!0)}};lt.addEventListener=lt.on,lt.removeEventListener=lt.clearAllEventListeners=lt.off,lt.addOneTimeEventListener=lt.once,lt.fireEvent=lt.fire,lt.hasEventListeners=lt.listens;var At=zt.extend(lt);function et(t,n,s){this.x=s?Math.round(t):t,this.y=s?Math.round(n):n}var ce=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};et.prototype={clone:function(){return new et(this.x,this.y)},add:function(t){return this.clone()._add(pt(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(pt(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new et(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new et(this.x/t.x,this.y/t.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=ce(this.x),this.y=ce(this.y),this},distanceTo:function(t){t=pt(t);var n=t.x-this.x,s=t.y-this.y;return Math.sqrt(n*n+s*s)},equals:function(t){return t=pt(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=pt(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+U(this.x)+", "+U(this.y)+")"}};function pt(t,n,s){return t instanceof et?t:dt(t)?new et(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new et(t.x,t.y):new et(t,n,s)}function kt(t,n){if(t)for(var s=n?[t,n]:t,r=0,c=s.length;r<c;r++)this.extend(s[r])}kt.prototype={extend:function(t){var n,s;if(!t)return this;if(t instanceof et||typeof t[0]=="number"||"x"in t)n=s=pt(t);else if(t=Yt(t),n=t.min,s=t.max,!n||!s)return this;return!this.min&&!this.max?(this.min=n.clone(),this.max=s.clone()):(this.min.x=Math.min(n.x,this.min.x),this.max.x=Math.max(s.x,this.max.x),this.min.y=Math.min(n.y,this.min.y),this.max.y=Math.max(s.y,this.max.y)),this},getCenter:function(t){return pt((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return pt(this.min.x,this.max.y)},getTopRight:function(){return pt(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(t){var n,s;return typeof t[0]=="number"||t instanceof et?t=pt(t):t=Yt(t),t instanceof kt?(n=t.min,s=t.max):n=s=t,n.x>=this.min.x&&s.x<=this.max.x&&n.y>=this.min.y&&s.y<=this.max.y},intersects:function(t){t=Yt(t);var n=this.min,s=this.max,r=t.min,c=t.max,p=c.x>=n.x&&r.x<=s.x,S=c.y>=n.y&&r.y<=s.y;return p&&S},overlaps:function(t){t=Yt(t);var n=this.min,s=this.max,r=t.min,c=t.max,p=c.x>n.x&&r.x<s.x,S=c.y>n.y&&r.y<s.y;return p&&S},isValid:function(){return!!(this.min&&this.max)},pad:function(t){var n=this.min,s=this.max,r=Math.abs(n.x-s.x)*t,c=Math.abs(n.y-s.y)*t;return Yt(pt(n.x-r,n.y-c),pt(s.x+r,s.y+c))},equals:function(t){return t?(t=Yt(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight())):!1}};function Yt(t,n){return!t||t instanceof kt?t:new kt(t,n)}function ae(t,n){if(t)for(var s=n?[t,n]:t,r=0,c=s.length;r<c;r++)this.extend(s[r])}ae.prototype={extend:function(t){var n=this._southWest,s=this._northEast,r,c;if(t instanceof Bt)r=t,c=t;else if(t instanceof ae){if(r=t._southWest,c=t._northEast,!r||!c)return this}else return t?this.extend(j(t)||Jt(t)):this;return!n&&!s?(this._southWest=new Bt(r.lat,r.lng),this._northEast=new Bt(c.lat,c.lng)):(n.lat=Math.min(r.lat,n.lat),n.lng=Math.min(r.lng,n.lng),s.lat=Math.max(c.lat,s.lat),s.lng=Math.max(c.lng,s.lng)),this},pad:function(t){var n=this._southWest,s=this._northEast,r=Math.abs(n.lat-s.lat)*t,c=Math.abs(n.lng-s.lng)*t;return new ae(new Bt(n.lat-r,n.lng-c),new Bt(s.lat+r,s.lng+c))},getCenter:function(){return new Bt((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 Bt(this.getNorth(),this.getWest())},getSouthEast:function(){return new Bt(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(t){typeof t[0]=="number"||t instanceof Bt||"lat"in t?t=j(t):t=Jt(t);var n=this._southWest,s=this._northEast,r,c;return t instanceof ae?(r=t.getSouthWest(),c=t.getNorthEast()):r=c=t,r.lat>=n.lat&&c.lat<=s.lat&&r.lng>=n.lng&&c.lng<=s.lng},intersects:function(t){t=Jt(t);var n=this._southWest,s=this._northEast,r=t.getSouthWest(),c=t.getNorthEast(),p=c.lat>=n.lat&&r.lat<=s.lat,S=c.lng>=n.lng&&r.lng<=s.lng;return p&&S},overlaps:function(t){t=Jt(t);var n=this._southWest,s=this._northEast,r=t.getSouthWest(),c=t.getNorthEast(),p=c.lat>n.lat&&r.lat<s.lat,S=c.lng>n.lng&&r.lng<s.lng;return p&&S},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,n){return t?(t=Jt(t),this._southWest.equals(t.getSouthWest(),n)&&this._northEast.equals(t.getNorthEast(),n)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function Jt(t,n){return t instanceof ae?t:new ae(t,n)}function Bt(t,n,s){if(isNaN(t)||isNaN(n))throw new Error("Invalid LatLng object: ("+t+", "+n+")");this.lat=+t,this.lng=+n,s!==void 0&&(this.alt=+s)}Bt.prototype={equals:function(t,n){if(!t)return!1;t=j(t);var s=Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng));return s<=(n===void 0?1e-9:n)},toString:function(t){return"LatLng("+U(this.lat,t)+", "+U(this.lng,t)+")"},distanceTo:function(t){return E.distance(this,j(t))},wrap:function(){return E.wrapLatLng(this)},toBounds:function(t){var n=180*t/40075017,s=n/Math.cos(Math.PI/180*this.lat);return Jt([this.lat-n,this.lng-s],[this.lat+n,this.lng+s])},clone:function(){return new Bt(this.lat,this.lng,this.alt)}};function j(t,n,s){return t instanceof Bt?t:dt(t)&&typeof t[0]!="object"?t.length===3?new Bt(t[0],t[1],t[2]):t.length===2?new Bt(t[0],t[1]):null:t==null?t:typeof t=="object"&&"lat"in t?new Bt(t.lat,"lng"in t?t.lng:t.lon,t.alt):n===void 0?null:new Bt(t,n,s)}var C={latLngToPoint:function(t,n){var s=this.projection.project(t),r=this.scale(n);return this.transformation._transform(s,r)},pointToLatLng:function(t,n){var s=this.scale(n),r=this.transformation.untransform(t,s);return this.projection.unproject(r)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var n=this.projection.bounds,s=this.scale(t),r=this.transformation.transform(n.min,s),c=this.transformation.transform(n.max,s);return new kt(r,c)},infinite:!1,wrapLatLng:function(t){var n=this.wrapLng?w(t.lng,this.wrapLng,!0):t.lng,s=this.wrapLat?w(t.lat,this.wrapLat,!0):t.lat,r=t.alt;return new Bt(s,n,r)},wrapLatLngBounds:function(t){var n=t.getCenter(),s=this.wrapLatLng(n),r=n.lat-s.lat,c=n.lng-s.lng;if(r===0&&c===0)return t;var p=t.getSouthWest(),S=t.getNorthEast(),z=new Bt(p.lat-r,p.lng-c),I=new Bt(S.lat-r,S.lng-c);return new ae(z,I)}},E=l({},C,{wrapLng:[-180,180],R:6371e3,distance:function(t,n){var s=Math.PI/180,r=t.lat*s,c=n.lat*s,p=Math.sin((n.lat-t.lat)*s/2),S=Math.sin((n.lng-t.lng)*s/2),z=p*p+Math.cos(r)*Math.cos(c)*S*S,I=2*Math.atan2(Math.sqrt(z),Math.sqrt(1-z));return this.R*I}}),_e=6378137,se={R:_e,MAX_LATITUDE:85.0511287798,project:function(t){var n=Math.PI/180,s=this.MAX_LATITUDE,r=Math.max(Math.min(s,t.lat),-s),c=Math.sin(r*n);return new et(this.R*t.lng*n,this.R*Math.log((1+c)/(1-c))/2)},unproject:function(t){var n=180/Math.PI;return new Bt((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*n,t.x*n/this.R)},bounds:(function(){var t=_e*Math.PI;return new kt([-t,-t],[t,t])})()};function Ge(t,n,s,r){if(dt(t)){this._a=t[0],this._b=t[1],this._c=t[2],this._d=t[3];return}this._a=t,this._b=n,this._c=s,this._d=r}Ge.prototype={transform:function(t,n){return this._transform(t.clone(),n)},_transform:function(t,n){return n=n||1,t.x=n*(this._a*t.x+this._b),t.y=n*(this._c*t.y+this._d),t},untransform:function(t,n){return n=n||1,new et((t.x/n-this._b)/this._a,(t.y/n-this._d)/this._c)}};function v(t,n,s,r){return new Ge(t,n,s,r)}var m=l({},E,{code:"EPSG:3857",projection:se,transformation:(function(){var t=.5/(Math.PI*se.R);return v(t,.5,-t,.5)})()}),M=l({},m,{code:"EPSG:900913"});function F(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function R(t,n){var s="",r,c,p,S,z,I;for(r=0,p=t.length;r<p;r++){for(z=t[r],c=0,S=z.length;c<S;c++)I=z[c],s+=(c?"L":"M")+I.x+" "+I.y;s+=n?ft.svg?"z":"x":""}return s||"M0 0"}var B=document.documentElement.style,J="ActiveXObject"in window,D=J&&!document.addEventListener,K="msLaunchUri"in navigator&&!("documentMode"in document),Z=Vt("webkit"),yt=Vt("android"),st=Vt("android 2")||Vt("android 3"),tt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),bt=yt&&Vt("Google")&&tt<537&&!("AudioNode"in window),Rt=!!window.opera,gt=!K&&Vt("chrome"),Ht=Vt("gecko")&&!Z&&!Rt&&!J,le=!gt&&Vt("safari"),me=Vt("phantom"),ve="OTransition"in B,Te=navigator.platform.indexOf("Win")===0,vn=J&&"transition"in B,ci="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!st,ke="MozPerspective"in B,Ie=!window.L_DISABLE_3D&&(vn||ci||ke)&&!ve&&!me,On=typeof orientation<"u"||Vt("mobile"),Be=On&&Z,Ji=On&&ci,Ee=!window.PointerEvent&&window.MSPointerEvent,Ve=!!(window.PointerEvent||Ee),ye="ontouchstart"in window||!!window.TouchEvent,wr=!window.L_NO_TOUCH&&(ye||Ve),_o=On&&Rt,Cs=On&&Ht,kr=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,Sr=(function(){var t=!1;try{var n=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",A,n),window.removeEventListener("testPassiveEventSupport",A,n)}catch{}return t})(),Pr=(function(){return!!document.createElement("canvas").getContext})(),Ms=!!(document.createElementNS&&F("svg").createSVGRect),vo=!!Ms&&(function(){var t=document.createElement("div");return t.innerHTML="<svg/>",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Tr=!Ms&&(function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var n=t.firstChild;return n.style.behavior="url(#default#VML)",n&&typeof n.adj=="object"}catch{return!1}})(),Lr=navigator.platform.indexOf("Mac")===0,Cr=navigator.platform.indexOf("Linux")===0;function Vt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var ft={ie:J,ielt9:D,edge:K,webkit:Z,android:yt,android23:st,androidStock:bt,opera:Rt,chrome:gt,gecko:Ht,safari:le,phantom:me,opera12:ve,win:Te,ie3d:vn,webkit3d:ci,gecko3d:ke,any3d:Ie,mobile:On,mobileWebkit:Be,mobileWebkit3d:Ji,msPointer:Ee,pointer:Ve,touch:wr,touchNative:ye,mobileOpera:_o,mobileGecko:Cs,retina:kr,passiveEvents:Sr,canvas:Pr,svg:Ms,vml:Tr,inlineSvg:vo,mac:Lr,linux:Cr},Xi=ft.msPointer?"MSPointerDown":"pointerdown",ze=ft.msPointer?"MSPointerMove":"pointermove",di=ft.msPointer?"MSPointerUp":"pointerup",Ci=ft.msPointer?"MSPointerCancel":"pointercancel",fi={touchstart:Xi,touchmove:ze,touchend:di,touchcancel:Ci},rn={touchstart:bo,touchmove:Ze,touchend:Ze,touchcancel:Ze},tn={},yo=!1;function Os(t,n,s){return n==="touchstart"&&hi(),rn[n]?(s=rn[n].bind(this,s),t.addEventListener(fi[n],s,!1),s):(console.warn("wrong event specified:",n),A)}function Es(t,n,s){if(!fi[n]){console.warn("wrong event specified:",n);return}t.removeEventListener(fi[n],s,!1)}function Mr(t){tn[t.pointerId]=t}function an(t){tn[t.pointerId]&&(tn[t.pointerId]=t)}function yn(t){delete tn[t.pointerId]}function hi(){yo||(document.addEventListener(Xi,Mr,!0),document.addEventListener(ze,an,!0),document.addEventListener(di,yn,!0),document.addEventListener(Ci,yn,!0),yo=!0)}function Ze(t,n){if(n.pointerType!==(n.MSPOINTER_TYPE_MOUSE||"mouse")){n.touches=[];for(var s in tn)n.touches.push(tn[s]);n.changedTouches=[n],t(n)}}function bo(t,n){n.MSPOINTER_TYPE_TOUCH&&n.pointerType===n.MSPOINTER_TYPE_TOUCH&&Le(n),Ze(t,n)}function zs(t){var n={},s,r;for(r in t)s=t[r],n[r]=s&&s.bind?s.bind(t):s;return t=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var Or=200;function Er(t,n){t.addEventListener("dblclick",n);var s=0,r;function c(p){if(p.detail!==1){r=p.detail;return}if(!(p.pointerType==="mouse"||p.sourceCapabilities&&!p.sourceCapabilities.firesTouchEvents)){var S=So(p);if(!(S.some(function(I){return I instanceof HTMLLabelElement&&I.attributes.for})&&!S.some(function(I){return I instanceof HTMLInputElement||I instanceof HTMLSelectElement}))){var z=Date.now();z-s<=Or?(r++,r===2&&n(zs(p))):r=1,s=z}}}return t.addEventListener("click",c),{dblclick:n,simDblclick:c}}function zr(t,n){t.removeEventListener("dblclick",n.dblclick),t.removeEventListener("click",n.simDblclick)}var As=Qi(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),pi=Qi(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),xo=pi==="webkitTransition"||pi==="OTransition"?pi+"End":"transitionend";function wo(t){return typeof t=="string"?document.getElementById(t):t}function Mi(t,n){var s=t.style[n]||t.currentStyle&&t.currentStyle[n];if((!s||s==="auto")&&document.defaultView){var r=document.defaultView.getComputedStyle(t,null);s=r?r[n]:null}return s==="auto"?null:s}function X(t,n,s){var r=document.createElement(t);return r.className=n||"",s&&s.appendChild(r),r}function Qt(t){var n=t.parentNode;n&&n.removeChild(t)}function jn(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function ln(t){var n=t.parentNode;n&&n.lastChild!==t&&n.appendChild(t)}function bn(t){var n=t.parentNode;n&&n.firstChild!==t&&n.insertBefore(t,n.firstChild)}function mi(t,n){if(t.classList!==void 0)return t.classList.contains(n);var s=Oi(t);return s.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(s)}function Pt(t,n){if(t.classList!==void 0)for(var s=rt(n),r=0,c=s.length;r<c;r++)t.classList.add(s[r]);else if(!mi(t,n)){var p=Oi(t);Wn(t,(p?p+" ":"")+n)}}function oe(t,n){t.classList!==void 0?t.classList.remove(n):Wn(t,V((" "+Oi(t)+" ").replace(" "+n+" "," ")))}function Wn(t,n){t.className.baseVal===void 0?t.className=n:t.className.baseVal=n}function Oi(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}function $e(t,n){"opacity"in t.style?t.style.opacity=n:"filter"in t.style&&Is(t,n)}function Is(t,n){var s=!1,r="DXImageTransform.Microsoft.Alpha";try{s=t.filters.item(r)}catch{if(n===1)return}n=Math.round(n*100),s?(s.Enabled=n!==100,s.Opacity=n):t.style.filter+=" progid:"+r+"(opacity="+n+")"}function Qi(t){for(var n=document.documentElement.style,s=0;s<t.length;s++)if(t[s]in n)return t[s];return!1}function Se(t,n,s){var r=n||new et(0,0);t.style[As]=(ft.ie3d?"translate("+r.x+"px,"+r.y+"px)":"translate3d("+r.x+"px,"+r.y+"px,0)")+(s?" scale("+s+")":"")}function ge(t,n){t._leaflet_pos=n,ft.any3d?Se(t,n):(t.style.left=n.x+"px",t.style.top=n.y+"px")}function En(t){return t._leaflet_pos||new et(0,0)}var gi,Ei,ts;if("onselectstart"in document)gi=function(){It(window,"selectstart",Le)},Ei=function(){te(window,"selectstart",Le)};else{var xn=Qi(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);gi=function(){if(xn){var t=document.documentElement.style;ts=t[xn],t[xn]="none"}},Ei=function(){xn&&(document.documentElement.style[xn]=ts,ts=void 0)}}function $s(){It(window,"dragstart",Le)}function Ds(){te(window,"dragstart",Le)}var es,Ns;function ns(t){for(;t.tabIndex===-1;)t=t.parentNode;t.style&&(is(),es=t,Ns=t.style.outlineStyle,t.style.outlineStyle="none",It(window,"keydown",is))}function is(){es&&(es.style.outlineStyle=Ns,es=void 0,Ns=void 0,te(window,"keydown",is))}function ko(t){do t=t.parentNode;while((!t.offsetWidth||!t.offsetHeight)&&t!==document.body);return t}function Rs(t){var n=t.getBoundingClientRect();return{x:n.width/t.offsetWidth||1,y:n.height/t.offsetHeight||1,boundingClientRect:n}}var Ar={__proto__:null,TRANSFORM:As,TRANSITION:pi,TRANSITION_END:xo,get:wo,getStyle:Mi,create:X,remove:Qt,empty:jn,toFront:ln,toBack:bn,hasClass:mi,addClass:Pt,removeClass:oe,setClass:Wn,getClass:Oi,setOpacity:$e,testProp:Qi,setTransform:Se,setPosition:ge,getPosition:En,get disableTextSelection(){return gi},get enableTextSelection(){return Ei},disableImageDrag:$s,enableImageDrag:Ds,preventOutline:ns,restoreOutline:is,getSizedParentNode:ko,getScale:Rs};function It(t,n,s,r){if(n&&typeof n=="object")for(var c in n)zi(t,c,n[c],s);else{n=rt(n);for(var p=0,S=n.length;p<S;p++)zi(t,n[p],s,r)}return this}var un="_leaflet_events";function te(t,n,s,r){if(arguments.length===1)ss(t),delete t[un];else if(n&&typeof n=="object")for(var c in n)jt(t,c,n[c],s);else if(n=rt(n),arguments.length===2)ss(t,function(z){return it(n,z)!==-1});else for(var p=0,S=n.length;p<S;p++)jt(t,n[p],s,r);return this}function ss(t,n){for(var s in t[un]){var r=s.split(/\d/)[0];(!n||n(r))&&jt(t,r,null,null,s)}}var _i={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function zi(t,n,s,r){var c=n+y(s)+(r?"_"+y(r):"");if(t[un]&&t[un][c])return this;var p=function(z){return s.call(r||t,z||window.event)},S=p;!ft.touchNative&&ft.pointer&&n.indexOf("touch")===0?p=Os(t,n,p):ft.touch&&n==="dblclick"?p=Er(t,p):"addEventListener"in t?n==="touchstart"||n==="touchmove"||n==="wheel"||n==="mousewheel"?t.addEventListener(_i[n]||n,p,ft.passiveEvents?{passive:!1}:!1):n==="mouseenter"||n==="mouseleave"?(p=function(z){z=z||window.event,Kn(t,z)&&S(z)},t.addEventListener(_i[n],p,!1)):t.addEventListener(n,S,!1):t.attachEvent("on"+n,p),t[un]=t[un]||{},t[un][c]=p}function jt(t,n,s,r,c){c=c||n+y(s)+(r?"_"+y(r):"");var p=t[un]&&t[un][c];if(!p)return this;!ft.touchNative&&ft.pointer&&n.indexOf("touch")===0?Es(t,n,p):ft.touch&&n==="dblclick"?zr(t,p):"removeEventListener"in t?t.removeEventListener(_i[n]||n,p,!1):t.detachEvent("on"+n,p),t[un][c]=null}function we(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function zn(t){return zi(t,"wheel",we),this}function vi(t){return It(t,"mousedown touchstart dblclick contextmenu",we),t._leaflet_disable_click=!0,this}function Le(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function wn(t){return Le(t),we(t),this}function So(t){if(t.composedPath)return t.composedPath();for(var n=[],s=t.target;s;)n.push(s),s=s.parentNode;return n}function Po(t,n){if(!n)return new et(t.clientX,t.clientY);var s=Rs(n),r=s.boundingClientRect;return new et((t.clientX-r.left)/s.x-n.clientLeft,(t.clientY-r.top)/s.y-n.clientTop)}var Ir=ft.linux&&ft.chrome?window.devicePixelRatio:ft.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function To(t){return ft.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/Ir:t.deltaY&&t.deltaMode===1?-t.deltaY*20:t.deltaY&&t.deltaMode===2?-t.deltaY*60:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?-t.detail*20:t.detail?t.detail/-32765*60:0}function Kn(t,n){var s=n.relatedTarget;if(!s)return!0;try{for(;s&&s!==t;)s=s.parentNode}catch{return!1}return s!==t}var Lo={__proto__:null,on:It,off:te,stopPropagation:we,disableScrollPropagation:zn,disableClickPropagation:vi,preventDefault:Le,stop:wn,getPropagationPath:So,getMousePosition:Po,getWheelDelta:To,isExternalTarget:Kn,addListener:It,removeListener:te},Ai=At.extend({run:function(t,n,s,r){this.stop(),this._el=t,this._inProgress=!0,this._duration=s||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=En(t),this._offset=n.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=Et(this._animate,this),this._step()},_step:function(t){var n=+new Date-this._startTime,s=this._duration*1e3;n<s?this._runFrame(this._easeOut(n/s),t):(this._runFrame(1),this._complete())},_runFrame:function(t,n){var s=this._startPos.add(this._offset.multiplyBy(t));n&&s._round(),ge(this._el,s),this.fire("step")},_complete:function(){nt(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),Zt=At.extend({options:{crs:m,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(t,n){n=Q(this,n),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=h(this._onResize,this),this._initEvents(),n.maxBounds&&this.setMaxBounds(n.maxBounds),n.zoom!==void 0&&(this._zoom=this._limitZoom(n.zoom)),n.center&&n.zoom!==void 0&&this.setView(j(n.center),n.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=pi&&ft.any3d&&!ft.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),It(this._proxy,xo,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,n,s){if(n=n===void 0?this._zoom:this._limitZoom(n),t=this._limitCenter(j(t),n,this.options.maxBounds),s=s||{},this._stop(),this._loaded&&!s.reset&&s!==!0){s.animate!==void 0&&(s.zoom=l({animate:s.animate},s.zoom),s.pan=l({animate:s.animate,duration:s.duration},s.pan));var r=this._zoom!==n?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,n,s.zoom):this._tryAnimatedPan(t,s.pan);if(r)return clearTimeout(this._sizeTimer),this}return this._resetView(t,n,s.pan&&s.pan.noMoveStart),this},setZoom:function(t,n){return this._loaded?this.setView(this.getCenter(),t,{zoom:n}):(this._zoom=t,this)},zoomIn:function(t,n){return t=t||(ft.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,n)},zoomOut:function(t,n){return t=t||(ft.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,n)},setZoomAround:function(t,n,s){var r=this.getZoomScale(n),c=this.getSize().divideBy(2),p=t instanceof et?t:this.latLngToContainerPoint(t),S=p.subtract(c).multiplyBy(1-1/r),z=this.containerPointToLatLng(c.add(S));return this.setView(z,n,{zoom:s})},_getBoundsCenterZoom:function(t,n){n=n||{},t=t.getBounds?t.getBounds():Jt(t);var s=pt(n.paddingTopLeft||n.padding||[0,0]),r=pt(n.paddingBottomRight||n.padding||[0,0]),c=this.getBoundsZoom(t,!1,s.add(r));if(c=typeof n.maxZoom=="number"?Math.min(n.maxZoom,c):c,c===1/0)return{center:t.getCenter(),zoom:c};var p=r.subtract(s).divideBy(2),S=this.project(t.getSouthWest(),c),z=this.project(t.getNorthEast(),c),I=this.unproject(S.add(z).divideBy(2).add(p),c);return{center:I,zoom:c}},fitBounds:function(t,n){if(t=Jt(t),!t.isValid())throw new Error("Bounds are not valid.");var s=this._getBoundsCenterZoom(t,n);return this.setView(s.center,s.zoom,n)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,n){return this.setView(t,this._zoom,{pan:n})},panBy:function(t,n){if(t=pt(t).round(),n=n||{},!t.x&&!t.y)return this.fire("moveend");if(n.animate!==!0&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new Ai,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),n.noMoveStart||this.fire("movestart"),n.animate!==!1){Pt(this._mapPane,"leaflet-pan-anim");var s=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,s,n.duration||.25,n.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,n,s){if(s=s||{},s.animate===!1||!ft.any3d)return this.setView(t,n,s);this._stop();var r=this.project(this.getCenter()),c=this.project(t),p=this.getSize(),S=this._zoom;t=j(t),n=n===void 0?S:n;var z=Math.max(p.x,p.y),I=z*this.getZoomScale(S,n),W=c.distanceTo(r)||1,at=1.42,Lt=at*at;function Ut(Pe){var Zo=Pe?-1:1,qc=Pe?I:z,Yc=I*I-z*z+Zo*Lt*Lt*W*W,Jc=2*qc*Lt*W,jr=Yc/Jc,il=Math.sqrt(jr*jr+1)-jr,Xc=il<1e-9?-18:Math.log(il);return Xc}function He(Pe){return(Math.exp(Pe)-Math.exp(-Pe))/2}function Me(Pe){return(Math.exp(Pe)+Math.exp(-Pe))/2}function dn(Pe){return He(Pe)/Me(Pe)}var Je=Ut(0);function ms(Pe){return z*(Me(Je)/Me(Je+at*Pe))}function jc(Pe){return z*(Me(Je)*dn(Je+at*Pe)-He(Je))/Lt}function Wc(Pe){return 1-Math.pow(1-Pe,1.5)}var Kc=Date.now(),el=(Ut(1)-Je)/at,Gc=s.duration?1e3*s.duration:1e3*el*.8;function nl(){var Pe=(Date.now()-Kc)/Gc,Zo=Wc(Pe)*el;Pe<=1?(this._flyToFrame=Et(nl,this),this._move(this.unproject(r.add(c.subtract(r).multiplyBy(jc(Zo)/W)),S),this.getScaleZoom(z/ms(Zo),S),{flyTo:!0})):this._move(t,n)._moveEnd(!0)}return this._moveStart(!0,s.noMoveStart),nl.call(this),this},flyToBounds:function(t,n){var s=this._getBoundsCenterZoom(t,n);return this.flyTo(s.center,s.zoom,n)},setMaxBounds:function(t){return t=Jt(t),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),t.isValid()?(this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(t){var n=this.options.minZoom;return this.options.minZoom=t,this._loaded&&n!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var n=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&n!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,n){this._enforcingBounds=!0;var s=this.getCenter(),r=this._limitCenter(s,this._zoom,Jt(t));return s.equals(r)||this.panTo(r,n),this._enforcingBounds=!1,this},panInside:function(t,n){n=n||{};var s=pt(n.paddingTopLeft||n.padding||[0,0]),r=pt(n.paddingBottomRight||n.padding||[0,0]),c=this.project(this.getCenter()),p=this.project(t),S=this.getPixelBounds(),z=Yt([S.min.add(s),S.max.subtract(r)]),I=z.getSize();if(!z.contains(p)){this._enforcingBounds=!0;var W=p.subtract(z.getCenter()),at=z.extend(p).getSize().subtract(I);c.x+=W.x<0?-at.x:at.x,c.y+=W.y<0?-at.y:at.y,this.panTo(this.unproject(c),n),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=l({animate:!1,pan:!0},t===!0?{animate:!0}:t);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var s=this.getSize(),r=n.divideBy(2).round(),c=s.divideBy(2).round(),p=r.subtract(c);return!p.x&&!p.y?this:(t.animate&&t.pan?this.panBy(p):(t.pan&&this._rawPanBy(p),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(h(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:s}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=l({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=h(this._handleGeolocationResponse,this),s=h(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,s,t):navigator.geolocation.getCurrentPosition(n,s,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var n=t.code,s=t.message||(n===1?"permission denied":n===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:n,message:"Geolocation error: "+s+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var n=t.coords.latitude,s=t.coords.longitude,r=new Bt(n,s),c=r.toBounds(t.coords.accuracy*2),p=this._locateOptions;if(p.setView){var S=this.getBoundsZoom(c);this.setView(r,p.maxZoom?Math.min(S,p.maxZoom):S)}var z={latlng:r,bounds:c,timestamp:t.timestamp};for(var I in t.coords)typeof t.coords[I]=="number"&&(z[I]=t.coords[I]);this.fire("locationfound",z)}},addHandler:function(t,n){if(!n)return this;var s=this[t]=new n(this);return this._handlers.push(s),this.options[t]&&s.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(),Qt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(nt(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var t;for(t in this._layers)this._layers[t].remove();for(t in this._panes)Qt(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,n){var s="leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),r=X("div",s,n||this._mapPane);return t&&(this._panes[t]=r),r},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),n=this.unproject(t.getBottomLeft()),s=this.unproject(t.getTopRight());return new ae(n,s)},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(t,n,s){t=Jt(t),s=pt(s||[0,0]);var r=this.getZoom()||0,c=this.getMinZoom(),p=this.getMaxZoom(),S=t.getNorthWest(),z=t.getSouthEast(),I=this.getSize().subtract(s),W=Yt(this.project(z,r),this.project(S,r)).getSize(),at=ft.any3d?this.options.zoomSnap:1,Lt=I.x/W.x,Ut=I.y/W.y,He=n?Math.max(Lt,Ut):Math.min(Lt,Ut);return r=this.getScaleZoom(He,r),at&&(r=Math.round(r/(at/100))*(at/100),r=n?Math.ceil(r/at)*at:Math.floor(r/at)*at),Math.max(c,Math.min(p,r))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new et(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,n){var s=this._getTopLeftPoint(t,n);return new kt(s,s.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(t===void 0?this.getZoom():t)},getPane:function(t){return typeof t=="string"?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,n){var s=this.options.crs;return n=n===void 0?this._zoom:n,s.scale(t)/s.scale(n)},getScaleZoom:function(t,n){var s=this.options.crs;n=n===void 0?this._zoom:n;var r=s.zoom(t*s.scale(n));return isNaN(r)?1/0:r},project:function(t,n){return n=n===void 0?this._zoom:n,this.options.crs.latLngToPoint(j(t),n)},unproject:function(t,n){return n=n===void 0?this._zoom:n,this.options.crs.pointToLatLng(pt(t),n)},layerPointToLatLng:function(t){var n=pt(t).add(this.getPixelOrigin());return this.unproject(n)},latLngToLayerPoint:function(t){var n=this.project(j(t))._round();return n._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(j(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(Jt(t))},distance:function(t,n){return this.options.crs.distance(j(t),j(n))},containerPointToLayerPoint:function(t){return pt(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return pt(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var n=this.containerPointToLayerPoint(pt(t));return this.layerPointToLatLng(n)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(j(t)))},mouseEventToContainerPoint:function(t){return Po(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var n=this._container=wo(t);if(n){if(n._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");It(n,"scroll",this._onScroll,this),this._containerId=y(n)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&ft.any3d,Pt(t,"leaflet-container"+(ft.touch?" leaflet-touch":"")+(ft.retina?" leaflet-retina":"")+(ft.ielt9?" leaflet-oldie":"")+(ft.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var n=Mi(t,"position");n!=="absolute"&&n!=="relative"&&n!=="fixed"&&n!=="sticky"&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),ge(this._mapPane,new et(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Pt(t.markerPane,"leaflet-zoom-hide"),Pt(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,n,s){ge(this._mapPane,new et(0,0));var r=!this._loaded;this._loaded=!0,n=this._limitZoom(n),this.fire("viewprereset");var c=this._zoom!==n;this._moveStart(c,s)._move(t,n)._moveEnd(c),this.fire("viewreset"),r&&this.fire("load")},_moveStart:function(t,n){return t&&this.fire("zoomstart"),n||this.fire("movestart"),this},_move:function(t,n,s,r){n===void 0&&(n=this._zoom);var c=this._zoom!==n;return this._zoom=n,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),r?s&&s.pinch&&this.fire("zoom",s):((c||s&&s.pinch)&&this.fire("zoom",s),this.fire("move",s)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return nt(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){ge(this._mapPane,this._getMapPanePos().subtract(t))},_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(t){this._targets={},this._targets[y(this._container)]=this;var n=t?te:It;n(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&n(window,"resize",this._onResize,this),ft.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){nt(this._resizeRequest),this._resizeRequest=Et(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,n){for(var s=[],r,c=n==="mouseout"||n==="mouseover",p=t.target||t.srcElement,S=!1;p;){if(r=this._targets[y(p)],r&&(n==="click"||n==="preclick")&&this._draggableMoved(r)){S=!0;break}if(r&&r.listens(n,!0)&&(c&&!Kn(p,t)||(s.push(r),c))||p===this._container)break;p=p.parentNode}return!s.length&&!S&&!c&&this.listens(n,!0)&&(s=[this]),s},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var n=t.target||t.srcElement;if(!(!this._loaded||n._leaflet_disable_events||t.type==="click"&&this._isClickDisabled(n))){var s=t.type;s==="mousedown"&&ns(n),this._fireDOMEvent(t,s)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,n,s){if(t.type==="click"){var r=l({},t);r.type="preclick",this._fireDOMEvent(r,r.type,s)}var c=this._findEventTargets(t,n);if(s){for(var p=[],S=0;S<s.length;S++)s[S].listens(n,!0)&&p.push(s[S]);c=p.concat(c)}if(c.length){n==="contextmenu"&&Le(t);var z=c[0],I={originalEvent:t};if(t.type!=="keypress"&&t.type!=="keydown"&&t.type!=="keyup"){var W=z.getLatLng&&(!z._radius||z._radius<=10);I.containerPoint=W?this.latLngToContainerPoint(z.getLatLng()):this.mouseEventToContainerPoint(t),I.layerPoint=this.containerPointToLayerPoint(I.containerPoint),I.latlng=W?z.getLatLng():this.layerPointToLatLng(I.layerPoint)}for(S=0;S<c.length;S++)if(c[S].fire(n,I,!0),I.originalEvent._stopped||c[S].options.bubblingMouseEvents===!1&&it(this._mouseEvents,n)!==-1)return}},_draggableMoved:function(t){return t=t.dragging&&t.dragging.enabled()?t:this,t.dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,n=this._handlers.length;t<n;t++)this._handlers[t].disable()},whenReady:function(t,n){return this._loaded?t.call(n||this,{target:this}):this.on("load",t,n),this},_getMapPanePos:function(){return En(this._mapPane)||new et(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,n){var s=t&&n!==void 0?this._getNewPixelOrigin(t,n):this.getPixelOrigin();return s.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,n){var s=this.getSize()._divideBy(2);return this.project(t,n)._subtract(s)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,n,s){var r=this._getNewPixelOrigin(s,n);return this.project(t,n)._subtract(r)},_latLngBoundsToNewLayerBounds:function(t,n,s){var r=this._getNewPixelOrigin(s,n);return Yt([this.project(t.getSouthWest(),n)._subtract(r),this.project(t.getNorthWest(),n)._subtract(r),this.project(t.getSouthEast(),n)._subtract(r),this.project(t.getNorthEast(),n)._subtract(r)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,n,s){if(!s)return t;var r=this.project(t,n),c=this.getSize().divideBy(2),p=new kt(r.subtract(c),r.add(c)),S=this._getBoundsOffset(p,s,n);return Math.abs(S.x)<=1&&Math.abs(S.y)<=1?t:this.unproject(r.add(S),n)},_limitOffset:function(t,n){if(!n)return t;var s=this.getPixelBounds(),r=new kt(s.min.add(t),s.max.add(t));return t.add(this._getBoundsOffset(r,n))},_getBoundsOffset:function(t,n,s){var r=Yt(this.project(n.getNorthEast(),s),this.project(n.getSouthWest(),s)),c=r.min.subtract(t.min),p=r.max.subtract(t.max),S=this._rebound(c.x,-p.x),z=this._rebound(c.y,-p.y);return new et(S,z)},_rebound:function(t,n){return t+n>0?Math.round(t-n)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(n))},_limitZoom:function(t){var n=this.getMinZoom(),s=this.getMaxZoom(),r=ft.any3d?this.options.zoomSnap:1;return r&&(t=Math.round(t/r)*r),Math.max(n,Math.min(s,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){oe(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,n){var s=this._getCenterOffset(t)._trunc();return(n&&n.animate)!==!0&&!this.getSize().contains(s)?!1:(this.panBy(s,n),!0)},_createAnimProxy:function(){var t=this._proxy=X("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(n){var s=As,r=this._proxy.style[s];Se(this._proxy,this.project(n.center,n.zoom),this.getZoomScale(n.zoom,1)),r===this._proxy.style[s]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){Qt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),n=this.getZoom();Se(this._proxy,this.project(t,n),this.getZoomScale(n,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,n,s){if(this._animatingZoom)return!0;if(s=s||{},!this._zoomAnimated||s.animate===!1||this._nothingToAnimate()||Math.abs(n-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(n),c=this._getCenterOffset(t)._divideBy(1-1/r);return s.animate!==!0&&!this.getSize().contains(c)?!1:(Et(function(){this._moveStart(!0,s.noMoveStart||!1)._animateZoom(t,n,!0)},this),!0)},_animateZoom:function(t,n,s,r){this._mapPane&&(s&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=n,Pt(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:n,noUpdate:r}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(h(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&oe(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 os(t,n){return new Zt(t,n)}var Ue=zt.extend({options:{position:"topright"},initialize:function(t){Q(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var n=this._map;return n&&n.removeControl(this),this.options.position=t,n&&n.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var n=this._container=this.onAdd(t),s=this.getPosition(),r=t._controlCorners[s];return Pt(n,"leaflet-control"),s.indexOf("bottom")!==-1?r.insertBefore(n,r.firstChild):r.appendChild(n),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(Qt(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),Ii=function(t){return new Ue(t)};Zt.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},n="leaflet-",s=this._controlContainer=X("div",n+"control-container",this._container);function r(c,p){var S=n+c+" "+n+p;t[c+p]=X("div",S,s)}r("top","left"),r("top","right"),r("bottom","left"),r("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)Qt(this._controlCorners[t]);Qt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Co=Ue.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,n,s,r){return s<r?-1:r<s?1:0}},initialize:function(t,n,s){Q(this,s),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var r in t)this._addLayer(t[r],r);for(r in n)this._addLayer(n[r],r,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var n=0;n<this._layers.length;n++)this._layers[n].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return Ue.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,n){return this._addLayer(t,n),this._map?this._update():this},addOverlay:function(t,n){return this._addLayer(t,n,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var n=this._getLayer(y(t));return n&&this._layers.splice(this._layers.indexOf(n),1),this._map?this._update():this},expand:function(){Pt(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(Pt(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):oe(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return oe(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",n=this._container=X("div",t),s=this.options.collapsed;n.setAttribute("aria-haspopup",!0),vi(n),zn(n);var r=this._section=X("section",t+"-list");s&&(this._map.on("click",this.collapse,this),It(n,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var c=this._layersLink=X("a",t+"-toggle",n);c.href="#",c.title="Layers",c.setAttribute("role","button"),It(c,{keydown:function(p){p.keyCode===13&&this._expandSafely()},click:function(p){Le(p),this._expandSafely()}},this),s||this.expand(),this._baseLayersList=X("div",t+"-base",r),this._separator=X("div",t+"-separator",r),this._overlaysList=X("div",t+"-overlays",r),n.appendChild(r)},_getLayer:function(t){for(var n=0;n<this._layers.length;n++)if(this._layers[n]&&y(this._layers[n].layer)===t)return this._layers[n]},_addLayer:function(t,n,s){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:n,overlay:s}),this.options.sortLayers&&this._layers.sort(h(function(r,c){return this.options.sortFunction(r.layer,c.layer,r.name,c.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;jn(this._baseLayersList),jn(this._overlaysList),this._layerControlInputs=[];var t,n,s,r,c=0;for(s=0;s<this._layers.length;s++)r=this._layers[s],this._addItem(r),n=n||r.overlay,t=t||!r.overlay,c+=r.overlay?0:1;return this.options.hideSingleBase&&(t=t&&c>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=n&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var n=this._getLayer(y(t.target)),s=n.overlay?t.type==="add"?"overlayadd":"overlayremove":t.type==="add"?"baselayerchange":null;s&&this._map.fire(s,n)},_createRadioElement:function(t,n){var s='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(n?' checked="checked"':"")+"/>",r=document.createElement("div");return r.innerHTML=s,r.firstChild},_addItem:function(t){var n=document.createElement("label"),s=this._map.hasLayer(t.layer),r;t.overlay?(r=document.createElement("input"),r.type="checkbox",r.className="leaflet-control-layers-selector",r.defaultChecked=s):r=this._createRadioElement("leaflet-base-layers_"+y(this),s),this._layerControlInputs.push(r),r.layerId=y(t.layer),It(r,"click",this._onInputClick,this);var c=document.createElement("span");c.innerHTML=" "+t.name;var p=document.createElement("span");n.appendChild(p),p.appendChild(r),p.appendChild(c);var S=t.overlay?this._overlaysList:this._baseLayersList;return S.appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var t=this._layerControlInputs,n,s,r=[],c=[];this._handlingClick=!0;for(var p=t.length-1;p>=0;p--)n=t[p],s=this._getLayer(n.layerId).layer,n.checked?r.push(s):n.checked||c.push(s);for(p=0;p<c.length;p++)this._map.hasLayer(c[p])&&this._map.removeLayer(c[p]);for(p=0;p<r.length;p++)this._map.hasLayer(r[p])||this._map.addLayer(r[p]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var t=this._layerControlInputs,n,s,r=this._map.getZoom(),c=t.length-1;c>=0;c--)n=t[c],s=this._getLayer(n.layerId).layer,n.disabled=s.options.minZoom!==void 0&&r<s.options.minZoom||s.options.maxZoom!==void 0&&r>s.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,It(t,"click",Le),this.expand();var n=this;setTimeout(function(){te(t,"click",Le),n._preventClick=!1})}}),$r=function(t,n,s){return new Co(t,n,s)},qe=Ue.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">&#x2212;</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var n="leaflet-control-zoom",s=X("div",n+" leaflet-bar"),r=this.options;return this._zoomInButton=this._createButton(r.zoomInText,r.zoomInTitle,n+"-in",s,this._zoomIn),this._zoomOutButton=this._createButton(r.zoomOutText,r.zoomOutTitle,n+"-out",s,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),s},onRemove:function(t){t.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(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,n,s,r,c){var p=X("a",s,r);return p.innerHTML=t,p.href="#",p.title=n,p.setAttribute("role","button"),p.setAttribute("aria-label",n),vi(p),It(p,"click",wn),It(p,"click",c,this),It(p,"click",this._refocusOnMap,this),p},_updateDisabled:function(){var t=this._map,n="leaflet-disabled";oe(this._zoomInButton,n),oe(this._zoomOutButton,n),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(Pt(this._zoomOutButton,n),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(Pt(this._zoomInButton,n),this._zoomInButton.setAttribute("aria-disabled","true"))}});Zt.mergeOptions({zoomControl:!0}),Zt.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new qe,this.addControl(this.zoomControl))});var Dr=function(t){return new qe(t)},Mo=Ue.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var n="leaflet-control-scale",s=X("div",n),r=this.options;return this._addScales(r,n+"-line",s),t.on(r.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),s},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,n,s){t.metric&&(this._mScale=X("div",n,s)),t.imperial&&(this._iScale=X("div",n,s))},_update:function(){var t=this._map,n=t.getSize().y/2,s=t.distance(t.containerPointToLatLng([0,n]),t.containerPointToLatLng([this.options.maxWidth,n]));this._updateScales(s)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var n=this._getRoundNum(t),s=n<1e3?n+" m":n/1e3+" km";this._updateScale(this._mScale,s,n/t)},_updateImperial:function(t){var n=t*3.2808399,s,r,c;n>5280?(s=n/5280,r=this._getRoundNum(s),this._updateScale(this._iScale,r+" mi",r/s)):(c=this._getRoundNum(n),this._updateScale(this._iScale,c+" ft",c/n))},_updateScale:function(t,n,s){t.style.width=Math.round(this.options.maxWidth*s)+"px",t.innerHTML=n},_getRoundNum:function(t){var n=Math.pow(10,(Math.floor(t)+"").length-1),s=t/n;return s=s>=10?10:s>=5?5:s>=3?3:s>=2?2:1,n*s}}),Nr=function(t){return new Mo(t)},rs='<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>',Gn=Ue.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(ft.inlineSvg?rs+" ":"")+"Leaflet</a>"},initialize:function(t){Q(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=X("div","leaflet-control-attribution"),vi(this._container);for(var n in t._layers)t._layers[n].getAttribution&&this.addAttribution(t._layers[n].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var n in this._attributions)this._attributions[n]&&t.push(n);var s=[];this.options.prefix&&s.push(this.options.prefix),t.length&&s.push(t.join(", ")),this._container.innerHTML=s.join(' <span aria-hidden="true">|</span> ')}}});Zt.mergeOptions({attributionControl:!0}),Zt.addInitHook(function(){this.options.attributionControl&&new Gn().addTo(this)});var as=function(t){return new Gn(t)};Ue.Layers=Co,Ue.Zoom=qe,Ue.Scale=Mo,Ue.Attribution=Gn,Ii.layers=$r,Ii.zoom=Dr,Ii.scale=Nr,Ii.attribution=as;var re=zt.extend({initialize:function(t){this._map=t},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}});re.addTo=function(t,n){return t.addHandler(n,this),this};var yi={Events:lt},$i=ft.touch?"touchstart mousedown":"mousedown",Ye=At.extend({options:{clickTolerance:3},initialize:function(t,n,s,r){Q(this,r),this._element=t,this._dragStartTarget=n||t,this._preventOutline=s},enable:function(){this._enabled||(It(this._dragStartTarget,$i,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Ye._dragging===this&&this.finishDrag(!0),te(this._dragStartTarget,$i,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!mi(this._element,"leaflet-zoom-anim"))){if(t.touches&&t.touches.length!==1){Ye._dragging===this&&this.finishDrag();return}if(!(Ye._dragging||t.shiftKey||t.which!==1&&t.button!==1&&!t.touches)&&(Ye._dragging=this,this._preventOutline&&ns(this._element),$s(),gi(),!this._moving)){this.fire("down");var n=t.touches?t.touches[0]:t,s=ko(this._element);this._startPoint=new et(n.clientX,n.clientY),this._startPos=En(this._element),this._parentScale=Rs(s);var r=t.type==="mousedown";It(document,r?"mousemove":"touchmove",this._onMove,this),It(document,r?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(t){if(this._enabled){if(t.touches&&t.touches.length>1){this._moved=!0;return}var n=t.touches&&t.touches.length===1?t.touches[0]:t,s=new et(n.clientX,n.clientY)._subtract(this._startPoint);!s.x&&!s.y||Math.abs(s.x)+Math.abs(s.y)<this.options.clickTolerance||(s.x/=this._parentScale.x,s.y/=this._parentScale.y,Le(t),this._moved||(this.fire("dragstart"),this._moved=!0,Pt(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),Pt(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(s),this._moving=!0,this._lastEvent=t,this._updatePosition())}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),ge(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){oe(document.body,"leaflet-dragging"),this._lastTarget&&(oe(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),te(document,"mousemove touchmove",this._onMove,this),te(document,"mouseup touchend touchcancel",this._onUp,this),Ds(),Ei();var n=this._moved&&this._moving;this._moving=!1,Ye._dragging=!1,n&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}});function Fs(t,n,s){var r,c=[1,4,2,8],p,S,z,I,W,at,Lt,Ut;for(p=0,at=t.length;p<at;p++)t[p]._code=In(t[p],n);for(z=0;z<4;z++){for(Lt=c[z],r=[],p=0,at=t.length,S=at-1;p<at;S=p++)I=t[p],W=t[S],I._code&Lt?W._code&Lt||(Ut=us(W,I,Lt,n,s),Ut._code=In(Ut,n),r.push(Ut)):(W._code&Lt&&(Ut=us(W,I,Lt,n,s),Ut._code=In(Ut,n),r.push(Ut)),r.push(I));t=r}return t}function Di(t,n){var s,r,c,p,S,z,I,W,at;if(!t||t.length===0)throw new Error("latlngs not passed");Ce(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var Lt=j([0,0]),Ut=Jt(t),He=Ut.getNorthWest().distanceTo(Ut.getSouthWest())*Ut.getNorthEast().distanceTo(Ut.getNorthWest());He<1700&&(Lt=qn(t));var Me=t.length,dn=[];for(s=0;s<Me;s++){var Je=j(t[s]);dn.push(n.project(j([Je.lat-Lt.lat,Je.lng-Lt.lng])))}for(z=I=W=0,s=0,r=Me-1;s<Me;r=s++)c=dn[s],p=dn[r],S=c.y*p.x-p.y*c.x,I+=(c.x+p.x)*S,W+=(c.y+p.y)*S,z+=S*3;z===0?at=dn[0]:at=[I/z,W/z];var ms=n.unproject(pt(at));return j([ms.lat+Lt.lat,ms.lng+Lt.lng])}function qn(t){for(var n=0,s=0,r=0,c=0;c<t.length;c++){var p=j(t[c]);n+=p.lat,s+=p.lng,r++}return j([n/r,s/r])}var Oo={__proto__:null,clipPolygon:Fs,polygonCenter:Di,centroid:qn};function Yn(t,n){if(!n||!t.length)return t.slice();var s=n*n;return t=An(t,s),t=Fr(t,s),t}function Ni(t,n,s){return Math.sqrt($n(t,n,s,!0))}function Rr(t,n,s){return $n(t,n,s)}function Fr(t,n){var s=t.length,r=typeof Uint8Array<"u"?Uint8Array:Array,c=new r(s);c[0]=c[s-1]=1,Gt(t,c,n,0,s-1);var p,S=[];for(p=0;p<s;p++)c[p]&&S.push(t[p]);return S}function Gt(t,n,s,r,c){var p=0,S,z,I;for(z=r+1;z<=c-1;z++)I=$n(t[z],t[r],t[c],!0),I>p&&(S=z,p=I);p>s&&(n[S]=1,Gt(t,n,s,r,S),Gt(t,n,s,S,c))}function An(t,n){for(var s=[t[0]],r=1,c=0,p=t.length;r<p;r++)Br(t[r],t[c])>n&&(s.push(t[r]),c=r);return c<p-1&&s.push(t[p-1]),s}var Ri;function ls(t,n,s,r,c){var p=r?Ri:In(t,s),S=In(n,s),z,I,W;for(Ri=S;;){if(!(p|S))return[t,n];if(p&S)return!1;z=p||S,I=us(t,n,z,s,c),W=In(I,s),z===p?(t=I,p=W):(n=I,S=W)}}function us(t,n,s,r,c){var p=n.x-t.x,S=n.y-t.y,z=r.min,I=r.max,W,at;return s&8?(W=t.x+p*(I.y-t.y)/S,at=I.y):s&4?(W=t.x+p*(z.y-t.y)/S,at=z.y):s&2?(W=I.x,at=t.y+S*(I.x-t.x)/p):s&1&&(W=z.x,at=t.y+S*(z.x-t.x)/p),new et(W,at,c)}function In(t,n){var s=0;return t.x<n.min.x?s|=1:t.x>n.max.x&&(s|=2),t.y<n.min.y?s|=4:t.y>n.max.y&&(s|=8),s}function Br(t,n){var s=n.x-t.x,r=n.y-t.y;return s*s+r*r}function $n(t,n,s,r){var c=n.x,p=n.y,S=s.x-c,z=s.y-p,I=S*S+z*z,W;return I>0&&(W=((t.x-c)*S+(t.y-p)*z)/I,W>1?(c=s.x,p=s.y):W>0&&(c+=S*W,p+=z*W)),S=t.x-c,z=t.y-p,r?S*S+z*z:new et(c,p)}function Ce(t){return!dt(t[0])||typeof t[0][0]!="object"&&typeof t[0][0]<"u"}function Fi(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Ce(t)}function bi(t,n){var s,r,c,p,S,z,I,W;if(!t||t.length===0)throw new Error("latlngs not passed");Ce(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var at=j([0,0]),Lt=Jt(t),Ut=Lt.getNorthWest().distanceTo(Lt.getSouthWest())*Lt.getNorthEast().distanceTo(Lt.getNorthWest());Ut<1700&&(at=qn(t));var He=t.length,Me=[];for(s=0;s<He;s++){var dn=j(t[s]);Me.push(n.project(j([dn.lat-at.lat,dn.lng-at.lng])))}for(s=0,r=0;s<He-1;s++)r+=Me[s].distanceTo(Me[s+1])/2;if(r===0)W=Me[0];else for(s=0,p=0;s<He-1;s++)if(S=Me[s],z=Me[s+1],c=S.distanceTo(z),p+=c,p>r){I=(p-r)/c,W=[z.x-I*(z.x-S.x),z.y-I*(z.y-S.y)];break}var Je=n.unproject(pt(W));return j([Je.lat+at.lat,Je.lng+at.lng])}var kn={__proto__:null,simplify:Yn,pointToSegmentDistance:Ni,closestPointOnSegment:Rr,clipSegment:ls,_getEdgeIntersection:us,_getBitCode:In,_sqClosestPointOnSegment:$n,isFlat:Ce,_flat:Fi,polylineCenter:bi},Sn={project:function(t){return new et(t.lng,t.lat)},unproject:function(t){return new Bt(t.y,t.x)},bounds:new kt([-180,-90],[180,90])},Bi={R:6378137,R_MINOR:6356752314245179e-9,bounds:new kt([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(t){var n=Math.PI/180,s=this.R,r=t.lat*n,c=this.R_MINOR/s,p=Math.sqrt(1-c*c),S=p*Math.sin(r),z=Math.tan(Math.PI/4-r/2)/Math.pow((1-S)/(1+S),p/2);return r=-s*Math.log(Math.max(z,1e-10)),new et(t.lng*n*s,r)},unproject:function(t){for(var n=180/Math.PI,s=this.R,r=this.R_MINOR/s,c=Math.sqrt(1-r*r),p=Math.exp(-t.y/s),S=Math.PI/2-2*Math.atan(p),z=0,I=.1,W;z<15&&Math.abs(I)>1e-7;z++)W=c*Math.sin(S),W=Math.pow((1-W)/(1+W),c/2),I=Math.PI/2-2*Math.atan(p*W)-S,S+=I;return new Bt(S*n,t.x*n/s)}},Eo={__proto__:null,LonLat:Sn,Mercator:Bi,SphericalMercator:se},Vr=l({},E,{code:"EPSG:3395",projection:Bi,transformation:(function(){var t=.5/(Math.PI*Bi.R);return v(t,.5,-t,.5)})()}),Bs=l({},E,{code:"EPSG:4326",projection:Sn,transformation:v(1/180,1,-1/180,.5)}),zo=l({},C,{projection:Sn,transformation:v(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,n){var s=n.lng-t.lng,r=n.lat-t.lat;return Math.sqrt(s*s+r*r)},infinite:!0});C.Earth=E,C.EPSG3395=Vr,C.EPSG3857=m,C.EPSG900913=M,C.EPSG4326=Bs,C.Simple=zo;var en=At.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[y(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[y(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var n=t.target;if(n.hasLayer(this)){if(this._map=n,this._zoomAnimated=n._zoomAnimated,this.getEvents){var s=this.getEvents();n.on(s,this),this.once("remove",function(){n.off(s,this)},this)}this.onAdd(n),this.fire("add"),n.fire("layeradd",{layer:this})}}});Zt.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var n=y(t);return this._layers[n]?this:(this._layers[n]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var n=y(t);return this._layers[n]?(this._loaded&&t.onRemove(this),delete this._layers[n],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return y(t)in this._layers},eachLayer:function(t,n){for(var s in this._layers)t.call(n,this._layers[s]);return this},_addLayers:function(t){t=t?dt(t)?t:[t]:[];for(var n=0,s=t.length;n<s;n++)this.addLayer(t[n])},_addZoomLimit:function(t){(!isNaN(t.options.maxZoom)||!isNaN(t.options.minZoom))&&(this._zoomBoundLayers[y(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var n=y(t);this._zoomBoundLayers[n]&&(delete this._zoomBoundLayers[n],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,n=-1/0,s=this._getZoomSpan();for(var r in this._zoomBoundLayers){var c=this._zoomBoundLayers[r].options;t=c.minZoom===void 0?t:Math.min(t,c.minZoom),n=c.maxZoom===void 0?n:Math.max(n,c.maxZoom)}this._layersMaxZoom=n===-1/0?void 0:n,this._layersMinZoom=t===1/0?void 0:t,s!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var xi=en.extend({initialize:function(t,n){Q(this,n),this._layers={};var s,r;if(t)for(s=0,r=t.length;s<r;s++)this.addLayer(t[s])},addLayer:function(t){var n=this.getLayerId(t);return this._layers[n]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var n=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[n]&&this._map.removeLayer(this._layers[n]),delete this._layers[n],this},hasLayer:function(t){var n=typeof t=="number"?t:this.getLayerId(t);return n in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var n=Array.prototype.slice.call(arguments,1),s,r;for(s in this._layers)r=this._layers[s],r[t]&&r[t].apply(r,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,n){for(var s in this._layers)t.call(n,this._layers[s]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return y(t)}}),cs=function(t,n){return new xi(t,n)},Pn=xi.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),xi.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),xi.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new ae;for(var n in this._layers){var s=this._layers[n];t.extend(s.getBounds?s.getBounds():s.getLatLng())}return t}}),de=function(t,n){return new Pn(t,n)},cn=zt.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){Q(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,n){var s=this._getIconUrl(t);if(!s){if(t==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var r=this._createImg(s,n&&n.tagName==="IMG"?n:null);return this._setIconStyles(r,t),(this.options.crossOrigin||this.options.crossOrigin==="")&&(r.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),r},_setIconStyles:function(t,n){var s=this.options,r=s[n+"Size"];typeof r=="number"&&(r=[r,r]);var c=pt(r),p=pt(n==="shadow"&&s.shadowAnchor||s.iconAnchor||c&&c.divideBy(2,!0));t.className="leaflet-marker-"+n+" "+(s.className||""),p&&(t.style.marginLeft=-p.x+"px",t.style.marginTop=-p.y+"px"),c&&(t.style.width=c.x+"px",t.style.height=c.y+"px")},_createImg:function(t,n){return n=n||document.createElement("img"),n.src=t,n},_getIconUrl:function(t){return ft.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Vs(t){return new cn(t)}var Jn=cn.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(t){return typeof Jn.imagePath!="string"&&(Jn.imagePath=this._detectIconPath()),(this.options.imagePath||Jn.imagePath)+cn.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){var n=function(s,r,c){var p=r.exec(s);return p&&p[c]};return t=n(t,/^url\((['"])?(.+)\1\)$/,2),t&&n(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=X("div","leaflet-default-icon-path",document.body),n=Mi(t,"background-image")||Mi(t,"backgroundImage");if(document.body.removeChild(t),n=this._stripUrl(n),n)return n;var s=document.querySelector('link[href$="leaflet.css"]');return s?s.href.substring(0,s.href.length-11-1):""}}),Ao=re.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new Ye(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),Pt(t,"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&&oe(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var n=this._marker,s=n._map,r=this._marker.options.autoPanSpeed,c=this._marker.options.autoPanPadding,p=En(n._icon),S=s.getPixelBounds(),z=s.getPixelOrigin(),I=Yt(S.min._subtract(z).add(c),S.max._subtract(z).subtract(c));if(!I.contains(p)){var W=pt((Math.max(I.max.x,p.x)-I.max.x)/(S.max.x-I.max.x)-(Math.min(I.min.x,p.x)-I.min.x)/(S.min.x-I.min.x),(Math.max(I.max.y,p.y)-I.max.y)/(S.max.y-I.max.y)-(Math.min(I.min.y,p.y)-I.min.y)/(S.min.y-I.min.y)).multiplyBy(r);s.panBy(W,{animate:!1}),this._draggable._newPos._add(W),this._draggable._startPos._add(W),ge(n._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=Et(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(nt(this._panRequest),this._panRequest=Et(this._adjustPan.bind(this,t)))},_onDrag:function(t){var n=this._marker,s=n._shadow,r=En(n._icon),c=n._map.layerPointToLatLng(r);s&&ge(s,r),n._latlng=c,t.latlng=c,t.oldLatLng=this._oldLatLng,n.fire("move",t).fire("drag",t)},_onDragEnd:function(t){nt(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),ds=en.extend({options:{icon:new Jn,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(t,n){Q(this,n),this._latlng=j(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.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(t){var n=this._latlng;return this._latlng=j(t),this.update(),this.fire("move",{oldLatLng:n,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,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 t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,n="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),s=t.icon.createIcon(this._icon),r=!1;s!==this._icon&&(this._icon&&this._removeIcon(),r=!0,t.title&&(s.title=t.title),s.tagName==="IMG"&&(s.alt=t.alt||"")),Pt(s,n),t.keyboard&&(s.tabIndex="0",s.setAttribute("role","button")),this._icon=s,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&It(s,"focus",this._panOnFocus,this);var c=t.icon.createShadow(this._shadow),p=!1;c!==this._shadow&&(this._removeShadow(),p=!0),c&&(Pt(c,n),c.alt=""),this._shadow=c,t.opacity<1&&this._updateOpacity(),r&&this.getPane().appendChild(this._icon),this._initInteraction(),c&&p&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&te(this._icon,"focus",this._panOnFocus,this),Qt(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&Qt(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&ge(this._icon,t),this._shadow&&ge(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var n=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(n)},_initInteraction:function(){if(this.options.interactive&&(Pt(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Ao)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Ao(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&$e(this._icon,t),this._shadow&&$e(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t=this._map;if(t){var n=this.options.icon.options,s=n.iconSize?pt(n.iconSize):pt(0,0),r=n.iconAnchor?pt(n.iconAnchor):pt(0,0);t.panInside(this._latlng,{paddingTopLeft:r,paddingBottomRight:s.subtract(r)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function b(t,n){return new ds(t,n)}var f=en.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(t){this._renderer=t.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(t){return Q(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"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)}}),H=f.extend({options:{fill:!0,radius:10},initialize:function(t,n){Q(this,n),this._latlng=j(t),this._radius=this.options.radius},setLatLng:function(t){var n=this._latlng;return this._latlng=j(t),this.redraw(),this.fire("move",{oldLatLng:n,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var n=t&&t.radius||this._radius;return f.prototype.setStyle.call(this,t),this.setRadius(n),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,n=this._radiusY||t,s=this._clickTolerance(),r=[t+s,n+s];this._pxBounds=new kt(this._point.subtract(r),this._point.add(r))},_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(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function k(t,n){return new H(t,n)}var qt=H.extend({initialize:function(t,n,s){if(typeof n=="number"&&(n=l({},s,{radius:n})),Q(this,n),this._latlng=j(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new ae(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:f.prototype.setStyle,_project:function(){var t=this._latlng.lng,n=this._latlng.lat,s=this._map,r=s.options.crs;if(r.distance===E.distance){var c=Math.PI/180,p=this._mRadius/E.R/c,S=s.project([n+p,t]),z=s.project([n-p,t]),I=S.add(z).divideBy(2),W=s.unproject(I).lat,at=Math.acos((Math.cos(p*c)-Math.sin(n*c)*Math.sin(W*c))/(Math.cos(n*c)*Math.cos(W*c)))/c;(isNaN(at)||at===0)&&(at=p/Math.cos(Math.PI/180*n)),this._point=I.subtract(s.getPixelOrigin()),this._radius=isNaN(at)?0:I.x-s.project([W,t-at]).x,this._radiusY=I.y-S.y}else{var Lt=r.unproject(r.project(this._latlng).subtract([this._mRadius,0]));this._point=s.latLngToLayerPoint(this._latlng),this._radius=this._point.x-s.latLngToLayerPoint(Lt).x}this._updateBounds()}});function Mc(t,n,s){return new qt(t,n,s)}var Xn=f.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,n){Q(this,n),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var n=1/0,s=null,r=$n,c,p,S=0,z=this._parts.length;S<z;S++)for(var I=this._parts[S],W=1,at=I.length;W<at;W++){c=I[W-1],p=I[W];var Lt=r(t,c,p,!0);Lt<n&&(n=Lt,s=r(t,c,p))}return s&&(s.distance=Math.sqrt(n)),s},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return bi(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(t,n){return n=n||this._defaultShape(),t=j(t),n.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new ae,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Ce(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var n=[],s=Ce(t),r=0,c=t.length;r<c;r++)s?(n[r]=j(t[r]),this._bounds.extend(n[r])):n[r]=this._convertLatLngs(t[r]);return n},_project:function(){var t=new kt;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),n=new et(t,t);this._rawPxBounds&&(this._pxBounds=new kt([this._rawPxBounds.min.subtract(n),this._rawPxBounds.max.add(n)]))},_projectLatlngs:function(t,n,s){var r=t[0]instanceof Bt,c=t.length,p,S;if(r){for(S=[],p=0;p<c;p++)S[p]=this._map.latLngToLayerPoint(t[p]),s.extend(S[p]);n.push(S)}else for(p=0;p<c;p++)this._projectLatlngs(t[p],n,s)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}var n=this._parts,s,r,c,p,S,z,I;for(s=0,c=0,p=this._rings.length;s<p;s++)for(I=this._rings[s],r=0,S=I.length;r<S-1;r++)z=ls(I[r],I[r+1],t,r,!0),z&&(n[c]=n[c]||[],n[c].push(z[0]),(z[1]!==I[r+1]||r===S-2)&&(n[c].push(z[1]),c++))}},_simplifyPoints:function(){for(var t=this._parts,n=this.options.smoothFactor,s=0,r=t.length;s<r;s++)t[s]=Yn(t[s],n)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,n){var s,r,c,p,S,z,I=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(s=0,p=this._parts.length;s<p;s++)for(z=this._parts[s],r=0,S=z.length,c=S-1;r<S;c=r++)if(!(!n&&r===0)&&Ni(t,z[c],z[r])<=I)return!0;return!1}});function Oc(t,n){return new Xn(t,n)}Xn._flat=Fi;var fs=Xn.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Di(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(t){var n=Xn.prototype._convertLatLngs.call(this,t),s=n.length;return s>=2&&n[0]instanceof Bt&&n[0].equals(n[s-1])&&n.pop(),n},_setLatLngs:function(t){Xn.prototype._setLatLngs.call(this,t),Ce(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Ce(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,n=this.options.weight,s=new et(n,n);if(t=new kt(t.min.subtract(s),t.max.add(s)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}for(var r=0,c=this._rings.length,p;r<c;r++)p=Fs(this._rings[r],t,!0),p.length&&this._parts.push(p)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var n=!1,s,r,c,p,S,z,I,W;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(p=0,I=this._parts.length;p<I;p++)for(s=this._parts[p],S=0,W=s.length,z=W-1;S<W;z=S++)r=s[S],c=s[z],r.y>t.y!=c.y>t.y&&t.x<(c.x-r.x)*(t.y-r.y)/(c.y-r.y)+r.x&&(n=!n);return n||Xn.prototype._containsPoint.call(this,t,!0)}});function Ec(t,n){return new fs(t,n)}var Qn=Pn.extend({initialize:function(t,n){Q(this,n),this._layers={},t&&this.addData(t)},addData:function(t){var n=dt(t)?t:t.features,s,r,c;if(n){for(s=0,r=n.length;s<r;s++)c=n[s],(c.geometries||c.geometry||c.features||c.coordinates)&&this.addData(c);return this}var p=this.options;if(p.filter&&!p.filter(t))return this;var S=Io(t,p);return S?(S.feature=No(t),S.defaultOptions=S.options,this.resetStyle(S),p.onEachFeature&&p.onEachFeature(t,S),this.addLayer(S)):this},resetStyle:function(t){return t===void 0?this.eachLayer(this.resetStyle,this):(t.options=l({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer(function(n){this._setLayerStyle(n,t)},this)},_setLayerStyle:function(t,n){t.setStyle&&(typeof n=="function"&&(n=n(t.feature)),t.setStyle(n))}});function Io(t,n){var s=t.type==="Feature"?t.geometry:t,r=s?s.coordinates:null,c=[],p=n&&n.pointToLayer,S=n&&n.coordsToLatLng||Zr,z,I,W,at;if(!r&&!s)return null;switch(s.type){case"Point":return z=S(r),Na(p,t,z,n);case"MultiPoint":for(W=0,at=r.length;W<at;W++)z=S(r[W]),c.push(Na(p,t,z,n));return new Pn(c);case"LineString":case"MultiLineString":return I=$o(r,s.type==="LineString"?0:1,S),new Xn(I,n);case"Polygon":case"MultiPolygon":return I=$o(r,s.type==="Polygon"?1:2,S),new fs(I,n);case"GeometryCollection":for(W=0,at=s.geometries.length;W<at;W++){var Lt=Io({geometry:s.geometries[W],type:"Feature",properties:t.properties},n);Lt&&c.push(Lt)}return new Pn(c);case"FeatureCollection":for(W=0,at=s.features.length;W<at;W++){var Ut=Io(s.features[W],n);Ut&&c.push(Ut)}return new Pn(c);default:throw new Error("Invalid GeoJSON object.")}}function Na(t,n,s,r){return t?t(n,s):new ds(s,r&&r.markersInheritOptions&&r)}function Zr(t){return new Bt(t[1],t[0],t[2])}function $o(t,n,s){for(var r=[],c=0,p=t.length,S;c<p;c++)S=n?$o(t[c],n-1,s):(s||Zr)(t[c]),r.push(S);return r}function Ur(t,n){return t=j(t),t.alt!==void 0?[U(t.lng,n),U(t.lat,n),U(t.alt,n)]:[U(t.lng,n),U(t.lat,n)]}function Do(t,n,s,r){for(var c=[],p=0,S=t.length;p<S;p++)c.push(n?Do(t[p],Ce(t[p])?0:n-1,s,r):Ur(t[p],r));return!n&&s&&c.length>0&&c.push(c[0].slice()),c}function hs(t,n){return t.feature?l({},t.feature,{geometry:n}):No(n)}function No(t){return t.type==="Feature"||t.type==="FeatureCollection"?t:{type:"Feature",properties:{},geometry:t}}var Hr={toGeoJSON:function(t){return hs(this,{type:"Point",coordinates:Ur(this.getLatLng(),t)})}};ds.include(Hr),qt.include(Hr),H.include(Hr),Xn.include({toGeoJSON:function(t){var n=!Ce(this._latlngs),s=Do(this._latlngs,n?1:0,!1,t);return hs(this,{type:(n?"Multi":"")+"LineString",coordinates:s})}}),fs.include({toGeoJSON:function(t){var n=!Ce(this._latlngs),s=n&&!Ce(this._latlngs[0]),r=Do(this._latlngs,s?2:n?1:0,!0,t);return n||(r=[r]),hs(this,{type:(s?"Multi":"")+"Polygon",coordinates:r})}}),xi.include({toMultiPoint:function(t){var n=[];return this.eachLayer(function(s){n.push(s.toGeoJSON(t).geometry.coordinates)}),hs(this,{type:"MultiPoint",coordinates:n})},toGeoJSON:function(t){var n=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(n==="MultiPoint")return this.toMultiPoint(t);var s=n==="GeometryCollection",r=[];return this.eachLayer(function(c){if(c.toGeoJSON){var p=c.toGeoJSON(t);if(s)r.push(p.geometry);else{var S=No(p);S.type==="FeatureCollection"?r.push.apply(r,S.features):r.push(S)}}}),s?hs(this,{geometries:r,type:"GeometryCollection"}):{type:"FeatureCollection",features:r}}});function Ra(t,n){return new Qn(t,n)}var zc=Ra,Ro=en.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,n,s){this._url=t,this._bounds=Jt(n),Q(this,s)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Pt(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){Qt(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&ln(this._image),this},bringToBack:function(){return this._map&&bn(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=Jt(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=this._url.tagName==="IMG",n=this._image=t?this._url:X("img");if(Pt(n,"leaflet-image-layer"),this._zoomAnimated&&Pt(n,"leaflet-zoom-animated"),this.options.className&&Pt(n,this.options.className),n.onselectstart=A,n.onmousemove=A,n.onload=h(this.fire,this,"load"),n.onerror=h(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(n.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t){this._url=n.src;return}n.src=this._url,n.alt=this.options.alt},_animateZoom:function(t){var n=this._map.getZoomScale(t.zoom),s=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Se(this._image,s,n)},_reset:function(){var t=this._image,n=new kt(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),s=n.getSize();ge(t,n.min),t.style.width=s.x+"px",t.style.height=s.y+"px"},_updateOpacity:function(){$e(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 t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),Ac=function(t,n,s){return new Ro(t,n,s)},Fa=Ro.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t=this._url.tagName==="VIDEO",n=this._image=t?this._url:X("video");if(Pt(n,"leaflet-image-layer"),this._zoomAnimated&&Pt(n,"leaflet-zoom-animated"),this.options.className&&Pt(n,this.options.className),n.onselectstart=A,n.onmousemove=A,n.onloadeddata=h(this.fire,this,"load"),t){for(var s=n.getElementsByTagName("source"),r=[],c=0;c<s.length;c++)r.push(s[c].src);this._url=s.length>0?r:[n.src];return}dt(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(n.style,"objectFit")&&(n.style.objectFit="fill"),n.autoplay=!!this.options.autoplay,n.loop=!!this.options.loop,n.muted=!!this.options.muted,n.playsInline=!!this.options.playsInline;for(var p=0;p<this._url.length;p++){var S=X("source");S.src=this._url[p],n.appendChild(S)}}});function Ic(t,n,s){return new Fa(t,n,s)}var Ba=Ro.extend({_initImage:function(){var t=this._image=this._url;Pt(t,"leaflet-image-layer"),this._zoomAnimated&&Pt(t,"leaflet-zoom-animated"),this.options.className&&Pt(t,this.options.className),t.onselectstart=A,t.onmousemove=A}});function $c(t,n,s){return new Ba(t,n,s)}var Dn=en.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,n){t&&(t instanceof Bt||dt(t))?(this._latlng=j(t),Q(this,n)):(Q(this,t),this._source=n),this.options.content&&(this._content=this.options.content)},openOn:function(t){return t=arguments.length?t:this._source._map,t.hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&$e(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&$e(this._container,1),this.bringToFront(),this.options.interactive&&(Pt(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?($e(this._container,0),this._removeTimeout=setTimeout(h(Qt,void 0,this._container),200)):Qt(this._container),this.options.interactive&&(oe(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=j(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,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 t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&ln(this._container),this},bringToBack:function(){return this._map&&bn(this._container),this},_prepareOpen:function(t){var n=this._source;if(!n._map)return!1;if(n instanceof Pn){n=null;var s=this._source._layers;for(var r in s)if(s[r]._map){n=s[r];break}if(!n)return!1;this._source=n}if(!t)if(n.getCenter)t=n.getCenter();else if(n.getLatLng)t=n.getLatLng();else if(n.getBounds)t=n.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var t=this._contentNode,n=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof n=="string")t.innerHTML=n;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(n)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),n=pt(this.options.offset),s=this._getAnchor();this._zoomAnimated?ge(this._container,t.add(s)):n=n.add(t).add(s);var r=this._containerBottom=-n.y,c=this._containerLeft=-Math.round(this._containerWidth/2)+n.x;this._container.style.bottom=r+"px",this._container.style.left=c+"px"}},_getAnchor:function(){return[0,0]}});Zt.include({_initOverlay:function(t,n,s,r){var c=n;return c instanceof t||(c=new t(r).setContent(n)),s&&c.setLatLng(s),c}}),en.include({_initOverlay:function(t,n,s,r){var c=s;return c instanceof t?(Q(c,r),c._source=this):(c=n&&!r?n:new t(r,this),c.setContent(s)),c}});var Fo=Dn.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(t){return t=arguments.length?t:this._source._map,!t.hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,Dn.prototype.openOn.call(this,t)},onAdd:function(t){Dn.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof f||this._source.on("preclick",we))},onRemove:function(t){Dn.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof f||this._source.off("preclick",we))},getEvents:function(){var t=Dn.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",n=this._container=X("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),s=this._wrapper=X("div",t+"-content-wrapper",n);if(this._contentNode=X("div",t+"-content",s),vi(n),zn(this._contentNode),It(n,"contextmenu",we),this._tipContainer=X("div",t+"-tip-container",n),this._tip=X("div",t+"-tip",this._tipContainer),this.options.closeButton){var r=this._closeButton=X("a",t+"-close-button",n);r.setAttribute("role","button"),r.setAttribute("aria-label","Close popup"),r.href="#close",r.innerHTML='<span aria-hidden="true">&#215;</span>',It(r,"click",function(c){Le(c),this.close()},this)}},_updateLayout:function(){var t=this._contentNode,n=t.style;n.width="",n.whiteSpace="nowrap";var s=t.offsetWidth;s=Math.min(s,this.options.maxWidth),s=Math.max(s,this.options.minWidth),n.width=s+1+"px",n.whiteSpace="",n.height="";var r=t.offsetHeight,c=this.options.maxHeight,p="leaflet-popup-scrolled";c&&r>c?(n.height=c+"px",Pt(t,p)):oe(t,p),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var n=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),s=this._getAnchor();ge(this._container,n.add(s))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var t=this._map,n=parseInt(Mi(this._container,"marginBottom"),10)||0,s=this._container.offsetHeight+n,r=this._containerWidth,c=new et(this._containerLeft,-s-this._containerBottom);c._add(En(this._container));var p=t.layerPointToContainerPoint(c),S=pt(this.options.autoPanPadding),z=pt(this.options.autoPanPaddingTopLeft||S),I=pt(this.options.autoPanPaddingBottomRight||S),W=t.getSize(),at=0,Lt=0;p.x+r+I.x>W.x&&(at=p.x+r-W.x+I.x),p.x-at-z.x<0&&(at=p.x-z.x),p.y+s+I.y>W.y&&(Lt=p.y+s-W.y+I.y),p.y-Lt-z.y<0&&(Lt=p.y-z.y),(at||Lt)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([at,Lt]))}},_getAnchor:function(){return pt(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Dc=function(t,n){return new Fo(t,n)};Zt.mergeOptions({closePopupOnClick:!0}),Zt.include({openPopup:function(t,n,s){return this._initOverlay(Fo,t,n,s).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),en.include({bindPopup:function(t,n){return this._popup=this._initOverlay(Fo,this._popup,t,n),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(t){return this._popup&&(this instanceof Pn||(this._popup._source=this),this._popup._prepareOpen(t||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},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(!(!this._popup||!this._map)){wn(t);var n=t.layer||t.target;if(this._popup._source===n&&!(n instanceof f)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng);return}this._popup._source=n,this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){t.originalEvent.keyCode===13&&this._openPopup(t)}});var Bo=Dn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Dn.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){Dn.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=Dn.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip",n=t+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=X("div",n),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+y(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var n,s,r=this._map,c=this._container,p=r.latLngToContainerPoint(r.getCenter()),S=r.layerPointToContainerPoint(t),z=this.options.direction,I=c.offsetWidth,W=c.offsetHeight,at=pt(this.options.offset),Lt=this._getAnchor();z==="top"?(n=I/2,s=W):z==="bottom"?(n=I/2,s=0):z==="center"?(n=I/2,s=W/2):z==="right"?(n=0,s=W/2):z==="left"?(n=I,s=W/2):S.x<p.x?(z="right",n=0,s=W/2):(z="left",n=I+(at.x+Lt.x)*2,s=W/2),t=t.subtract(pt(n,s,!0)).add(at).add(Lt),oe(c,"leaflet-tooltip-right"),oe(c,"leaflet-tooltip-left"),oe(c,"leaflet-tooltip-top"),oe(c,"leaflet-tooltip-bottom"),Pt(c,"leaflet-tooltip-"+z),ge(c,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&$e(this._container,t)},_animateZoom:function(t){var n=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(n)},_getAnchor:function(){return pt(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),Nc=function(t,n){return new Bo(t,n)};Zt.include({openTooltip:function(t,n,s){return this._initOverlay(Bo,t,n,s).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),en.include({bindTooltip:function(t,n){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Bo,this._tooltip,t,n),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(t){if(!(!t&&this._tooltipHandlersAdded)){var n=t?"off":"on",s={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?s.add=this._openTooltip:(s.mouseover=this._openTooltip,s.mouseout=this.closeTooltip,s.click=this._openTooltip,this._map?this._addFocusListeners():s.add=this._addFocusListeners),this._tooltip.options.sticky&&(s.mousemove=this._moveTooltip),this[n](s),this._tooltipHandlersAdded=!t}},openTooltip:function(t){return this._tooltip&&(this instanceof Pn||(this._tooltip._source=this),this._tooltip._prepareOpen(t)&&(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(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(t){var n=typeof t.getElement=="function"&&t.getElement();n&&(It(n,"focus",function(){this._tooltip._source=t,this.openTooltip()},this),It(n,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(t){var n=typeof t.getElement=="function"&&t.getElement();n&&n.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(t){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var n=this;this._map.once("moveend",function(){n._openOnceFlag=!1,n._openTooltip(t)});return}this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0)}},_moveTooltip:function(t){var n=t.latlng,s,r;this._tooltip.options.sticky&&t.originalEvent&&(s=this._map.mouseEventToContainerPoint(t.originalEvent),r=this._map.containerPointToLayerPoint(s),n=this._map.layerPointToLatLng(r)),this._tooltip.setLatLng(n)}});var Va=cn.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var n=t&&t.tagName==="DIV"?t:document.createElement("div"),s=this.options;if(s.html instanceof Element?(jn(n),n.appendChild(s.html)):n.innerHTML=s.html!==!1?s.html:"",s.bgPos){var r=pt(s.bgPos);n.style.backgroundPosition=-r.x+"px "+-r.y+"px"}return this._setIconStyles(n,"icon"),n},createShadow:function(){return null}});function Rc(t){return new Va(t)}cn.Default=Jn;var Zs=en.extend({options:{tileSize:256,opacity:1,updateWhenIdle:ft.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(t){Q(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),Qt(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(ln(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(bn(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var t=this._clampZoom(this._map.getZoom());t!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()}return this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=T(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof et?t:new et(t,t)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var n=this.getPane().children,s=-t(-1/0,1/0),r=0,c=n.length,p;r<c;r++)p=n[r].style.zIndex,n[r]!==this._container&&p&&(s=t(s,+p));isFinite(s)&&(this.options.zIndex=s+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!ft.ielt9){$e(this._container,this.options.opacity);var t=+new Date,n=!1,s=!1;for(var r in this._tiles){var c=this._tiles[r];if(!(!c.current||!c.loaded)){var p=Math.min(1,(t-c.loaded)/200);$e(c.el,p),p<1?n=!0:(c.active?s=!0:this._onOpaqueTile(c),c.active=!0)}}s&&!this._noPrune&&this._pruneTiles(),n&&(nt(this._fadeFrame),this._fadeFrame=Et(this._updateOpacity,this))}},_onOpaqueTile:A,_initContainer:function(){this._container||(this._container=X("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,n=this.options.maxZoom;if(t!==void 0){for(var s in this._levels)s=Number(s),this._levels[s].el.children.length||s===t?(this._levels[s].el.style.zIndex=n-Math.abs(t-s),this._onUpdateLevel(s)):(Qt(this._levels[s].el),this._removeTilesAtZoom(s),this._onRemoveLevel(s),delete this._levels[s]);var r=this._levels[t],c=this._map;return r||(r=this._levels[t]={},r.el=X("div","leaflet-tile-container leaflet-zoom-animated",this._container),r.el.style.zIndex=n,r.origin=c.project(c.unproject(c.getPixelOrigin()),t).round(),r.zoom=t,this._setZoomTransform(r,c.getCenter(),c.getZoom()),A(r.el.offsetWidth),this._onCreateLevel(r)),this._level=r,r}},_onUpdateLevel:A,_onRemoveLevel:A,_onCreateLevel:A,_pruneTiles:function(){if(this._map){var t,n,s=this._map.getZoom();if(s>this.options.maxZoom||s<this.options.minZoom){this._removeAllTiles();return}for(t in this._tiles)n=this._tiles[t],n.retain=n.current;for(t in this._tiles)if(n=this._tiles[t],n.current&&!n.active){var r=n.coords;this._retainParent(r.x,r.y,r.z,r.z-5)||this._retainChildren(r.x,r.y,r.z,r.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}},_removeTilesAtZoom:function(t){for(var n in this._tiles)this._tiles[n].coords.z===t&&this._removeTile(n)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)Qt(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,n,s,r){var c=Math.floor(t/2),p=Math.floor(n/2),S=s-1,z=new et(+c,+p);z.z=+S;var I=this._tileCoordsToKey(z),W=this._tiles[I];return W&&W.active?(W.retain=!0,!0):(W&&W.loaded&&(W.retain=!0),S>r?this._retainParent(c,p,S,r):!1)},_retainChildren:function(t,n,s,r){for(var c=2*t;c<2*t+2;c++)for(var p=2*n;p<2*n+2;p++){var S=new et(c,p);S.z=s+1;var z=this._tileCoordsToKey(S),I=this._tiles[z];if(I&&I.active){I.retain=!0;continue}else I&&I.loaded&&(I.retain=!0);s+1<r&&this._retainChildren(c,p,s+1,r)}},_resetView:function(t){var n=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),n,n)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var n=this.options;return n.minNativeZoom!==void 0&&t<n.minNativeZoom?n.minNativeZoom:n.maxNativeZoom!==void 0&&n.maxNativeZoom<t?n.maxNativeZoom:t},_setView:function(t,n,s,r){var c=Math.round(n);this.options.maxZoom!==void 0&&c>this.options.maxZoom||this.options.minZoom!==void 0&&c<this.options.minZoom?c=void 0:c=this._clampZoom(c);var p=this.options.updateWhenZooming&&c!==this._tileZoom;(!r||p)&&(this._tileZoom=c,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),c!==void 0&&this._update(t),s||this._pruneTiles(),this._noPrune=!!s),this._setZoomTransforms(t,n)},_setZoomTransforms:function(t,n){for(var s in this._levels)this._setZoomTransform(this._levels[s],t,n)},_setZoomTransform:function(t,n,s){var r=this._map.getZoomScale(s,t.zoom),c=t.origin.multiplyBy(r).subtract(this._map._getNewPixelOrigin(n,s)).round();ft.any3d?Se(t.el,c,r):ge(t.el,c)},_resetGrid:function(){var t=this._map,n=t.options.crs,s=this._tileSize=this.getTileSize(),r=this._tileZoom,c=this._map.getPixelWorldBounds(this._tileZoom);c&&(this._globalTileRange=this._pxBoundsToTileRange(c)),this._wrapX=n.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,n.wrapLng[0]],r).x/s.x),Math.ceil(t.project([0,n.wrapLng[1]],r).x/s.y)],this._wrapY=n.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([n.wrapLat[0],0],r).y/s.x),Math.ceil(t.project([n.wrapLat[1],0],r).y/s.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(t){var n=this._map,s=n._animatingZoom?Math.max(n._animateToZoom,n.getZoom()):n.getZoom(),r=n.getZoomScale(s,this._tileZoom),c=n.project(t,this._tileZoom).floor(),p=n.getSize().divideBy(r*2);return new kt(c.subtract(p),c.add(p))},_update:function(t){var n=this._map;if(n){var s=this._clampZoom(n.getZoom());if(t===void 0&&(t=n.getCenter()),this._tileZoom!==void 0){var r=this._getTiledPixelBounds(t),c=this._pxBoundsToTileRange(r),p=c.getCenter(),S=[],z=this.options.keepBuffer,I=new kt(c.getBottomLeft().subtract([z,-z]),c.getTopRight().add([z,-z]));if(!(isFinite(c.min.x)&&isFinite(c.min.y)&&isFinite(c.max.x)&&isFinite(c.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var W in this._tiles){var at=this._tiles[W].coords;(at.z!==this._tileZoom||!I.contains(new et(at.x,at.y)))&&(this._tiles[W].current=!1)}if(Math.abs(s-this._tileZoom)>1){this._setView(t,s);return}for(var Lt=c.min.y;Lt<=c.max.y;Lt++)for(var Ut=c.min.x;Ut<=c.max.x;Ut++){var He=new et(Ut,Lt);if(He.z=this._tileZoom,!!this._isValidTile(He)){var Me=this._tiles[this._tileCoordsToKey(He)];Me?Me.current=!0:S.push(He)}}if(S.sort(function(Je,ms){return Je.distanceTo(p)-ms.distanceTo(p)}),S.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var dn=document.createDocumentFragment();for(Ut=0;Ut<S.length;Ut++)this._addTile(S[Ut],dn);this._level.el.appendChild(dn)}}}},_isValidTile:function(t){var n=this._map.options.crs;if(!n.infinite){var s=this._globalTileRange;if(!n.wrapLng&&(t.x<s.min.x||t.x>s.max.x)||!n.wrapLat&&(t.y<s.min.y||t.y>s.max.y))return!1}if(!this.options.bounds)return!0;var r=this._tileCoordsToBounds(t);return Jt(this.options.bounds).overlaps(r)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var n=this._map,s=this.getTileSize(),r=t.scaleBy(s),c=r.add(s),p=n.unproject(r,t.z),S=n.unproject(c,t.z);return[p,S]},_tileCoordsToBounds:function(t){var n=this._tileCoordsToNwSe(t),s=new ae(n[0],n[1]);return this.options.noWrap||(s=this._map.wrapLatLngBounds(s)),s},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var n=t.split(":"),s=new et(+n[0],+n[1]);return s.z=+n[2],s},_removeTile:function(t){var n=this._tiles[t];n&&(Qt(n.el),delete this._tiles[t],this.fire("tileunload",{tile:n.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){Pt(t,"leaflet-tile");var n=this.getTileSize();t.style.width=n.x+"px",t.style.height=n.y+"px",t.onselectstart=A,t.onmousemove=A,ft.ielt9&&this.options.opacity<1&&$e(t,this.options.opacity)},_addTile:function(t,n){var s=this._getTilePos(t),r=this._tileCoordsToKey(t),c=this.createTile(this._wrapCoords(t),h(this._tileReady,this,t));this._initTile(c),this.createTile.length<2&&Et(h(this._tileReady,this,t,null,c)),ge(c,s),this._tiles[r]={el:c,coords:t,current:!0},n.appendChild(c),this.fire("tileloadstart",{tile:c,coords:t})},_tileReady:function(t,n,s){n&&this.fire("tileerror",{error:n,tile:s,coords:t});var r=this._tileCoordsToKey(t);s=this._tiles[r],s&&(s.loaded=+new Date,this._map._fadeAnimated?($e(s.el,0),nt(this._fadeFrame),this._fadeFrame=Et(this._updateOpacity,this)):(s.active=!0,this._pruneTiles()),n||(Pt(s.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:s.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ft.ielt9||!this._map._fadeAnimated?Et(this._pruneTiles,this):setTimeout(h(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var n=new et(this._wrapX?w(t.x,this._wrapX):t.x,this._wrapY?w(t.y,this._wrapY):t.y);return n.z=t.z,n},_pxBoundsToTileRange:function(t){var n=this.getTileSize();return new kt(t.min.unscaleBy(n).floor(),t.max.unscaleBy(n).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Fc(t){return new Zs(t)}var ps=Zs.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,n){this._url=t,n=Q(this,n),n.detectRetina&&ft.retina&&n.maxZoom>0?(n.tileSize=Math.floor(n.tileSize/2),n.zoomReverse?(n.zoomOffset--,n.minZoom=Math.min(n.maxZoom,n.minZoom+1)):(n.zoomOffset++,n.maxZoom=Math.max(n.minZoom,n.maxZoom-1)),n.minZoom=Math.max(0,n.minZoom)):n.zoomReverse?n.minZoom=Math.min(n.maxZoom,n.minZoom):n.maxZoom=Math.max(n.minZoom,n.maxZoom),typeof n.subdomains=="string"&&(n.subdomains=n.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,n){return this._url===t&&n===void 0&&(n=!0),this._url=t,n||this.redraw(),this},createTile:function(t,n){var s=document.createElement("img");return It(s,"load",h(this._tileOnLoad,this,n,s)),It(s,"error",h(this._tileOnError,this,n,s)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(s.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(s.referrerPolicy=this.options.referrerPolicy),s.alt="",s.src=this.getTileUrl(t),s},getTileUrl:function(t){var n={r:ft.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var s=this._globalTileRange.max.y-t.y;this.options.tms&&(n.y=s),n["-y"]=s}return q(this._url,l(n,this.options))},_tileOnLoad:function(t,n){ft.ielt9?setTimeout(h(t,this,null,n),0):t(null,n)},_tileOnError:function(t,n,s){var r=this.options.errorTileUrl;r&&n.getAttribute("src")!==r&&(n.src=r),t(s,n)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,n=this.options.maxZoom,s=this.options.zoomReverse,r=this.options.zoomOffset;return s&&(t=n-t),t+r},_getSubdomain:function(t){var n=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[n]},_abortLoading:function(){var t,n;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&(n=this._tiles[t].el,n.onload=A,n.onerror=A,!n.complete)){n.src=ht;var s=this._tiles[t].coords;Qt(n),delete this._tiles[t],this.fire("tileabort",{tile:n,coords:s})}},_removeTile:function(t){var n=this._tiles[t];if(n)return n.el.setAttribute("src",ht),Zs.prototype._removeTile.call(this,t)},_tileReady:function(t,n,s){if(!(!this._map||s&&s.getAttribute("src")===ht))return Zs.prototype._tileReady.call(this,t,n,s)}});function Za(t,n){return new ps(t,n)}var Ua=ps.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,n){this._url=t;var s=l({},this.defaultWmsParams);for(var r in n)r in this.options||(s[r]=n[r]);n=Q(this,n);var c=n.detectRetina&&ft.retina?2:1,p=this.getTileSize();s.width=p.x*c,s.height=p.y*c,this.wmsParams=s},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var n=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[n]=this._crs.code,ps.prototype.onAdd.call(this,t)},getTileUrl:function(t){var n=this._tileCoordsToNwSe(t),s=this._crs,r=Yt(s.project(n[0]),s.project(n[1])),c=r.min,p=r.max,S=(this._wmsVersion>=1.3&&this._crs===Bs?[c.y,c.x,p.y,p.x]:[c.x,c.y,p.x,p.y]).join(","),z=ps.prototype.getTileUrl.call(this,t);return z+Ot(this.wmsParams,z,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+S},setParams:function(t,n){return l(this.wmsParams,t),n||this.redraw(),this}});function Bc(t,n){return new Ua(t,n)}ps.WMS=Ua,Za.wms=Bc;var ti=en.extend({options:{padding:.1},initialize:function(t){Q(this,t),y(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Pt(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 t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,n){var s=this._map.getZoomScale(n,this._zoom),r=this._map.getSize().multiplyBy(.5+this.options.padding),c=this._map.project(this._center,n),p=r.multiplyBy(-s).add(c).subtract(this._map._getNewPixelOrigin(t,n));ft.any3d?Se(this._container,p,s):ge(this._container,p)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var t in this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,n=this._map.getSize(),s=this._map.containerPointToLayerPoint(n.multiplyBy(-t)).round();this._bounds=new kt(s,s.add(n.multiplyBy(1+t*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Ha=ti.extend({options:{tolerance:0},getEvents:function(){var t=ti.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ti.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");It(t,"mousemove",this._onMouseMove,this),It(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),It(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){nt(this._redrawRequest),delete this._ctx,Qt(this._container),te(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var t;this._redrawBounds=null;for(var n in this._layers)t=this._layers[n],t._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ti.prototype._update.call(this);var t=this._bounds,n=this._container,s=t.getSize(),r=ft.retina?2:1;ge(n,t.min),n.width=r*s.x,n.height=r*s.y,n.style.width=s.x+"px",n.style.height=s.y+"px",ft.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){ti.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[y(t)]=t;var n=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=n),this._drawLast=n,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var n=t._order,s=n.next,r=n.prev;s?s.prev=r:this._drawLast=r,r?r.next=s:this._drawFirst=s,delete t._order,delete this._layers[y(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(typeof t.options.dashArray=="string"){var n=t.options.dashArray.split(/[, ]+/),s=[],r,c;for(c=0;c<n.length;c++){if(r=Number(n[c]),isNaN(r))return;s.push(r)}t.options._dashArray=s}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||Et(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var n=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new kt,this._redrawBounds.extend(t._pxBounds.min.subtract([n,n])),this._redrawBounds.extend(t._pxBounds.max.add([n,n]))}},_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 t=this._redrawBounds;if(t){var n=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,n.x,n.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 t,n=this._redrawBounds;if(this._ctx.save(),n){var s=n.getSize();this._ctx.beginPath(),this._ctx.rect(n.min.x,n.min.y,s.x,s.y),this._ctx.clip()}this._drawing=!0;for(var r=this._drawFirst;r;r=r.next)t=r.layer,(!n||t._pxBounds&&t._pxBounds.intersects(n))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,n){if(this._drawing){var s,r,c,p,S=t._parts,z=S.length,I=this._ctx;if(z){for(I.beginPath(),s=0;s<z;s++){for(r=0,c=S[s].length;r<c;r++)p=S[s][r],I[r?"lineTo":"moveTo"](p.x,p.y);n&&I.closePath()}this._fillStroke(I,t)}}},_updateCircle:function(t){if(!(!this._drawing||t._empty())){var n=t._point,s=this._ctx,r=Math.max(Math.round(t._radius),1),c=(Math.max(Math.round(t._radiusY),1)||r)/r;c!==1&&(s.save(),s.scale(1,c)),s.beginPath(),s.arc(n.x,n.y/c,r,0,Math.PI*2,!1),c!==1&&s.restore(),this._fillStroke(s,t)}},_fillStroke:function(t,n){var s=n.options;s.fill&&(t.globalAlpha=s.fillOpacity,t.fillStyle=s.fillColor||s.color,t.fill(s.fillRule||"evenodd")),s.stroke&&s.weight!==0&&(t.setLineDash&&t.setLineDash(n.options&&n.options._dashArray||[]),t.globalAlpha=s.opacity,t.lineWidth=s.weight,t.strokeStyle=s.color,t.lineCap=s.lineCap,t.lineJoin=s.lineJoin,t.stroke())},_onClick:function(t){for(var n=this._map.mouseEventToLayerPoint(t),s,r,c=this._drawFirst;c;c=c.next)s=c.layer,s.options.interactive&&s._containsPoint(n)&&(!(t.type==="click"||t.type==="preclick")||!this._map._draggableMoved(s))&&(r=s);this._fireEvent(r?[r]:!1,t)},_onMouseMove:function(t){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var n=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,n)}},_handleMouseOut:function(t){var n=this._hoveredLayer;n&&(oe(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,n){if(!this._mouseHoverThrottled){for(var s,r,c=this._drawFirst;c;c=c.next)s=c.layer,s.options.interactive&&s._containsPoint(n)&&(r=s);r!==this._hoveredLayer&&(this._handleMouseOut(t),r&&(Pt(this._container,"leaflet-interactive"),this._fireEvent([r],t,"mouseover"),this._hoveredLayer=r)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,t),this._mouseHoverThrottled=!0,setTimeout(h(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(t,n,s){this._map._fireDOMEvent(n,s||n.type,t)},_bringToFront:function(t){var n=t._order;if(n){var s=n.next,r=n.prev;if(s)s.prev=r;else return;r?r.next=s:s&&(this._drawFirst=s),n.prev=this._drawLast,this._drawLast.next=n,n.next=null,this._drawLast=n,this._requestRedraw(t)}},_bringToBack:function(t){var n=t._order;if(n){var s=n.next,r=n.prev;if(r)r.next=s;else return;s?s.prev=r:r&&(this._drawLast=r),n.prev=null,n.next=this._drawFirst,this._drawFirst.prev=n,this._drawFirst=n,this._requestRedraw(t)}}});function ja(t){return ft.canvas?new Ha(t):null}var Us=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch{}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),Vc={_initContainer:function(){this._container=X("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ti.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var n=t._container=Us("shape");Pt(n,"leaflet-vml-shape "+(this.options.className||"")),n.coordsize="1 1",t._path=Us("path"),n.appendChild(t._path),this._updateStyle(t),this._layers[y(t)]=t},_addPath:function(t){var n=t._container;this._container.appendChild(n),t.options.interactive&&t.addInteractiveTarget(n)},_removePath:function(t){var n=t._container;Qt(n),t.removeInteractiveTarget(n),delete this._layers[y(t)]},_updateStyle:function(t){var n=t._stroke,s=t._fill,r=t.options,c=t._container;c.stroked=!!r.stroke,c.filled=!!r.fill,r.stroke?(n||(n=t._stroke=Us("stroke")),c.appendChild(n),n.weight=r.weight+"px",n.color=r.color,n.opacity=r.opacity,r.dashArray?n.dashStyle=dt(r.dashArray)?r.dashArray.join(" "):r.dashArray.replace(/( *, *)/g," "):n.dashStyle="",n.endcap=r.lineCap.replace("butt","flat"),n.joinstyle=r.lineJoin):n&&(c.removeChild(n),t._stroke=null),r.fill?(s||(s=t._fill=Us("fill")),c.appendChild(s),s.color=r.fillColor||r.color,s.opacity=r.fillOpacity):s&&(c.removeChild(s),t._fill=null)},_updateCircle:function(t){var n=t._point.round(),s=Math.round(t._radius),r=Math.round(t._radiusY||s);this._setPath(t,t._empty()?"M0 0":"AL "+n.x+","+n.y+" "+s+","+r+" 0,"+65535*360)},_setPath:function(t,n){t._path.v=n},_bringToFront:function(t){ln(t._container)},_bringToBack:function(t){bn(t._container)}},Vo=ft.vml?Us:F,Hs=ti.extend({_initContainer:function(){this._container=Vo("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Vo("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){Qt(this._container),te(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ti.prototype._update.call(this);var t=this._bounds,n=t.getSize(),s=this._container;(!this._svgSize||!this._svgSize.equals(n))&&(this._svgSize=n,s.setAttribute("width",n.x),s.setAttribute("height",n.y)),ge(s,t.min),s.setAttribute("viewBox",[t.min.x,t.min.y,n.x,n.y].join(" ")),this.fire("update")}},_initPath:function(t){var n=t._path=Vo("path");t.options.className&&Pt(n,t.options.className),t.options.interactive&&Pt(n,"leaflet-interactive"),this._updateStyle(t),this._layers[y(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){Qt(t._path),t.removeInteractiveTarget(t._path),delete this._layers[y(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var n=t._path,s=t.options;n&&(s.stroke?(n.setAttribute("stroke",s.color),n.setAttribute("stroke-opacity",s.opacity),n.setAttribute("stroke-width",s.weight),n.setAttribute("stroke-linecap",s.lineCap),n.setAttribute("stroke-linejoin",s.lineJoin),s.dashArray?n.setAttribute("stroke-dasharray",s.dashArray):n.removeAttribute("stroke-dasharray"),s.dashOffset?n.setAttribute("stroke-dashoffset",s.dashOffset):n.removeAttribute("stroke-dashoffset")):n.setAttribute("stroke","none"),s.fill?(n.setAttribute("fill",s.fillColor||s.color),n.setAttribute("fill-opacity",s.fillOpacity),n.setAttribute("fill-rule",s.fillRule||"evenodd")):n.setAttribute("fill","none"))},_updatePoly:function(t,n){this._setPath(t,R(t._parts,n))},_updateCircle:function(t){var n=t._point,s=Math.max(Math.round(t._radius),1),r=Math.max(Math.round(t._radiusY),1)||s,c="a"+s+","+r+" 0 1,0 ",p=t._empty()?"M0 0":"M"+(n.x-s)+","+n.y+c+s*2+",0 "+c+-s*2+",0 ";this._setPath(t,p)},_setPath:function(t,n){t._path.setAttribute("d",n)},_bringToFront:function(t){ln(t._path)},_bringToBack:function(t){bn(t._path)}});ft.vml&&Hs.include(Vc);function Wa(t){return ft.svg||ft.vml?new Hs(t):null}Zt.include({getRenderer:function(t){var n=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return n||(n=this._renderer=this._createRenderer()),this.hasLayer(n)||this.addLayer(n),n},_getPaneRenderer:function(t){if(t==="overlayPane"||t===void 0)return!1;var n=this._paneRenderers[t];return n===void 0&&(n=this._createRenderer({pane:t}),this._paneRenderers[t]=n),n},_createRenderer:function(t){return this.options.preferCanvas&&ja(t)||Wa(t)}});var Ka=fs.extend({initialize:function(t,n){fs.prototype.initialize.call(this,this._boundsToLatLngs(t),n)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=Jt(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Zc(t,n){return new Ka(t,n)}Hs.create=Vo,Hs.pointsToPath=R,Qn.geometryToLayer=Io,Qn.coordsToLatLng=Zr,Qn.coordsToLatLngs=$o,Qn.latLngToCoords=Ur,Qn.latLngsToCoords=Do,Qn.getFeature=hs,Qn.asFeature=No,Zt.mergeOptions({boxZoom:!0});var Ga=re.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){It(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){te(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){Qt(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(t){if(!t.shiftKey||t.which!==1&&t.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),gi(),$s(),this._startPoint=this._map.mouseEventToContainerPoint(t),It(document,{contextmenu:wn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=X("div","leaflet-zoom-box",this._container),Pt(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var n=new kt(this._point,this._startPoint),s=n.getSize();ge(this._box,n.min),this._box.style.width=s.x+"px",this._box.style.height=s.y+"px"},_finish:function(){this._moved&&(Qt(this._box),oe(this._container,"leaflet-crosshair")),Ei(),Ds(),te(document,{contextmenu:wn,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if(!(t.which!==1&&t.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(h(this._resetState,this),0);var n=new ae(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(n).fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(t){t.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Zt.addInitHook("addHandler","boxZoom",Ga),Zt.mergeOptions({doubleClickZoom:!0});var qa=re.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var n=this._map,s=n.getZoom(),r=n.options.zoomDelta,c=t.originalEvent.shiftKey?s-r:s+r;n.options.doubleClickZoom==="center"?n.setZoom(c):n.setZoomAround(t.containerPoint,c)}});Zt.addInitHook("addHandler","doubleClickZoom",qa),Zt.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Ya=re.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new Ye(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}Pt(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){oe(this._map._container,"leaflet-grab"),oe(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 t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var n=Jt(this._map.options.maxBounds);this._offsetLimit=Yt(this._map.latLngToContainerPoint(n.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(n.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var n=this._lastTime=+new Date,s=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(s),this._times.push(n),this._prunePositions(n)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),n=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=n.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,n){return t-(t-n)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var t=this._draggable._newPos.subtract(this._draggable._startPos),n=this._offsetLimit;t.x<n.min.x&&(t.x=this._viscousLimit(t.x,n.min.x)),t.y<n.min.y&&(t.y=this._viscousLimit(t.y,n.min.y)),t.x>n.max.x&&(t.x=this._viscousLimit(t.x,n.max.x)),t.y>n.max.y&&(t.y=this._viscousLimit(t.y,n.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,n=Math.round(t/2),s=this._initialWorldOffset,r=this._draggable._newPos.x,c=(r-n+s)%t+n-s,p=(r+n+s)%t-n-s,S=Math.abs(c+s)<Math.abs(p+s)?c:p;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=S},_onDragEnd:function(t){var n=this._map,s=n.options,r=!s.inertia||t.noInertia||this._times.length<2;if(n.fire("dragend",t),r)n.fire("moveend");else{this._prunePositions(+new Date);var c=this._lastPos.subtract(this._positions[0]),p=(this._lastTime-this._times[0])/1e3,S=s.easeLinearity,z=c.multiplyBy(S/p),I=z.distanceTo([0,0]),W=Math.min(s.inertiaMaxSpeed,I),at=z.multiplyBy(W/I),Lt=W/(s.inertiaDeceleration*S),Ut=at.multiplyBy(-Lt/2).round();!Ut.x&&!Ut.y?n.fire("moveend"):(Ut=n._limitOffset(Ut,n.options.maxBounds),Et(function(){n.panBy(Ut,{duration:Lt,easeLinearity:S,noMoveStart:!0,animate:!0})}))}}});Zt.addInitHook("addHandler","dragging",Ya),Zt.mergeOptions({keyboard:!0,keyboardPanDelta:80});var Ja=re.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),It(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),te(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 t=document.body,n=document.documentElement,s=t.scrollTop||n.scrollTop,r=t.scrollLeft||n.scrollLeft;this._map._container.focus(),window.scrollTo(r,s)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var n=this._panKeys={},s=this.keyCodes,r,c;for(r=0,c=s.left.length;r<c;r++)n[s.left[r]]=[-1*t,0];for(r=0,c=s.right.length;r<c;r++)n[s.right[r]]=[t,0];for(r=0,c=s.down.length;r<c;r++)n[s.down[r]]=[0,t];for(r=0,c=s.up.length;r<c;r++)n[s.up[r]]=[0,-1*t]},_setZoomDelta:function(t){var n=this._zoomKeys={},s=this.keyCodes,r,c;for(r=0,c=s.zoomIn.length;r<c;r++)n[s.zoomIn[r]]=t;for(r=0,c=s.zoomOut.length;r<c;r++)n[s.zoomOut[r]]=-t},_addHooks:function(){It(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){te(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var n=t.keyCode,s=this._map,r;if(n in this._panKeys){if(!s._panAnim||!s._panAnim._inProgress)if(r=this._panKeys[n],t.shiftKey&&(r=pt(r).multiplyBy(3)),s.options.maxBounds&&(r=s._limitOffset(pt(r),s.options.maxBounds)),s.options.worldCopyJump){var c=s.wrapLatLng(s.unproject(s.project(s.getCenter()).add(r)));s.panTo(c)}else s.panBy(r)}else if(n in this._zoomKeys)s.setZoom(s.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[n]);else if(n===27&&s._popup&&s._popup.options.closeOnEscapeKey)s.closePopup();else return;wn(t)}}});Zt.addInitHook("addHandler","keyboard",Ja),Zt.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var Xa=re.extend({addHooks:function(){It(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){te(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var n=To(t),s=this._map.options.wheelDebounceTime;this._delta+=n,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var r=Math.max(s-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(h(this._performZoom,this),r),wn(t)},_performZoom:function(){var t=this._map,n=t.getZoom(),s=this._map.options.zoomSnap||0;t._stop();var r=this._delta/(this._map.options.wheelPxPerZoomLevel*4),c=4*Math.log(2/(1+Math.exp(-Math.abs(r))))/Math.LN2,p=s?Math.ceil(c/s)*s:c,S=t._limitZoom(n+(this._delta>0?p:-p))-n;this._delta=0,this._startTime=null,S&&(t.options.scrollWheelZoom==="center"?t.setZoom(n+S):t.setZoomAround(this._lastMousePos,n+S))}});Zt.addInitHook("addHandler","scrollWheelZoom",Xa);var Uc=600;Zt.mergeOptions({tapHold:ft.touchNative&&ft.safari&&ft.mobile,tapTolerance:15});var Qa=re.extend({addHooks:function(){It(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){te(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),t.touches.length===1){var n=t.touches[0];this._startPos=this._newPos=new et(n.clientX,n.clientY),this._holdTimeout=setTimeout(h(function(){this._cancel(),this._isTapValid()&&(It(document,"touchend",Le),It(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",n))},this),Uc),It(document,"touchend touchcancel contextmenu",this._cancel,this),It(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){te(document,"touchend",Le),te(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),te(document,"touchend touchcancel contextmenu",this._cancel,this),te(document,"touchmove",this._onMove,this)},_onMove:function(t){var n=t.touches[0];this._newPos=new et(n.clientX,n.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,n){var s=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY});s._simulated=!0,n.target.dispatchEvent(s)}});Zt.addInitHook("addHandler","tapHold",Qa),Zt.mergeOptions({touchZoom:ft.touch,bounceAtZoomLimits:!0});var tl=re.extend({addHooks:function(){Pt(this._map._container,"leaflet-touch-zoom"),It(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){oe(this._map._container,"leaflet-touch-zoom"),te(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var n=this._map;if(!(!t.touches||t.touches.length!==2||n._animatingZoom||this._zooming)){var s=n.mouseEventToContainerPoint(t.touches[0]),r=n.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=n.getSize()._divideBy(2),this._startLatLng=n.containerPointToLatLng(this._centerPoint),n.options.touchZoom!=="center"&&(this._pinchStartLatLng=n.containerPointToLatLng(s.add(r)._divideBy(2))),this._startDist=s.distanceTo(r),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),It(document,"touchmove",this._onTouchMove,this),It(document,"touchend touchcancel",this._onTouchEnd,this),Le(t)}},_onTouchMove:function(t){if(!(!t.touches||t.touches.length!==2||!this._zooming)){var n=this._map,s=n.mouseEventToContainerPoint(t.touches[0]),r=n.mouseEventToContainerPoint(t.touches[1]),c=s.distanceTo(r)/this._startDist;if(this._zoom=n.getScaleZoom(c,this._startZoom),!n.options.bounceAtZoomLimits&&(this._zoom<n.getMinZoom()&&c<1||this._zoom>n.getMaxZoom()&&c>1)&&(this._zoom=n._limitZoom(this._zoom)),n.options.touchZoom==="center"){if(this._center=this._startLatLng,c===1)return}else{var p=s._add(r)._divideBy(2)._subtract(this._centerPoint);if(c===1&&p.x===0&&p.y===0)return;this._center=n.unproject(n.project(this._pinchStartLatLng,this._zoom).subtract(p),this._zoom)}this._moved||(n._moveStart(!0,!1),this._moved=!0),nt(this._animRequest);var S=h(n._move,n,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=Et(S,this,!0),Le(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,nt(this._animRequest),te(document,"touchmove",this._onTouchMove,this),te(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))}});Zt.addInitHook("addHandler","touchZoom",tl),Zt.BoxZoom=Ga,Zt.DoubleClickZoom=qa,Zt.Drag=Ya,Zt.Keyboard=Ja,Zt.ScrollWheelZoom=Xa,Zt.TapHold=Qa,Zt.TouchZoom=tl,o.Bounds=kt,o.Browser=ft,o.CRS=C,o.Canvas=Ha,o.Circle=qt,o.CircleMarker=H,o.Class=zt,o.Control=Ue,o.DivIcon=Va,o.DivOverlay=Dn,o.DomEvent=Lo,o.DomUtil=Ar,o.Draggable=Ye,o.Evented=At,o.FeatureGroup=Pn,o.GeoJSON=Qn,o.GridLayer=Zs,o.Handler=re,o.Icon=cn,o.ImageOverlay=Ro,o.LatLng=Bt,o.LatLngBounds=ae,o.Layer=en,o.LayerGroup=xi,o.LineUtil=kn,o.Map=Zt,o.Marker=ds,o.Mixin=yi,o.Path=f,o.Point=et,o.PolyUtil=Oo,o.Polygon=fs,o.Polyline=Xn,o.Popup=Fo,o.PosAnimation=Ai,o.Projection=Eo,o.Rectangle=Ka,o.Renderer=ti,o.SVG=Hs,o.SVGOverlay=Ba,o.TileLayer=ps,o.Tooltip=Bo,o.Transformation=Ge,o.Util=ut,o.VideoOverlay=Fa,o.bind=h,o.bounds=Yt,o.canvas=ja,o.circle=Mc,o.circleMarker=k,o.control=Ii,o.divIcon=Rc,o.extend=l,o.featureGroup=de,o.geoJSON=Ra,o.geoJson=zc,o.gridLayer=Fc,o.icon=Vs,o.imageOverlay=Ac,o.latLng=j,o.latLngBounds=Jt,o.layerGroup=cs,o.map=os,o.marker=b,o.point=pt,o.polygon=Ec,o.polyline=Oc,o.popup=Dc,o.rectangle=Zc,o.setOptions=Q,o.stamp=y,o.svg=Wa,o.svgOverlay=$c,o.tileLayer=Za,o.tooltip=Nc,o.transformation=v,o.version=a,o.videoOverlay=Ic;var Hc=window.L;o.noConflict=function(){return window.L=Hc,this},window.L=o}))})(Js,Js.exports)),Js.exports}var Rp=Np();const Go=$p(Rp),Ql={__name:"DeviceMap",props:{position:{type:Object,default:null},trail:{type:Array,default:()=>[]}},setup(e){const i=e,o=G(null);let a,l,d;function h(){if(!a)return;const _=i.position;if(_&&(_.lat||_.lng)){const y=[_.lat,_.lng];l?l.setLatLng(y):(l=Go.marker(y).addTo(a),a.setView(y,17))}if(d&&d.remove(),i.trail.length){const y=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0";d=Go.polyline(i.trail,{color:y,weight:3}).addTo(a)}}return Yi(()=>{a=Go.map(o.value,{zoomControl:!0}).setView([20,0],2),Go.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",maxZoom:19}).addTo(a),setTimeout(()=>a.invalidateSize(),60),h()}),Qe(()=>i.position,h,{deep:!0}),Qe(()=>i.trail,h,{deep:!0}),(_,y)=>(g(),x("div",{ref_key:"el",ref:o,class:"h-[320px] w-full rounded-lg"},null,512))}},Fp=["width","height","stroke-width"],Bp=["d"],Y={__name:"Icon",props:{name:{type:String,required:!0},size:{type:[Number,String],default:18},stroke:{type:[Number,String],default:2}},setup(e){const a=({grid:"M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z",radio:"M4.9 19.1a10 10 0 0 1 0-14.2M7.8 16.2a6 6 0 0 1 0-8.4M16.2 7.8a6 6 0 0 1 0 8.4M19.1 4.9a10 10 0 0 1 0 14.2M12 13a1 1 0 1 0 0-2 1 1 0 0 0 0 2z",route:"M6 19a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM18 11a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 13V9a4 4 0 0 1 4-4h4",calendar:"M8 2v4M16 2v4M3 10h18M5 4h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z",book:"M4 19.5A2.5 2.5 0 0 1 6.5 17H20M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z",fileText:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zM14 2v6h6M16 13H8M16 17H8M10 9H8",settings:"M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z",search:"M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM21 21l-4.3-4.3",plus:"M12 5v14M5 12h14",battery:"M3 8h14a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H3a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1zM22 11v2",signal:"M2 20h.01M7 20v-4M12 20v-8M17 20V8M22 20V4",clock:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2",chevronRight:"M9 6l6 6-6 6",play:"M6 3l14 9-14 9V3z",logout:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4M16 17l5-5-5-5M21 12H9",wind:"M12.8 19.6A2 2 0 1 0 14 16H2M17.5 8a2.5 2.5 0 1 1 2 4H2M9.6 4.6A2 2 0 1 1 11 8H2",drone:"M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM6 6 4 4M18 6l2-2M6 18l-2 2M18 18l2 2",user:"M20 21a8 8 0 1 0-16 0M12 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8z",users:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM23 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75",shield:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z",sliders:"M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6",alertTriangle:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0zM12 9v4M12 17h.01",download:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3",upload:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12",trash:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6M10 11v6M14 11v6",check:"M20 6 9 17l-5-5",mail:"M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zM22 6l-10 7L2 6",lock:"M5 11h14a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-6a2 2 0 0 1 2-2zM7 11V7a5 5 0 0 1 10 0v4",monitor:"M3 4h18a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zM8 21h8M12 17v4",globe:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM3 12h18M12 3a15 15 0 0 1 0 18 15 15 0 0 1 0-18z",smartphone:"M7 2h10a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM11 18h2",image:"M4 4h16a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1zM8.5 11a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3zM21 15l-5-5L5 21",type:"M4 7V4h16v3M9 20h6M12 4v16",sun:"M12 17a5 5 0 1 0 0-10 5 5 0 0 0 0 10zM12 1v2M12 21v2M4.2 4.2l1.4 1.4M18.4 18.4l1.4 1.4M1 12h2M21 12h2M4.2 19.8l1.4-1.4M18.4 5.6l1.4-1.4",moon:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z",x:"M18 6 6 18M6 6l12 12",server:"M20 4H4a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM20 13H4a2 2 0 0 0-2 2v3a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2zM6 7.5h.01M6 16.5h.01",cloud:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9z"}[e.name]||"").split(" M").map((l,d)=>d?"M"+l:l);return(l,d)=>(g(),x("svg",{width:e.size,height:e.size,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":e.stroke,"stroke-linecap":"round","stroke-linejoin":"round",style:{flex:"none"},"aria-hidden":"true"},[(g(!0),x(ct,null,Wt($t(a),(h,_)=>(g(),x("path",{key:_,d:h},null,8,Bp))),128))],8,Fp))}},Vp=["aria-checked","disabled"],nn={__name:"Toggle",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:i}){const o=i;return(a,l)=>(g(),x("button",{type:"button",role:"switch","aria-checked":e.modelValue,disabled:e.disabled,class:Ct(["relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition disabled:opacity-40",e.modelValue?"bg-accent":"bg-surface-2 border border-line-strong"]),onClick:l[0]||(l[0]=d=>o("update:modelValue",!e.modelValue))},[u("span",{class:Ct(["inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition",e.modelValue?"translate-x-6":"translate-x-1"])},null,2)],10,Vp))}},Zp={class:"inline-flex rounded-[10px] border border-line bg-surface-2 p-0.5"},Up=["onClick"],hn={__name:"Segmented",props:{modelValue:{type:[String,Number],default:""},options:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(e,{emit:i}){const o=i;return(a,l)=>(g(),x("div",Zp,[(g(!0),x(ct,null,Wt(e.options,d=>(g(),x("button",{key:d.value,type:"button",class:Ct(["inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] font-semibold transition",e.modelValue===d.value?"bg-surface-1 text-ink shadow-xs":"text-ink-secondary hover:text-ink"]),onClick:h=>o("update:modelValue",d.value)},[d.icon?(g(),ie(Y,{key:0,name:d.icon,size:15},null,8,["name"])):N("",!0),$(" "+P(d.label),1)],10,Up))),128))]))}},Hp={class:"text-sm font-semibold text-ink"},jp={key:0,class:"mt-0.5 text-xs text-ink-muted"},_t={__name:"Row",props:{title:{type:String,default:""},desc:{type:String,default:""},keywords:{type:String,default:""},block:{type:Boolean,default:!1}},setup(e){const i=e,o=eo("settingsSearch",{value:""}),a=xt(()=>{const l=(o.value||"").trim().toLowerCase();return l?`${i.title} ${i.desc} ${i.keywords}`.toLowerCase().includes(l):!0});return(l,d)=>a.value?(g(),x("div",{key:0,class:Ct(["border-b border-line py-4 last:border-0",e.block?"":"flex items-center justify-between gap-6"])},[u("div",{class:Ct(e.block?"mb-3":"min-w-0")},[u("div",Hp,P(e.title),1),e.desc?(g(),x("div",jp,P(e.desc),1)):N("",!0)],2),u("div",{class:Ct(e.block?"":"shrink-0")},[af(l.$slots,"default")],2)],2)):N("",!0)}},Wp=(e,i)=>{const o=e.__vccOpts||e;for(const[a,l]of i)o[a]=l;return o},Kp={class:"mx-auto max-w-[1280px] p-7"},Gp={class:"mb-5 flex flex-wrap items-end justify-between gap-4"},qp={class:"flex h-10 w-full max-w-[280px] items-center gap-2 rounded border border-line-strong bg-surface-1 px-3"},Yp={class:"grid grid-cols-[210px_1fr] gap-6 max-[760px]:grid-cols-1"},Jp={class:"flex flex-col gap-0.5 max-[760px]:flex-row max-[760px]:overflow-x-auto"},Xp=["onClick"],Qp={class:"whitespace-nowrap"},tm={class:"min-w-0"},em={key:0,class:"panel p-10 text-center text-sm text-ink-muted"},nm={key:0,class:"eyebrow mb-2 mt-5 first:mt-0 flex items-center gap-2"},im={key:1,class:"panel mb-5 p-5"},sm={class:"flex items-center gap-1"},om={class:"flex items-center gap-2"},rm={class:"font-mono text-sm text-ink"},am={class:"inline-flex items-center gap-1 rounded-full bg-amber-soft px-2 py-0.5 text-[11px] font-semibold text-amber-fg"},lm={key:0,class:"mt-2 text-xs text-ink-muted"},um={class:"grid max-w-[420px] gap-2"},cm={class:"flex items-center gap-3"},dm={key:2,class:"panel mb-5 p-5"},fm=["value"],hm=["value"],pm=["value"],mm={class:"font-mono text-sm text-ink"},gm={key:3},_m={key:0,class:"mb-5 flex items-center gap-1 overflow-x-auto border-b border-line"},vm=["onClick"],ym={key:1,class:"panel mb-5 p-5"},bm={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},xm={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},wm={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},km={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},Sm={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Pm={key:0},Tm={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Lm={class:"font-semibold text-ink-secondary"},Cm={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Mm={key:7,class:"my-4 rounded-lg border border-line bg-surface-2 p-4","data-keywords":"credits usage quota remaining daily allowance rate limit"},Om={class:"flex items-center justify-between gap-3"},Em={class:"flex items-center gap-2 text-sm font-semibold text-ink"},zm={key:0,class:"text-[11px] text-ink-muted"},Am={class:"mt-2 flex items-baseline gap-1.5"},Im={class:"font-mono text-2xl font-semibold text-ink"},$m={class:"text-sm text-ink-muted"},Dm={class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},Nm={class:"mt-2 text-xs text-ink-muted"},Rm={class:"mt-2 text-sm text-ink"},Fm={class:"font-semibold"},Bm={class:"mt-1 text-xs text-ink-muted"},Vm={key:1,class:"mt-2 text-xs text-ink-muted"},Zm={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Um={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Hm={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},jm={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Wm={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Km={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Gm={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},qm={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Ym={key:8,class:"border-b border-line py-3 text-xs text-amber-fg"},Jm={class:"mt-4 flex flex-wrap items-center gap-3"},Xm=["disabled"],Qm=["disabled"],tg={key:2,class:"text-xs text-danger-fg"},eg={class:"panel mb-5 p-5"},ng={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},ig={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},sg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},og={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},rg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},ag={key:0},lg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},ug={class:"font-semibold text-ink-secondary"},cg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},dg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},fg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},hg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},pg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},mg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},gg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},_g={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},vg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},yg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},bg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},xg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},wg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},kg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Sg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Pg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Tg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Lg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Cg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Mg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Og={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Eg={class:"mt-4 flex flex-wrap items-center gap-3"},zg=["disabled"],Ag=["disabled"],Ig={key:2,class:"text-xs text-danger-fg"},$g={key:3,class:"text-[11px] text-ink-muted"},Dg={class:"panel mb-5 p-5"},Ng={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Rg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Fg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Bg={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},Vg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Zg={key:0},Ug={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Hg={class:"font-semibold text-ink-secondary"},jg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Wg={key:0,class:"inline-flex items-center gap-2 break-all font-mono text-sm text-ink"},Kg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Gg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},qg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Yg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Jg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Xg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Qg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},t_={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},e_={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},n_={class:"mt-4 flex flex-wrap items-center gap-3"},i_=["disabled"],s_=["disabled"],o_={key:2,class:"text-xs text-danger-fg"},r_={key:3,class:"text-[11px] text-ink-muted"},a_={key:3,class:"panel mb-5 p-5"},l_={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},u_={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},c_={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},d_={key:1,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},f_={key:2,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},h_={key:5,class:"border-b border-line py-3 text-xs text-amber-fg"},p_={key:0},m_={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},g_={class:"font-semibold text-ink-secondary"},__={key:7,class:"border-b border-line py-3 text-xs text-ink-muted"},v_={class:"flex w-full flex-col gap-2"},y_={class:"break-all font-mono text-sm text-ink"},b_={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},x_={key:1,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},w_={key:0,class:"text-xs text-ink-muted"},k_={key:1,class:"border-b border-line py-3 text-xs text-ink-muted"},S_={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},P_={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},T_={class:"mt-4 flex flex-wrap items-center gap-3"},L_=["disabled"],C_=["disabled"],M_={key:2,class:"text-xs text-danger-fg"},O_={key:3,class:"text-[11px] text-ink-muted"},E_={key:4,class:"panel mb-5 p-5"},z_={class:"flex items-center gap-4"},A_=["src"],I_={key:1,class:"grid h-16 w-16 place-items-center rounded-full bg-[var(--navy-800)] text-lg font-bold text-white"},$_={class:"flex gap-2"},D_={class:"btn-ghost cursor-pointer"},N_={class:"mt-1 text-right text-[11px] text-ink-muted"},R_={key:5,class:"panel mb-5 p-5"},F_={class:"flex items-center gap-3"},B_={key:0,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},V_={class:"flex flex-wrap items-center gap-4"},Z_={class:"min-w-0"},U_={class:"mt-1 select-all font-mono text-sm font-bold text-ink"},H_={class:"mt-3 flex items-center gap-2"},j_={key:0,class:"mt-2 text-xs text-danger-fg"},W_={key:1,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},K_={class:"mt-2 grid grid-cols-2 gap-1 font-mono text-xs text-ink-secondary sm:grid-cols-4"},G_={class:"rounded-lg border border-line bg-surface-2 p-3"},q_={class:"flex items-center gap-3"},Y_={class:"grid h-9 w-9 place-items-center rounded-full bg-accent-soft text-accent-soft-fg"},J_={class:"min-w-0 flex-1"},X_={class:"text-sm font-semibold text-ink"},Q_={class:"font-mono text-[11px] text-ink-muted"},tv={key:6,class:"mb-5"},ev={key:0,class:"panel mb-5 p-5"},nv={class:"grid max-w-[520px] gap-2"},iv={class:"flex flex-wrap gap-2"},sv=["disabled","title"],ov=["value"],rv=["value"],av={class:"flex items-center gap-2 py-1 text-sm text-ink-secondary"},lv={class:"flex items-center gap-3"},uv=["disabled"],cv={key:0,class:"text-xs text-danger-fg"},dv={key:1,class:"text-xs text-ink-muted"},fv={key:1,class:"panel mb-5 p-5"},hv={class:"grid max-w-[520px] gap-2"},pv={class:"flex flex-wrap gap-2"},mv=["value"],gv=["value"],_v={key:1,class:"text-xs text-ink-muted"},vv={class:"font-semibold text-ink-secondary"},yv={class:"flex items-center gap-3"},bv=["disabled"],xv={key:0,class:"text-xs text-danger-fg"},wv={class:"panel overflow-hidden p-0"},kv={class:"flex items-center justify-between px-5 py-4"},Sv=["disabled"],Pv={key:0,class:"px-5 pb-5 text-sm text-danger-fg"},Tv={key:1,class:"px-5 pb-8 text-sm text-ink-muted"},Lv={key:2,class:"overflow-x-auto"},Cv={class:"w-full border-collapse text-sm"},Mv={class:"text-left"},Ov={class:"px-5 py-3"},Ev={class:"text-ink"},zv={key:0,class:"ml-1.5 text-[11px] text-ink-muted"},Av={class:"px-5 py-3"},Iv={class:"px-5 py-3"},$v={class:"px-5 py-3"},Dv={class:"px-5 py-3 text-right"},Nv=["onClick"],Rv={key:1,class:"inline-flex items-center gap-1.5"},Fv=["onClick"],Bv=["onClick"],Vv={key:7,class:"mb-5"},Zv={key:0,class:"panel mb-5 p-5"},Uv={class:"grid max-w-[520px] gap-2"},Hv={class:"flex items-center gap-3"},jv={key:0,class:"text-xs text-danger-fg"},Wv={key:1,class:"panel mb-5 p-5"},Kv={class:"grid max-w-[520px] gap-2"},Gv={class:"flex items-center gap-3"},qv=["disabled"],Yv={key:0,class:"text-xs text-danger-fg"},Jv={class:"panel overflow-hidden p-0"},Xv={key:0,class:"px-5 pb-8 text-sm text-ink-muted"},Qv={key:1,class:"overflow-x-auto"},ty={class:"w-full border-collapse text-sm"},ey={class:"text-left"},ny={class:"px-5 py-3"},iy={class:"inline-flex items-center gap-2 text-ink"},sy={class:"px-5 py-3 text-ink-secondary"},oy={class:"px-5 py-3 text-right"},ry=["onClick"],ay={key:1,class:"inline-flex items-center gap-1.5"},ly=["onClick"],uy=["disabled","title","onClick"],cy={key:8,class:"mb-5"},dy={class:"panel mb-5 p-5"},fy={class:"btn-ghost cursor-pointer"},hy={key:0,class:"mt-2 text-xs text-ink-muted"},py={class:"rounded-lg border p-5",style:{"border-color":"color-mix(in srgb, var(--danger) 35%, transparent)",background:"var(--danger-soft)"}},my={class:"flex items-center gap-2 text-danger-fg"},gy={class:"mt-4 rounded-lg border border-line bg-surface-1 p-4"},_y={class:"mt-3 flex items-start gap-2 text-sm text-ink-secondary"},vy={class:"mt-3"},yy={class:"eyebrow mb-1 block"},by={class:"text-ink"},xy=["placeholder"],wy={class:"mt-4 flex flex-wrap items-center gap-3"},ky=["disabled"],Sy=["disabled"],Py={key:2,class:"text-xs text-ink-muted"},Ty={key:0,class:"mt-3 rounded border border-line bg-surface-2 px-3 py-2 text-xs text-ink-secondary"},Ly={key:0,class:"fixed bottom-5 right-5 z-20 flex items-center gap-2 rounded-lg border border-line bg-surface-1 px-4 py-2.5 text-sm text-ink shadow-md"},tu="pv.opensky.health",eu="pv.filetransfer.health",nu="pv.webdav.health",iu="pv.localstorage.health",Cy={__name:"Settings",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(e,{emit:i}){const o=e,a=i,l=xt(()=>o.role==="superadmin"),d=xt(()=>o.role==="admin"||o.role==="superadmin");function h(b){return b==="superadmin"?"Superadmin":b==="admin"?"Admin":"User"}function _(b){return b==="superadmin"||b==="admin"?"shield":"user"}function y(b){return b==="superadmin"||b==="admin"?T.accent:T.neutral}const T={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},w=xt(()=>{const b=[{id:"account",label:"Account",icon:"user",kw:"name username email password verification login credentials role"},{id:"appearance",label:"Appearance",icon:"sliders",kw:"theme light dark system language region font size accessibility date time format motion"},{id:"integrations",label:"Integrations",icon:"radio",kw:"opensky flights adsb aircraft plugin oauth credentials bounding box plan connection ftp sftp ftps file transfer server host upload download local storage folder drive isolated private read only webdav nextcloud owncloud dav url https"},{id:"profile",label:"Profile",icon:"image",kw:"avatar photo display name bio public"},{id:"security",label:"Privacy & Security",icon:"shield",kw:"two factor authentication 2fa sessions devices logout security privacy"}];return d.value&&b.push({id:"team",label:"User management",icon:"users",kw:"users team members add remove create delete role admin permissions rights organization"}),l.value&&b.push({id:"organizations",label:"Organizations",icon:"grid",kw:"organization org tenant company create rename delete members"}),b.push({id:"advanced",label:"Advanced",icon:"alertTriangle",kw:"export import data delete account danger zone",danger:!0}),b}),A=G("account"),U=G("");Iu("settingsSearch",U);const V=xt(()=>U.value.trim().length>0),rt=xt(()=>U.value.trim().toLowerCase());function Q(b){return rt.value?(b.label+" "+b.kw).toLowerCase().includes(rt.value)||Mt(b.id):!0}const Ot={account:["full name","username","email address verification verify","password change current new"],appearance:["theme light dark system","language","region","font size accessibility","reduce motion","date format","time format clock"],integrations:["opensky live flights","enable plugin","oauth client id secret","plan credits","bounding box","test connection","file transfer ftp sftp ftps","server host port username password","private key passphrase","base path directory","local storage folder drive","private isolated folder","read only access mode","webdav nextcloud owncloud dav","server url username password tls","base path directory folder"],profile:["profile photo avatar","display name","bio about","show email public"],security:["two factor authentication","active sessions devices","sign out"],team:["add user create account","members list role admin remove delete","organization org assign"],organizations:["add organization create","rename organization","delete organization members"],advanced:["export data download","import data upload","delete account permanent danger"]};function Mt(b){return rt.value?(Ot[b]||[]).some(f=>f.includes(rt.value)):!0}const q=xt(()=>V.value?w.value.filter(Q):w.value.filter(b=>b.id===A.value)),dt=xt({get:()=>qi.value,set:b=>lr(b)}),it=[{value:"light",label:"Light",icon:"sun"},{value:"dark",label:"Dark",icon:"moon"},{value:"system",label:"System",icon:"monitor"}],ht=[{value:"sm",label:"Small"},{value:"md",label:"Default"},{value:"lg",label:"Large"}],Kt=[{value:"12",label:"12-hour"},{value:"24",label:"24-hour"}],he=[["en","English"],["es","Español"],["de","Deutsch"],["fr","Français"],["pl","Polski"],["ja","日本語"]],pe=[["US","United States"],["GB","United Kingdom"],["EU","European Union"],["CA","Canada"],["AU","Australia"],["JP","Japan"]],St=[["MDY","MM/DD/YYYY"],["DMY","DD/MM/YYYY"],["YMD","YYYY/MM/DD"],["ISO","YYYY-MM-DD"]],Nt=G(Date.now());let Et=null;const nt=xt(()=>Yl(Nt.value)),ut=xe({loaded:!1,available:!1,orgEnabled:!0,allowAnonymous:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),zt=G("user"),Ft=xe({clientId:"",clientSecret:"",plan:"",bbox:""}),lt=G(""),At=G(!1),et=G(!1),ce=G(null),pt=G(null),kt=xt(()=>ce.value&&ce.value.credits||null),Yt=xt(()=>{const b=kt.value;return!b||!b.daily||b.remaining==null?null:Math.max(0,Math.min(100,Math.round(b.remaining/b.daily*100)))}),ae=xt(()=>{const b=Yt.value;return b==null?"bg-accent":b<=10?"bg-danger":b<=30?"bg-amber":"bg-success"});function Jt(b){return typeof b=="number"?b.toLocaleString():b}function Bt(){if(!pt.value)return"";const b=Math.max(0,Math.round((Date.now()-pt.value)/1e3));if(b<60)return"just now";const f=Math.round(b/60);if(f<60)return`${f} min ago`;const H=Math.round(f/60);return H<24?`${H} h ago`:`${Math.round(H/24)} d ago`}function j(){try{ce.value&&localStorage.setItem(tu,JSON.stringify({health:ce.value,ts:pt.value}))}catch{}}function C(){try{const b=localStorage.getItem(tu);if(!b)return;const f=JSON.parse(b);f&&f.health&&(ce.value=f.health,pt.value=f.ts||null)}catch{}}const E=[{value:"",label:"Not set"},{value:"anonymous",label:"Anonymous"},{value:"standard",label:"Standard"},{value:"contributor",label:"Contributor"}],_e=[{value:"user",label:"My settings",icon:"user"},{value:"org",label:"Organization",icon:"users"}],se=xt(()=>ut.isSuperadmin),Ge=xt(()=>ut.isSuperadmin?"user":zt.value),v=xt(()=>ut.scopes[Ge.value]||{editableLayer:"user",fields:{}}),m=xt(()=>Ge.value==="org");function M(b){return v.value.fields[b]||{effective:"",own:"",source:"unset",locked:!1}}function F(b){return se.value||M(b).locked}function R(b){const f=M(b).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function B(){Ft.clientId=M("clientId").own||"",Ft.clientSecret=M("clientSecret").own||"",Ft.plan=M("plan").own||"",Ft.bbox=M("bbox").own||""}function J(b){ut.available=!!b.available,ut.orgEnabled=b.orgEnabled!==!1,ut.allowAnonymous=!!b.allowAnonymous,ut.enabled=!!b.enabled,ut.canEditOrg=!!b.canEditOrg,ut.isSuperadmin=!!b.isSuperadmin,ut.scopes=b.scopes||{},zt.value==="org"&&!ut.canEditOrg&&(zt.value="user"),B(),ut.loaded=!0}Qe(zt,()=>{lt.value="",B()});async function D(){C();const{ok:b,body:f}=await qh();b&&J(f)}async function K(b){const f=m.value;f?ut.orgEnabled=b:ut.enabled=b;const{ok:H,body:k}=await Wl(f?{scope:"org",enabled:b}:{scope:"user",enabled:b});H?(J(k),jt(f?b?"OpenSky enabled for your organization.":"OpenSky disabled for your organization.":b?"OpenSky enabled.":"OpenSky disabled.")):(f?ut.orgEnabled=!b:ut.enabled=!b,jt(k.error||"Could not update."))}async function Z(){lt.value="",At.value=!0;const b={};for(const qt of["clientId","clientSecret","plan","bbox"])F(qt)||(b[qt]=Ft[qt]);const f={scope:Ge.value,config:b};m.value||(f.enabled=ut.enabled);const{ok:H,body:k}=await Wl(f);if(At.value=!1,!H){lt.value=k.error||"Could not save settings.";return}J(k),jt(m.value?"Organization OpenSky settings saved.":"OpenSky settings saved.")}async function yt(){et.value=!0,ce.value=null;const{ok:b,body:f}=await Yh();et.value=!1,ce.value=b&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},pt.value=Date.now(),j()}function st(b){return b==="ok"?T.success:b==="degraded"?T.warning:T.danger}const tt=xe({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),bt=G("user"),Rt=["protocol","host","port","username","password","privateKey","keyPassphrase","hostKeyFingerprint","insecureSkipVerify","basePath"],gt=xe(Object.fromEntries(Rt.map(b=>[b,""]))),Ht=G(""),le=G(!1),me=G(!1),ve=G(null),Te=G(null),vn=[{value:"sftp",label:"SFTP"},{value:"ftps",label:"FTPS"},{value:"ftp",label:"FTP"}],ci=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],ke=xt(()=>tt.isSuperadmin),Ie=xt(()=>tt.isSuperadmin?"user":bt.value),On=xt(()=>tt.scopes[Ie.value]||{editableLayer:"user",fields:{}}),Be=xt(()=>Ie.value==="org"),Ji=xt(()=>(Ve("protocol")?Ee("protocol").effective:gt.protocol)||"sftp");function Ee(b){return On.value.fields[b]||{effective:"",own:"",source:"unset",locked:!1}}function Ve(b){return ke.value||Ee(b).locked}function ye(b){const f=Ee(b).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function wr(b){return(vn.find(f=>f.value===b)||{}).label||b||"—"}function _o(){for(const b of Rt)gt[b]=Ee(b).own||"";gt.protocol||(gt.protocol="sftp"),gt.insecureSkipVerify||(gt.insecureSkipVerify="false")}function Cs(b){tt.available=!!b.available,tt.orgEnabled=b.orgEnabled!==!1,tt.enabled=!!b.enabled,tt.canEditOrg=!!b.canEditOrg,tt.isSuperadmin=!!b.isSuperadmin,tt.scopes=b.scopes||{},bt.value==="org"&&!tt.canEditOrg&&(bt.value="user"),_o(),tt.loaded=!0}Qe(bt,()=>{Ht.value="",_o()});function kr(){if(!Te.value)return"";const b=Math.max(0,Math.round((Date.now()-Te.value)/1e3));if(b<60)return"just now";const f=Math.round(b/60);if(f<60)return`${f} min ago`;const H=Math.round(f/60);return H<24?`${H} h ago`:`${Math.round(H/24)} d ago`}function Sr(){try{ve.value&&localStorage.setItem(eu,JSON.stringify({health:ve.value,ts:Te.value}))}catch{}}function Pr(){try{const b=localStorage.getItem(eu);if(!b)return;const f=JSON.parse(b);f&&f.health&&(ve.value=f.health,Te.value=f.ts||null)}catch{}}async function Ms(){Pr();const{ok:b,body:f}=await Jh();b&&Cs(f)}async function vo(b){const f=Be.value;f?tt.orgEnabled=b:tt.enabled=b;const{ok:H,body:k}=await Kl(f?{scope:"org",enabled:b}:{scope:"user",enabled:b});H?(Cs(k),jt(f?b?"File transfer enabled for your organization.":"File transfer disabled for your organization.":b?"File transfer enabled.":"File transfer disabled.")):(f?tt.orgEnabled=!b:tt.enabled=!b,jt(k.error||"Could not update."))}async function Tr(){Ht.value="",le.value=!0;const b={};for(const qt of Rt)Ve(qt)||(b[qt]=gt[qt]);const f={scope:Ie.value,config:b};Be.value||(f.enabled=tt.enabled);const{ok:H,body:k}=await Kl(f);if(le.value=!1,!H){Ht.value=k.error||"Could not save settings.";return}Cs(k),jt(Be.value?"Organization file-transfer settings saved.":"File-transfer settings saved.")}async function Lr(){me.value=!0,ve.value=null;const{ok:b,body:f}=await Xh();me.value=!1,ve.value=b&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},Te.value=Date.now(),Sr()}function Cr(b){return b==="ok"?T.success:b==="degraded"?T.warning:T.danger}const Vt=xe({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),ft=G("user"),Xi=["baseURL","username","password","insecureSkipVerify","basePath"],ze=xe(Object.fromEntries(Xi.map(b=>[b,""]))),di=G(""),Ci=G(!1),fi=G(!1),rn=G(null),tn=G(null),yo=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],Os=xt(()=>Vt.isSuperadmin),Es=xt(()=>Vt.isSuperadmin?"user":ft.value),Mr=xt(()=>Vt.scopes[Es.value]||{editableLayer:"user",fields:{}}),an=xt(()=>Es.value==="org");function yn(b){return Mr.value.fields[b]||{effective:"",own:"",source:"unset",locked:!1}}function hi(b){return Os.value||yn(b).locked}function Ze(b){const f=yn(b).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function bo(){for(const b of Xi)ze[b]=yn(b).own||"";ze.insecureSkipVerify||(ze.insecureSkipVerify="false")}function zs(b){Vt.available=!!b.available,Vt.orgEnabled=b.orgEnabled!==!1,Vt.enabled=!!b.enabled,Vt.canEditOrg=!!b.canEditOrg,Vt.isSuperadmin=!!b.isSuperadmin,Vt.scopes=b.scopes||{},ft.value==="org"&&!Vt.canEditOrg&&(ft.value="user"),bo(),Vt.loaded=!0}Qe(ft,()=>{di.value="",bo()});function Or(){if(!tn.value)return"";const b=Math.max(0,Math.round((Date.now()-tn.value)/1e3));if(b<60)return"just now";const f=Math.round(b/60);if(f<60)return`${f} min ago`;const H=Math.round(f/60);return H<24?`${H} h ago`:`${Math.round(H/24)} d ago`}function Er(){try{rn.value&&localStorage.setItem(nu,JSON.stringify({health:rn.value,ts:tn.value}))}catch{}}function zr(){try{const b=localStorage.getItem(nu);if(!b)return;const f=JSON.parse(b);f&&f.health&&(rn.value=f.health,tn.value=f.ts||null)}catch{}}async function As(){zr();const{ok:b,body:f}=await ep();b&&zs(f)}async function pi(b){const f=an.value;f?Vt.orgEnabled=b:Vt.enabled=b;const{ok:H,body:k}=await Gl(f?{scope:"org",enabled:b}:{scope:"user",enabled:b});H?(zs(k),jt(f?b?"WebDAV enabled for your organization.":"WebDAV disabled for your organization.":b?"WebDAV enabled.":"WebDAV disabled.")):(f?Vt.orgEnabled=!b:Vt.enabled=!b,jt(k.error||"Could not update."))}async function xo(){di.value="",Ci.value=!0;const b={};for(const qt of Xi)hi(qt)||(b[qt]=ze[qt]);const f={scope:Es.value,config:b};an.value||(f.enabled=Vt.enabled);const{ok:H,body:k}=await Gl(f);if(Ci.value=!1,!H){di.value=k.error||"Could not save settings.";return}zs(k),jt(an.value?"Organization WebDAV settings saved.":"WebDAV settings saved.")}async function wo(){fi.value=!0,rn.value=null;const{ok:b,body:f}=await np();fi.value=!1,rn.value=b&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},tn.value=Date.now(),Er()}function Mi(b){return b==="ok"?T.success:b==="degraded"?T.warning:T.danger}const X=xe({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,isOrgUser:!1,mounts:[],privateFolder:!1,privateEnabled:!1,allowPrivate:!0,rootConfigured:!1,scopes:{}}),Qt=G("user"),jn=G(""),ln=G(""),bn=G(!1),mi=G(!1),Pt=G(null),oe=G(null),Wn=G({}),Oi=[{value:"",label:"Inherit"},{value:"false",label:"Read-write"},{value:"true",label:"Read-only"}],$e=xt(()=>X.isSuperadmin),Is=xt(()=>X.isSuperadmin?"user":Qt.value),Qi=xt(()=>X.scopes[Is.value]||{editableLayer:"user",fields:{}}),Se=xt(()=>Is.value==="org");function ge(b){return Qi.value.fields[b]||{effective:"",own:"",source:"unset",locked:!1}}function En(b){return $e.value||ge(b).locked}function gi(b){const f=ge(b).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function Ei(b){return(Oi.find(f=>f.value===b)||{}).label||"Inherit"}function ts(){jn.value=ge("readOnly").own||""}function xn(b){X.available=!!b.available,X.orgEnabled=b.orgEnabled!==!1,X.enabled=!!b.enabled,X.canEditOrg=!!b.canEditOrg,X.isSuperadmin=!!b.isSuperadmin,X.isOrgUser=!!b.isOrgUser,X.mounts=Array.isArray(b.mounts)?b.mounts:[],X.privateFolder=!!b.privateFolder,X.privateEnabled=!!b.privateEnabled,X.allowPrivate=b.allowPrivate!==!1,X.rootConfigured=!!b.rootConfigured,X.scopes=b.scopes||{},Qt.value==="org"&&!X.canEditOrg&&(Qt.value="user"),ts(),X.loaded=!0}Qe(Qt,()=>{ln.value="",ts()});function $s(){if(!oe.value)return"";const b=Math.max(0,Math.round((Date.now()-oe.value)/1e3));if(b<60)return"just now";const f=Math.round(b/60);if(f<60)return`${f} min ago`;const H=Math.round(f/60);return H<24?`${H} h ago`:`${Math.round(H/24)} d ago`}function Ds(){try{Pt.value&&localStorage.setItem(iu,JSON.stringify({health:Pt.value,ts:oe.value}))}catch{}}function es(){try{const b=localStorage.getItem(iu);if(!b)return;const f=JSON.parse(b);f&&f.health&&(Pt.value=f.health,oe.value=f.ts||null)}catch{}}async function Ns(){es();const{ok:b,body:f}=await Qh();b&&xn(f)}async function ns(b){const f=Se.value;f?X.orgEnabled=b:X.enabled=b;const{ok:H,body:k}=await Ko(f?{scope:"org",enabled:b}:{scope:"user",enabled:b});H?(xn(k),jt(f?b?"Local storage enabled for your organization.":"Local storage disabled for your organization.":b?"Local storage enabled.":"Local storage disabled.")):(f?X.orgEnabled=!b:X.enabled=!b,jt(k.error||"Could not update."))}async function is(b){X.privateFolder=b;const{ok:f,body:H}=await Ko({scope:"user",privateFolder:b});f?(xn(H),jt(b?"Private folder enabled.":"Private folder disabled.")):(X.privateFolder=!b,jt(H.error||"Could not update."))}async function ko(b){X.allowPrivate=b;const{ok:f,body:H}=await Ko({scope:"org",allowPrivate:b});f?(xn(H),jt(b?"Members may now create private folders.":"Private folders disabled for your organization.")):(X.allowPrivate=!b,jt(H.error||"Could not update."))}async function Rs(){ln.value="",bn.value=!0;const b={};En("readOnly")||(b.readOnly=jn.value);const f={scope:Is.value,config:b};Se.value||(f.enabled=X.enabled);const{ok:H,body:k}=await Ko(f);if(bn.value=!1,!H){ln.value=k.error||"Could not save settings.";return}xn(k),jt(Se.value?"Organization local-storage settings saved.":"Local-storage settings saved.")}async function Ar(){mi.value=!0,Pt.value=null,Wn.value={};const{ok:b,body:f}=await tp();mi.value=!1,Pt.value=b&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."};const H={};if(Array.isArray(f.mounts))for(const k of f.mounts)H[k.id]={status:k.status,detail:k.detail};Wn.value=H,oe.value=Date.now(),Ds()}function It(b){return b==="ok"?T.success:b==="degraded"?T.warning:T.danger}const un=[{id:"apis-external",label:"APIs — External",icon:"globe"},{id:"drives-external",label:"Drives — External",icon:"server"},{id:"drives-local",label:"Drives — Local",icon:"monitor"}],te=G("apis-external");function ss(b){return V.value||te.value===b}const _i=G("");let zi=null;function jt(b){_i.value=b,clearTimeout(zi),zi=setTimeout(()=>_i.value="",2200)}const we=xe({current:"",next:"",confirm:""}),zn=G(""),vi=G(!1);function Le(){if(vi.value=!1,!we.current)return zn.value="Enter your current password.";if(we.next.length<8)return zn.value="New password must be at least 8 characters.";if(we.next!==we.confirm)return zn.value="New passwords do not match.";zn.value="Validated. Connecting to the account service is pending — no password endpoint yet.",we.current=we.next=we.confirm=""}const wn=G("");function So(){wn.value="Verification link would be sent once the account service is wired up."}function Po(b){const f=b.target.files&&b.target.files[0];if(!f)return;if(f.size>1.5*1024*1024){jt("Image too large (max ~1.5 MB).");return}const H=new FileReader;H.onload=()=>{Tt.avatar=String(H.result),jt("Photo updated.")},H.readAsDataURL(f)}function Ir(){Tt.avatar="",jt("Photo removed.")}const To=xt(()=>{var H,k,qt;const f=(Tt.displayName||Tt.name||o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((H=f[0])==null?void 0:H[0])||"P")+(((k=f[1])==null?void 0:k[0])||((qt=f[0])==null?void 0:qt[1])||"V")).toUpperCase()}),Kn=G(!1),Lo=G(""),Ai=G(""),Zt=G(""),os=G([]);function Ue(b){const f="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let H="";for(let k=0;k<b;k++)H+=f[Math.floor(Math.random()*f.length)];return H}function Ii(){Lo.value=Ue(16).replace(/(.{4})/g,"$1 ").trim(),Ai.value="",Zt.value="",Kn.value=!0}function Co(){if(!/^\d{6}$/.test(Ai.value)){Zt.value="Enter the 6-digit code from your authenticator app.";return}Tt.twoFactor=!0,Kn.value=!1,os.value=Array.from({length:8},()=>Ue(4).toLowerCase()+"-"+Ue(4).toLowerCase()),Zt.value=""}function $r(){Tt.twoFactor=!1,os.value=[],Kn.value=!1}const qe=navigator.userAgent;function Dr(){return/Edg\//.test(qe)?"Edge":/OPR\//.test(qe)?"Opera":/Chrome\//.test(qe)?"Chrome":/Firefox\//.test(qe)?"Firefox":/Safari\//.test(qe)?"Safari":"Browser"}function Mo(){return/Windows/.test(qe)?"Windows":/Mac OS X/.test(qe)?"macOS":/Android/.test(qe)?"Android":/iPhone|iPad/.test(qe)?"iOS":/Linux/.test(qe)?"Linux":"Unknown OS"}const Nr=Date.now(),rs=G([]),Gn=G(!1),as=G(""),re=xe({email:"",password:"",role:"user",organization:""}),yi=G(""),$i=G(!1),Ye=G(""),Fs=xt(()=>{const b=[{value:"user",label:"User"},{value:"admin",label:"Admin"}];return l.value&&b.push({value:"superadmin",label:"Superadmin"}),b}),Di=G([]);async function qn(){if(!d.value)return;const b=await Uh();b.ok&&(Di.value=b.organizations.slice().sort((f,H)=>f.name.localeCompare(H.name)))}const Oo=xt(()=>{const b=Di.value.map(f=>({value:f.id,label:f.name}));return l.value&&b.unshift({value:"",label:"No organization"}),b});async function Yn(){if(!d.value)return;Gn.value=!0,as.value="";const b=await Fh();if(Gn.value=!1,!b.ok){as.value=b.status===403?"Manager role required.":"Could not load users.";return}rs.value=b.users.slice().sort((f,H)=>f.email.localeCompare(H.email))}function Ni(b){try{const f=b.data||{},H=Object.keys(f)[0];return H&&f[H]&&f[H].message||b.message||b.error||"Invalid input."}catch{return b.error||"Could not create user."}}async function Rr(){yi.value="";const b=re.email.trim().toLowerCase();if(!b.includes("@"))return yi.value="Enter a valid email.";if(re.password.length<8)return yi.value="Password must be at least 8 characters.";$i.value=!0;const f=l.value?re.organization:o.organization,{ok:H,body:k}=await Bh(b,re.password,re.role,f);if($i.value=!1,!H)return yi.value=Ni(k);re.email="",re.password="",re.role="user",re.organization="",jt("User created."),Yn()}async function Fr(b){const{ok:f,body:H}=await Zh(b.id);if(Ye.value="",!f)return jt(H.error||"Could not remove user.");jt("User removed."),Yn()}const Gt=xe({id:"",email:"",role:"user",verified:!1,password:"",organization:""}),An=G(""),Ri=G(!1),ls=xt(()=>!!Gt.id&&Gt.email===o.email);function us(b){Ye.value="",Gt.id=b.id,Gt.email=b.email,Gt.role=b.role||"user",Gt.verified=!!b.verified,Gt.password="",Gt.organization=b.organization||"",An.value=""}function In(){Gt.id="",An.value=""}async function Br(){An.value="";const b=Gt.email.trim().toLowerCase();if(!b.includes("@"))return An.value="Enter a valid email.";if(Gt.password&&Gt.password.length<8)return An.value="New password must be at least 8 characters (or leave blank).";const f={email:b,role:Gt.role,verified:Gt.verified};l.value&&(f.organization=Gt.organization),Gt.password&&(f.password=Gt.password),Ri.value=!0;const{ok:H,body:k}=await Vh(Gt.id,f);if(Ri.value=!1,!H)return An.value=Ni(k);jt("User updated."),In(),Yn()}const $n=xe({name:""}),Ce=G(""),Fi=G(!1),bi=G(""),kn=xe({id:"",name:""}),Sn=G(""),Bi=xt(()=>{const b={};for(const f of rs.value)f.organization&&(b[f.organization]=(b[f.organization]||0)+1);return b});async function Eo(){Ce.value="";const b=$n.name.trim();if(!b)return Ce.value="Enter an organization name.";Fi.value=!0;const{ok:f,body:H}=await Hh(b);if(Fi.value=!1,!f)return Ce.value=Ni(H);$n.name="",jt("Organization created."),qn()}function Vr(b){bi.value="",kn.id=b.id,kn.name=b.name,Sn.value=""}function Bs(){kn.id="",Sn.value=""}async function zo(){Sn.value="";const b=kn.name.trim();if(!b)return Sn.value="Enter an organization name.";const{ok:f,body:H}=await jh(kn.id,b);if(!f)return Sn.value=Ni(H);jt("Organization renamed."),Bs(),qn(),Yn()}async function en(b){const{ok:f,body:H}=await Wh(b.id);if(bi.value="",!f)return jt(H.error||"Could not delete organization.");jt("Organization deleted."),qn()}function xi(){const b={_app:"PilotVault",_kind:"settings-export",exportedAt:new Date().toISOString(),email:o.email,prefs:{...Tt},themeMode:qi.value},f=new Blob([JSON.stringify(b,null,2)],{type:"application/json"}),H=URL.createObjectURL(f),k=document.createElement("a");k.href=H,k.download=`pilotvault-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(k),k.click(),k.remove(),URL.revokeObjectURL(H),jt("Settings exported.")}const cs=G("");function Pn(b){const f=b.target.files&&b.target.files[0];if(!f)return;const H=new FileReader;H.onload=()=>{try{const k=JSON.parse(String(H.result)),qt=k.prefs||k;if(!Tc(qt))throw new Error("bad shape");k.themeMode&&lr(k.themeMode),Aa(Tt.fontSize),Ia(Tt.reduceMotion),cs.value="Settings imported and applied."}catch{cs.value="That file is not a valid PilotVault settings export."}},H.readAsText(f),b.target.value=""}const de=xe({understand:!1,typed:"",cooldown:0,armed:!1,msg:""});let cn=null;const Vs=xt(()=>o.email||"DELETE MY ACCOUNT"),Jn=xt(()=>de.understand&&de.typed===Vs.value);function Ao(){Jn.value&&(de.armed=!0,de.cooldown=5,clearInterval(cn),cn=setInterval(()=>{de.cooldown--,de.cooldown<=0&&clearInterval(cn)},1e3))}Qe(Jn,b=>{!b&&de.armed&&(de.armed=!1,de.cooldown=0,clearInterval(cn))});function ds(){if(!(!de.armed||de.cooldown>0)){try{localStorage.removeItem("pv_prefs")}catch{}de.msg="Account deletion requires the account service. Local data was cleared and you were signed out.",setTimeout(()=>a("logout"),900)}}return Yi(()=>{Et=setInterval(()=>Nt.value=Date.now(),1e3),qn(),Yn(),D(),Ms(),As(),Ns()}),vr(()=>{clearInterval(Et),clearInterval(cn),clearTimeout(zi)}),(b,f)=>(g(),x("div",Kp,[u("div",Gp,[f[62]||(f[62]=u("div",null,[u("div",{class:"eyebrow"},"Preferences"),u("h2",{class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},"Settings")],-1)),u("div",qp,[O(Y,{name:"search",size:16,class:"text-ink-muted"}),ot(u("input",{"onUpdate:modelValue":f[0]||(f[0]=H=>U.value=H),placeholder:"Search settings…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[vt,U.value]]),U.value?(g(),x("button",{key:0,class:"text-ink-muted hover:text-ink","aria-label":"Clear search",onClick:f[1]||(f[1]=H=>U.value="")},[O(Y,{name:"x",size:15})])):N("",!0)])]),u("div",Yp,[ot(u("nav",Jp,[(g(!0),x(ct,null,Wt(w.value,H=>(g(),x("button",{key:H.id,class:Ct(["flex items-center gap-2.5 rounded px-3 py-2.5 text-left text-sm transition",[A.value===H.id?H.danger?"bg-danger-soft font-semibold text-danger-fg":"bg-accent-soft font-semibold text-accent-soft-fg":H.danger?"font-medium text-danger-fg hover:bg-danger-soft":"font-medium text-ink-secondary hover:bg-surface-2"]]),onClick:k=>A.value=H.id},[O(Y,{name:H.icon,size:17},null,8,["name"]),u("span",Qp,P(H.label),1)],10,Xp))),128))],512),[[oh,!V.value]]),u("div",tm,[V.value&&!q.value.length?(g(),x("div",em," No settings match “"+P(U.value)+"”. ",1)):N("",!0),(g(!0),x(ct,null,Wt(q.value,H=>(g(),x(ct,{key:H.id},[V.value?(g(),x("div",nm,[O(Y,{name:H.icon,size:14},null,8,["name"]),$(" "+P(H.label),1)])):N("",!0),H.id==="account"?(g(),x("div",im,[O(_t,{title:"Full name",desc:"Shown to your team on flights and audit logs.",keywords:"full name account"},{default:mt(()=>[ot(u("input",{"onUpdate:modelValue":f[2]||(f[2]=k=>$t(Tt).name=k),class:"field w-56",placeholder:"Jane Operator",onBlur:f[3]||(f[3]=k=>jt("Saved."))},null,544),[[vt,$t(Tt).name]])]),_:1}),O(_t,{title:"Username",desc:"Your unique handle within PilotVault.",keywords:"username handle"},{default:mt(()=>[u("div",sm,[f[63]||(f[63]=u("span",{class:"text-sm text-ink-muted"},"@",-1)),ot(u("input",{"onUpdate:modelValue":f[4]||(f[4]=k=>$t(Tt).username=k),class:"field w-48",placeholder:"jane",onBlur:f[5]||(f[5]=k=>jt("Saved."))},null,544),[[vt,$t(Tt).username]])])]),_:1}),O(_t,{title:"Email address",desc:"Used for sign-in and notifications.",keywords:"email verification verify"},{default:mt(()=>[u("div",om,[u("span",rm,P(e.email||"—"),1),u("span",am,[O(Y,{name:"mail",size:12}),f[64]||(f[64]=$(" Unverified ",-1))])])]),_:1}),O(_t,{title:"Role",desc:"Your access level in PilotVault.",keywords:"role admin user superadmin access rights permissions"},{default:mt(()=>[u("span",{class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(e.role)])},[O(Y,{name:_(e.role),size:12},null,8,["name"]),$(P(h(e.role)),1)],2)]),_:1}),O(_t,{title:"Organization",desc:"The organization your account belongs to.",keywords:"organization org tenant company"},{default:mt(()=>[u("span",{class:Ct(["text-sm",e.organizationName?"text-ink":"text-ink-muted"])},P(e.organizationName||(l.value?"All organizations":"None")),3)]),_:1}),O(_t,{block:"",title:"Verify email",desc:"Confirm ownership to enable password resets and alerts.",keywords:"verify email resend"},{default:mt(()=>[u("button",{class:"btn-ghost",onClick:So},"Send verification link"),wn.value?(g(),x("p",lm,P(wn.value),1)):N("",!0)]),_:1}),O(_t,{block:"",title:"Change password",desc:"Use at least 8 characters.",keywords:"password change current new"},{default:mt(()=>[u("div",um,[ot(u("input",{"onUpdate:modelValue":f[6]||(f[6]=k=>we.current=k),type:"password",class:"field",placeholder:"Current password"},null,512),[[vt,we.current]]),ot(u("input",{"onUpdate:modelValue":f[7]||(f[7]=k=>we.next=k),type:"password",class:"field",placeholder:"New password"},null,512),[[vt,we.next]]),ot(u("input",{"onUpdate:modelValue":f[8]||(f[8]=k=>we.confirm=k),type:"password",class:"field",placeholder:"Confirm new password"},null,512),[[vt,we.confirm]]),u("div",cm,[u("button",{class:"btn-accent",onClick:Le},"Update password"),zn.value?(g(),x("span",{key:0,class:Ct(["text-xs",vi.value?"text-success-fg":"text-ink-muted"])},P(zn.value),3)):N("",!0)])])]),_:1})])):H.id==="appearance"?(g(),x("div",dm,[O(_t,{title:"Theme",desc:"Light, dark, or follow your system.",keywords:"theme light dark system appearance"},{default:mt(()=>[O(hn,{modelValue:dt.value,"onUpdate:modelValue":f[9]||(f[9]=k=>dt.value=k),options:it},null,8,["modelValue"])]),_:1}),O(_t,{title:"Font size",desc:"Scales the entire interface for readability.",keywords:"font size accessibility text"},{default:mt(()=>[O(hn,{modelValue:$t(Tt).fontSize,"onUpdate:modelValue":f[10]||(f[10]=k=>$t(Tt).fontSize=k),options:ht},null,8,["modelValue"])]),_:1}),O(_t,{title:"Reduce motion",desc:"Minimise animations and transitions.",keywords:"reduce motion accessibility animation"},{default:mt(()=>[O(nn,{modelValue:$t(Tt).reduceMotion,"onUpdate:modelValue":f[11]||(f[11]=k=>$t(Tt).reduceMotion=k)},null,8,["modelValue"])]),_:1}),O(_t,{title:"Language",desc:"Interface language.",keywords:"language locale"},{default:mt(()=>[ot(u("select",{"onUpdate:modelValue":f[12]||(f[12]=k=>$t(Tt).language=k),class:"field w-48"},[(g(),x(ct,null,Wt(he,([k,qt])=>u("option",{key:k,value:k},P(qt),9,fm)),64))],512),[[sn,$t(Tt).language]])]),_:1}),O(_t,{title:"Region",desc:"Affects number, unit and date defaults.",keywords:"region country locale"},{default:mt(()=>[ot(u("select",{"onUpdate:modelValue":f[13]||(f[13]=k=>$t(Tt).region=k),class:"field w-48"},[(g(),x(ct,null,Wt(pe,([k,qt])=>u("option",{key:k,value:k},P(qt),9,hm)),64))],512),[[sn,$t(Tt).region]])]),_:1}),O(_t,{title:"Date format",desc:"How calendar dates are displayed.",keywords:"date format"},{default:mt(()=>[ot(u("select",{"onUpdate:modelValue":f[14]||(f[14]=k=>$t(Tt).dateFormat=k),class:"field w-48"},[(g(),x(ct,null,Wt(St,([k,qt])=>u("option",{key:k,value:k},P(qt),9,pm)),64))],512),[[sn,$t(Tt).dateFormat]])]),_:1}),O(_t,{title:"Time format",desc:"12- or 24-hour clock.",keywords:"time format clock 12 24 hour"},{default:mt(()=>[O(hn,{modelValue:$t(Tt).timeFormat,"onUpdate:modelValue":f[15]||(f[15]=k=>$t(Tt).timeFormat=k),options:Kt},null,8,["modelValue"])]),_:1}),O(_t,{title:"Preview",desc:"How timestamps appear across the app.",keywords:"preview date time"},{default:mt(()=>[u("span",mm,P(nt.value),1)]),_:1}),f[65]||(f[65]=u("p",{class:"mt-3 text-xs text-ink-muted"}," Language & region are stored now; full localisation ships with the account service. ",-1))])):H.id==="integrations"?(g(),x("div",gm,[V.value?N("",!0):(g(),x("div",_m,[(g(),x(ct,null,Wt(un,k=>u("button",{key:k.id,type:"button",class:Ct(["-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",te.value===k.id?"border-accent text-ink":"border-transparent text-ink-secondary hover:text-ink"]),onClick:qt=>te.value=k.id},[O(Y,{name:k.icon,size:16},null,8,["name"]),$(P(k.label),1)],10,vm)),64))])),ss("apis-external")?(g(),x("div",ym,[u("div",bm,[u("div",xm,[O(Y,{name:"radio",size:20})]),f[66]||(f[66]=u("div",{class:"min-w-0"},[u("div",{class:"text-sm font-semibold text-ink"},"OpenSky Network"),u("div",{class:"mt-0.5 text-xs text-ink-muted"}," Live ADS-B aircraft data. Configure your own OAuth2 credentials, plan and default bounding box. ")],-1))]),ut.loaded&&!ut.available?(g(),x("div",wm,[O(Y,{name:"lock",size:14,class:"mr-1 inline"}),f[67]||(f[67]=$(" OpenSky is currently disabled by your administrator. Contact them to enable it. ",-1))])):N("",!0),ut.canEditOrg?(g(),x("div",km,[f[68]||(f[68]=u("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),O(hn,{modelValue:zt.value,"onUpdate:modelValue":f[16]||(f[16]=k=>zt.value=k),options:_e},null,8,["modelValue"])])):N("",!0),m.value?(g(),ie(_t,{key:2,title:"Enable OpenSky (organization-wide)",desc:"Turn OpenSky on or off for everyone in your organization.",keywords:"enable disable plugin opensky organization"},{default:mt(()=>[O(nn,{"model-value":ut.orgEnabled,disabled:!ut.available,"onUpdate:modelValue":K},null,8,["model-value","disabled"])]),_:1})):(g(),ie(_t,{key:3,title:"Enable OpenSky",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin opensky"},{default:mt(()=>[O(nn,{"model-value":ut.enabled,disabled:!ut.available||!ut.orgEnabled,"onUpdate:modelValue":K},null,8,["model-value","disabled"])]),_:1})),!m.value&&ut.available&&!ut.orgEnabled?(g(),x("div",Sm,[O(Y,{name:"lock",size:13,class:"mr-1 inline"}),f[70]||(f[70]=$("OpenSky is turned off for your organization",-1)),ut.canEditOrg?(g(),x("span",Pm,[...f[69]||(f[69]=[$(" — switch to ",-1),u("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):N("",!0),f[71]||(f[71]=$(". ",-1))])):N("",!0),m.value?(g(),x("div",Tm,[O(Y,{name:"users",size:13,class:"mr-1 inline"}),f[72]||(f[72]=$("These are organization-wide settings — they apply to everyone in ",-1)),u("span",Lm,P(e.organizationName||"your organization"),1),f[73]||(f[73]=$(". Leave a field blank to let each user choose their own; a value set here overrides the user's. ",-1))])):se.value?(g(),x("div",Cm," As a superadmin you manage the global OpenSky configuration in the API Server panel. The effective configuration is shown below. ")):N("",!0),ut.available&&!m.value?(g(),x("div",Mm,[u("div",Om,[u("div",Em,[O(Y,{name:"signal",size:15}),f[74]||(f[74]=$("Credit usage ",-1))]),pt.value?(g(),x("span",zm,"Checked "+P(Bt()),1)):N("",!0)]),kt.value?(g(),x(ct,{key:0},[kt.value.remaining!=null?(g(),x(ct,{key:0},[u("div",Am,[u("span",Im,P(Jt(kt.value.remaining)),1),u("span",$m,"/ "+P(Jt(kt.value.daily))+" credits left today",1)]),u("div",Dm,[u("div",{class:Ct(["h-full rounded-full transition-all",ae.value]),style:Ss({width:Yt.value+"%"})},null,6)]),u("div",Nm," Used "+P(Jt(kt.value.daily-kt.value.remaining))+" today · "+P(kt.value.probeCost)+" credit"+P(kt.value.probeCost===1?"":"s")+" per query · "+P(kt.value.mode),1)],64)):(g(),x(ct,{key:1},[u("div",Rm,[f[75]||(f[75]=$("Daily allowance: ",-1)),u("span",Fm,P(Jt(kt.value.daily)),1),f[76]||(f[76]=$(" credits",-1))]),u("div",Bm,P(kt.value.probeCost)+" credit"+P(kt.value.probeCost===1?"":"s")+" per query · "+P(kt.value.mode)+". OpenSky only reports live remaining credits for authenticated requests — add OAuth2 credentials below to track usage. ",1)],64))],64)):(g(),x("div",Vm,[...f[77]||(f[77]=[$(" Run ",-1),u("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),$(" below to fetch your live OpenSky credit balance. ",-1)])]))])):N("",!0),O(_t,{title:"OpenSky plan",desc:"Your account tier — sets the daily credit allowance.",keywords:"plan tier credits"},{default:mt(()=>[F("plan")?(g(),x("span",Zm,[$(P((E.find(k=>k.value===M("plan").effective)||{}).label||M("plan").effective||"—")+" ",1),R("plan")?(g(),x("span",Um,[O(Y,{name:"lock",size:10}),$(P(R("plan")),1)])):N("",!0)])):(g(),ie(hn,{key:1,modelValue:Ft.plan,"onUpdate:modelValue":f[17]||(f[17]=k=>Ft.plan=k),options:E},null,8,["modelValue"]))]),_:1}),O(_t,{title:"Default bounding box",desc:"lamin,lomin,lamax,lomax — used for live queries and the health probe.",keywords:"bounding box bbox area"},{default:mt(()=>[F("bbox")?(g(),x("span",Hm,[$(P(M("bbox").effective||"—")+" ",1),R("bbox")?(g(),x("span",jm,[O(Y,{name:"lock",size:10}),$(P(R("bbox")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[18]||(f[18]=k=>Ft.bbox=k),class:"field w-64 font-mono",placeholder:"50.5,3.2,53.7,7.3"},null,512)),[[vt,Ft.bbox]])]),_:1}),O(_t,{title:"OAuth2 client ID",desc:"Optional — leave blank for anonymous access (lower limits).",keywords:"oauth client id credentials"},{default:mt(()=>[F("clientId")?(g(),x("span",Wm,[$(P(M("clientId").effective||"—")+" ",1),R("clientId")?(g(),x("span",Km,[O(Y,{name:"lock",size:10}),$(P(R("clientId")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[19]||(f[19]=k=>Ft.clientId=k),class:"field w-64",placeholder:"your-api-client"},null,512)),[[vt,Ft.clientId]])]),_:1}),O(_t,{title:"OAuth2 client secret",desc:"Paired with the client ID for authenticated access.",keywords:"oauth client secret credentials password"},{default:mt(()=>[F("clientSecret")?(g(),x("span",Gm,[$(P(M("clientSecret").effective||"—")+" ",1),R("clientSecret")?(g(),x("span",qm,[O(Y,{name:"lock",size:10}),$(P(R("clientSecret")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[20]||(f[20]=k=>Ft.clientSecret=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[vt,Ft.clientSecret]])]),_:1}),ut.available&&!ut.allowAnonymous?(g(),x("div",Ym," Anonymous access is disabled by the administrator — OpenSky needs OAuth2 credentials from some layer to work. ")):N("",!0),u("div",Jm,[se.value?N("",!0):(g(),x("button",{key:0,class:"btn-accent",disabled:At.value||!ut.available,onClick:Z},P(At.value?"Saving…":m.value?"Save organization settings":"Save settings"),9,Xm)),m.value?N("",!0):(g(),x("button",{key:1,class:"btn-ghost",disabled:et.value||!ut.available,onClick:yt},P(et.value?"Testing…":"Test connection"),9,Qm)),lt.value?(g(),x("span",tg,P(lt.value),1)):N("",!0),ce.value&&!m.value?(g(),x("span",{key:3,class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",st(ce.value.status)])},[f[78]||(f[78]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P(ce.value.detail||ce.value.status),1)],2)):N("",!0)])])):N("",!0),ss("drives-external")?(g(),x(ct,{key:2},[u("div",eg,[u("div",ng,[u("div",ig,[O(Y,{name:"server",size:20})]),f[79]||(f[79]=u("div",{class:"min-w-0"},[u("div",{class:"text-sm font-semibold text-ink"},"File Transfer (FTP / SFTP)"),u("div",{class:"mt-0.5 text-xs text-ink-muted"}," Connect to an FTP, FTPS or SFTP server. Configure the connection your account uses for file transfers. ")],-1))]),tt.loaded&&!tt.available?(g(),x("div",sg,[O(Y,{name:"lock",size:14,class:"mr-1 inline"}),f[80]||(f[80]=$(" File transfer is currently disabled by your administrator. Contact them to enable it. ",-1))])):N("",!0),tt.canEditOrg?(g(),x("div",og,[f[81]||(f[81]=u("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),O(hn,{modelValue:bt.value,"onUpdate:modelValue":f[21]||(f[21]=k=>bt.value=k),options:_e},null,8,["modelValue"])])):N("",!0),Be.value?(g(),ie(_t,{key:2,title:"Enable file transfer (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin ftp sftp organization"},{default:mt(()=>[O(nn,{"model-value":tt.orgEnabled,disabled:!tt.available,"onUpdate:modelValue":vo},null,8,["model-value","disabled"])]),_:1})):(g(),ie(_t,{key:3,title:"Enable file transfer",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin ftp sftp"},{default:mt(()=>[O(nn,{"model-value":tt.enabled,disabled:!tt.available||!tt.orgEnabled,"onUpdate:modelValue":vo},null,8,["model-value","disabled"])]),_:1})),!Be.value&&tt.available&&!tt.orgEnabled?(g(),x("div",rg,[O(Y,{name:"lock",size:13,class:"mr-1 inline"}),f[83]||(f[83]=$("File transfer is turned off for your organization",-1)),tt.canEditOrg?(g(),x("span",ag,[...f[82]||(f[82]=[$(" — switch to ",-1),u("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):N("",!0),f[84]||(f[84]=$(". ",-1))])):N("",!0),Be.value?(g(),x("div",lg,[O(Y,{name:"users",size:13,class:"mr-1 inline"}),f[85]||(f[85]=$("These are organization-wide settings — they apply to everyone in ",-1)),u("span",ug,P(e.organizationName||"your organization"),1),f[86]||(f[86]=$(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):ke.value?(g(),x("div",cg," As a superadmin you manage the global file-transfer configuration in the API Server panel. The effective configuration is shown below. ")):N("",!0),O(_t,{title:"Protocol",desc:"SFTP (over SSH), FTPS (FTP over TLS), or plain FTP.",keywords:"protocol sftp ftps ftp"},{default:mt(()=>[Ve("protocol")?(g(),x("span",dg,[$(P(wr(Ee("protocol").effective))+" ",1),ye("protocol")?(g(),x("span",fg,[O(Y,{name:"lock",size:10}),$(P(ye("protocol")),1)])):N("",!0)])):(g(),ie(hn,{key:1,modelValue:gt.protocol,"onUpdate:modelValue":f[22]||(f[22]=k=>gt.protocol=k),options:vn},null,8,["modelValue"]))]),_:1}),O(_t,{title:"Host",desc:"Server hostname or IP address.",keywords:"host server address"},{default:mt(()=>[Ve("host")?(g(),x("span",hg,[$(P(Ee("host").effective||"—")+" ",1),ye("host")?(g(),x("span",pg,[O(Y,{name:"lock",size:10}),$(P(ye("host")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[23]||(f[23]=k=>gt.host=k),class:"field w-64",placeholder:"files.example.com"},null,512)),[[vt,gt.host]])]),_:1}),O(_t,{title:"Port",desc:"Leave blank for the protocol default (22 for SFTP, 21 for FTP/FTPS).",keywords:"port"},{default:mt(()=>[Ve("port")?(g(),x("span",mg,[$(P(Ee("port").effective||"default")+" ",1),ye("port")?(g(),x("span",gg,[O(Y,{name:"lock",size:10}),$(P(ye("port")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[24]||(f[24]=k=>gt.port=k),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"22"},null,512)),[[vt,gt.port]])]),_:1}),O(_t,{title:"Username",desc:"Account used to authenticate.",keywords:"username login account"},{default:mt(()=>[Ve("username")?(g(),x("span",_g,[$(P(Ee("username").effective||"—")+" ",1),ye("username")?(g(),x("span",vg,[O(Y,{name:"lock",size:10}),$(P(ye("username")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[25]||(f[25]=k=>gt.username=k),class:"field w-64",placeholder:"user"},null,512)),[[vt,gt.username]])]),_:1}),O(_t,{title:"Password",desc:"Password auth for FTP/FTPS, or SFTP password login. Leave blank to use a key.",keywords:"password secret credentials"},{default:mt(()=>[Ve("password")?(g(),x("span",yg,[$(P(Ee("password").effective||"—")+" ",1),ye("password")?(g(),x("span",bg,[O(Y,{name:"lock",size:10}),$(P(ye("password")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[26]||(f[26]=k=>gt.password=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[vt,gt.password]])]),_:1}),Ji.value==="sftp"?(g(),ie(_t,{key:7,block:"",title:"SSH private key",desc:"PEM key for SFTP key auth — used instead of, or alongside, a password.",keywords:"private key ssh pem identity"},{default:mt(()=>[Ve("privateKey")?(g(),x("span",xg,[$(P(Ee("privateKey").effective||"—")+" ",1),ye("privateKey")?(g(),x("span",wg,[O(Y,{name:"lock",size:10}),$(P(ye("privateKey")),1)])):N("",!0)])):ot((g(),x("textarea",{key:1,"onUpdate:modelValue":f[27]||(f[27]=k=>gt.privateKey=k),rows:"3",class:"field w-full font-mono text-xs",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512)),[[vt,gt.privateKey]])]),_:1})):N("",!0),Ji.value==="sftp"?(g(),ie(_t,{key:8,title:"Private key passphrase",desc:"Passphrase protecting the SSH private key, if any.",keywords:"passphrase key secret"},{default:mt(()=>[Ve("keyPassphrase")?(g(),x("span",kg,[$(P(Ee("keyPassphrase").effective||"—")+" ",1),ye("keyPassphrase")?(g(),x("span",Sg,[O(Y,{name:"lock",size:10}),$(P(ye("keyPassphrase")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[28]||(f[28]=k=>gt.keyPassphrase=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[vt,gt.keyPassphrase]])]),_:1})):N("",!0),Ji.value==="sftp"?(g(),ie(_t,{key:9,title:"Host key fingerprint",desc:"Optional SHA256:… fingerprint to pin the server's host key. Blank accepts any key.",keywords:"host key fingerprint verify trust"},{default:mt(()=>[Ve("hostKeyFingerprint")?(g(),x("span",Pg,[$(P(Ee("hostKeyFingerprint").effective||"—")+" ",1),ye("hostKeyFingerprint")?(g(),x("span",Tg,[O(Y,{name:"lock",size:10}),$(P(ye("hostKeyFingerprint")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[29]||(f[29]=k=>gt.hostKeyFingerprint=k),class:"field w-full font-mono text-xs",placeholder:"SHA256:…"},null,512)),[[vt,gt.hostKeyFingerprint]])]),_:1})):N("",!0),Ji.value==="ftps"?(g(),ie(_t,{key:10,title:"TLS verification",desc:"Skip only for self-signed test servers.",keywords:"tls certificate verify insecure ftps"},{default:mt(()=>[Ve("insecureSkipVerify")?(g(),x("span",Lg,[$(P(Ee("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),ye("insecureSkipVerify")?(g(),x("span",Cg,[O(Y,{name:"lock",size:10}),$(P(ye("insecureSkipVerify")),1)])):N("",!0)])):(g(),ie(hn,{key:1,modelValue:gt.insecureSkipVerify,"onUpdate:modelValue":f[30]||(f[30]=k=>gt.insecureSkipVerify=k),options:ci},null,8,["modelValue"]))]),_:1})):N("",!0),O(_t,{title:"Base path",desc:"Working directory and health-check target, e.g. /uploads.",keywords:"base path directory folder root"},{default:mt(()=>[Ve("basePath")?(g(),x("span",Mg,[$(P(Ee("basePath").effective||"—")+" ",1),ye("basePath")?(g(),x("span",Og,[O(Y,{name:"lock",size:10}),$(P(ye("basePath")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[31]||(f[31]=k=>gt.basePath=k),class:"field w-64 font-mono",placeholder:"/uploads"},null,512)),[[vt,gt.basePath]])]),_:1}),u("div",Eg,[ke.value?N("",!0):(g(),x("button",{key:0,class:"btn-accent",disabled:le.value||!tt.available,onClick:Tr},P(le.value?"Saving…":Be.value?"Save organization settings":"Save settings"),9,zg)),Be.value?N("",!0):(g(),x("button",{key:1,class:"btn-ghost",disabled:me.value||!tt.available,onClick:Lr},P(me.value?"Testing…":"Test connection"),9,Ag)),Ht.value?(g(),x("span",Ig,P(Ht.value),1)):N("",!0),Te.value&&!Be.value?(g(),x("span",$g,"Checked "+P(kr()),1)):N("",!0),ve.value&&!Be.value?(g(),x("span",{key:4,class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Cr(ve.value.status)])},[f[87]||(f[87]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P(ve.value.detail||ve.value.status),1)],2)):N("",!0)])]),u("div",Dg,[u("div",Ng,[u("div",Rg,[O(Y,{name:"cloud",size:20})]),f[88]||(f[88]=u("div",{class:"min-w-0"},[u("div",{class:"text-sm font-semibold text-ink"},"WebDAV"),u("div",{class:"mt-0.5 text-xs text-ink-muted"}," Connect to a WebDAV server (Nextcloud, ownCloud, IIS, …). Configure the connection your account uses. ")],-1))]),Vt.loaded&&!Vt.available?(g(),x("div",Fg,[O(Y,{name:"lock",size:14,class:"mr-1 inline"}),f[89]||(f[89]=$(" WebDAV is currently disabled by your administrator. Contact them to enable it. ",-1))])):N("",!0),Vt.canEditOrg?(g(),x("div",Bg,[f[90]||(f[90]=u("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),O(hn,{modelValue:ft.value,"onUpdate:modelValue":f[32]||(f[32]=k=>ft.value=k),options:_e},null,8,["modelValue"])])):N("",!0),an.value?(g(),ie(_t,{key:2,title:"Enable WebDAV (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin webdav organization"},{default:mt(()=>[O(nn,{"model-value":Vt.orgEnabled,disabled:!Vt.available,"onUpdate:modelValue":pi},null,8,["model-value","disabled"])]),_:1})):(g(),ie(_t,{key:3,title:"Enable WebDAV",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin webdav"},{default:mt(()=>[O(nn,{"model-value":Vt.enabled,disabled:!Vt.available||!Vt.orgEnabled,"onUpdate:modelValue":pi},null,8,["model-value","disabled"])]),_:1})),!an.value&&Vt.available&&!Vt.orgEnabled?(g(),x("div",Vg,[O(Y,{name:"lock",size:13,class:"mr-1 inline"}),f[92]||(f[92]=$("WebDAV is turned off for your organization",-1)),Vt.canEditOrg?(g(),x("span",Zg,[...f[91]||(f[91]=[$(" — switch to ",-1),u("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):N("",!0),f[93]||(f[93]=$(". ",-1))])):N("",!0),an.value?(g(),x("div",Ug,[O(Y,{name:"users",size:13,class:"mr-1 inline"}),f[94]||(f[94]=$("These are organization-wide settings — they apply to everyone in ",-1)),u("span",Hg,P(e.organizationName||"your organization"),1),f[95]||(f[95]=$(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):Os.value?(g(),x("div",jg," As a superadmin you manage the global WebDAV configuration in the API Server panel. The effective configuration is shown below. ")):N("",!0),O(_t,{block:"",title:"Server URL",desc:"WebDAV endpoint including scheme, e.g. https://cloud.example.com/remote.php/dav/files/alice/.",keywords:"url server address endpoint webdav host"},{default:mt(()=>[hi("baseURL")?(g(),x("span",Wg,[$(P(yn("baseURL").effective||"—")+" ",1),Ze("baseURL")?(g(),x("span",Kg,[O(Y,{name:"lock",size:10}),$(P(Ze("baseURL")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[33]||(f[33]=k=>ze.baseURL=k),class:"field w-full font-mono text-xs",placeholder:"https://cloud.example.com/remote.php/dav/files/alice/"},null,512)),[[vt,ze.baseURL]])]),_:1}),O(_t,{title:"Username",desc:"Account used to authenticate (leave blank for a public share).",keywords:"username login account"},{default:mt(()=>[hi("username")?(g(),x("span",Gg,[$(P(yn("username").effective||"—")+" ",1),Ze("username")?(g(),x("span",qg,[O(Y,{name:"lock",size:10}),$(P(Ze("username")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[34]||(f[34]=k=>ze.username=k),class:"field w-64",placeholder:"user"},null,512)),[[vt,ze.username]])]),_:1}),O(_t,{title:"Password",desc:"Password or app-specific token for HTTP Basic auth.",keywords:"password secret credentials token"},{default:mt(()=>[hi("password")?(g(),x("span",Yg,[$(P(yn("password").effective||"—")+" ",1),Ze("password")?(g(),x("span",Jg,[O(Y,{name:"lock",size:10}),$(P(Ze("password")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[35]||(f[35]=k=>ze.password=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[vt,ze.password]])]),_:1}),O(_t,{title:"TLS verification",desc:"Only affects HTTPS. Skip only for self-signed test servers.",keywords:"tls certificate verify insecure https"},{default:mt(()=>[hi("insecureSkipVerify")?(g(),x("span",Xg,[$(P(yn("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),Ze("insecureSkipVerify")?(g(),x("span",Qg,[O(Y,{name:"lock",size:10}),$(P(Ze("insecureSkipVerify")),1)])):N("",!0)])):(g(),ie(hn,{key:1,modelValue:ze.insecureSkipVerify,"onUpdate:modelValue":f[36]||(f[36]=k=>ze.insecureSkipVerify=k),options:yo},null,8,["modelValue"]))]),_:1}),O(_t,{title:"Base path",desc:"Working directory under the server URL and health-check target, e.g. /Documents.",keywords:"base path directory folder root"},{default:mt(()=>[hi("basePath")?(g(),x("span",t_,[$(P(yn("basePath").effective||"—")+" ",1),Ze("basePath")?(g(),x("span",e_,[O(Y,{name:"lock",size:10}),$(P(Ze("basePath")),1)])):N("",!0)])):ot((g(),x("input",{key:1,"onUpdate:modelValue":f[37]||(f[37]=k=>ze.basePath=k),class:"field w-64 font-mono",placeholder:"/Documents"},null,512)),[[vt,ze.basePath]])]),_:1}),u("div",n_,[Os.value?N("",!0):(g(),x("button",{key:0,class:"btn-accent",disabled:Ci.value||!Vt.available,onClick:xo},P(Ci.value?"Saving…":an.value?"Save organization settings":"Save settings"),9,i_)),an.value?N("",!0):(g(),x("button",{key:1,class:"btn-ghost",disabled:fi.value||!Vt.available,onClick:wo},P(fi.value?"Testing…":"Test connection"),9,s_)),di.value?(g(),x("span",o_,P(di.value),1)):N("",!0),tn.value&&!an.value?(g(),x("span",r_,"Checked "+P(Or()),1)):N("",!0),rn.value&&!an.value?(g(),x("span",{key:4,class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Mi(rn.value.status)])},[f[96]||(f[96]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P(rn.value.detail||rn.value.status),1)],2)):N("",!0)])])],64)):N("",!0),ss("drives-local")?(g(),x("div",a_,[u("div",l_,[u("div",u_,[O(Y,{name:"monitor",size:20})]),f[97]||(f[97]=u("div",{class:"min-w-0"},[u("div",{class:"text-sm font-semibold text-ink"},"Local Storage"),u("div",{class:"mt-0.5 text-xs text-ink-muted"}," A private folder on the server for your files. Each user has their own; members of an organization share one. ")],-1))]),X.loaded&&!X.available?(g(),x("div",c_,[O(Y,{name:"lock",size:14,class:"mr-1 inline"}),f[98]||(f[98]=$(" Local storage is currently disabled by your administrator. Contact them to enable it. ",-1))])):X.loaded&&!X.rootConfigured?(g(),x("div",d_,[O(Y,{name:"alertTriangle",size:14,class:"mr-1 inline"}),f[99]||(f[99]=$(" No storage root has been configured by your administrator yet. ",-1))])):N("",!0),X.canEditOrg?(g(),x("div",f_,[f[100]||(f[100]=u("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),O(hn,{modelValue:Qt.value,"onUpdate:modelValue":f[38]||(f[38]=k=>Qt.value=k),options:_e},null,8,["modelValue"])])):N("",!0),Se.value?(g(),ie(_t,{key:3,title:"Enable local storage (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin local storage folder organization"},{default:mt(()=>[O(nn,{"model-value":X.orgEnabled,disabled:!X.available,"onUpdate:modelValue":ns},null,8,["model-value","disabled"])]),_:1})):(g(),ie(_t,{key:4,title:"Enable local storage",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin local storage folder"},{default:mt(()=>[O(nn,{"model-value":X.enabled,disabled:!X.available||!X.orgEnabled,"onUpdate:modelValue":ns},null,8,["model-value","disabled"])]),_:1})),!Se.value&&X.available&&!X.orgEnabled?(g(),x("div",h_,[O(Y,{name:"lock",size:13,class:"mr-1 inline"}),f[102]||(f[102]=$("Local storage is turned off for your organization",-1)),X.canEditOrg?(g(),x("span",p_,[...f[101]||(f[101]=[$(" — switch to ",-1),u("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):N("",!0),f[103]||(f[103]=$(". ",-1))])):N("",!0),Se.value?(g(),x("div",m_,[O(Y,{name:"users",size:13,class:"mr-1 inline"}),f[104]||(f[104]=$("These are organization-wide settings — they apply to everyone in ",-1)),u("span",g_,P(e.organizationName||"your organization"),1),f[105]||(f[105]=$(", who all share the organization folder. Members can additionally enable a private folder inside it. ",-1))])):$e.value?(g(),x("div",__," As a superadmin you manage the global storage root in the API Server panel. The effective configuration is shown below. ")):N("",!0),Se.value?(g(),ie(_t,{key:8,title:"Private folders",desc:"Let members create a private folder inside the organization folder, reachable only by them.",keywords:"private folder members allow policy organization"},{default:mt(()=>[O(nn,{"model-value":X.allowPrivate,disabled:!X.available,"onUpdate:modelValue":ko},null,8,["model-value","disabled"])]),_:1})):N("",!0),Se.value?N("",!0):(g(),x(ct,{key:9},[O(_t,{block:"",title:"Your folders",desc:"Assigned automatically and isolated — no one else can reach your private folder.",keywords:"folder directory path storage location isolated private shared"},{default:mt(()=>[u("div",v_,[(g(!0),x(ct,null,Wt(X.mounts,k=>(g(),x("div",{key:k.id,class:"flex flex-wrap items-center gap-2"},[u("span",y_,P(k.path),1),k.kind==="shared"?(g(),x("span",b_,[O(Y,{name:"users",size:10}),f[106]||(f[106]=$("Shared with your organization",-1))])):(g(),x("span",x_,[O(Y,{name:"lock",size:10}),f[107]||(f[107]=$("Private to you",-1))])),Wn.value[k.id]?(g(),x("span",{key:2,class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold",It(Wn.value[k.id].status)])},[f[108]||(f[108]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P(Wn.value[k.id].status),1)],2)):N("",!0)]))),128)),X.mounts.length?N("",!0):(g(),x("div",w_,P(X.rootConfigured?"No folder assigned yet.":"Waiting for the administrator to configure a storage root."),1))])]),_:1}),X.isOrgUser&&X.allowPrivate?(g(),ie(_t,{key:0,title:"My private folder",desc:"Add a private folder inside the organization folder, reachable only by you — you keep the shared folder too.",keywords:"private folder personal isolated organization inside"},{default:mt(()=>[O(nn,{"model-value":X.privateFolder,disabled:!X.available||!X.orgEnabled,"onUpdate:modelValue":is},null,8,["model-value","disabled"])]),_:1})):X.isOrgUser&&!X.allowPrivate?(g(),x("div",k_,[O(Y,{name:"lock",size:13,class:"mr-1 inline"}),f[109]||(f[109]=$("Private folders are turned off by your organization. ",-1))])):N("",!0)],64)),O(_t,{title:"Access mode",desc:"Read-only prevents uploads, deletes and folder creation.",keywords:"read only write access mode permission"},{default:mt(()=>[En("readOnly")?(g(),x("span",S_,[$(P(Ei(ge("readOnly").effective))+" ",1),gi("readOnly")?(g(),x("span",P_,[O(Y,{name:"lock",size:10}),$(P(gi("readOnly")),1)])):N("",!0)])):(g(),ie(hn,{key:1,modelValue:jn.value,"onUpdate:modelValue":f[39]||(f[39]=k=>jn.value=k),options:Oi},null,8,["modelValue"]))]),_:1}),u("div",T_,[$e.value?N("",!0):(g(),x("button",{key:0,class:"btn-accent",disabled:bn.value||!X.available,onClick:Rs},P(bn.value?"Saving…":Se.value?"Save organization settings":"Save settings"),9,L_)),Se.value?N("",!0):(g(),x("button",{key:1,class:"btn-ghost",disabled:mi.value||!X.available,onClick:Ar},P(mi.value?"Testing…":"Test folder"),9,C_)),ln.value?(g(),x("span",M_,P(ln.value),1)):N("",!0),oe.value&&!Se.value?(g(),x("span",O_,"Checked "+P($s()),1)):N("",!0),Pt.value&&!Se.value?(g(),x("span",{key:4,class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",It(Pt.value.status)])},[f[110]||(f[110]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P(Pt.value.detail||Pt.value.status),1)],2)):N("",!0)])])):N("",!0)])):H.id==="profile"?(g(),x("div",E_,[O(_t,{block:"",title:"Profile photo",desc:"PNG or JPG, up to ~1.5 MB. Stored on this device.",keywords:"avatar photo picture"},{default:mt(()=>[u("div",z_,[$t(Tt).avatar?(g(),x("img",{key:0,src:$t(Tt).avatar,alt:"Avatar",class:"h-16 w-16 rounded-full object-cover"},null,8,A_)):(g(),x("div",I_,P(To.value),1)),u("div",$_,[u("label",D_,[O(Y,{name:"upload",size:15,class:"mr-1.5 inline"}),f[111]||(f[111]=$("Upload ",-1)),u("input",{type:"file",accept:"image/*",class:"hidden",onChange:Po},null,32)]),$t(Tt).avatar?(g(),x("button",{key:0,class:"btn-ghost",onClick:Ir},"Remove")):N("",!0)])])]),_:1}),O(_t,{title:"Display name",desc:"The name shown on your public profile.",keywords:"display name profile"},{default:mt(()=>[ot(u("input",{"onUpdate:modelValue":f[40]||(f[40]=k=>$t(Tt).displayName=k),class:"field w-56",placeholder:"Jane O.",onBlur:f[41]||(f[41]=k=>jt("Saved."))},null,544),[[vt,$t(Tt).displayName]])]),_:1}),O(_t,{block:"",title:"Bio",desc:"A short description others can see.",keywords:"bio about description"},{default:mt(()=>[ot(u("textarea",{"onUpdate:modelValue":f[42]||(f[42]=k=>$t(Tt).bio=k),rows:"3",maxlength:"240",class:"field w-full resize-none",placeholder:"Flight director, North yard operations…",onBlur:f[43]||(f[43]=k=>jt("Saved."))},null,544),[[vt,$t(Tt).bio]]),u("div",N_,P(($t(Tt).bio||"").length)+"/240",1)]),_:1}),O(_t,{title:"Show email on profile",desc:"Let teammates see your email address.",keywords:"show email public visibility"},{default:mt(()=>[O(nn,{modelValue:$t(Tt).showEmail,"onUpdate:modelValue":f[44]||(f[44]=k=>$t(Tt).showEmail=k)},null,8,["modelValue"])]),_:1})])):H.id==="security"?(g(),x("div",R_,[O(_t,{block:"",title:"Two-factor authentication",desc:"Require a one-time code at sign-in.",keywords:"two factor 2fa authentication security"},{default:mt(()=>[u("div",F_,[u("span",{class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",$t(Tt).twoFactor?"bg-success-soft text-success-fg":"bg-surface-2 text-ink-secondary"])},[f[112]||(f[112]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P($t(Tt).twoFactor?"Enabled":"Disabled"),1)],2),!$t(Tt).twoFactor&&!Kn.value?(g(),x("button",{key:0,class:"btn-accent",onClick:Ii},"Enable 2FA")):$t(Tt).twoFactor?(g(),x("button",{key:1,class:"btn-ghost",onClick:$r},"Disable")):N("",!0)]),Kn.value?(g(),x("div",B_,[u("div",V_,[f[114]||(f[114]=u("div",{class:"grid h-28 w-28 place-items-center rounded bg-white p-2"},[u("svg",{viewBox:"0 0 100 100",class:"h-full w-full"},[u("rect",{width:"100",height:"100",fill:"#fff"}),u("g",{fill:"#0F1E3D"},[u("rect",{x:"6",y:"6",width:"24",height:"24"}),u("rect",{x:"70",y:"6",width:"24",height:"24"}),u("rect",{x:"6",y:"70",width:"24",height:"24"}),u("rect",{x:"12",y:"12",width:"12",height:"12",fill:"#fff"}),u("rect",{x:"76",y:"12",width:"12",height:"12",fill:"#fff"}),u("rect",{x:"12",y:"76",width:"12",height:"12",fill:"#fff"}),u("rect",{x:"40",y:"10",width:"8",height:"8"}),u("rect",{x:"52",y:"20",width:"8",height:"8"}),u("rect",{x:"40",y:"40",width:"8",height:"8"}),u("rect",{x:"60",y:"44",width:"8",height:"8"}),u("rect",{x:"44",y:"60",width:"8",height:"8"}),u("rect",{x:"70",y:"60",width:"8",height:"8"}),u("rect",{x:"80",y:"72",width:"8",height:"8"}),u("rect",{x:"60",y:"80",width:"8",height:"8"})])])],-1)),u("div",Z_,[f[113]||(f[113]=u("div",{class:"text-xs text-ink-secondary"},"Scan with an authenticator app, or enter this secret:",-1)),u("div",U_,P(Lo.value),1),u("div",H_,[ot(u("input",{"onUpdate:modelValue":f[45]||(f[45]=k=>Ai.value=k),inputmode:"numeric",maxlength:"6",class:"field w-28 font-mono tracking-[0.3em]",placeholder:"000000"},null,512),[[vt,Ai.value]]),u("button",{class:"btn-accent",onClick:Co},"Verify & enable")]),Zt.value?(g(),x("p",j_,P(Zt.value),1)):N("",!0)])])])):N("",!0),$t(Tt).twoFactor&&os.value.length?(g(),x("div",W_,[f[115]||(f[115]=u("div",{class:"text-xs font-semibold text-ink"},"Recovery codes",-1)),f[116]||(f[116]=u("div",{class:"mt-0.5 text-xs text-ink-muted"},"Store these somewhere safe — each works once.",-1)),u("div",K_,[(g(!0),x(ct,null,Wt(os.value,k=>(g(),x("span",{key:k,class:"select-all"},P(k),1))),128))])])):N("",!0),f[117]||(f[117]=u("p",{class:"mt-2 text-xs text-ink-muted"},"Prototype — codes are generated locally until the account service verifies them.",-1))]),_:1}),O(_t,{block:"",title:"Active sessions",desc:"Devices currently signed in to your account.",keywords:"sessions devices logout sign out remote"},{default:mt(()=>[u("div",G_,[u("div",q_,[u("div",Y_,[O(Y,{name:"monitor",size:18})]),u("div",J_,[u("div",X_,[$(P(Dr())+" on "+P(Mo())+" ",1),f[118]||(f[118]=u("span",{class:"ml-1 rounded-full bg-success-soft px-2 py-0.5 text-[10px] font-semibold text-success-fg"},"This device",-1))]),u("div",Q_,"Signed in "+P($t(Yl)($t(Nr))),1)]),u("button",{class:"btn-ghost",onClick:f[46]||(f[46]=k=>a("logout"))},"Log out")])]),f[119]||(f[119]=u("button",{class:"btn-ghost mt-2 opacity-60",disabled:"",title:"Requires the account service"}," Log out all other devices ",-1)),f[120]||(f[120]=u("p",{class:"mt-2 text-xs text-ink-muted"}," Only this session is visible from the browser; enumerating and revoking remote sessions needs the account service. ",-1))]),_:1})])):H.id==="team"?(g(),x("div",tv,[Gt.id?(g(),x("div",ev,[O(_t,{block:"",title:`Edit user — ${Gt.email}`,desc:"Update details, change role, reset password, or set verified.",keywords:"edit user update role password verified organization"},{default:mt(()=>[u("div",nv,[u("div",iv,[ot(u("input",{"onUpdate:modelValue":f[47]||(f[47]=k=>Gt.email=k),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[vt,Gt.email]]),ot(u("select",{"onUpdate:modelValue":f[48]||(f[48]=k=>Gt.role=k),class:"field w-32",disabled:ls.value,title:ls.value?"You cannot change your own role":""},[(g(!0),x(ct,null,Wt(Fs.value,k=>(g(),x("option",{key:k.value,value:k.value},P(k.label),9,ov))),128))],8,sv),[[sn,Gt.role]])]),l.value?ot((g(),x("select",{key:0,"onUpdate:modelValue":f[49]||(f[49]=k=>Gt.organization=k),class:"field",title:"Organization"},[(g(!0),x(ct,null,Wt(Oo.value,k=>(g(),x("option",{key:k.value,value:k.value},P(k.label),9,rv))),128))],512)),[[sn,Gt.organization]]):N("",!0),ot(u("input",{"onUpdate:modelValue":f[50]||(f[50]=k=>Gt.password=k),type:"password",class:"field",placeholder:"New password (leave blank to keep current)"},null,512),[[vt,Gt.password]]),u("label",av,[O(nn,{modelValue:Gt.verified,"onUpdate:modelValue":f[51]||(f[51]=k=>Gt.verified=k)},null,8,["modelValue"]),f[121]||(f[121]=$(" Email verified ",-1))]),u("div",lv,[u("button",{class:"btn-accent",disabled:Ri.value,onClick:Br},P(Ri.value?"Saving…":"Save changes"),9,uv),u("button",{class:"btn-ghost",onClick:In},"Cancel"),An.value?(g(),x("span",cv,P(An.value),1)):N("",!0),ls.value?(g(),x("span",dv,"Editing your own account — role locked.")):N("",!0)])])]),_:1},8,["title"])])):(g(),x("div",fv,[O(_t,{block:"",title:"Add user",desc:"Create a new account. Admins add users within their organization; superadmins can target any.",keywords:"add user create account role admin organization"},{default:mt(()=>[u("div",hv,[u("div",pv,[ot(u("input",{"onUpdate:modelValue":f[52]||(f[52]=k=>re.email=k),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[vt,re.email]]),ot(u("select",{"onUpdate:modelValue":f[53]||(f[53]=k=>re.role=k),class:"field w-32"},[(g(!0),x(ct,null,Wt(Fs.value,k=>(g(),x("option",{key:k.value,value:k.value},P(k.label),9,mv))),128))],512),[[sn,re.role]])]),l.value?ot((g(),x("select",{key:0,"onUpdate:modelValue":f[54]||(f[54]=k=>re.organization=k),class:"field",title:"Organization"},[(g(!0),x(ct,null,Wt(Oo.value,k=>(g(),x("option",{key:k.value,value:k.value},P(k.label),9,gv))),128))],512)),[[sn,re.organization]]):(g(),x("div",_v,[f[122]||(f[122]=$(" New users join your organization: ",-1)),u("span",vv,P(e.organizationName||"—"),1)])),ot(u("input",{"onUpdate:modelValue":f[55]||(f[55]=k=>re.password=k),type:"password",class:"field",placeholder:"Temporary password (min 8 chars)"},null,512),[[vt,re.password]]),u("div",yv,[u("button",{class:"btn-accent",disabled:$i.value,onClick:Rr},P($i.value?"Creating…":"Create user"),9,bv),yi.value?(g(),x("span",xv,P(yi.value),1)):N("",!0)])])]),_:1})])),u("div",wv,[u("div",kv,[f[123]||(f[123]=u("div",null,[u("div",{class:"eyebrow"},"Team"),u("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All users")],-1)),u("button",{class:"btn-ghost",disabled:Gn.value,onClick:Yn},P(Gn.value?"Loading…":"Refresh"),9,Sv)]),as.value?(g(),x("div",Pv,P(as.value),1)):!rs.value.length&&!Gn.value?(g(),x("div",Tv,"No users yet.")):(g(),x("div",Lv,[u("table",Cv,[u("thead",null,[u("tr",Mv,[(g(),x(ct,null,Wt(["User","Role","Organization","Status",""],k=>u("th",{key:k,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},P(k),1)),64))])]),u("tbody",null,[(g(!0),x(ct,null,Wt(rs.value,k=>(g(),x("tr",{key:k.id,class:Ct(["border-b border-line last:border-0",Gt.id===k.id?"bg-accent-soft":""])},[u("td",Ov,[u("span",Ev,P(k.email),1),k.email===e.email?(g(),x("span",zv,"(you)")):N("",!0)]),u("td",Av,[u("span",{class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(k.role||"user")])},[O(Y,{name:_(k.role||"user"),size:12},null,8,["name"]),$(P(h(k.role||"user")),1)],2)]),u("td",Iv,[u("span",{class:Ct(["text-sm",k.organizationName?"text-ink-secondary":"text-ink-muted"])},P(k.organizationName||"—"),3)]),u("td",$v,[u("span",{class:Ct(["text-xs",k.verified?"text-success-fg":"text-ink-muted"])},P(k.verified?"Verified":"Unverified"),3)]),u("td",Dv,[Ye.value===k.id?(g(),x(ct,{key:0},[f[124]||(f[124]=u("span",{class:"mr-2 text-xs text-ink-muted"},"Remove?",-1)),u("button",{class:"btn-ghost mr-1",onClick:f[56]||(f[56]=qt=>Ye.value="")},"Cancel"),u("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:qt=>Fr(k)}," Remove ",8,Nv)],64)):(g(),x("div",Rv,[u("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:qt=>us(k)},[O(Y,{name:"settings",size:14}),f[125]||(f[125]=$(" Edit ",-1))],8,Fv),k.email!==e.email?(g(),x("button",{key:0,class:"btn-ghost inline-flex items-center gap-1.5",onClick:qt=>Ye.value=k.id},[O(Y,{name:"trash",size:14}),f[126]||(f[126]=$(" Remove ",-1))],8,Bv)):N("",!0)]))])],2))),128))])])]))])])):H.id==="organizations"?(g(),x("div",Vv,[kn.id?(g(),x("div",Zv,[O(_t,{block:"",title:"Rename organization",desc:"Update the organization's display name.",keywords:"rename organization edit"},{default:mt(()=>[u("div",Uv,[ot(u("input",{"onUpdate:modelValue":f[57]||(f[57]=k=>kn.name=k),class:"field",placeholder:"Organization name",onKeyup:Vl(zo,["enter"])},null,544),[[vt,kn.name]]),u("div",Hv,[u("button",{class:"btn-accent",onClick:zo},"Save changes"),u("button",{class:"btn-ghost",onClick:Bs},"Cancel"),Sn.value?(g(),x("span",jv,P(Sn.value),1)):N("",!0)])])]),_:1})])):(g(),x("div",Wv,[O(_t,{block:"",title:"Add organization",desc:"Create a new organization. Assign admins and users to it from User management.",keywords:"add organization create tenant company"},{default:mt(()=>[u("div",Kv,[ot(u("input",{"onUpdate:modelValue":f[58]||(f[58]=k=>$n.name=k),class:"field",placeholder:"e.g. Northwind Aerial",onKeyup:Vl(Eo,["enter"])},null,544),[[vt,$n.name]]),u("div",Gv,[u("button",{class:"btn-accent",disabled:Fi.value,onClick:Eo},P(Fi.value?"Creating…":"Create organization"),9,qv),Ce.value?(g(),x("span",Yv,P(Ce.value),1)):N("",!0)])])]),_:1})])),u("div",Jv,[u("div",{class:"flex items-center justify-between px-5 py-4"},[f[127]||(f[127]=u("div",null,[u("div",{class:"eyebrow"},"Tenancy"),u("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All organizations")],-1)),u("button",{class:"btn-ghost",onClick:qn},"Refresh")]),Di.value.length?(g(),x("div",Qv,[u("table",ty,[u("thead",null,[u("tr",ey,[(g(),x(ct,null,Wt(["Organization","Members",""],k=>u("th",{key:k,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},P(k),1)),64))])]),u("tbody",null,[(g(!0),x(ct,null,Wt(Di.value,k=>(g(),x("tr",{key:k.id,class:Ct(["border-b border-line last:border-0",kn.id===k.id?"bg-accent-soft":""])},[u("td",ny,[u("span",iy,[O(Y,{name:"grid",size:14,class:"text-ink-muted"}),$(P(k.name),1)])]),u("td",sy,P(Bi.value[k.id]||0),1),u("td",oy,[bi.value===k.id?(g(),x(ct,{key:0},[f[128]||(f[128]=u("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),u("button",{class:"btn-ghost mr-1",onClick:f[59]||(f[59]=qt=>bi.value="")},"Cancel"),u("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:qt=>en(k)}," Delete ",8,ry)],64)):(g(),x("div",ay,[u("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:qt=>Vr(k)},[O(Y,{name:"settings",size:14}),f[129]||(f[129]=$(" Rename ",-1))],8,ly),u("button",{class:"btn-ghost inline-flex items-center gap-1.5",disabled:(Bi.value[k.id]||0)>0,title:(Bi.value[k.id]||0)>0?"Reassign or remove members first":"",onClick:qt=>bi.value=k.id},[O(Y,{name:"trash",size:14}),f[130]||(f[130]=$(" Delete ",-1))],8,uy)]))])],2))),128))])])])):(g(),x("div",Xv,"No organizations yet."))])])):H.id==="advanced"?(g(),x("div",cy,[u("div",dy,[O(_t,{title:"Export data",desc:"Download your settings and profile as JSON.",keywords:"export data download backup"},{default:mt(()=>[u("button",{class:"btn-ghost",onClick:xi},[O(Y,{name:"download",size:15,class:"mr-1.5 inline"}),f[131]||(f[131]=$("Export",-1))])]),_:1}),O(_t,{block:"",title:"Import data",desc:"Restore settings from a previous export.",keywords:"import data upload restore"},{default:mt(()=>[u("label",fy,[O(Y,{name:"upload",size:15,class:"mr-1.5 inline"}),f[132]||(f[132]=$("Choose file… ",-1)),u("input",{type:"file",accept:"application/json,.json",class:"hidden",onChange:Pn},null,32)]),cs.value?(g(),x("p",hy,P(cs.value),1)):N("",!0)]),_:1})]),u("div",py,[u("div",my,[O(Y,{name:"alertTriangle",size:18}),f[133]||(f[133]=u("h3",{class:"text-sm font-bold uppercase tracking-caps"},"Danger zone",-1))]),f[138]||(f[138]=u("p",{class:"mt-1 text-xs text-ink-secondary"},"Deleting your account is permanent and cannot be undone.",-1)),u("div",gy,[f[137]||(f[137]=u("div",{class:"text-sm font-semibold text-ink"},"Delete account",-1)),u("label",_y,[ot(u("input",{"onUpdate:modelValue":f[60]||(f[60]=k=>de.understand=k),type:"checkbox",class:"mt-0.5 h-4 w-4 accent-[var(--danger)]"},null,512),[[rr,de.understand]]),f[134]||(f[134]=$(" I understand this permanently deletes my account and all associated data. ",-1))]),u("div",vy,[u("label",yy,[f[135]||(f[135]=$("Type ",-1)),u("span",by,P(Vs.value),1),f[136]||(f[136]=$(" to confirm",-1))]),ot(u("input",{"onUpdate:modelValue":f[61]||(f[61]=k=>de.typed=k),class:"field w-full max-w-[360px] font-mono",placeholder:Vs.value},null,8,xy),[[vt,de.typed]])]),u("div",wy,[de.armed?(g(),x("button",{key:1,class:"rounded bg-danger px-4 py-2.5 text-sm font-semibold text-white transition enabled:hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-50",disabled:de.cooldown>0,onClick:ds},P(de.cooldown>0?`Confirm in ${de.cooldown}s…`:"Permanently delete account"),9,Sy)):(g(),x("button",{key:0,class:"rounded bg-danger px-4 py-2.5 text-sm font-semibold text-white transition enabled:hover:brightness-110 disabled:cursor-not-allowed disabled:opacity-40",disabled:!Jn.value,onClick:Ao}," Delete account… ",8,ky)),de.armed&&de.cooldown>0?(g(),x("span",Py,"Cooling-off period — read once more.")):N("",!0)]),de.msg?(g(),x("p",Ty,P(de.msg),1)):N("",!0)])])])):N("",!0)],64))),128))])]),O(Qf,{name:"fade"},{default:mt(()=>[_i.value?(g(),x("div",Ly,[O(Y,{name:"check",size:16,class:"text-success-fg"}),$(P(_i.value),1)])):N("",!0)]),_:1})]))}},My=Wp(Cy,[["__scopeId","data-v-4fe25eb7"]]),Oy={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Ey={class:"flex flex-wrap items-center gap-3"},zy={class:"inline-flex rounded-lg border border-line bg-surface-1 p-0.5"},Ay=["onClick"],Iy={class:"ml-auto flex items-center gap-2"},$y=["href"],Dy={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},Ny={class:"eyebrow"},Ry={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},Fy={key:0,class:"panel p-5"},By={class:"mb-4 flex items-center justify-between"},Vy={class:"eyebrow"},Zy={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},Uy={class:"block"},Hy={class:"block"},jy={class:"block"},Wy={class:"block"},Ky={key:0,value:""},Gy=["value"],qy={class:"block"},Yy={class:"block"},Jy={class:"block"},Xy={class:"block"},Qy={class:"block"},t1=["value"],e1={class:"block"},n1=["value"],i1={class:"block"},s1=["value"],o1={class:"block"},r1={class:"mt-3 block"},a1={key:0,class:"mt-3 grid grid-cols-2 gap-3 max-[760px]:grid-cols-1"},l1={class:"block"},u1={class:"block"},c1={class:"block"},d1={class:"block"},f1={class:"col-span-2 block max-[760px]:col-span-1"},h1={class:"mt-4 flex items-center gap-3"},p1=["disabled"],m1={key:0,class:"text-sm text-danger-fg"},g1={class:"panel overflow-hidden p-0"},_1={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},v1={key:1,class:"grid place-items-center px-5 py-16 text-center"},y1={key:2,class:"overflow-x-auto"},b1={class:"w-full border-collapse text-sm"},x1={class:"text-left"},w1={class:"whitespace-nowrap px-5 py-3 font-mono text-ink"},k1={key:0,class:"text-ink-muted"},S1={class:"px-5 py-3 text-ink-secondary"},P1=["title"],T1={class:"px-5 py-3 font-mono text-ink-secondary"},L1={class:"px-5 py-3 text-ink-secondary"},C1={class:"px-5 py-3"},M1=["onClick"],O1={class:"whitespace-nowrap px-5 py-3 text-right"},E1=["onClick"],z1=["onClick"],A1=["onClick"],I1={key:0,class:"border-b border-line bg-surface-2"},$1={colspan:"7",class:"px-5 py-3"},D1={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},N1={class:"text-ink-secondary"},R1={class:"text-ink"},F1={class:"text-ink-secondary"},B1={class:"text-ink"},V1={class:"text-ink-secondary"},Z1={class:"font-mono text-ink"},U1={key:0,class:"text-ink-secondary"},H1={class:"text-ink"},j1={key:0,class:"mt-2 space-y-1"},W1={key:1,class:"mt-2 text-xs text-success-fg"},K1={key:0,class:"panel p-5"},G1={class:"mb-4 flex items-center justify-between"},q1={class:"eyebrow"},Y1={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},J1={class:"block"},X1={class:"block"},Q1={class:"block"},tb={class:"block"},eb={class:"block"},nb={class:"block"},ib=["value"],sb={class:"mt-3 flex flex-wrap gap-6"},ob={class:"flex items-center gap-2 text-sm text-ink-secondary"},rb={class:"flex items-center gap-2 text-sm text-ink-secondary"},ab={class:"mt-4 flex items-center gap-3"},lb=["disabled"],ub={key:0,class:"text-sm text-danger-fg"},cb={class:"panel overflow-hidden p-0"},db={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},fb={key:1,class:"grid place-items-center px-5 py-16 text-center"},hb={key:2,class:"overflow-x-auto"},pb={class:"w-full border-collapse text-sm"},mb={class:"text-left"},gb={class:"px-5 py-3 font-semibold text-ink"},_b={class:"px-5 py-3 text-ink-secondary"},vb={class:"px-5 py-3 font-mono text-ink-secondary"},yb={class:"px-5 py-3"},bb={key:1,class:"text-ink-muted"},xb={class:"px-5 py-3"},wb={class:"whitespace-nowrap px-5 py-3 text-right"},kb=["onClick"],Sb=["onClick"],Pb=["onClick"],Tb={__name:"Logbook",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},setup(e){const i=e,o={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},a=G("flights"),l=G([]),d=G([]),h=G(!1),_=G("");async function y(){h.value=!0,_.value="";const[j,C]=await Promise.all([ip(),ap()]);(!j.ok||!C.ok)&&(_.value=j.status===503||C.status===503?"Logbook storage is not configured on the API Server (service account missing).":"Could not load the logbook."),l.value=j.drones,d.value=C.flights,h.value=!1}Yi(y);function T(j){const C=j.compliance||{};return C.exempt?{tone:"neutral",label:"Exempt"}:(C.redFlags||[]).length?{tone:"danger",label:`${C.redFlags.length} issue${C.redFlags.length>1?"s":""}`}:{tone:"success",label:"Compliant"}}const w=G("");function A(j){w.value=w.value===j?"":j}const U=[{value:"open",label:"Open"},{value:"specific",label:"Specific"},{value:"certified",label:"Certified"}],V=[{value:"commercial",label:"Commercial"},{value:"research",label:"Research"},{value:"public",label:"Public-benefit"},{value:"hobby",label:"Private hobby"},{value:"club_area",label:"Model-club area"}],rt=[{value:"",label:"Auto (from drone)"},{value:"manual",label:"Manual"},{value:"automatic",label:"Automatic (FDR)"}];function Q(){var j;return{operationDate:new Date().toISOString().slice(0,10),startTime:"",endTime:"",drone:((j=l.value[0])==null?void 0:j.id)||"",areaRoute:"",maxAltitudeAgl:"",pilotName:i.email,certificateRef:"",category:"open",purpose:"commercial",loggingPath:"",rawFdrLogUrl:"",authorisationRef:"",weather:"",airspaceRef:"",observer:"",incidents:"",notes:""}}const Ot=G(!1),Mt=G(""),q=xe(Q()),dt=G(""),it=G(!1),ht=G(!1);function Kt(){Object.assign(q,Q()),Mt.value="",dt.value="",ht.value=!1,Ot.value=!0}function he(j){Object.assign(q,{operationDate:(j.operationDate||"").slice(0,10),startTime:j.startTime||"",endTime:j.endTime||"",drone:j.drone||"",areaRoute:j.areaRoute||"",maxAltitudeAgl:j.maxAltitudeAgl||"",pilotName:j.pilotName||"",certificateRef:j.certificateRef||"",category:j.category||"open",purpose:j.purpose||"commercial",loggingPath:j.loggingPath||"",rawFdrLogUrl:j.rawFdrLogUrl||"",authorisationRef:j.authorisationRef||"",weather:j.weather||"",airspaceRef:j.airspaceRef||"",observer:j.observer||"",incidents:j.incidents||"",notes:j.notes||""}),Mt.value=j.id,dt.value="",ht.value=!!(j.weather||j.airspaceRef||j.observer||j.incidents||j.notes),Ot.value=!0}function pe(){Ot.value=!1,Mt.value=""}async function St(){var E;if(dt.value="",!q.drone){dt.value="Select a drone first (add one on the Drones tab).";return}it.value=!0;const j={...q,maxAltitudeAgl:Number(q.maxAltitudeAgl)||0},C=Mt.value?await up(Mt.value,j):await lp(j);if(it.value=!1,!C.ok){dt.value=((E=C.body)==null?void 0:E.error)||"Could not save the flight.";return}Ot.value=!1,await y()}const Nt=G("");async function Et(j){const C=await cp(j.id);Nt.value="",C.ok&&await y()}const nt=["","C0","C1","C2","C3","C4","C5","C6"];function ut(){return{name:"",model:"",serial:"",operatorNumber:"",mtomGrams:"",isToy:!1,autologsFlights:!1,cClass:""}}const zt=G(!1),Ft=G(""),lt=xe(ut()),At=G(""),et=G(!1);function ce(){Object.assign(lt,ut()),Ft.value="",At.value="",zt.value=!0}function pt(j){Object.assign(lt,{name:j.name||"",model:j.model||"",serial:j.serial||"",operatorNumber:j.operatorNumber||"",mtomGrams:j.mtomGrams||"",isToy:!!j.isToy,autologsFlights:!!j.autologsFlights,cClass:j.cClass||""}),Ft.value=j.id,At.value="",zt.value=!0}function kt(){zt.value=!1,Ft.value=""}async function Yt(){var E;if(At.value="",!lt.name.trim()){At.value="Give the drone a name.";return}et.value=!0;const j={...lt,mtomGrams:Number(lt.mtomGrams)||0},C=Ft.value?await op(Ft.value,j):await sp(j);if(et.value=!1,!C.ok){At.value=((E=C.body)==null?void 0:E.error)||"Could not save the drone.";return}zt.value=!1,await y()}const ae=G("");async function Jt(j){var E;const C=await rp(j.id);ae.value="",C.ok?await y():At.value=((E=C.body)==null?void 0:E.error)||"Could not delete the drone."}const Bt=xt(()=>{const j=d.value.length,C=d.value.filter(_e=>{var se;return(((se=_e.compliance)==null?void 0:se.redFlags)||[]).length}).length,E=d.value.filter(_e=>{var se;return(se=_e.compliance)==null?void 0:se.required}).length;return{total:j,flagged:C,required:E,fleet:l.value.length}});return(j,C)=>(g(),x("div",Oy,[u("div",Ey,[u("div",zy,[(g(),x(ct,null,Wt([["flights","Flights"],["drones","Drones"]],E=>u("button",{key:E[0],class:Ct(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",a.value===E[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:_e=>a.value=E[0]},P(E[1]),11,Ay)),64))]),u("div",Iy,[u("a",{href:$t(dp)(),class:"btn-ghost inline-flex items-center gap-2",title:"Download a compliance CSV (Trafikstyrelsen / police disclosure)"},[O(Y,{name:"download",size:15}),C[29]||(C[29]=$(" Export CSV ",-1))],8,$y),a.value==="flights"?(g(),x("button",{key:0,class:"btn-accent inline-flex items-center gap-2",onClick:Kt},[O(Y,{name:"plus",size:15}),C[30]||(C[30]=$(" Log flight ",-1))])):(g(),x("button",{key:1,class:"btn-accent inline-flex items-center gap-2",onClick:ce},[O(Y,{name:"plus",size:15}),C[31]||(C[31]=$(" Add drone ",-1))]))])]),u("div",Dy,[(g(!0),x(ct,null,Wt([{label:"Flights logged",value:Bt.value.total,tone:"neutral"},{label:"Require logbook",value:Bt.value.required,tone:"neutral"},{label:"Compliance flags",value:Bt.value.flagged,tone:Bt.value.flagged?"danger":"success"},{label:"Registered drones",value:Bt.value.fleet,tone:"neutral"}],E=>(g(),x("div",{key:E.label,class:"panel p-5"},[u("div",Ny,P(E.label),1),u("div",{class:Ct(["mt-2 text-[30px] font-bold leading-none tracking-tightest",E.tone==="danger"?"text-danger-fg":E.tone==="success"?"text-success-fg":"text-ink"])},P(E.value),3)]))),128))]),_.value?(g(),x("div",Ry,P(_.value),1)):N("",!0),a.value==="flights"?(g(),x(ct,{key:1},[Ot.value?(g(),x("div",Fy,[u("div",By,[u("div",null,[u("div",Vy,P(Mt.value?"Edit entry":"New entry"),1),C[32]||(C[32]=u("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Logbook flight (BEK 1649 §5)",-1))]),u("button",{class:"btn-icon",onClick:pe},[O(Y,{name:"x",size:16})])]),u("div",Zy,[u("label",Uy,[C[33]||(C[33]=u("span",{class:"eyebrow mb-1 block"},"Date",-1)),ot(u("input",{"onUpdate:modelValue":C[0]||(C[0]=E=>q.operationDate=E),type:"date",class:"field"},null,512),[[vt,q.operationDate]])]),u("label",Hy,[C[34]||(C[34]=u("span",{class:"eyebrow mb-1 block"},"Start",-1)),ot(u("input",{"onUpdate:modelValue":C[1]||(C[1]=E=>q.startTime=E),type:"time",class:"field"},null,512),[[vt,q.startTime]])]),u("label",jy,[C[35]||(C[35]=u("span",{class:"eyebrow mb-1 block"},"End",-1)),ot(u("input",{"onUpdate:modelValue":C[2]||(C[2]=E=>q.endTime=E),type:"time",class:"field"},null,512),[[vt,q.endTime]])]),u("label",Wy,[C[36]||(C[36]=u("span",{class:"eyebrow mb-1 block"},"Drone",-1)),ot(u("select",{"onUpdate:modelValue":C[3]||(C[3]=E=>q.drone=E),class:"field"},[l.value.length?N("",!0):(g(),x("option",Ky,"— add a drone first —")),(g(!0),x(ct,null,Wt(l.value,E=>(g(),x("option",{key:E.id,value:E.id},P(E.name)+P(E.model?` · ${E.model}`:""),9,Gy))),128))],512),[[sn,q.drone]])]),u("label",qy,[C[37]||(C[37]=u("span",{class:"eyebrow mb-1 block"},"Max altitude (m AGL)",-1)),ot(u("input",{"onUpdate:modelValue":C[4]||(C[4]=E=>q.maxAltitudeAgl=E),type:"number",min:"0",class:"field",placeholder:"120"},null,512),[[vt,q.maxAltitudeAgl]])]),u("label",Yy,[C[38]||(C[38]=u("span",{class:"eyebrow mb-1 block"},"Area / route",-1)),ot(u("input",{"onUpdate:modelValue":C[5]||(C[5]=E=>q.areaRoute=E),class:"field",placeholder:"Field N of Roskilde, grid survey"},null,512),[[vt,q.areaRoute]])]),u("label",Jy,[C[39]||(C[39]=u("span",{class:"eyebrow mb-1 block"},"Remote pilot name",-1)),ot(u("input",{"onUpdate:modelValue":C[6]||(C[6]=E=>q.pilotName=E),class:"field",placeholder:"Full name"},null,512),[[vt,q.pilotName]])]),u("label",Xy,[C[40]||(C[40]=u("span",{class:"eyebrow mb-1 block"},"Certificate ref",-1)),ot(u("input",{"onUpdate:modelValue":C[7]||(C[7]=E=>q.certificateRef=E),class:"field",placeholder:"A2 / STS cert no."},null,512),[[vt,q.certificateRef]])]),u("label",Qy,[C[41]||(C[41]=u("span",{class:"eyebrow mb-1 block"},"Logging path",-1)),ot(u("select",{"onUpdate:modelValue":C[8]||(C[8]=E=>q.loggingPath=E),class:"field"},[(g(),x(ct,null,Wt(rt,E=>u("option",{key:E.value,value:E.value},P(E.label),9,t1)),64))],512),[[sn,q.loggingPath]])]),u("label",e1,[C[42]||(C[42]=u("span",{class:"eyebrow mb-1 block"},"Category",-1)),ot(u("select",{"onUpdate:modelValue":C[9]||(C[9]=E=>q.category=E),class:"field"},[(g(),x(ct,null,Wt(U,E=>u("option",{key:E.value,value:E.value},P(E.label),9,n1)),64))],512),[[sn,q.category]])]),u("label",i1,[C[43]||(C[43]=u("span",{class:"eyebrow mb-1 block"},"Purpose",-1)),ot(u("select",{"onUpdate:modelValue":C[10]||(C[10]=E=>q.purpose=E),class:"field"},[(g(),x(ct,null,Wt(V,E=>u("option",{key:E.value,value:E.value},P(E.label),9,s1)),64))],512),[[sn,q.purpose]])]),u("label",o1,[C[44]||(C[44]=u("span",{class:"eyebrow mb-1 block"},"Authorisation ref",-1)),ot(u("input",{"onUpdate:modelValue":C[11]||(C[11]=E=>q.authorisationRef=E),class:"field",placeholder:"Specific-category ref"},null,512),[[vt,q.authorisationRef]])])]),u("label",r1,[C[45]||(C[45]=u("span",{class:"eyebrow mb-1 block"},"FDR log URL (automatic path)",-1)),ot(u("input",{"onUpdate:modelValue":C[12]||(C[12]=E=>q.rawFdrLogUrl=E),class:"field",placeholder:"Link to the stored flight-data-recorder export"},null,512),[[vt,q.rawFdrLogUrl]])]),u("button",{class:"mt-4 flex items-center gap-1.5 text-sm font-semibold text-accent",onClick:C[13]||(C[13]=E=>ht.value=!ht.value)},[O(Y,{name:ht.value?"x":"plus",size:14},null,8,["name"]),C[46]||(C[46]=$(" Operational details (weather, airspace, incidents) ",-1))]),ht.value?(g(),x("div",a1,[u("label",l1,[C[47]||(C[47]=u("span",{class:"eyebrow mb-1 block"},"Weather / wind",-1)),ot(u("input",{"onUpdate:modelValue":C[14]||(C[14]=E=>q.weather=E),class:"field",placeholder:"6 m/s NW, CAVOK"},null,512),[[vt,q.weather]])]),u("label",u1,[C[48]||(C[48]=u("span",{class:"eyebrow mb-1 block"},"Airspace / NOTAM ref",-1)),ot(u("input",{"onUpdate:modelValue":C[15]||(C[15]=E=>q.airspaceRef=E),class:"field"},null,512),[[vt,q.airspaceRef]])]),u("label",c1,[C[49]||(C[49]=u("span",{class:"eyebrow mb-1 block"},"Observer",-1)),ot(u("input",{"onUpdate:modelValue":C[16]||(C[16]=E=>q.observer=E),class:"field"},null,512),[[vt,q.observer]])]),u("label",d1,[C[50]||(C[50]=u("span",{class:"eyebrow mb-1 block"},"Incidents / anomalies",-1)),ot(u("input",{"onUpdate:modelValue":C[17]||(C[17]=E=>q.incidents=E),class:"field",placeholder:"RTH trigger, GPS dropout…"},null,512),[[vt,q.incidents]])]),u("label",f1,[C[51]||(C[51]=u("span",{class:"eyebrow mb-1 block"},"Notes",-1)),ot(u("textarea",{"onUpdate:modelValue":C[18]||(C[18]=E=>q.notes=E),rows:"2",class:"field"},null,512),[[vt,q.notes]])])])):N("",!0),u("div",h1,[u("button",{class:"btn-accent",disabled:it.value,onClick:St},P(it.value?"Saving…":Mt.value?"Save changes":"Log flight"),9,p1),u("button",{class:"btn-ghost",onClick:pe},"Cancel"),dt.value?(g(),x("span",m1,P(dt.value),1)):N("",!0)])])):N("",!0),u("div",g1,[h.value?(g(),x("div",_1,"Loading…")):d.value.length?(g(),x("div",y1,[u("table",b1,[u("thead",null,[u("tr",x1,[(g(),x(ct,null,Wt(["Date","Drone","Area / route","Alt","Pilot","Compliance",""],E=>u("th",{key:E,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},P(E),1)),64))])]),u("tbody",null,[(g(!0),x(ct,null,Wt(d.value,E=>{var _e,se,Ge,v;return g(),x(ct,{key:E.id},[u("tr",{class:Ct(["border-b border-line last:border-0",Mt.value===E.id?"bg-accent-soft":""])},[u("td",w1,[$(P((E.operationDate||"").slice(0,10))+" ",1),E.startTime?(g(),x("span",k1,P(E.startTime),1)):N("",!0)]),u("td",S1,P(E.droneName||"—"),1),u("td",{class:"max-w-[220px] truncate px-5 py-3 text-ink-secondary",title:E.areaRoute},P(E.areaRoute||"—"),9,P1),u("td",T1,P(E.maxAltitudeAgl?E.maxAltitudeAgl+" m":"—"),1),u("td",L1,P(E.pilotName||"—"),1),u("td",C1,[u("button",{class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",o[T(E).tone]]),onClick:m=>A(E.id)},[T(E).tone==="danger"?(g(),ie(Y,{key:0,name:"alertTriangle",size:12})):T(E).tone==="success"?(g(),ie(Y,{key:1,name:"check",size:12})):N("",!0),$(" "+P(T(E).label),1)],10,M1)]),u("td",O1,[Nt.value===E.id?(g(),x(ct,{key:0},[C[54]||(C[54]=u("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),u("button",{class:"btn-ghost mr-1",onClick:C[19]||(C[19]=m=>Nt.value="")},"Cancel"),u("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:m=>Et(E)},"Delete",8,E1)],64)):(g(),x(ct,{key:1},[u("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:m=>he(E)},[O(Y,{name:"sliders",size:13}),C[55]||(C[55]=$(" Edit",-1))],8,z1),u("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:m=>Nt.value=E.id},[O(Y,{name:"trash",size:13})],8,A1)],64))])],2),w.value===E.id?(g(),x("tr",I1,[u("td",$1,[u("div",D1,[u("span",N1,[C[56]||(C[56]=$("Logging path: ",-1)),u("b",R1,P(((_e=E.compliance)==null?void 0:_e.loggingPath)||"—"),1)]),u("span",F1,[C[57]||(C[57]=$("Category: ",-1)),u("b",B1,P(E.category||"—"),1)]),u("span",V1,[C[58]||(C[58]=$("Retain until: ",-1)),u("b",Z1,P((E.retentionUntil||"").slice(0,10)||"—"),1)]),(se=E.compliance)!=null&&se.exempt?(g(),x("span",U1,[C[59]||(C[59]=$("Exempt: ",-1)),u("b",H1,P(E.compliance.exemptReason),1)])):N("",!0)]),(((Ge=E.compliance)==null?void 0:Ge.redFlags)||[]).length?(g(),x("ul",j1,[(g(!0),x(ct,null,Wt(E.compliance.redFlags,(m,M)=>(g(),x("li",{key:M,class:"flex items-start gap-2 text-xs text-danger-fg"},[O(Y,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),$(" "+P(m),1)]))),128))])):(v=E.compliance)!=null&&v.exempt?N("",!0):(g(),x("div",W1,"No compliance gaps detected."))])])):N("",!0)],64)}),128))])])])):(g(),x("div",v1,[O(Y,{name:"book",size:26,class:"text-ink-muted"}),C[52]||(C[52]=u("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No flights logged yet",-1)),C[53]||(C[53]=u("div",{class:"mt-1 text-xs text-ink-muted"},"Log your first operation to start the 5-year retention record.",-1))]))])],64)):(g(),x(ct,{key:2},[zt.value?(g(),x("div",K1,[u("div",G1,[u("div",null,[u("div",q1,P(Ft.value?"Edit drone":"New drone"),1),C[60]||(C[60]=u("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft registry",-1))]),u("button",{class:"btn-icon",onClick:kt},[O(Y,{name:"x",size:16})])]),u("div",Y1,[u("label",J1,[C[61]||(C[61]=u("span",{class:"eyebrow mb-1 block"},"Name",-1)),ot(u("input",{"onUpdate:modelValue":C[20]||(C[20]=E=>lt.name=E),class:"field",placeholder:"Mavic-01"},null,512),[[vt,lt.name]])]),u("label",X1,[C[62]||(C[62]=u("span",{class:"eyebrow mb-1 block"},"Model",-1)),ot(u("input",{"onUpdate:modelValue":C[21]||(C[21]=E=>lt.model=E),class:"field",placeholder:"DJI Mavic 3 Enterprise"},null,512),[[vt,lt.model]])]),u("label",Q1,[C[63]||(C[63]=u("span",{class:"eyebrow mb-1 block"},"Serial",-1)),ot(u("input",{"onUpdate:modelValue":C[22]||(C[22]=E=>lt.serial=E),class:"field"},null,512),[[vt,lt.serial]])]),u("label",tb,[C[64]||(C[64]=u("span",{class:"eyebrow mb-1 block"},"Operator no.",-1)),ot(u("input",{"onUpdate:modelValue":C[23]||(C[23]=E=>lt.operatorNumber=E),class:"field",placeholder:"DNK…"},null,512),[[vt,lt.operatorNumber]])]),u("label",eb,[C[65]||(C[65]=u("span",{class:"eyebrow mb-1 block"},"MTOM (grams)",-1)),ot(u("input",{"onUpdate:modelValue":C[24]||(C[24]=E=>lt.mtomGrams=E),type:"number",min:"0",class:"field",placeholder:"920"},null,512),[[vt,lt.mtomGrams]])]),u("label",nb,[C[66]||(C[66]=u("span",{class:"eyebrow mb-1 block"},"C-class",-1)),ot(u("select",{"onUpdate:modelValue":C[25]||(C[25]=E=>lt.cClass=E),class:"field"},[(g(),x(ct,null,Wt(nt,E=>u("option",{key:E,value:E},P(E||"— none —"),9,ib)),64))],512),[[sn,lt.cClass]])])]),u("div",sb,[u("label",ob,[ot(u("input",{"onUpdate:modelValue":C[26]||(C[26]=E=>lt.autologsFlights=E),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[rr,lt.autologsFlights]]),C[67]||(C[67]=$(" Auto-logs flights (onboard FDR) ",-1))]),u("label",rb,[ot(u("input",{"onUpdate:modelValue":C[27]||(C[27]=E=>lt.isToy=E),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[rr,lt.isToy]]),C[68]||(C[68]=$(" Toy drone (logbook-exempt) ",-1))])]),u("div",ab,[u("button",{class:"btn-accent",disabled:et.value,onClick:Yt},P(et.value?"Saving…":Ft.value?"Save changes":"Add drone"),9,lb),u("button",{class:"btn-ghost",onClick:kt},"Cancel"),At.value?(g(),x("span",ub,P(At.value),1)):N("",!0)])])):N("",!0),u("div",cb,[h.value?(g(),x("div",db,"Loading…")):l.value.length?(g(),x("div",hb,[u("table",pb,[u("thead",null,[u("tr",mb,[(g(),x(ct,null,Wt(["Name","Model","MTOM","Class","FDR",""],E=>u("th",{key:E,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},P(E),1)),64))])]),u("tbody",null,[(g(!0),x(ct,null,Wt(l.value,E=>(g(),x("tr",{key:E.id,class:Ct(["border-b border-line last:border-0",Ft.value===E.id?"bg-accent-soft":""])},[u("td",gb,P(E.name),1),u("td",_b,P(E.model||"—"),1),u("td",vb,P(E.mtomGrams?E.mtomGrams+" g":"—"),1),u("td",yb,[E.cClass?(g(),x("span",{key:0,class:Ct(["inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.accent])},P(E.cClass),3)):(g(),x("span",bb,"—")),E.isToy?(g(),x("span",{key:2,class:Ct(["ml-1 inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",o.neutral])},"toy",2)):N("",!0)]),u("td",xb,[u("span",{class:Ct(["text-xs",E.autologsFlights?"text-success-fg":"text-ink-muted"])},P(E.autologsFlights?"yes":"no"),3)]),u("td",wb,[ae.value===E.id?(g(),x(ct,{key:0},[C[71]||(C[71]=u("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),u("button",{class:"btn-ghost mr-1",onClick:C[28]||(C[28]=_e=>ae.value="")},"Cancel"),u("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:_e=>Jt(E)},"Delete",8,kb)],64)):(g(),x(ct,{key:1},[u("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:_e=>pt(E)},[O(Y,{name:"sliders",size:13}),C[72]||(C[72]=$(" Edit",-1))],8,Sb),u("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:_e=>ae.value=E.id},[O(Y,{name:"trash",size:13})],8,Pb)],64))])],2))),128))])])])):(g(),x("div",fb,[O(Y,{name:"drone",size:26,class:"text-ink-muted"}),C[69]||(C[69]=u("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No drones registered",-1)),C[70]||(C[70]=u("div",{class:"mt-1 text-xs text-ink-muted"},"Register the airframes you fly to log flights against them.",-1))]))])],64))]))}},Lb={class:"grid h-full grid-cols-[248px_1fr] max-[900px]:grid-cols-1"},Cb={class:"flex flex-col border-r border-line bg-surface-1 px-4 py-5 max-[900px]:hidden"},Mb={class:"flex items-center gap-2.5 px-2 pb-5"},Ob={class:"flex flex-col gap-0.5"},Eb=["onClick"],zb={class:"mt-auto flex flex-col gap-2.5"},Ab={class:"rounded-lg bg-surface-2 p-3"},Ib={class:"flex items-center gap-2"},$b={class:"text-xs font-semibold text-ink"},Db={class:"mt-1.5 block font-mono text-[10.5px] text-ink-muted"},Nb={class:"flex items-center gap-2.5 px-2 py-1"},Rb={class:"grid h-8 w-8 place-items-center rounded-full bg-[var(--navy-800)] text-xs font-bold text-white"},Fb={class:"min-w-0 flex-1"},Bb={class:"truncate text-[13px] font-semibold text-ink"},Vb={class:"flex items-center gap-1.5 text-[11px] text-ink-muted"},Zb=["title"],Ub={class:"overflow-y-auto"},Hb={class:"sticky top-0 z-10 flex items-center gap-4 border-b border-line px-7 py-3.5",style:{background:"color-mix(in srgb, var(--bg-app) 82%, transparent)","backdrop-filter":"blur(10px)"}},jb={class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},Wb={class:"ml-auto flex items-center gap-3"},Kb={class:"flex h-10 w-60 items-center gap-2 rounded border border-line-strong bg-surface-1 px-3 max-[1100px]:hidden"},Gb={key:0,class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},qb={class:"grid grid-cols-4 gap-4 max-[1100px]:grid-cols-2 max-[560px]:grid-cols-1"},Yb={class:"flex items-center justify-between"},Jb={class:"eyebrow"},Xb={class:"mt-2.5 text-[34px] font-bold leading-none tracking-tightest text-ink"},Qb={class:"grid grid-cols-[1.6fr_1fr] gap-5 max-[1100px]:grid-cols-1"},tx={class:"panel p-5"},ex={class:"mb-3.5 flex items-center justify-between"},nx={class:"panel p-5"},ix={class:"mb-3.5 flex items-center justify-between"},sx={class:"grid place-items-center py-10 text-center"},ox={class:"panel overflow-hidden p-0"},rx={class:"flex items-center justify-between px-5 py-4"},ax={class:"flex gap-2"},lx={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},ux={key:1,class:"overflow-x-auto"},cx={class:"w-full border-collapse text-sm"},dx={class:"text-left"},fx=["onClick"],hx={class:"px-5 py-3 font-mono font-bold text-ink"},px={class:"px-5 py-3 text-ink-secondary"},mx={class:"px-5 py-3"},gx={class:"px-5 py-3 font-mono text-ink-secondary"},_x={class:"px-5 py-3"},vx={key:0,class:"flex items-center gap-2"},yx={class:"h-1.5 w-12 overflow-hidden rounded bg-surface-2"},bx={class:"font-mono text-xs text-ink-secondary"},xx={key:1,class:"font-mono text-xs text-ink-muted"},wx={class:"px-5 py-3 font-mono text-ink-secondary"},kx={class:"px-5 py-3 text-right"},Sx=["onClick"],Px={key:1,class:"p-7"},Tx={class:"mb-4 flex flex-wrap items-center gap-3"},Lx={class:"font-mono text-mode font-bold text-ink"},Cx={key:0,class:"rounded-full bg-danger-soft px-2.5 py-0.5 font-mono text-[10px] font-bold uppercase tracking-caps text-danger-fg"},Mx={key:1,class:"ml-auto flex flex-wrap gap-1.5"},Ox=["onClick"],Ex={key:0,class:"panel grid place-items-center p-16 text-center"},zx={class:"pill"},Ax={class:"pill"},Ix={class:"pill"},$x={class:"mt-1 text-sm font-semibold text-ink"},Dx={class:"pill"},Nx={class:"mt-1 font-mono text-sm font-bold tabular text-ink"},Rx={class:"grid grid-cols-2 gap-4 max-[820px]:grid-cols-1"},Fx={class:"panel p-4"},Bx={class:"flex items-center gap-4"},Vx={class:"h-9 flex-1 overflow-hidden rounded border border-line bg-surface-2"},Zx={class:"readout"},Ux={class:"panel p-4"},Hx={class:"readout"},jx={class:"panel p-4"},Wx={class:"space-y-1.5 text-sm"},Kx={class:"flex justify-between"},Gx={class:"text-ink"},qx={class:"flex justify-between"},Yx={class:"text-ink"},Jx={class:"flex justify-between"},Xx={class:"font-mono tabular text-ink"},Qx={class:"flex justify-between"},t0={class:"font-mono tabular text-ink"},e0={class:"panel p-4"},n0={class:"space-y-1.5 text-sm"},i0={class:"flex justify-between"},s0={class:"font-mono tabular text-ink"},o0={class:"flex justify-between"},r0={class:"font-mono tabular text-ink"},a0={class:"flex justify-between"},l0={class:"font-mono tabular text-ink"},u0={class:"panel col-span-2 p-4 max-[820px]:col-span-1"},c0={class:"panel p-4"},d0={class:"flex flex-wrap gap-2"},f0={class:"mt-2 min-h-[16px] text-xs text-ink-muted"},h0={class:"panel p-4"},p0={class:"h-[180px] overflow-y-auto font-mono text-xs"},m0={class:"text-ink-muted"},g0={class:"font-semibold text-accent"},_0={class:"break-all text-ink"},v0={key:4,class:"p-7"},y0={class:"panel grid place-items-center p-16 text-center"},b0={class:"mt-3 text-sm font-medium text-ink-secondary"},x0={key:0,class:"mt-1 text-xs text-ink-muted"},w0={key:1,class:"mt-1 text-xs text-ink-muted"},k0={__name:"Dashboard",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(e,{emit:i}){const o=e,a=i,l=xe({}),d=xe({}),h=G(null),_=G(!1),y=xe([]),T=G(""),w=G("Overview"),A=[["grid","Overview"],["radio","Live flights"],["route","Routes"],["calendar","Schedule"],["book","Logbook"],["fileText","Documents"],["server","Drives"],["settings","Settings"]],U=xt(()=>(A.find(([,v])=>v===w.value)||["grid"])[0]),V=G(""),rt=G(""),Q=G("");let Ot=null,Mt=null,q=!1;const dt=xt(()=>Object.keys(l).sort((v,m)=>(l[m].online?1:0)-(l[v].online?1:0)||v.localeCompare(m))),it=xt(()=>h.value?l[h.value]:null),ht=xt(()=>it.value&&it.value.telemetry||{}),Kt=xt(()=>!!(it.value&&it.value.online)),he=xt(()=>{const v=ht.value;return typeof v.latitude=="number"&&typeof v.longitude=="number"&&(v.latitude||v.longitude)?{lat:v.latitude,lng:v.longitude}:null}),pe=xt(()=>h.value&&d[h.value]||[]),St=xt(()=>{const v=ht.value;return typeof v.velocityX=="number"&&typeof v.velocityY=="number"?Math.hypot(v.velocityX,v.velocityY):null});function Nt(v){return v.online?v.connected?["In flight","success"]:["Standby","accent"]:["Offline","neutral"]}function Et(v){const m=v&&v.telemetry||{};return typeof m.velocityX=="number"&&typeof m.velocityY=="number"?Math.hypot(m.velocityX,m.velocityY):null}const nt=xt(()=>dt.value.map(v=>{const m=l[v],M=m.telemetry||{},[F,R]=Nt(m);return{id:v,mission:m.model||(m.connected?"Drone linked":m.online?"App online":"No signal"),status:F,tone:R,alt:typeof M.altitude=="number"?M.altitude.toFixed(0)+" m":"—",battery:typeof M.batteryPercent=="number"?M.batteryPercent:null,speed:Et(m)}})),ut=xt(()=>dt.value.filter(v=>l[v].online).length),zt=xt(()=>dt.value.filter(v=>l[v].online&&l[v].connected).length),Ft=xt(()=>dt.value.filter(v=>!l[v].online).length),lt=xt(()=>{const v=dt.value.map(m=>{var M;return(M=l[m].telemetry)==null?void 0:M.batteryPercent}).filter(m=>typeof m=="number");return v.length?Math.round(v.reduce((m,M)=>m+M,0)/v.length):null}),At=xt(()=>[{label:"Active flights",value:String(zt.value),delta:`${ut.value} online`,tone:"success",icon:"radio"},{label:"Avg battery",value:lt.value==null?"—":lt.value+"%",delta:lt.value==null?"no telemetry":lt.value<40?"low — watch":"nominal",tone:lt.value!=null&&lt.value<40?"danger":"neutral",icon:"battery"},{label:"Fleet size",value:String(dt.value.length),delta:`${zt.value} in flight`,tone:"neutral",icon:"grid"},{label:"Offline",value:String(Ft.value),delta:Ft.value?"needs attention":"all reachable",tone:Ft.value?"warning":"success",icon:"signal"}]),et={success:"bg-success-soft text-success-fg",warning:"bg-amber-soft text-amber-fg",danger:"bg-danger-soft text-danger-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},ce={success:"text-success-fg",danger:"text-danger-fg",warning:"text-amber-fg",neutral:"text-ink-muted",accent:"text-accent-soft-fg"},pt=xt(()=>{var M,F,R;const m=(o.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((M=m[0])==null?void 0:M[0])||"P")+(((F=m[1])==null?void 0:F[0])||((R=m[0])==null?void 0:R[1])||"V")).toUpperCase()}),kt={superadmin:"Superadmin",admin:"Admin",user:"Operator"},Yt=xt(()=>kt[o.role]||"Operator"),ae=xt(()=>o.organizationName||(o.role==="superadmin"?"All organizations":"No organization"));function Jt(v){var M;l[v.deviceId]=v;const m=v.telemetry||{};typeof m.latitude=="number"&&typeof m.longitude=="number"&&(m.latitude||m.longitude)&&(d[v.deviceId]||(d[v.deviceId]=[]),d[v.deviceId].push([m.latitude,m.longitude]),d[v.deviceId].length>1e3&&d[v.deviceId].shift()),(!h.value||v.online&&!((M=l[h.value])!=null&&M.online))&&(h.value=v.deviceId)}function Bt(v){delete l[v],delete d[v],h.value===v&&(h.value=dt.value[0]||null)}function j(v){y.unshift({t:ql(Date.now()),tag:v.type||"?",text:JSON.stringify(C(v))}),y.length>200&&y.pop()}function C(v){const m={...v};return delete m.type,m}function E(){const v=location.protocol==="https:"?"wss":"ws";Ot=new WebSocket(`${v}://${location.host}/bff/ws`),Ot.onopen=()=>_.value=!0,Ot.onclose=()=>{_.value=!1,q||(Mt=setTimeout(E,1500))},Ot.onerror=()=>Ot&&Ot.close(),Ot.onmessage=m=>{let M;try{M=JSON.parse(m.data)}catch{return}M.type==="snapshot"?(M.devices||[]).forEach(Jt):M.type==="update"&&M.device?(Jt(M.device),M.event&&M.device.deviceId===h.value&&j(M.event)):M.type==="removed"&&M.deviceId&&Bt(M.deviceId)}}async function _e(){if(!h.value)return Q.value="No device selected.";if(!V.value.trim())return Q.value="Enter a command name.";let v;if(rt.value.trim())try{v=JSON.parse(rt.value)}catch{return Q.value="Payload is not valid JSON."}const{ok:m,body:M}=await fp(h.value,V.value.trim(),v);Q.value=m?`Sent "${V.value.trim()}".`:`Error: ${M.error||"failed"}`}function se(v,m,M=""){return typeof v=="number"?v.toFixed(m)+M:"—"}function Ge(v){h.value=v,w.value="Live flights"}return Yi(async()=>{(await Rh()).forEach(Jt),E()}),vr(()=>{q=!0,Mt&&clearTimeout(Mt),Ot&&Ot.close()}),(v,m)=>{var M,F,R,B,J;return g(),x("div",Lb,[u("aside",Cb,[u("div",Mb,[O(Cc,{size:26}),m[7]||(m[7]=u("span",{class:"text-[19px] tracking-tightest"},[u("span",{class:"font-medium text-ink-secondary"},"Pilot"),u("span",{class:"font-bold text-ink"},"Vault")],-1))]),u("nav",Ob,[(g(),x(ct,null,Wt(A,([D,K])=>u("button",{key:K,class:Ct(["flex items-center gap-3 rounded px-3 py-2.5 text-left text-sm transition",w.value===K?"bg-accent-soft font-semibold text-accent-soft-fg":"font-medium text-ink-secondary hover:bg-surface-2"]),onClick:Z=>w.value=K},[O(Y,{name:D,size:18,stroke:w.value===K?2.2:1.8},null,8,["name","stroke"]),$(" "+P(K),1)],10,Eb)),64))]),u("div",zb,[u("div",Ab,[u("div",Ib,[u("span",{class:Ct(["h-2 w-2 rounded-full",_.value?"bg-ready":"bg-caution"])},null,2),u("span",$b,P(_.value?"Link healthy":"Reconnecting…"),1)]),u("span",Db,"API gateway · "+P(_.value?"streaming":"retrying"),1)]),u("div",Nb,[u("div",Rb,P(pt.value),1),u("div",Fb,[u("div",Bb,P(e.email||"Operator"),1),u("div",Vb,[O(Y,{name:"grid",size:11,class:"shrink-0"}),u("span",{class:"truncate",title:`${Yt.value} · ${ae.value}`},P(Yt.value)+" · "+P(ae.value),9,Zb)])]),u("button",{class:"text-ink-muted transition hover:text-ink",title:"Log out","aria-label":"Log out",onClick:m[0]||(m[0]=D=>a("logout"))},[O(Y,{name:"logout",size:16})])])])]),u("main",Ub,[u("header",Hb,[u("div",null,[m[8]||(m[8]=u("div",{class:"eyebrow"},"Live operations",-1)),u("h1",jb,P(w.value),1)]),u("div",Wb,[u("div",Kb,[O(Y,{name:"search",size:16,class:"text-ink-muted"}),ot(u("input",{"onUpdate:modelValue":m[1]||(m[1]=D=>T.value=D),placeholder:"Search drones, routes…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[vt,T.value]])]),u("button",{class:"btn-accent flex items-center gap-2",onClick:m[2]||(m[2]=D=>w.value="Live flights")},[O(Y,{name:"radio",size:16}),m[9]||(m[9]=$(" Live flights ",-1))])])]),w.value==="Overview"?(g(),x("div",Gb,[u("div",qb,[(g(!0),x(ct,null,Wt(At.value,D=>(g(),x("div",{key:D.label,class:"panel p-5"},[u("div",Yb,[u("span",Jb,P(D.label),1),O(Y,{name:D.icon,size:16,class:"text-ink-muted"},null,8,["name"])]),u("div",Xb,P(D.value),1),u("span",{class:Ct(["mt-2 block font-mono text-[11px]",ce[D.tone]])},P(D.delta),3)]))),128))]),u("div",Qb,[u("div",tx,[u("div",ex,[m[11]||(m[11]=u("div",null,[u("div",{class:"eyebrow"},"Airspace"),u("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Live map")],-1)),zt.value?(g(),x("span",{key:0,class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",et.success])},[m[10]||(m[10]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P(zt.value)+" airborne ",1)],2)):N("",!0)]),O(Ql,{position:he.value,trail:pe.value},null,8,["position","trail"])]),u("div",nx,[u("div",ix,[m[12]||(m[12]=u("div",null,[u("div",{class:"eyebrow"},"Today"),u("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Schedule")],-1)),O(Y,{name:"clock",size:16,class:"text-ink-muted"})]),u("div",sx,[O(Y,{name:"calendar",size:24,class:"text-ink-muted"}),m[13]||(m[13]=u("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"No missions scheduled",-1)),m[14]||(m[14]=u("div",{class:"mt-0.5 text-xs text-ink-muted"},"Scheduling is not wired to a backend yet.",-1))])])]),u("div",ox,[u("div",rx,[m[17]||(m[17]=u("div",null,[u("div",{class:"eyebrow"},"Fleet"),u("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft status")],-1)),u("div",ax,[u("span",{class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",et.success])},[m[15]||(m[15]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P(zt.value)+" in flight ",1)],2),Ft.value?(g(),x("span",{key:0,class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",et.warning])},[m[16]||(m[16]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P(Ft.value)+" offline ",1)],2)):N("",!0)])]),nt.value.length?(g(),x("div",ux,[u("table",cx,[u("thead",null,[u("tr",dx,[(g(),x(ct,null,Wt(["Aircraft","Mission","Status","Alt","Battery","Speed",""],D=>u("th",{key:D,class:"border-y border-line bg-surface-2 px-5 py-2.5 font-mono text-[10.5px] font-normal uppercase tracking-caps text-ink-muted"},P(D),1)),64))])]),u("tbody",null,[(g(!0),x(ct,null,Wt(nt.value,(D,K)=>(g(),x("tr",{key:D.id,class:Ct(["cursor-pointer transition hover:bg-surface-2",K<nt.value.length-1?"border-b border-line":""]),onClick:Z=>Ge(D.id)},[u("td",hx,P(D.id),1),u("td",px,P(D.mission),1),u("td",mx,[u("span",{class:Ct(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",et[D.tone]])},[m[18]||(m[18]=u("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(P(D.status),1)],2)]),u("td",gx,P(D.alt),1),u("td",_x,[D.battery!=null?(g(),x("div",vx,[u("div",yx,[u("div",{class:Ct(["h-full",D.battery<40?"bg-caution":"bg-ready"]),style:Ss({width:D.battery+"%"})},null,6)]),u("span",bx,P(D.battery)+"%",1)])):(g(),x("span",xx,"—"))]),u("td",wx,[$(P(D.speed==null?"—":D.speed.toFixed(1))+" ",1),m[19]||(m[19]=u("span",{class:"text-ink-muted"},"m/s",-1))]),u("td",kx,[u("button",{class:"btn-ghost inline-flex items-center gap-1.5 whitespace-nowrap",onClick:yc(Z=>Ge(D.id),["stop"])},[O(Y,{name:"play",size:14}),m[20]||(m[20]=$(" Track ",-1))],8,Sx)])],10,fx))),128))])])])):(g(),x("div",lx," No aircraft connected yet. Devices appear here as they come online. "))])])):w.value==="Live flights"?(g(),x("div",Px,[u("div",Tx,[u("span",Lx,P(h.value||"No device selected"),1),it.value&&!Kt.value?(g(),x("span",Cx,"Offline")):N("",!0),dt.value.length?(g(),x("div",Mx,[(g(!0),x(ct,null,Wt(dt.value,D=>(g(),x("button",{key:D,class:Ct(["flex items-center gap-2 rounded border px-3 py-1.5 font-mono text-xs font-bold transition",D===h.value?"border-accent bg-accent-soft text-accent-soft-fg":"border-line bg-surface-1 text-ink-secondary hover:border-line-strong"]),onClick:K=>h.value=D},[u("span",{class:Ct(["h-2 w-2 rounded-full",l[D].online?"bg-ready":"bg-ink-muted"])},null,2),$(" "+P(D),1)],10,Ox))),128))])):N("",!0)]),dt.value.length?(g(),x(ct,{key:1},[u("div",{class:Ct(["mb-4 grid gap-3",!Kt.value&&it.value?"opacity-60":""]),style:{"grid-template-columns":"repeat(auto-fit, minmax(150px, 1fr))"}},[u("div",zx,[m[23]||(m[23]=u("div",{class:"eyebrow"},"Registration",-1)),u("div",{class:Ct(["mt-1 text-sm font-semibold",Kt.value?((M=it.value)==null?void 0:M.registration)==="success"?"text-success-fg":"text-danger-fg":"text-ink"])},P(Kt.value&&((F=it.value)!=null&&F.registration)?it.value.registration:"—"),3)]),u("div",Ax,[m[24]||(m[24]=u("div",{class:"eyebrow"},"Drone link",-1)),u("div",{class:Ct(["mt-1 text-sm font-semibold",Kt.value?(R=it.value)!=null&&R.connected?"text-success-fg":"text-danger-fg":"text-ink"])},P(it.value?Kt.value?it.value.connected?"connected":"no drone":"app offline":"—"),3)]),u("div",Ix,[m[25]||(m[25]=u("div",{class:"eyebrow"},"Model",-1)),u("div",$x,P(((B=it.value)==null?void 0:B.model)||"—"),1)]),u("div",Dx,[m[26]||(m[26]=u("div",{class:"eyebrow"},"Last update",-1)),u("div",Nx,P((J=it.value)!=null&&J.lastSeenMs?$t(ql)(it.value.lastSeenMs):"—"),1)])],2),u("div",Rx,[u("div",Fx,[m[28]||(m[28]=u("div",{class:"mb-3 eyebrow"},"Battery",-1)),u("div",Bx,[u("div",Vx,[u("div",{class:Ct(["h-full transition-all",typeof ht.value.batteryPercent=="number"?ht.value.batteryPercent<20?"bg-warning":ht.value.batteryPercent<40?"bg-caution":"bg-ready":""]),style:Ss({width:(typeof ht.value.batteryPercent=="number"?ht.value.batteryPercent:0)+"%"})},null,6)]),u("div",Zx,[$(P(typeof ht.value.batteryPercent=="number"?ht.value.batteryPercent:"—"),1),m[27]||(m[27]=u("span",{class:"text-sm text-ink-secondary"},"%",-1))])])]),u("div",Ux,[m[30]||(m[30]=u("div",{class:"mb-3 eyebrow"},"Altitude",-1)),u("div",Hx,[$(P(se(ht.value.altitude,1)),1),m[29]||(m[29]=u("span",{class:"text-sm text-ink-secondary"}," m",-1))])]),u("div",jx,[m[35]||(m[35]=u("div",{class:"mb-3 eyebrow"},"Flight",-1)),u("div",Wx,[u("div",Kx,[m[31]||(m[31]=u("span",{class:"text-ink-secondary"},"Mode",-1)),u("b",Gx,P(ht.value.flightMode||"—"),1)]),u("div",qx,[m[32]||(m[32]=u("span",{class:"text-ink-secondary"},"Flying",-1)),u("b",Yx,P(ht.value.isFlying==null?"—":ht.value.isFlying?"yes":"no"),1)]),u("div",Jx,[m[33]||(m[33]=u("span",{class:"text-ink-secondary"},"GPS sats",-1)),u("b",Xx,P(ht.value.satelliteCount==null?"—":ht.value.satelliteCount),1)]),u("div",Qx,[m[34]||(m[34]=u("span",{class:"text-ink-secondary"},"Speed (H)",-1)),u("b",t0,P(St.value==null?"—":se(St.value,2," m/s")),1)])])]),u("div",e0,[m[39]||(m[39]=u("div",{class:"mb-3 eyebrow"},"Position",-1)),u("div",n0,[u("div",i0,[m[36]||(m[36]=u("span",{class:"text-ink-secondary"},"Latitude",-1)),u("b",s0,P(se(ht.value.latitude,6)),1)]),u("div",o0,[m[37]||(m[37]=u("span",{class:"text-ink-secondary"},"Longitude",-1)),u("b",r0,P(se(ht.value.longitude,6)),1)]),u("div",a0,[m[38]||(m[38]=u("span",{class:"text-ink-secondary"},"Vert. speed",-1)),u("b",l0,P(se(typeof ht.value.velocityZ=="number"?-ht.value.velocityZ:void 0,2," m/s")),1)])])]),u("div",u0,[m[40]||(m[40]=u("div",{class:"mb-3 eyebrow"},"Track",-1)),O(Ql,{position:he.value,trail:pe.value},null,8,["position","trail"])]),u("div",c0,[m[41]||(m[41]=u("div",{class:"mb-3 eyebrow"},"Send command",-1)),u("div",d0,[ot(u("input",{"onUpdate:modelValue":m[3]||(m[3]=D=>V.value=D),class:"field flex-1",placeholder:"command (e.g. startConnection)"},null,512),[[vt,V.value]]),ot(u("input",{"onUpdate:modelValue":m[4]||(m[4]=D=>rt.value=D),class:"field flex-1",placeholder:"payload JSON (optional)"},null,512),[[vt,rt.value]]),u("button",{class:"btn-accent",onClick:_e},"Send")]),u("div",f0,P(Q.value),1)]),u("div",h0,[m[42]||(m[42]=u("div",{class:"mb-3 eyebrow"},"Event log",-1)),u("div",p0,[(g(!0),x(ct,null,Wt(y,(D,K)=>(g(),x("div",{key:K,class:"border-b border-line py-1"},[u("span",m0,P(D.t),1),u("span",g0,P(D.tag),1),u("span",_0,P(D.text),1)]))),128))])])])],64)):(g(),x("div",Ex,[O(Y,{name:"radio",size:28,class:"text-ink-muted"}),m[21]||(m[21]=u("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No aircraft online",-1)),m[22]||(m[22]=u("div",{class:"mt-1 text-xs text-ink-muted"},"Live telemetry appears here once a drone connects.",-1))]))])):w.value==="Logbook"?(g(),ie(Tb,{key:2,email:e.email,role:e.role,organization:e.organization,"organization-name":e.organizationName},null,8,["email","role","organization","organization-name"])):w.value==="Settings"?(g(),ie(My,{key:3,email:e.email,role:e.role,organization:e.organization,"organization-name":e.organizationName,onLogout:m[5]||(m[5]=D=>a("logout"))},null,8,["email","role","organization","organization-name"])):(g(),x("div",v0,[u("div",y0,[O(Y,{name:U.value,size:28,class:"text-ink-muted"},null,8,["name"]),u("div",b0,P(w.value),1),w.value==="Drives"?(g(),x("div",x0,[m[43]||(m[43]=$(" Browse and transfer files here once a drive is connected. Configure drives in ",-1)),u("button",{class:"font-semibold text-accent hover:underline",onClick:m[6]||(m[6]=D=>w.value="Settings")},"Settings → Integrations"),m[44]||(m[44]=$(". ",-1))])):(g(),x("div",w0,"This section is part of the console shell and has no backend yet."))])]))])])}}},S0={key:0,class:"h-full"},P0={key:1,class:"grid h-full place-items-center text-ink-muted text-sm"},T0={__name:"App",setup(e){const i=G(!1),o=G(null),a=G("user"),l=G(""),d=G(""),h=G("");function _(w){a.value=w&&w.role||"user",l.value=w&&w.organization||"",d.value=w&&w.organizationName||""}Yi(async()=>{h.value=(await $h()).apiBase||"";const w=await jl();w&&(o.value=w.email,_(w),await Jl()),i.value=!0});async function y(w){o.value=w,_(await jl()),await Jl()}async function T(){_p(),await Nh(),o.value=null,a.value="user",l.value="",d.value=""}return(w,A)=>i.value?(g(),x("div",S0,[o.value?(g(),ie(k0,{key:0,email:o.value,role:a.value,organization:l.value,"organization-name":d.value,onLogout:T},null,8,["email","role","organization","organization-name"])):(g(),ie(Ip,{key:1,"default-api-base":h.value,onSignedIn:y},null,8,["default-api-base"]))])):(g(),x("div",P0,"Loading…"))}};Eh(T0).mount("#app");