From bc41d8b1287f7e7f504baf57411f6814dfa6287e Mon Sep 17 00:00:00 2001 From: tajniak81 <13187254+tajniak81@users.noreply.github.com> Date: Thu, 22 Oct 2026 19:36:16 +0200 Subject: [PATCH] Split the automatic logging path by the app that logged the flight MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit logging_path is now manual, automatic_flyapp or automatic_flyagentapp. The Fly App's entries are backed by the aircraft's flight recorder and keep the missing-FDR red flag; the Fly Agent App's come from Remote ID, which is not a flight recorder, so they must carry the § 5 fields like a manual entry. The API maps the old "automatic" onto automatic_flyapp so Fly App builds already on devices keep filing. The migration has been applied to the remote PocketBase. Co-Authored-By: Claude Opus 5.5 --- API Server/internal/api/logbook.go | 65 +++++++++++--- API Server/internal/api/logbook_test.go | 89 +++++++++++++++++++ .../1720301200_split_logging_path.js | 60 +++++++++++++ Fly Agent App/README.md | 11 +-- Fly Agent App/lib/session/flight_session.dart | 8 +- Fly Agent App/test/session_test.dart | 2 +- Fly App/lib/fly/flight_record_sync.dart | 4 +- Fly App/test/fly/p9_secondary_test.dart | 2 +- Web App/server/dist/assets/index-DtfZVo9q.js | 20 +++++ Web App/server/dist/assets/index-DwIAtafL.js | 20 ----- Web App/server/dist/index.html | 2 +- Web App/web/src/components/Logbook.vue | 9 +- 12 files changed, 242 insertions(+), 50 deletions(-) create mode 100644 API Server/internal/api/logbook_test.go create mode 100644 API Server/pocketbase/pb_migrations/1720301200_split_logging_path.js create mode 100644 Web App/server/dist/assets/index-DtfZVo9q.js delete mode 100644 Web App/server/dist/assets/index-DwIAtafL.js diff --git a/API Server/internal/api/logbook.go b/API Server/internal/api/logbook.go index a026754..a89594b 100644 --- a/API Server/internal/api/logbook.go +++ b/API Server/internal/api/logbook.go @@ -175,7 +175,7 @@ type compliance struct { Required bool `json:"required"` // does § 5 require a logbook entry? Exempt bool `json:"exempt"` // exempt from the logbook obligation ExemptReason string `json:"exemptReason"` // why, when exempt - LoggingPath string `json:"loggingPath"` // automatic | manual + LoggingPath string `json:"loggingPath"` // manual | automatic_flyapp | automatic_flyagentapp RedFlags []string `json:"redFlags"` // compliance gaps to surface } @@ -205,16 +205,49 @@ func (f flightRecord) view(drones map[string]droneRecord) flightView { // Compliance logic (BEK 1649 § 5 + the checklist's red flags). // --------------------------------------------------------------------------- +// Logging paths: who produced the entry. +// +// manual: typed in by the pilot (Web App form). +// +// automatic_flyapp: recorded by the Fly App from the aircraft's own telemetry +// over the DJI SDK; the FDR log backs it. +// +// automatic_flyagentapp: recorded by the Fly Agent App from the aircraft's +// Remote ID broadcast. That is not a flight data recorder, so the entry must +// carry the § 5 minimum like a manual one. +const ( + loggingManual = "manual" + loggingFlyApp = "automatic_flyapp" + loggingFlyAgentApp = "automatic_flyagentapp" + loggingLegacyAutomatic = "automatic" // pre-split value, still sent by older Fly App builds +) + +// normalizeLoggingPath maps the pre-split "automatic" onto the Fly App path: +// it was the only app that logged automatically before the split. +func normalizeLoggingPath(p string) string { + p = strings.TrimSpace(p) + if p == loggingLegacyAutomatic { + return loggingFlyApp + } + return p +} + // effectiveLoggingPath is the stored path, or — when blank — derived from the -// drone's capability (autologging → automatic, else manual). +// drone's capability (autologging → the Fly App path, else manual). func effectiveLoggingPath(f flightRecord, d *droneRecord) string { - if p := strings.TrimSpace(f.LoggingPath); p != "" { + if p := normalizeLoggingPath(f.LoggingPath); p != "" { return p } if d != nil && d.AutologsFlights { - return "automatic" + return loggingFlyApp } - return "manual" + return loggingManual +} + +// needsManualFields reports whether the path has no flight data recorder behind +// it, so the entry itself must hold every § 5 field. +func needsManualFields(path string) bool { + return path == loggingManual || path == loggingFlyAgentApp } // manualRequired are the § 5 minimum fields a manual-path entry must carry. @@ -263,13 +296,13 @@ func computeCompliance(f flightRecord, d *droneRecord) compliance { c.LoggingPath = effectiveLoggingPath(f, d) // 3. Red flags (compliance gaps, not just missing data). - if d != nil && d.AutologsFlights && c.LoggingPath == "automatic" && strings.TrimSpace(f.RawFDRLogURL) == "" { + if d != nil && d.AutologsFlights && c.LoggingPath == loggingFlyApp && strings.TrimSpace(f.RawFDRLogURL) == "" { c.RedFlags = append(c.RedFlags, "Automatic-logging drone but no FDR log stored for this operation") } if f.Category == "specific" && strings.TrimSpace(f.AuthorisationRef) == "" { c.RedFlags = append(c.RedFlags, "Specific-category flight with no linked authorisation reference") } - if c.Required && c.LoggingPath == "manual" { + if c.Required && needsManualFields(c.LoggingPath) { for _, m := range missingManualFields(f) { c.RedFlags = append(c.RedFlags, "Missing § 5 field: "+m) } @@ -786,7 +819,7 @@ func (in flightInput) asRecord() flightRecord { AreaRoute: strings.TrimSpace(in.AreaRoute), MaxAltitudeAGL: in.MaxAltitudeAGL, PilotName: strings.TrimSpace(in.PilotName), CertificateRef: strings.TrimSpace(in.CertificateRef), Category: strings.TrimSpace(in.Category), Purpose: strings.TrimSpace(in.Purpose), - LoggingPath: strings.TrimSpace(in.LoggingPath), RawFDRLogURL: strings.TrimSpace(in.RawFDRLogURL), + LoggingPath: normalizeLoggingPath(in.LoggingPath), RawFDRLogURL: strings.TrimSpace(in.RawFDRLogURL), AuthorisationRef: strings.TrimSpace(in.AuthorisationRef), } } @@ -804,7 +837,7 @@ func (in flightInput) payload(remotePilot, org, retentionUntil string) map[strin "certificate_ref": strings.TrimSpace(in.CertificateRef), "category": strings.TrimSpace(in.Category), "purpose": strings.TrimSpace(in.Purpose), - "logging_path": strings.TrimSpace(in.LoggingPath), + "logging_path": normalizeLoggingPath(in.LoggingPath), "raw_fdr_log_url": strings.TrimSpace(in.RawFDRLogURL), "authorisation_ref": strings.TrimSpace(in.AuthorisationRef), "weather": strings.TrimSpace(in.Weather), @@ -822,8 +855,9 @@ func (in flightInput) payload(remotePilot, org, retentionUntil string) map[strin } // validateFlight enforces the § 5 minimum for the effective logging path. It -// returns an error message (and false) when a manual-path entry is incomplete — -// callers must block the save rather than store a silent partial record. +// returns an error message (and false) when an entry with no FDR behind it is +// incomplete — callers must block the save rather than store a silent partial +// record. func validateFlight(rec flightRecord, d *droneRecord) (string, bool) { if strings.TrimSpace(rec.OperationDate) == "" { return "operation date is required", false @@ -831,9 +865,14 @@ func validateFlight(rec flightRecord, d *droneRecord) (string, bool) { if strings.TrimSpace(rec.Drone) == "" { return "a drone must be selected", false } - if effectiveLoggingPath(rec, d) == "manual" { + switch effectiveLoggingPath(rec, d) { + case loggingManual, loggingFlyApp, loggingFlyAgentApp: + default: + return "logging path must be manual, automatic_flyapp or automatic_flyagentapp", false + } + if path := effectiveLoggingPath(rec, d); needsManualFields(path) { if missing := missingManualFields(rec); len(missing) > 0 { - return "manual logbook entry is missing required § 5 field(s): " + strings.Join(missing, ", "), false + return path + " logbook entry is missing required § 5 field(s): " + strings.Join(missing, ", "), false } } return "", true diff --git a/API Server/internal/api/logbook_test.go b/API Server/internal/api/logbook_test.go new file mode 100644 index 0000000..3290dc9 --- /dev/null +++ b/API Server/internal/api/logbook_test.go @@ -0,0 +1,89 @@ +package api + +import ( + "strings" + "testing" +) + +func completeFlight(path string) flightRecord { + return flightRecord{ + OperationDate: "2026-10-22", StartTime: "14:05", EndTime: "14:17", Drone: "d1", + AreaRoute: "Field north of the hangar", MaxAltitudeAGL: 80, PilotName: "pilot@example.com", + Category: "open", Purpose: "commercial", LoggingPath: path, + } +} + +func TestNormalizeLoggingPath(t *testing.T) { + cases := map[string]string{ + "automatic": loggingFlyApp, + " automatic ": loggingFlyApp, + "automatic_flyapp": loggingFlyApp, + "automatic_flyagentapp": loggingFlyAgentApp, + "manual": loggingManual, + "": "", + } + for in, want := range cases { + if got := normalizeLoggingPath(in); got != want { + t.Errorf("normalizeLoggingPath(%q) = %q, want %q", in, got, want) + } + } +} + +func TestEffectiveLoggingPathDefaults(t *testing.T) { + autolog := &droneRecord{AutologsFlights: true} + if got := effectiveLoggingPath(flightRecord{}, autolog); got != loggingFlyApp { + t.Errorf("autologging drone, blank path = %q, want %q", got, loggingFlyApp) + } + if got := effectiveLoggingPath(flightRecord{}, &droneRecord{}); got != loggingManual { + t.Errorf("plain drone, blank path = %q, want %q", got, loggingManual) + } + if got := effectiveLoggingPath(flightRecord{LoggingPath: "automatic"}, nil); got != loggingFlyApp { + t.Errorf("legacy automatic = %q, want %q", got, loggingFlyApp) + } +} + +func TestValidateFlightByPath(t *testing.T) { + // The Fly App path is backed by the FDR, so a sparse entry is accepted. + sparse := flightRecord{OperationDate: "2026-10-22", Drone: "d1", LoggingPath: loggingFlyApp} + if msg, ok := validateFlight(sparse, nil); !ok { + t.Errorf("sparse automatic_flyapp entry rejected: %s", msg) + } + // Manual and Fly Agent entries have no FDR behind them: § 5 fields are required. + for _, path := range []string{loggingManual, loggingFlyAgentApp} { + sparse.LoggingPath = path + msg, ok := validateFlight(sparse, nil) + if ok || !strings.Contains(msg, path) { + t.Errorf("sparse %s entry: ok=%v msg=%q, want a rejection naming the path", path, ok, msg) + } + if msg, ok := validateFlight(completeFlight(path), nil); !ok { + t.Errorf("complete %s entry rejected: %s", path, msg) + } + } + if _, ok := validateFlight(completeFlight("companion"), nil); ok { + t.Error("unknown logging path accepted") + } +} + +func TestComplianceRedFlagsByPath(t *testing.T) { + autolog := &droneRecord{AutologsFlights: true} + hasFDRFlag := func(c compliance) bool { + for _, f := range c.RedFlags { + if strings.Contains(f, "no FDR log") { + return true + } + } + return false + } + if c := computeCompliance(completeFlight(loggingFlyApp), autolog); !hasFDRFlag(c) { + t.Error("automatic_flyapp without an FDR url should be flagged") + } + if c := computeCompliance(completeFlight(loggingFlyAgentApp), autolog); hasFDRFlag(c) { + t.Error("automatic_flyagentapp never has an FDR; it must not be flagged for one") + } + agent := completeFlight(loggingFlyAgentApp) + agent.AreaRoute = "" + c := computeCompliance(agent, nil) + if c.LoggingPath != loggingFlyAgentApp || len(c.RedFlags) == 0 { + t.Errorf("automatic_flyagentapp missing area: path=%q flags=%v, want a missing-field flag", c.LoggingPath, c.RedFlags) + } +} diff --git a/API Server/pocketbase/pb_migrations/1720301200_split_logging_path.js b/API Server/pocketbase/pb_migrations/1720301200_split_logging_path.js new file mode 100644 index 0000000..fabc889 --- /dev/null +++ b/API Server/pocketbase/pb_migrations/1720301200_split_logging_path.js @@ -0,0 +1,60 @@ +/// + +// Splits the flights' `logging_path` "automatic" by which app logged it, since +// there are now two and they are not equally trustworthy: +// +// manual typed in by the pilot (Web App form) +// automatic_flyapp Fly App, from the aircraft's own telemetry over the +// DJI SDK; backed by the FDR log +// automatic_flyagentapp Fly Agent App, from the aircraft's Remote ID +// broadcast; no FDR, so the API Server still requires +// the § 5 minimum fields on it +// +// Every existing "automatic" record was logged by the Fly App (the only app +// that logged automatically before this), so it becomes "automatic_flyapp". +// The API Server also maps an incoming "automatic" onto "automatic_flyapp", +// so Fly App builds already on devices keep filing. +// +// Apply by copying into your PocketBase deployment's `pb_migrations/` directory +// and restarting. Written for PocketBase v0.22+/v0.23. Idempotent: the values +// are set outright and only records still holding "automatic" are rewritten. +// +// Depends on 1720300700_add_logbook.js. +migrate( + (app) => { + const flights = app.findCollectionByNameOrId('flights') + const field = flights.fields.find((f) => f.name === 'logging_path') + + // Widen first, so records can move to the new value before the old one goes. + field.values = ['manual', 'automatic', 'automatic_flyapp', 'automatic_flyagentapp'] + app.save(flights) + + for (const rec of app.findRecordsByFilter('flights', "logging_path = 'automatic'", '', 0, 0)) { + rec.set('logging_path', 'automatic_flyapp') + app.save(rec) + } + + field.values = ['manual', 'automatic_flyapp', 'automatic_flyagentapp'] + app.save(flights) + }, + (app) => { + const flights = app.findCollectionByNameOrId('flights') + const field = flights.fields.find((f) => f.name === 'logging_path') + + field.values = ['automatic', 'manual', 'automatic_flyapp', 'automatic_flyagentapp'] + app.save(flights) + + // The old schema has one automatic value, so both apps fold back into it. + for (const rec of app.findRecordsByFilter( + 'flights', + "logging_path = 'automatic_flyapp' || logging_path = 'automatic_flyagentapp'", + '', 0, 0, + )) { + rec.set('logging_path', 'automatic') + app.save(rec) + } + + field.values = ['automatic', 'manual'] + app.save(flights) + }, +) diff --git a/Fly Agent App/README.md b/Fly Agent App/README.md index bbbcf02..8b30443 100644 --- a/Fly Agent App/README.md +++ b/Fly Agent App/README.md @@ -37,7 +37,7 @@ flutter build apk --debug The scanners only strip transport framing; all decoding is in Dart and unit tested against byte-built messages (`test/`). -**API Server contract.** No server changes were needed: +**API Server contract.** The only server change is the logging-path split: - Live map: the hub already ingests `telemetry` events (`latitude`, `longitude`, `altitude` = height above take-off, `velocityX/Y/Z` = north/east/down, @@ -45,10 +45,11 @@ tested against byte-built messages (`test/`). `ridSerial`, `pilotLatitude/Longitude`, `uaClass`, which ride along in the raw event. It never sends `flightControllerSerial`, so the Web App's fleet auto-add does not mint a drone from a Remote ID serial. -- Logbook: entries are filed with `loggingPath: "manual"` and every § 5 manual - field filled from the session (Remote ID is not the aircraft's own flight - recorder, so "automatic" would be a false claim). `logging_path` only allows - `automatic | manual`, so the plan's `"companion"` value would need a migration. +- Logbook: entries are filed with `loggingPath: "automatic_flyagentapp"` + (migration `1720301200_split_logging_path.js`; the paths are `manual`, + `automatic_flyapp`, `automatic_flyagentapp`). Remote ID is not the aircraft's + own flight recorder, so the API Server still requires every § 5 field on this + path, and the session fills them all in. - Pairing lives on the phone (SharedPreferences), not on the drone record; a `remote_id_serial` drone field is a later server change. diff --git a/Fly Agent App/lib/session/flight_session.dart b/Fly Agent App/lib/session/flight_session.dart index 0831cd3..5d7f227 100644 --- a/Fly Agent App/lib/session/flight_session.dart +++ b/Fly Agent App/lib/session/flight_session.dart @@ -202,9 +202,9 @@ class FlightSession { /// The `POST /api/flights` body (API Server `flightInput`). /// - /// Logged on the **manual** path: Remote ID gives us times, track and height, - /// but this is not the aircraft's own flight data recorder, so the § 5 manual - /// fields are all filled in here rather than claiming an automatic log. + /// Logged on the Fly Agent's own path, `automatic_flyagentapp`. Remote ID gives + /// times, track and height but is not the aircraft's flight data recorder, so + /// the API Server still requires every § 5 field and they are all filled here. Map toFlightInput() { final DateTime s = (startedAt ?? armedAt ?? DateTime.now()).toLocal(); final DateTime e = (endedAt ?? DateTime.now()).toLocal(); @@ -226,7 +226,7 @@ class FlightSession { 'maxAltitudeAgl': double.parse(effectiveMaxHeight.toStringAsFixed(1)), 'category': category, 'purpose': purpose, - 'loggingPath': 'manual', + 'loggingPath': 'automatic_flyagentapp', 'weather': weather, 'incidents': incidentText, 'notes': [if (notes.trim().isNotEmpty) notes.trim(), source].join('\n'), diff --git a/Fly Agent App/test/session_test.dart b/Fly Agent App/test/session_test.dart index af48684..0939078 100644 --- a/Fly Agent App/test/session_test.dart +++ b/Fly Agent App/test/session_test.dart @@ -76,7 +76,7 @@ void main() { expect(j['endTime'], '14:17'); expect(j['drone'], 'd1'); expect(j['maxAltitudeAgl'], 80.0); - expect(j['loggingPath'], 'manual'); + expect(j['loggingPath'], 'automatic_flyagentapp'); expect((j['areaRoute'] as String), contains('Remote ID track')); expect(j['routeGeojson']['type'], 'LineString'); expect((j['routeGeojson']['coordinates'] as List).first, [12.0, 55.0, 30.0]); diff --git a/Fly App/lib/fly/flight_record_sync.dart b/Fly App/lib/fly/flight_record_sync.dart index daf407a..c7e27b2 100644 --- a/Fly App/lib/fly/flight_record_sync.dart +++ b/Fly App/lib/fly/flight_record_sync.dart @@ -73,7 +73,7 @@ String areaLabel(FlightRecord r) { } /// The `/api/flights` body for [r] flown with logbook drone [droneId]: the -/// app-recorded ("automatic") path, the §5 times and maximum height, the track +/// Fly App's own logging path (`automatic_flyapp`), the §5 times and maximum height, the track /// as GeoJSON, and the flight's numbers in the notes. Map logbookEntry(FlightRecord r, {required String droneId}) { final String notes = [ @@ -94,7 +94,7 @@ Map logbookEntry(FlightRecord r, {required String droneId}) { if (route != null) 'routeGeojson': route, // Height above take-off: the closest the aircraft's barometer gets to AGL. 'maxAltitudeAgl': double.parse(r.maxAltitude.toStringAsFixed(1)), - 'loggingPath': 'automatic', + 'loggingPath': 'automatic_flyapp', 'notes': notes, }; } diff --git a/Fly App/test/fly/p9_secondary_test.dart b/Fly App/test/fly/p9_secondary_test.dart index 5dff435..a27e602 100644 --- a/Fly App/test/fly/p9_secondary_test.dart +++ b/Fly App/test/fly/p9_secondary_test.dart @@ -233,7 +233,7 @@ void main() { expect(e['endTime'], '14:17'); expect(e['drone'], 'd1'); expect(e['maxAltitudeAgl'], 42.4); - expect(e['loggingPath'], 'automatic'); + expect(e['loggingPath'], 'automatic_flyapp'); expect(e['areaRoute'], 'Take-off 55.67610° N, 12.56830° E'); final Map route = e['routeGeojson']! as Map; expect(route['type'], 'LineString'); diff --git a/Web App/server/dist/assets/index-DtfZVo9q.js b/Web App/server/dist/assets/index-DtfZVo9q.js new file mode 100644 index 0000000..3953035 --- /dev/null +++ b/Web App/server/dist/assets/index-DtfZVo9q.js @@ -0,0 +1,20 @@ +(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))l(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&l(h)}).observe(document,{childList:!0,subtree:!0});function s(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function l(u){if(u.ep)return;u.ep=!0;const f=s(u);fetch(u.href,f)}})();/** +* @vue/shared v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Xr(t){const i=Object.create(null);for(const s of t.split(","))i[s]=1;return s=>s in i}const gt={},es=[],ci=()=>{},zu=()=>!1,ja=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Wa=t=>t.startsWith("onUpdate:"),Kt=Object.assign,Qr=(t,i)=>{const s=t.indexOf(i);s>-1&&t.splice(s,1)},pd=Object.prototype.hasOwnProperty,ct=(t,i)=>pd.call(t,i),Fe=Array.isArray,ts=t=>ea(t)==="[object Map]",ls=t=>ea(t)==="[object Set]",Al=t=>ea(t)==="[object Date]",We=t=>typeof t=="function",Tt=t=>typeof t=="string",Qn=t=>typeof t=="symbol",dt=t=>t!==null&&typeof t=="object",$u=t=>(dt(t)||We(t))&&We(t.then)&&We(t.catch),Iu=Object.prototype.toString,ea=t=>Iu.call(t),md=t=>ea(t).slice(8,-1),Nu=t=>ea(t)==="[object Object]",el=t=>Tt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Rs=Xr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ka=t=>{const i=Object.create(null);return(s=>i[s]||(i[s]=t(s)))},gd=/-\w/g,Jn=Ka(t=>t.replace(gd,i=>i.slice(1).toUpperCase())),vd=/\B([A-Z])/g,to=Ka(t=>t.replace(vd,"-$1").toLowerCase()),Fu=Ka(t=>t.charAt(0).toUpperCase()+t.slice(1)),xr=Ka(t=>t?`on${Fu(t)}`:""),ui=(t,i)=>!Object.is(t,i),Ea=(t,...i)=>{for(let s=0;s{Object.defineProperty(t,i,{configurable:!0,enumerable:!1,writable:l,value:s})},Ga=t=>{const i=parseFloat(t);return isNaN(i)?t:i},_d=t=>{const i=Tt(t)?Number(t):NaN;return isNaN(i)?t:i};let Ml;const qa=()=>Ml||(Ml=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Eo(t){if(Fe(t)){const i={};for(let s=0;s{if(s){const l=s.split(yd);l.length>1&&(i[l[0].trim()]=l[1].trim())}}),i}function Ce(t){let i="";if(Tt(t))i=t;else if(Fe(t))for(let s=0;sXi(s,i))}const Bu=t=>!!(t&&t.__v_isRef===!0),x=t=>Tt(t)?t:t==null?"":Fe(t)||dt(t)&&(t.toString===Iu||!We(t.toString))?Bu(t)?x(t.value):JSON.stringify(t,Uu,2):String(t),Uu=(t,i)=>Bu(i)?Uu(t,i.value):ts(i)?{[`Map(${i.size})`]:[...i.entries()].reduce((s,[l,u],f)=>(s[wr(l,f)+" =>"]=u,s),{})}:ls(i)?{[`Set(${i.size})`]:[...i.values()].map(s=>wr(s))}:Qn(i)?wr(i):dt(i)&&!Fe(i)&&!Nu(i)?String(i):i,wr=(t,i="")=>{var s;return Qn(t)?`Symbol(${(s=t.description)!=null?s:i})`:t};/** +* @vue/reactivity v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Yt;class Pd{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&&Yt&&(Yt.active?(this.parent=Yt,this.index=(Yt.scopes||(Yt.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let i,s;if(this.scopes)for(i=0,s=this.scopes.length;i0&&--this._on===0){if(Yt===this)Yt=this.prevScope;else{let i=Yt;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 s,l;for(s=0,l=this.effects.length;s0)return;if(Us){let i=Us;for(Us=void 0;i;){const s=i.next;i.next=void 0,i.flags&=-9,i=s}}let t;for(;Bs;){let i=Bs;for(Bs=void 0;i;){const s=i.next;if(i.next=void 0,i.flags&=-9,i.flags&1)try{i.trigger()}catch(l){t||(t=l)}i=s}}if(t)throw t}function ju(t){for(let i=t.deps;i;i=i.nextDep)i.version=-1,i.prevActiveLink=i.dep.activeLink,i.dep.activeLink=i}function Wu(t){let i,s=t.depsTail,l=s;for(;l;){const u=l.prevDep;l.version===-1?(l===s&&(s=u),ol(l),Ld(l)):i=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=u}t.deps=i,t.depsTail=s}function Ir(t){for(let i=t.deps;i;i=i.nextDep)if(i.dep.version!==i.version||i.dep.computed&&(Ku(i.dep.computed)||i.dep.version!==i.version))return!0;return!!t._dirty}function Ku(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Ws)||(t.globalVersion=Ws,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Ir(t))))return;t.flags|=2;const i=t.dep,s=yt,l=Xn;yt=t,Xn=!0;try{ju(t);const u=t.fn(t._value);(i.version===0||ui(u,t._value))&&(t.flags|=128,t._value=u,i.version++)}catch(u){throw i.version++,u}finally{yt=s,Xn=l,Wu(t),t.flags&=-3}}function ol(t,i=!1){const{dep:s,prevSub:l,nextSub:u}=t;if(l&&(l.nextSub=u,t.prevSub=void 0),u&&(u.prevSub=l,t.nextSub=void 0),s.subs===t&&(s.subs=l,!l&&s.computed)){s.computed.flags&=-5;for(let f=s.computed.deps;f;f=f.nextDep)ol(f,!0)}!i&&!--s.sc&&s.map&&s.map.delete(s.key)}function Ld(t){const{prevDep:i,nextDep:s}=t;i&&(i.nextDep=s,t.prevDep=void 0),s&&(s.prevDep=i,t.nextDep=void 0)}let Xn=!0;const Gu=[];function di(){Gu.push(Xn),Xn=!1}function fi(){const t=Gu.pop();Xn=t===void 0?!0:t}function El(t){const{cleanup:i}=t;if(t.cleanup=void 0,i){const s=yt;yt=void 0;try{i()}finally{yt=s}}}let Ws=0;class Ad{constructor(i,s){this.sub=i,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class sl{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(!yt||!Xn||yt===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==yt)s=this.activeLink=new Ad(yt,this),yt.deps?(s.prevDep=yt.depsTail,yt.depsTail.nextDep=s,yt.depsTail=s):yt.deps=yt.depsTail=s,qu(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const l=s.nextDep;l.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=l),s.prevDep=yt.depsTail,s.nextDep=void 0,yt.depsTail.nextDep=s,yt.depsTail=s,yt.deps===s&&(yt.deps=l)}return s}trigger(i){this.version++,Ws++,this.notify(i)}notify(i){nl();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{il()}}}function qu(t){if(t.dep.sc++,t.sub.flags&4){const i=t.dep.computed;if(i&&!t.dep.subs){i.flags|=20;for(let l=i.deps;l;l=l.nextDep)qu(l)}const s=t.dep.subs;s!==t&&(t.prevSub=s,s&&(s.nextSub=t)),t.dep.subs=t}}const Nr=new WeakMap,Ao=Symbol(""),Fr=Symbol(""),Ks=Symbol("");function on(t,i,s){if(Xn&&yt){let l=Nr.get(t);l||Nr.set(t,l=new Map);let u=l.get(s);u||(l.set(s,u=new sl),u.map=l,u.key=s),u.track()}}function Li(t,i,s,l,u,f){const h=Nr.get(t);if(!h){Ws++;return}const _=b=>{b&&b.trigger()};if(nl(),i==="clear")h.forEach(_);else{const b=Fe(t),C=b&&el(s);if(b&&s==="length"){const T=Number(l);h.forEach((E,Z)=>{(Z==="length"||Z===Ks||!Qn(Z)&&Z>=T)&&_(E)})}else switch((s!==void 0||h.has(void 0))&&_(h.get(s)),C&&_(h.get(Ks)),i){case"add":b?C&&_(h.get("length")):(_(h.get(Ao)),ts(t)&&_(h.get(Fr)));break;case"delete":b||(_(h.get(Ao)),ts(t)&&_(h.get(Fr)));break;case"set":ts(t)&&_(h.get(Ao));break}}il()}function Xo(t){const i=ut(t);return i===t?i:(on(i,"iterate",Ks),Vn(t)?i:i.map(ei))}function Ya(t){return on(t=ut(t),"iterate",Ks),t}function ri(t,i){return Ei(t)?as(Mo(t)?ei(i):i):ei(i)}const Md={__proto__:null,[Symbol.iterator](){return Sr(this,Symbol.iterator,t=>ri(this,t))},concat(...t){return Xo(this).concat(...t.map(i=>Fe(i)?Xo(i):i))},entries(){return Sr(this,"entries",t=>(t[1]=ri(this,t[1]),t))},every(t,i){return Si(this,"every",t,i,void 0,arguments)},filter(t,i){return Si(this,"filter",t,i,s=>s.map(l=>ri(this,l)),arguments)},find(t,i){return Si(this,"find",t,i,s=>ri(this,s),arguments)},findIndex(t,i){return Si(this,"findIndex",t,i,void 0,arguments)},findLast(t,i){return Si(this,"findLast",t,i,s=>ri(this,s),arguments)},findLastIndex(t,i){return Si(this,"findLastIndex",t,i,void 0,arguments)},forEach(t,i){return Si(this,"forEach",t,i,void 0,arguments)},includes(...t){return Tr(this,"includes",t)},indexOf(...t){return Tr(this,"indexOf",t)},join(t){return Xo(this).join(t)},lastIndexOf(...t){return Tr(this,"lastIndexOf",t)},map(t,i){return Si(this,"map",t,i,void 0,arguments)},pop(){return Es(this,"pop")},push(...t){return Es(this,"push",t)},reduce(t,...i){return Ol(this,"reduce",t,i)},reduceRight(t,...i){return Ol(this,"reduceRight",t,i)},shift(){return Es(this,"shift")},some(t,i){return Si(this,"some",t,i,void 0,arguments)},splice(...t){return Es(this,"splice",t)},toReversed(){return Xo(this).toReversed()},toSorted(t){return Xo(this).toSorted(t)},toSpliced(...t){return Xo(this).toSpliced(...t)},unshift(...t){return Es(this,"unshift",t)},values(){return Sr(this,"values",t=>ri(this,t))}};function Sr(t,i,s){const l=Ya(t),u=l[i]();return l!==t&&!Vn(t)&&(u._next=u.next,u.next=()=>{const f=u._next();return f.done||(f.value=s(f.value)),f}),u}const Ed=Array.prototype;function Si(t,i,s,l,u,f){const h=Ya(t),_=h!==t&&!Vn(t),b=h[i];if(b!==Ed[i]){const E=b.apply(t,f);return _?ei(E):E}let C=s;h!==t&&(_?C=function(E,Z){return s.call(this,ri(t,E),Z,t)}:s.length>2&&(C=function(E,Z){return s.call(this,E,Z,t)}));const T=b.call(h,C,l);return _&&u?u(T):T}function Ol(t,i,s,l){const u=Ya(t),f=u!==t&&!Vn(t);let h=s,_=!1;u!==t&&(f?(_=l.length===0,h=function(C,T,E){return _&&(_=!1,C=ri(t,C)),s.call(this,C,ri(t,T),E,t)}):s.length>3&&(h=function(C,T,E){return s.call(this,C,T,E,t)}));const b=u[i](h,...l);return _?ri(t,b):b}function Tr(t,i,s){const l=ut(t);on(l,"iterate",Ks);const u=l[i](...s);return(u===-1||u===!1)&&ll(s[0])?(s[0]=ut(s[0]),l[i](...s)):u}function Es(t,i,s=[]){di(),nl();const l=ut(t)[i].apply(t,s);return il(),fi(),l}const Od=Xr("__proto__,__v_isRef,__isVue"),Yu=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Qn));function zd(t){Qn(t)||(t=String(t));const i=ut(this);return on(i,"has",t),i.hasOwnProperty(t)}class Ju{constructor(i=!1,s=!1){this._isReadonly=i,this._isShallow=s}get(i,s,l){if(s==="__v_skip")return i.__v_skip;const u=this._isReadonly,f=this._isShallow;if(s==="__v_isReactive")return!u;if(s==="__v_isReadonly")return u;if(s==="__v_isShallow")return f;if(s==="__v_raw")return l===(u?f?Zd:tc:f?ec:Qu).get(i)||Object.getPrototypeOf(i)===Object.getPrototypeOf(l)?i:void 0;const h=Fe(i);if(!u){let b;if(h&&(b=Md[s]))return b;if(s==="hasOwnProperty")return zd}const _=Reflect.get(i,s,rn(i)?i:l);if((Qn(s)?Yu.has(s):Od(s))||(u||on(i,"get",s),f))return _;if(rn(_)){const b=h&&el(s)?_:_.value;return u&&dt(b)?Rr(b):b}return dt(_)?u?Rr(_):mt(_):_}}class Xu extends Ju{constructor(i=!1){super(!1,i)}set(i,s,l,u){let f=i[s];const h=Fe(i)&&el(s);if(!this._isShallow){const C=Ei(f);if(!Vn(l)&&!Ei(l)&&(f=ut(f),l=ut(l)),!h&&rn(f)&&!rn(l))return C||(f.value=l),!0}const _=h?Number(s)t,Ta=t=>Reflect.getPrototypeOf(t);function Dd(t,i,s){return function(...l){const u=this.__v_raw,f=ut(u),h=ts(f),_=t==="entries"||t===Symbol.iterator&&h,b=t==="keys"&&h,C=u[t](...l),T=s?Dr:i?as:ei;return!i&&on(f,"iterate",b?Fr:Ao),Kt(Object.create(C),{next(){const{value:E,done:Z}=C.next();return Z?{value:E,done:Z}:{value:_?[T(E[0]),T(E[1])]:T(E),done:Z}}})}}function Pa(t){return function(...i){return t==="delete"?!1:t==="clear"?void 0:this}}function Rd(t,i){const s={get(u){const f=this.__v_raw,h=ut(f),_=ut(u);t||(ui(u,_)&&on(h,"get",u),on(h,"get",_));const{has:b}=Ta(h),C=i?Dr:t?as:ei;if(b.call(h,u))return C(f.get(u));if(b.call(h,_))return C(f.get(_));f!==h&&f.get(u)},get size(){const u=this.__v_raw;return!t&&on(ut(u),"iterate",Ao),u.size},has(u){const f=this.__v_raw,h=ut(f),_=ut(u);return t||(ui(u,_)&&on(h,"has",u),on(h,"has",_)),u===_?f.has(u):f.has(u)||f.has(_)},forEach(u,f){const h=this,_=h.__v_raw,b=ut(_),C=i?Dr:t?as:ei;return!t&&on(b,"iterate",Ao),_.forEach((T,E)=>u.call(f,C(T),C(E),h))}};return Kt(s,t?{add:Pa("add"),set:Pa("set"),delete:Pa("delete"),clear:Pa("clear")}:{add(u){const f=ut(this),h=Ta(f),_=ut(u),b=!i&&!Vn(u)&&!Ei(u)?_:u;return h.has.call(f,b)||ui(u,b)&&h.has.call(f,u)||ui(_,b)&&h.has.call(f,_)||(f.add(b),Li(f,"add",b,b)),this},set(u,f){!i&&!Vn(f)&&!Ei(f)&&(f=ut(f));const h=ut(this),{has:_,get:b}=Ta(h);let C=_.call(h,u);C||(u=ut(u),C=_.call(h,u));const T=b.call(h,u);return h.set(u,f),C?ui(f,T)&&Li(h,"set",u,f):Li(h,"add",u,f),this},delete(u){const f=ut(this),{has:h,get:_}=Ta(f);let b=h.call(f,u);b||(u=ut(u),b=h.call(f,u)),_&&_.call(f,u);const C=f.delete(u);return b&&Li(f,"delete",u,void 0),C},clear(){const u=ut(this),f=u.size!==0,h=u.clear();return f&&Li(u,"clear",void 0,void 0),h}}),["keys","values","entries",Symbol.iterator].forEach(u=>{s[u]=Dd(u,t,i)}),s}function al(t,i){const s=Rd(t,i);return(l,u,f)=>u==="__v_isReactive"?!t:u==="__v_isReadonly"?t:u==="__v_raw"?l:Reflect.get(ct(s,u)&&u in l?s:l,u,f)}const Bd={get:al(!1,!1)},Ud={get:al(!1,!0)},Vd={get:al(!0,!1)};const Qu=new WeakMap,ec=new WeakMap,tc=new WeakMap,Zd=new WeakMap;function Hd(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function mt(t){return Ei(t)?t:rl(t,!1,Id,Bd,Qu)}function jd(t){return rl(t,!1,Fd,Ud,ec)}function Rr(t){return rl(t,!0,Nd,Vd,tc)}function rl(t,i,s,l,u){if(!dt(t)||t.__v_raw&&!(i&&t.__v_isReactive)||t.__v_skip||!Object.isExtensible(t))return t;const f=u.get(t);if(f)return f;const h=Hd(md(t));if(h===0)return t;const _=new Proxy(t,h===2?l:s);return u.set(t,_),_}function Mo(t){return Ei(t)?Mo(t.__v_raw):!!(t&&t.__v_isReactive)}function Ei(t){return!!(t&&t.__v_isReadonly)}function Vn(t){return!!(t&&t.__v_isShallow)}function ll(t){return t?!!t.__v_raw:!1}function ut(t){const i=t&&t.__v_raw;return i?ut(i):t}function Wd(t){return!ct(t,"__v_skip")&&Object.isExtensible(t)&&Du(t,"__v_skip",!0),t}const ei=t=>dt(t)?mt(t):t,as=t=>dt(t)?Rr(t):t;function rn(t){return t?t.__v_isRef===!0:!1}function Y(t){return Kd(t,!1)}function Kd(t,i){return rn(t)?t:new Gd(t,i)}class Gd{constructor(i,s){this.dep=new sl,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?i:ut(i),this._value=s?i:ei(i),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(i){const s=this._rawValue,l=this.__v_isShallow||Vn(i)||Ei(i);i=l?i:ut(i),ui(i,s)&&(this._rawValue=i,this._value=l?i:ei(i),this.dep.trigger())}}function Ie(t){return rn(t)?t.value:t}const qd={get:(t,i,s)=>i==="__v_raw"?t:Ie(Reflect.get(t,i,s)),set:(t,i,s,l)=>{const u=t[i];return rn(u)&&!rn(s)?(u.value=s,!0):Reflect.set(t,i,s,l)}};function nc(t){return Mo(t)?t:new Proxy(t,qd)}class Yd{constructor(i,s,l){this.fn=i,this.setter=s,this._value=void 0,this.dep=new sl(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ws-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=l}notify(){if(this.flags|=16,!(this.flags&8)&&yt!==this)return Hu(this,!0),!0}get value(){const i=this.dep.track();return Ku(this),i&&(i.version=this.dep.version),this._value}set value(i){this.setter&&this.setter(i)}}function Jd(t,i,s=!1){let l,u;return We(t)?l=t:(l=t.get,u=t.set),new Yd(l,u,s)}const Ca={},za=new WeakMap;let Po;function Xd(t,i=!1,s=Po){if(s){let l=za.get(s);l||za.set(s,l=[]),l.push(t)}}function Qd(t,i,s=gt){const{immediate:l,deep:u,once:f,scheduler:h,augmentJob:_,call:b}=s,C=de=>u?de:Vn(de)||u===!1||u===0?Ai(de,1):Ai(de);let T,E,Z,U,G=!1,I=!1;if(rn(t)?(E=()=>t.value,G=Vn(t)):Mo(t)?(E=()=>C(t),G=!0):Fe(t)?(I=!0,G=t.some(de=>Mo(de)||Vn(de)),E=()=>t.map(de=>{if(rn(de))return de.value;if(Mo(de))return C(de);if(We(de))return b?b(de,2):de()})):We(t)?i?E=b?()=>b(t,2):t:E=()=>{if(Z){di();try{Z()}finally{fi()}}const de=Po;Po=T;try{return b?b(t,3,[U]):t(U)}finally{Po=de}}:E=ci,i&&u){const de=E,xe=u===!0?1/0:u;E=()=>Ai(de(),xe)}const R=Cd(),Q=()=>{T.stop(),R&&R.active&&Qr(R.effects,T)};if(f&&i){const de=i;i=(...xe)=>{const Le=de(...xe);return Q(),Le}}let K=I?new Array(t.length).fill(Ca):Ca;const ke=de=>{if(!(!(T.flags&1)||!T.dirty&&!de))if(i){const xe=T.run();if(de||u||G||(I?xe.some((Le,Me)=>ui(Le,K[Me])):ui(xe,K))){Z&&Z();const Le=Po;Po=T;try{const Me=[xe,K===Ca?void 0:I&&K[0]===Ca?[]:K,U];K=xe,b?b(i,3,Me):i(...Me)}finally{Po=Le}}}else T.run()};return _&&_(ke),T=new Vu(E),T.scheduler=h?()=>h(ke,!1):ke,U=de=>Xd(de,!1,T),Z=T.onStop=()=>{const de=za.get(T);if(de){if(b)b(de,4);else for(const xe of de)xe();za.delete(T)}},i?l?ke(!0):K=T.run():h?h(ke.bind(null,!0),!0):T.run(),Q.pause=T.pause.bind(T),Q.resume=T.resume.bind(T),Q.stop=Q,Q}function Ai(t,i=1/0,s){if(i<=0||!dt(t)||t.__v_skip||(s=s||new Map,(s.get(t)||0)>=i))return t;if(s.set(t,i),i--,rn(t))Ai(t.value,i,s);else if(Fe(t))for(let l=0;l{Ai(l,i,s)});else if(Nu(t)){for(const l in t)Ai(t[l],i,s);for(const l of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,l)&&Ai(t[l],i,s)}return t}/** +* @vue/runtime-core v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function ta(t,i,s,l){try{return l?t(...l):t()}catch(u){Ja(u,i,s)}}function Hn(t,i,s,l){if(We(t)){const u=ta(t,i,s,l);return u&&$u(u)&&u.catch(f=>{Ja(f,i,s)}),u}if(Fe(t)){const u=[];for(let f=0;f>>1,u=fn[l],f=Gs(u);f=Gs(s)?fn.push(t):fn.splice(tf(i),0,t),t.flags|=1,sc()}}function sc(){$a||($a=ic.then(rc))}function nf(t){Fe(t)?ns.push(...t):Ji&&t.id===-1?Ji.splice(Qo+1,0,t):t.flags&1||(ns.push(t),t.flags|=1),sc()}function zl(t,i,s=ai+1){for(;sGs(s)-Gs(l));if(ns.length=0,Ji){Ji.push(...i);return}for(Ji=i,Qo=0;Qot.id==null?t.flags&2?-1:1/0:t.id;function rc(t){try{for(ai=0;ai{l._d&&Da(-1);const f=Ia(i);let h;try{h=t(...u)}finally{Ia(f),l._d&&Da(1)}return h};return l._n=!0,l._c=!0,l._d=!0,l}function oe(t,i){if(an===null)return t;const s=nr(an),l=t.dirs||(t.dirs=[]);for(let u=0;u1)return s&&We(i)?i.call(l&&l.proxy):i}}const of=Symbol.for("v-scx"),sf=()=>Vs(of);function Bt(t,i,s){return cc(t,i,s)}function cc(t,i,s=gt){const{immediate:l,deep:u,flush:f,once:h}=s,_=Kt({},s),b=i&&l||!i&&f!=="post";let C;if(Xs){if(f==="sync"){const U=sf();C=U.__watcherHandles||(U.__watcherHandles=[])}else if(!b){const U=()=>{};return U.stop=ci,U.resume=ci,U.pause=ci,U}}const T=hn;_.call=(U,G,I)=>Hn(U,T,G,I);let E=!1;f==="post"?_.scheduler=U=>{dn(U,T&&T.suspense)}:f!=="sync"&&(E=!0,_.scheduler=(U,G)=>{G?U():ul(U)}),_.augmentJob=U=>{i&&(U.flags|=4),E&&(U.flags|=2,T&&(U.id=T.uid,U.i=T))};const Z=Qd(t,i,_);return Xs&&(C?C.push(Z):b&&Z()),Z}function af(t,i,s){const l=this.proxy,u=Tt(t)?t.includes(".")?dc(l,t):()=>l[t]:t.bind(l,l);let f;We(i)?f=i:(f=i.handler,s=i);const h=na(this),_=cc(u,f.bind(l),s);return h(),_}function dc(t,i){const s=i.split(".");return()=>{let l=t;for(let u=0;ut.__isTeleport,Co=t=>t&&(t.disabled||t.disabled===""),rf=t=>t&&(t.defer||t.defer===""),$l=t=>typeof SVGElement<"u"&&t instanceof SVGElement,Il=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Br=(t,i)=>{const s=t&&t.to;return Tt(s)?i?i(s):null:s},lf={name:"Teleport",__isTeleport:!0,process(t,i,s,l,u,f,h,_,b,C){const{mc:T,pc:E,pbc:Z,o:{insert:U,querySelector:G,createText:I,createComment:R,parentNode:Q}}=C,K=Co(i.props);let{dynamicChildren:ke}=i;const de=(Me,Ze,ve)=>{Me.shapeFlag&16&&T(Me.children,Ze,ve,u,f,h,_,b)},xe=(Me=i)=>{const Ze=Co(Me.props),ve=Me.target=Br(Me.props,G),te=Ur(ve,Me,I,U);ve&&(h!=="svg"&&$l(ve)?h="svg":h!=="mathml"&&Il(ve)&&(h="mathml"),u&&u.isCE&&(u.ce._teleportTargets||(u.ce._teleportTargets=new Set)).add(ve),Ze||(de(Me,ve,te),Is(Me,!1)))},Le=Me=>{const Ze=()=>{if(Yi.get(Me)===Ze){if(Yi.delete(Me),Co(Me.props)){const ve=Q(Me.el)||s;de(Me,ve,Me.anchor),Is(Me,!0)}xe(Me)}};Yi.set(Me,Ze),dn(Ze,f)};if(t==null){const Me=i.el=I(""),Ze=i.anchor=I("");if(U(Me,s,l),U(Ze,s,l),rf(i.props)||f&&f.pendingBranch){Le(i);return}K&&(de(i,s,Ze),Is(i,!0)),xe()}else{i.el=t.el;const Me=i.anchor=t.anchor,Ze=Yi.get(t);if(Ze){Ze.flags|=8,Yi.delete(t),Le(i);return}i.targetStart=t.targetStart;const ve=i.target=t.target,te=i.targetAnchor=t.targetAnchor,B=Co(t.props),F=B?s:ve,se=B?Me:te;if(h==="svg"||$l(ve)?h="svg":(h==="mathml"||Il(ve))&&(h="mathml"),ke?(Z(t.dynamicChildren,ke,F,u,f,h,_),fl(t,i,!0)):b||E(t,i,F,se,u,f,h,_,!1),K)B?i.props&&t.props&&i.props.to!==t.props.to&&(i.props.to=t.props.to):La(i,s,Me,C,1);else if((i.props&&i.props.to)!==(t.props&&t.props.to)){const M=Br(i.props,G);M&&(i.target=M,La(i,M,null,C,0))}else B&&La(i,ve,te,C,1);Is(i,K)}},remove(t,i,s,{um:l,o:{remove:u}},f){const{shapeFlag:h,children:_,anchor:b,targetStart:C,targetAnchor:T,target:E,props:Z}=t,U=Co(Z),G=f||!U,I=Yi.get(t);if(I&&(I.flags|=8,Yi.delete(t)),E&&(u(C),u(T)),f&&u(b),!I&&(U||E)&&h&16)for(let R=0;R<_.length;R++){const Q=_[R];l(Q,i,s,G,!!Q.dynamicChildren)}},move:La,hydrate:uf};function La(t,i,s,{o:{insert:l},m:u},f=2){f===0&&l(t.targetAnchor,i,s);const{el:h,anchor:_,shapeFlag:b,children:C,props:T}=t,E=f===2;if(E&&l(h,i,s),!Yi.has(t)&&(!E||Co(T))&&b&16)for(let Z=0;Z{t.isMounted=!0}),us(()=>{t.isUnmounting=!0}),t}const Bn=[Function,Array],pc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Bn,onEnter:Bn,onAfterEnter:Bn,onEnterCancelled:Bn,onBeforeLeave:Bn,onLeave:Bn,onAfterLeave:Bn,onLeaveCancelled:Bn,onBeforeAppear:Bn,onAppear:Bn,onAfterAppear:Bn,onAppearCancelled:Bn},mc=t=>{const i=t.subTree;return i.component?mc(i.component):i},ff={name:"BaseTransition",props:pc,setup(t,{slots:i}){const s=Uc(),l=df();return()=>{const u=i.default&&_c(i.default(),!0),f=u&&u.length?gc(u):s.subTree?$():void 0;if(!f)return;const h=ut(t),{mode:_}=h;if(l.isLeaving)return Pr(f);const b=Nl(f);if(!b)return Pr(f);let C=Vr(b,h,l,s,E=>C=E);b.type!==sn&&qs(b,C);let T=s.subTree&&Nl(s.subTree);if(T&&T.type!==sn&&!Lo(T,b)&&mc(s).type!==sn){let E=Vr(T,h,l,s);if(qs(T,E),_==="out-in"&&b.type!==sn)return l.isLeaving=!0,E.afterLeave=()=>{l.isLeaving=!1,s.job.flags&8||s.update(),delete E.afterLeave,T=void 0},Pr(f);_==="in-out"&&b.type!==sn?E.delayLeave=(Z,U,G)=>{const I=vc(l,T);I[String(T.key)]=T,Z[Un]=()=>{U(),Z[Un]=void 0,delete C.delayedLeave,T=void 0},C.delayedLeave=()=>{G(),delete C.delayedLeave,T=void 0}}:T=void 0}else T&&(T=void 0);return f}}};function gc(t){let i=t[0];if(t.length>1){for(const s of t)if(s.type!==sn){i=s;break}}return i}const hf=ff;function vc(t,i){const{leavingVNodes:s}=t;let l=s.get(i.type);return l||(l=Object.create(null),s.set(i.type,l)),l}function Vr(t,i,s,l,u){const{appear:f,mode:h,persisted:_=!1,onBeforeEnter:b,onEnter:C,onAfterEnter:T,onEnterCancelled:E,onBeforeLeave:Z,onLeave:U,onAfterLeave:G,onLeaveCancelled:I,onBeforeAppear:R,onAppear:Q,onAfterAppear:K,onAppearCancelled:ke}=i,de=String(t.key),xe=vc(s,t),Le=(ve,te)=>{ve&&Hn(ve,l,9,te)},Me=(ve,te)=>{const B=te[1];Le(ve,te),Fe(ve)?ve.every(F=>F.length<=1)&&B():ve.length<=1&&B()},Ze={mode:h,persisted:_,beforeEnter(ve){let te=b;if(!s.isMounted)if(f)te=R||b;else return;ve[Un]&&ve[Un](!0);const B=xe[de];B&&Lo(t,B)&&B.el[Un]&&B.el[Un](),Le(te,[ve])},enter(ve){if(xe[de]===t)return;let te=C,B=T,F=E;if(!s.isMounted)if(f)te=Q||C,B=K||T,F=ke||E;else return;let se=!1;ve[Os]=H=>{se||(se=!0,H?Le(F,[ve]):Le(B,[ve]),Ze.delayedLeave&&Ze.delayedLeave(),ve[Os]=void 0)};const M=ve[Os].bind(null,!1);te?Me(te,[ve,M]):M()},leave(ve,te){const B=String(t.key);if(ve[Os]&&ve[Os](!0),s.isUnmounting)return te();Le(Z,[ve]);let F=!1;ve[Un]=M=>{F||(F=!0,te(),M?Le(I,[ve]):Le(G,[ve]),ve[Un]=void 0,xe[B]===t&&delete xe[B])};const se=ve[Un].bind(null,!1);xe[B]=t,U?Me(U,[ve,se]):se()},clone(ve){const te=Vr(ve,i,s,l,u);return u&&u(te),te}};return Ze}function Pr(t){if(Xa(t))return t=Qi(t),t.children=null,t}function Nl(t){if(!Xa(t))return hc(t.type)&&t.children?gc(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:i,children:s}=t;if(s){if(i&16)return s[0];if(i&32&&We(s.default))return s.default()}}function qs(t,i){t.shapeFlag&6&&t.component?(t.transition=i,qs(t.component.subTree,i)):t.shapeFlag&128?(t.ssContent.transition=i.clone(t.ssContent),t.ssFallback.transition=i.clone(t.ssFallback)):t.transition=i}function _c(t,i=!1,s){let l=[],u=0;for(let f=0;f1)for(let f=0;fZs(I,i&&(Fe(i)?i[R]:i),s,l,u));return}if(is(l)&&!u){l.shapeFlag&512&&l.type.__asyncResolved&&l.component.subTree.component&&Zs(t,i,s,l.component.subTree);return}const f=l.shapeFlag&4?nr(l.component):l.el,h=u?null:f,{i:_,r:b}=t,C=i&&i.r,T=_.refs===gt?_.refs={}:_.refs,E=_.setupState,Z=ut(E),U=E===gt?zu:I=>Fl(T,I)?!1:ct(Z,I),G=(I,R)=>!(R&&Fl(T,R));if(C!=null&&C!==b){if(Dl(i),Tt(C))T[C]=null,U(C)&&(E[C]=null);else if(rn(C)){const I=i;G(C,I.k)&&(C.value=null),I.k&&(T[I.k]=null)}}if(We(b)){di();try{ta(b,_,12,[h,T])}finally{fi()}}else{const I=Tt(b),R=rn(b);if(I||R){const Q=()=>{if(t.f){const K=I?U(b)?E[b]:T[b]:G()||!t.k?b.value:T[t.k];if(u)Fe(K)&&Qr(K,f);else if(Fe(K))K.includes(f)||K.push(f);else if(I)T[b]=[f],U(b)&&(E[b]=T[b]);else{const ke=[f];G(b,t.k)&&(b.value=ke),t.k&&(T[t.k]=ke)}}else I?(T[b]=h,U(b)&&(E[b]=h)):R&&(G(b,t.k)&&(b.value=h),t.k&&(T[t.k]=h))};if(h){const K=()=>{Q(),Na.delete(t)};K.id=-1,Na.set(t,K),dn(K,s)}else Dl(t),Q()}}}function Dl(t){const i=Na.get(t);i&&(i.flags|=8,Na.delete(t))}qa().requestIdleCallback;qa().cancelIdleCallback;const is=t=>!!t.type.__asyncLoader,Xa=t=>t.type.__isKeepAlive;function pf(t,i){yc(t,"a",i)}function mf(t,i){yc(t,"da",i)}function yc(t,i,s=hn){const l=t.__wdc||(t.__wdc=()=>{let u=s;for(;u;){if(u.isDeactivated)return;u=u.parent}return t()});if(Qa(i,l,s),s){let u=s.parent;for(;u&&u.parent;)Xa(u.parent.vnode)&&gf(l,i,s,u),u=u.parent}}function gf(t,i,s,l){const u=Qa(i,t,l,!0);xc(()=>{Qr(l[i],u)},s)}function Qa(t,i,s=hn,l=!1){if(s){const u=s[t]||(s[t]=[]),f=i.__weh||(i.__weh=(...h)=>{di();const _=na(s),b=Hn(i,s,t,h);return _(),fi(),b});return l?u.unshift(f):u.push(f),f}}const Oi=t=>(i,s=hn)=>{(!Xs||t==="sp")&&Qa(t,(...l)=>i(...l),s)},vf=Oi("bm"),ti=Oi("m"),_f=Oi("bu"),bf=Oi("u"),us=Oi("bum"),xc=Oi("um"),yf=Oi("sp"),xf=Oi("rtg"),wf=Oi("rtc");function kf(t,i=hn){Qa("ec",t,i)}const Sf=Symbol.for("v-ndc");function $e(t,i,s,l){let u;const f=s,h=Fe(t);if(h||Tt(t)){const _=h&&Mo(t);let b=!1,C=!1;_&&(b=!Vn(t),C=Ei(t),t=Ya(t)),u=new Array(t.length);for(let T=0,E=t.length;Ti(_,b,void 0,f));else{const _=Object.keys(t);u=new Array(_.length);for(let b=0,C=_.length;b0;return p(),nt(re,null,[A("slot",s,l)],C?-2:64)}let f=t[i];f&&f._c&&(f._d=!1),p();const h=f&&wc(f(s)),_=s.key||h&&h.key,b=nt(re,{key:(_&&!Qn(_)?_:`_${i}`)+(!h&&l?"_fb":"")},h||[],h&&t._===1?64:-2);return b.scopeId&&(b.slotScopeIds=[b.scopeId+"-s"]),f&&f._c&&(f._d=!0),b}function wc(t){return t.some(i=>Js(i)?!(i.type===sn||i.type===re&&!wc(i.children)):!0)?t:null}const Zr=t=>t?Vc(t)?nr(t):Zr(t.parent):null,Hs=Kt(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Zr(t.parent),$root:t=>Zr(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>Sc(t),$forceUpdate:t=>t.f||(t.f=()=>{ul(t.update)}),$nextTick:t=>t.n||(t.n=oc.bind(t.proxy)),$watch:t=>af.bind(t)}),Cr=(t,i)=>t!==gt&&!t.__isScriptSetup&&ct(t,i),Pf={get({_:t},i){if(i==="__v_skip")return!0;const{ctx:s,setupState:l,data:u,props:f,accessCache:h,type:_,appContext:b}=t;if(i[0]!=="$"){const Z=h[i];if(Z!==void 0)switch(Z){case 1:return l[i];case 2:return u[i];case 4:return s[i];case 3:return f[i]}else{if(Cr(l,i))return h[i]=1,l[i];if(u!==gt&&ct(u,i))return h[i]=2,u[i];if(ct(f,i))return h[i]=3,f[i];if(s!==gt&&ct(s,i))return h[i]=4,s[i];Hr&&(h[i]=0)}}const C=Hs[i];let T,E;if(C)return i==="$attrs"&&on(t.attrs,"get",""),C(t);if((T=_.__cssModules)&&(T=T[i]))return T;if(s!==gt&&ct(s,i))return h[i]=4,s[i];if(E=b.config.globalProperties,ct(E,i))return E[i]},set({_:t},i,s){const{data:l,setupState:u,ctx:f}=t;return Cr(u,i)?(u[i]=s,!0):l!==gt&&ct(l,i)?(l[i]=s,!0):ct(t.props,i)||i[0]==="$"&&i.slice(1)in t?!1:(f[i]=s,!0)},has({_:{data:t,setupState:i,accessCache:s,ctx:l,appContext:u,props:f,type:h}},_){let b;return!!(s[_]||t!==gt&&_[0]!=="$"&&ct(t,_)||Cr(i,_)||ct(f,_)||ct(l,_)||ct(Hs,_)||ct(u.config.globalProperties,_)||(b=h.__cssModules)&&b[_])},defineProperty(t,i,s){return s.get!=null?t._.accessCache[i]=0:ct(s,"value")&&this.set(t,i,s.value,null),Reflect.defineProperty(t,i,s)}};function Rl(t){return Fe(t)?t.reduce((i,s)=>(i[s]=null,i),{}):t}let Hr=!0;function Cf(t){const i=Sc(t),s=t.proxy,l=t.ctx;Hr=!1,i.beforeCreate&&Bl(i.beforeCreate,t,"bc");const{data:u,computed:f,methods:h,watch:_,provide:b,inject:C,created:T,beforeMount:E,mounted:Z,beforeUpdate:U,updated:G,activated:I,deactivated:R,beforeDestroy:Q,beforeUnmount:K,destroyed:ke,unmounted:de,render:xe,renderTracked:Le,renderTriggered:Me,errorCaptured:Ze,serverPrefetch:ve,expose:te,inheritAttrs:B,components:F,directives:se,filters:M}=i;if(C&&Lf(C,l,null),h)for(const me in h){const he=h[me];We(he)&&(l[me]=he.bind(s))}if(u){const me=u.call(s,s);dt(me)&&(t.data=mt(me))}if(Hr=!0,f)for(const me in f){const he=f[me],St=We(he)?he.bind(s,s):We(he.get)?he.get.bind(s,s):ci,pe=!We(he)&&We(he.set)?he.set.bind(s):ci,Be=fe({get:St,set:pe});Object.defineProperty(l,me,{enumerable:!0,configurable:!0,get:()=>Be.value,set:He=>Be.value=He})}if(_)for(const me in _)kc(_[me],l,s,me);if(b){const me=We(b)?b.call(s):b;Reflect.ownKeys(me).forEach(he=>{uc(he,me[he])})}T&&Bl(T,t,"c");function Pe(me,he){Fe(he)?he.forEach(St=>me(St.bind(s))):he&&me(he.bind(s))}if(Pe(vf,E),Pe(ti,Z),Pe(_f,U),Pe(bf,G),Pe(pf,I),Pe(mf,R),Pe(kf,Ze),Pe(wf,Le),Pe(xf,Me),Pe(us,K),Pe(xc,de),Pe(yf,ve),Fe(te))if(te.length){const me=t.exposed||(t.exposed={});te.forEach(he=>{Object.defineProperty(me,he,{get:()=>s[he],set:St=>s[he]=St,enumerable:!0})})}else t.exposed||(t.exposed={});xe&&t.render===ci&&(t.render=xe),B!=null&&(t.inheritAttrs=B),F&&(t.components=F),se&&(t.directives=se),ve&&bc(t)}function Lf(t,i,s=ci){Fe(t)&&(t=jr(t));for(const l in t){const u=t[l];let f;dt(u)?"default"in u?f=Vs(u.from||l,u.default,!0):f=Vs(u.from||l):f=Vs(u),rn(f)?Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>f.value,set:h=>f.value=h}):i[l]=f}}function Bl(t,i,s){Hn(Fe(t)?t.map(l=>l.bind(i.proxy)):t.bind(i.proxy),i,s)}function kc(t,i,s,l){let u=l.includes(".")?dc(s,l):()=>s[l];if(Tt(t)){const f=i[t];We(f)&&Bt(u,f)}else if(We(t))Bt(u,t.bind(s));else if(dt(t))if(Fe(t))t.forEach(f=>kc(f,i,s,l));else{const f=We(t.handler)?t.handler.bind(s):i[t.handler];We(f)&&Bt(u,f,t)}}function Sc(t){const i=t.type,{mixins:s,extends:l}=i,{mixins:u,optionsCache:f,config:{optionMergeStrategies:h}}=t.appContext,_=f.get(i);let b;return _?b=_:!u.length&&!s&&!l?b=i:(b={},u.length&&u.forEach(C=>Fa(b,C,h,!0)),Fa(b,i,h)),dt(i)&&f.set(i,b),b}function Fa(t,i,s,l=!1){const{mixins:u,extends:f}=i;f&&Fa(t,f,s,!0),u&&u.forEach(h=>Fa(t,h,s,!0));for(const h in i)if(!(l&&h==="expose")){const _=Af[h]||s&&s[h];t[h]=_?_(t[h],i[h]):i[h]}return t}const Af={data:Ul,props:Vl,emits:Vl,methods:Ns,computed:Ns,beforeCreate:cn,created:cn,beforeMount:cn,mounted:cn,beforeUpdate:cn,updated:cn,beforeDestroy:cn,beforeUnmount:cn,destroyed:cn,unmounted:cn,activated:cn,deactivated:cn,errorCaptured:cn,serverPrefetch:cn,components:Ns,directives:Ns,watch:Ef,provide:Ul,inject:Mf};function Ul(t,i){return i?t?function(){return Kt(We(t)?t.call(this,this):t,We(i)?i.call(this,this):i)}:i:t}function Mf(t,i){return Ns(jr(t),jr(i))}function jr(t){if(Fe(t)){const i={};for(let s=0;si==="modelValue"||i==="model-value"?t.modelModifiers:t[`${i}Modifiers`]||t[`${Jn(i)}Modifiers`]||t[`${to(i)}Modifiers`];function If(t,i,...s){if(t.isUnmounted)return;const l=t.vnode.props||gt;let u=s;const f=i.startsWith("update:"),h=f&&$f(l,i.slice(7));h&&(h.trim&&(u=s.map(T=>Tt(T)?T.trim():T)),h.number&&(u=s.map(Ga)));let _,b=l[_=xr(i)]||l[_=xr(Jn(i))];!b&&f&&(b=l[_=xr(to(i))]),b&&Hn(b,t,6,u);const C=l[_+"Once"];if(C){if(!t.emitted)t.emitted={};else if(t.emitted[_])return;t.emitted[_]=!0,Hn(C,t,6,u)}}const Nf=new WeakMap;function Pc(t,i,s=!1){const l=s?Nf:i.emitsCache,u=l.get(t);if(u!==void 0)return u;const f=t.emits;let h={},_=!1;if(!We(t)){const b=C=>{const T=Pc(C,i,!0);T&&(_=!0,Kt(h,T))};!s&&i.mixins.length&&i.mixins.forEach(b),t.extends&&b(t.extends),t.mixins&&t.mixins.forEach(b)}return!f&&!_?(dt(t)&&l.set(t,null),null):(Fe(f)?f.forEach(b=>h[b]=null):Kt(h,f),dt(t)&&l.set(t,h),h)}function er(t,i){return!t||!ja(i)?!1:(i=i.slice(2),i=i==="Once"?i:i.replace(/Once$/,""),ct(t,i[0].toLowerCase()+i.slice(1))||ct(t,to(i))||ct(t,i))}function Zl(t){const{type:i,vnode:s,proxy:l,withProxy:u,propsOptions:[f],slots:h,attrs:_,emit:b,render:C,renderCache:T,props:E,data:Z,setupState:U,ctx:G,inheritAttrs:I}=t,R=Ia(t);let Q,K;try{if(s.shapeFlag&4){const de=u||l,xe=de;Q=li(C.call(xe,de,T,E,U,Z,G)),K=_}else{const de=i;Q=li(de.length>1?de(E,{attrs:_,slots:h,emit:b}):de(E,null)),K=i.props?_:Ff(_)}}catch(de){js.length=0,Ja(de,t,1),Q=A(sn)}let ke=Q;if(K&&I!==!1){const de=Object.keys(K),{shapeFlag:xe}=ke;de.length&&xe&7&&(f&&de.some(Wa)&&(K=Df(K,f)),ke=Qi(ke,K,!1,!0))}return s.dirs&&(ke=Qi(ke,null,!1,!0),ke.dirs=ke.dirs?ke.dirs.concat(s.dirs):s.dirs),s.transition&&qs(ke,s.transition),Q=ke,Ia(R),Q}const Ff=t=>{let i;for(const s in t)(s==="class"||s==="style"||ja(s))&&((i||(i={}))[s]=t[s]);return i},Df=(t,i)=>{const s={};for(const l in t)(!Wa(l)||!(l.slice(9)in i))&&(s[l]=t[l]);return s};function Rf(t,i,s){const{props:l,children:u,component:f}=t,{props:h,children:_,patchFlag:b}=i,C=f.emitsOptions;if(i.dirs||i.transition)return!0;if(s&&b>=0){if(b&1024)return!0;if(b&16)return l?Hl(l,h,C):!!h;if(b&8){const T=i.dynamicProps;for(let E=0;EObject.create(Lc),Mc=t=>Object.getPrototypeOf(t)===Lc;function Uf(t,i,s,l=!1){const u={},f=Ac();t.propsDefaults=Object.create(null),Ec(t,i,u,f);for(const h in t.propsOptions[0])h in u||(u[h]=void 0);s?t.props=l?u:jd(u):t.type.props?t.props=u:t.props=f,t.attrs=f}function Vf(t,i,s,l){const{props:u,attrs:f,vnode:{patchFlag:h}}=t,_=ut(u),[b]=t.propsOptions;let C=!1;if((l||h>0)&&!(h&16)){if(h&8){const T=t.vnode.dynamicProps;for(let E=0;E{b=!0;const[Z,U]=Oc(E,i,!0);Kt(h,Z),U&&_.push(...U)};!s&&i.mixins.length&&i.mixins.forEach(T),t.extends&&T(t.extends),t.mixins&&t.mixins.forEach(T)}if(!f&&!b)return dt(t)&&l.set(t,es),es;if(Fe(f))for(let T=0;Tt==="_"||t==="_ctx"||t==="$stable",dl=t=>Fe(t)?t.map(li):[li(t)],Hf=(t,i,s)=>{if(i._n)return i;const l=we((...u)=>dl(i(...u)),s);return l._c=!1,l},zc=(t,i,s)=>{const l=t._ctx;for(const u in t){if(cl(u))continue;const f=t[u];if(We(f))i[u]=Hf(u,f,l);else if(f!=null){const h=dl(f);i[u]=()=>h}}},$c=(t,i)=>{const s=dl(i);t.slots.default=()=>s},Ic=(t,i,s)=>{for(const l in i)(s||!cl(l))&&(t[l]=i[l])},jf=(t,i,s)=>{const l=t.slots=Ac();if(t.vnode.shapeFlag&32){const u=i._;u?(Ic(l,i,s),s&&Du(l,"_",u,!0)):zc(i,l)}else i&&$c(t,i)},Wf=(t,i,s)=>{const{vnode:l,slots:u}=t;let f=!0,h=gt;if(l.shapeFlag&32){const _=i._;_?s&&_===1?f=!1:Ic(u,i,s):(f=!i.$stable,zc(i,u)),h=i}else i&&($c(t,i),h={default:1});if(f)for(const _ in u)!cl(_)&&h[_]==null&&delete u[_]},dn=Jf;function Kf(t){return Gf(t)}function Gf(t,i){const s=qa();s.__VUE__=!0;const{insert:l,remove:u,patchProp:f,createElement:h,createText:_,createComment:b,setText:C,setElementText:T,parentNode:E,nextSibling:Z,setScopeId:U=ci,insertStaticContent:G}=t,I=(w,y,S,q=null,j=null,J=null,ce=void 0,ue=null,ae=!!y.dynamicChildren)=>{if(w===y)return;w&&!Lo(w,y)&&(q=zt(w),He(w,j,J,!0),w=null),y.patchFlag===-2&&(ae=!1,y.dynamicChildren=null);const{type:ne,ref:_e,shapeFlag:le}=y;switch(ne){case tr:R(w,y,S,q);break;case sn:Q(w,y,S,q);break;case Ar:w==null&&K(y,S,q,ce);break;case re:F(w,y,S,q,j,J,ce,ue,ae);break;default:le&1?xe(w,y,S,q,j,J,ce,ue,ae):le&6?se(w,y,S,q,j,J,ce,ue,ae):(le&64||le&128)&&ne.process(w,y,S,q,j,J,ce,ue,ae,Pt)}_e!=null&&j?Zs(_e,w&&w.ref,J,y||w,!y):_e==null&&w&&w.ref!=null&&Zs(w.ref,null,J,w,!0)},R=(w,y,S,q)=>{if(w==null)l(y.el=_(y.children),S,q);else{const j=y.el=w.el;y.children!==w.children&&C(j,y.children)}},Q=(w,y,S,q)=>{w==null?l(y.el=b(y.children||""),S,q):y.el=w.el},K=(w,y,S,q)=>{[w.el,w.anchor]=G(w.children,y,S,q,w.el,w.anchor)},ke=({el:w,anchor:y},S,q)=>{let j;for(;w&&w!==y;)j=Z(w),l(w,S,q),w=j;l(y,S,q)},de=({el:w,anchor:y})=>{let S;for(;w&&w!==y;)S=Z(w),u(w),w=S;u(y)},xe=(w,y,S,q,j,J,ce,ue,ae)=>{if(y.type==="svg"?ce="svg":y.type==="math"&&(ce="mathml"),w==null)Le(y,S,q,j,J,ce,ue,ae);else{const ne=w.el&&w.el._isVueCE?w.el:null;try{ne&&ne._beginPatch(),ve(w,y,j,J,ce,ue,ae)}finally{ne&&ne._endPatch()}}},Le=(w,y,S,q,j,J,ce,ue)=>{let ae,ne;const{props:_e,shapeFlag:le,transition:Te,dirs:Ae}=w;if(ae=w.el=h(w.type,J,_e&&_e.is,_e),le&8?T(ae,w.children):le&16&&Ze(w.children,ae,null,q,j,Lr(w,J),ce,ue),Ae&&wo(w,null,q,"created"),Me(ae,w,w.scopeId,ce,q),_e){for(const Ge in _e)Ge!=="value"&&!Rs(Ge)&&f(ae,Ge,null,_e[Ge],J,q);"value"in _e&&f(ae,"value",null,_e.value,J),(ne=_e.onVnodeBeforeMount)&&si(ne,q,w)}Ae&&wo(w,null,q,"beforeMount");const Ue=qf(j,Te);Ue&&Te.beforeEnter(ae),l(ae,y,S),((ne=_e&&_e.onVnodeMounted)||Ue||Ae)&&dn(()=>{try{ne&&si(ne,q,w),Ue&&Te.enter(ae),Ae&&wo(w,null,q,"mounted")}finally{}},j)},Me=(w,y,S,q,j)=>{if(S&&U(w,S),q)for(let J=0;J{for(let ne=ae;ne{const ue=y.el=w.el;let{patchFlag:ae,dynamicChildren:ne,dirs:_e}=y;ae|=w.patchFlag&16;const le=w.props||gt,Te=y.props||gt;let Ae;if(S&&ko(S,!1),(Ae=Te.onVnodeBeforeUpdate)&&si(Ae,S,y,w),_e&&wo(y,w,S,"beforeUpdate"),S&&ko(S,!0),ne&&(!w.dynamicChildren||w.dynamicChildren.length!==ne.length)&&(ae=0,ce=!1,ne=null),(le.innerHTML&&Te.innerHTML==null||le.textContent&&Te.textContent==null)&&T(ue,""),ne?te(w.dynamicChildren,ne,ue,S,q,Lr(y,j),J):ce||he(w,y,ue,null,S,q,Lr(y,j),J,!1),ae>0){if(ae&16)B(ue,le,Te,S,j);else if(ae&2&&le.class!==Te.class&&f(ue,"class",null,Te.class,j),ae&4&&f(ue,"style",le.style,Te.style,j),ae&8){const Ue=y.dynamicProps;for(let Ge=0;Ge{Ae&&si(Ae,S,y,w),_e&&wo(y,w,S,"updated")},q)},te=(w,y,S,q,j,J,ce)=>{for(let ue=0;ue{if(y!==S){if(y!==gt)for(const J in y)!Rs(J)&&!(J in S)&&f(w,J,y[J],null,j,q);for(const J in S){if(Rs(J))continue;const ce=S[J],ue=y[J];ce!==ue&&J!=="value"&&f(w,J,ue,ce,j,q)}"value"in S&&f(w,"value",y.value,S.value,j)}},F=(w,y,S,q,j,J,ce,ue,ae)=>{const ne=y.el=w?w.el:_(""),_e=y.anchor=w?w.anchor:_("");let{patchFlag:le,dynamicChildren:Te,slotScopeIds:Ae}=y;Ae&&(ue=ue?ue.concat(Ae):Ae),w==null?(l(ne,S,q),l(_e,S,q),Ze(y.children||[],S,_e,j,J,ce,ue,ae)):le>0&&le&64&&Te&&w.dynamicChildren&&w.dynamicChildren.length===Te.length?(te(w.dynamicChildren,Te,S,j,J,ce,ue),(y.key!=null||j&&y===j.subTree)&&fl(w,y,!0)):he(w,y,S,_e,j,J,ce,ue,ae)},se=(w,y,S,q,j,J,ce,ue,ae)=>{y.slotScopeIds=ue,w==null?y.shapeFlag&512?j.ctx.activate(y,S,q,ce,ae):M(y,S,q,j,J,ce,ae):H(w,y,ae)},M=(w,y,S,q,j,J,ce)=>{const ue=w.component=oh(w,q,j);if(Xa(w)&&(ue.ctx.renderer=Pt),sh(ue,!1,ce),ue.asyncDep){if(j&&j.registerDep(ue,Pe,ce),!w.el){const ae=ue.subTree=A(sn);Q(null,ae,y,S),w.placeholder=ae.el}}else Pe(ue,w,y,S,j,J,ce)},H=(w,y,S)=>{const q=y.component=w.component;if(Rf(w,y,S))if(q.asyncDep&&!q.asyncResolved){me(q,y,S);return}else q.next=y,q.update();else y.el=w.el,q.vnode=y},Pe=(w,y,S,q,j,J,ce)=>{const ue=()=>{if(w.isMounted){let{next:le,bu:Te,u:Ae,parent:Ue,vnode:Ge}=w;{const Jt=Nc(w);if(Jt){le&&(le.el=Ge.el,me(w,le,ce)),Jt.asyncDep.then(()=>{dn(()=>{w.isUnmounted||ne()},j)});return}}let qe=le,ht;ko(w,!1),le?(le.el=Ge.el,me(w,le,ce)):le=Ge,Te&&Ea(Te),(ht=le.props&&le.props.onVnodeBeforeUpdate)&&si(ht,Ue,le,Ge),ko(w,!0);const ft=Zl(w),Vt=w.subTree;w.subTree=ft,I(Vt,ft,E(Vt.el),zt(Vt),w,j,J),le.el=ft.el,qe===null&&Bf(w,ft.el),Ae&&dn(Ae,j),(ht=le.props&&le.props.onVnodeUpdated)&&dn(()=>si(ht,Ue,le,Ge),j)}else{let le;const{el:Te,props:Ae}=y,{bm:Ue,m:Ge,parent:qe,root:ht,type:ft}=w,Vt=is(y);ko(w,!1),Ue&&Ea(Ue),!Vt&&(le=Ae&&Ae.onVnodeBeforeMount)&&si(le,qe,y),ko(w,!0);{ht.ce&&ht.ce._hasShadowRoot()&&ht.ce._injectChildStyle(ft,w.parent?w.parent.type:void 0);const Jt=w.subTree=Zl(w);I(null,Jt,S,q,w,j,J),y.el=Jt.el}if(Ge&&dn(Ge,j),!Vt&&(le=Ae&&Ae.onVnodeMounted)){const Jt=y;dn(()=>si(le,qe,Jt),j)}(y.shapeFlag&256||qe&&is(qe.vnode)&&qe.vnode.shapeFlag&256)&&w.a&&dn(w.a,j),w.isMounted=!0,y=S=q=null}};w.scope.on();const ae=w.effect=new Vu(ue);w.scope.off();const ne=w.update=ae.run.bind(ae),_e=w.job=ae.runIfDirty.bind(ae);_e.i=w,_e.id=w.uid,ae.scheduler=()=>ul(_e),ko(w,!0),ne()},me=(w,y,S)=>{y.component=w;const q=w.vnode.props;w.vnode=y,w.next=null,Vf(w,y.props,q,S),Wf(w,y.children,S),di(),zl(w),fi()},he=(w,y,S,q,j,J,ce,ue,ae=!1)=>{const ne=w&&w.children,_e=w?w.shapeFlag:0,le=y.children,{patchFlag:Te,shapeFlag:Ae}=y;if(Te>0){if(Te&128){pe(ne,le,S,q,j,J,ce,ue,ae);return}else if(Te&256){St(ne,le,S,q,j,J,ce,ue,ae);return}}Ae&8?(_e&16&&Re(ne,j,J),le!==ne&&T(S,le)):_e&16?Ae&16?pe(ne,le,S,q,j,J,ce,ue,ae):Re(ne,j,J,!0):(_e&8&&T(S,""),Ae&16&&Ze(le,S,q,j,J,ce,ue,ae))},St=(w,y,S,q,j,J,ce,ue,ae)=>{w=w||es,y=y||es;const ne=w.length,_e=y.length,le=Math.min(ne,_e);let Te;for(Te=0;Te_e?Re(w,j,J,!0,!1,le):Ze(y,S,q,j,J,ce,ue,ae,le)},pe=(w,y,S,q,j,J,ce,ue,ae)=>{let ne=0;const _e=y.length;let le=w.length-1,Te=_e-1;for(;ne<=le&&ne<=Te;){const Ae=w[ne],Ue=y[ne]=ae?Ci(y[ne]):li(y[ne]);if(Lo(Ae,Ue))I(Ae,Ue,S,null,j,J,ce,ue,ae);else break;ne++}for(;ne<=le&&ne<=Te;){const Ae=w[le],Ue=y[Te]=ae?Ci(y[Te]):li(y[Te]);if(Lo(Ae,Ue))I(Ae,Ue,S,null,j,J,ce,ue,ae);else break;le--,Te--}if(ne>le){if(ne<=Te){const Ae=Te+1,Ue=Ae<_e?y[Ae].el:q;for(;ne<=Te;)I(null,y[ne]=ae?Ci(y[ne]):li(y[ne]),S,Ue,j,J,ce,ue,ae),ne++}}else if(ne>Te)for(;ne<=le;)He(w[ne],j,J,!0),ne++;else{const Ae=ne,Ue=ne,Ge=new Map;for(ne=Ue;ne<=Te;ne++){const Ct=y[ne]=ae?Ci(y[ne]):li(y[ne]);Ct.key!=null&&Ge.set(Ct.key,ne)}let qe,ht=0;const ft=Te-Ue+1;let Vt=!1,Jt=0;const Zt=new Array(ft);for(ne=0;ne=ft){He(Ct,j,J,!0);continue}let $t;if(Ct.key!=null)$t=Ge.get(Ct.key);else for(qe=Ue;qe<=Te;qe++)if(Zt[qe-Ue]===0&&Lo(Ct,y[qe])){$t=qe;break}$t===void 0?He(Ct,j,J,!0):(Zt[$t-Ue]=ne+1,$t>=Jt?Jt=$t:Vt=!0,I(Ct,y[$t],S,null,j,J,ce,ue,ae),ht++)}const pn=Vt?Yf(Zt):es;for(qe=pn.length-1,ne=ft-1;ne>=0;ne--){const Ct=Ue+ne,$t=y[Ct],kn=y[Ct+1],zi=Ct+1<_e?kn.el||Fc(kn):q;Zt[ne]===0?I(null,$t,S,zi,j,J,ce,ue,ae):Vt&&(qe<0||ne!==pn[qe]?Be($t,S,zi,2):qe--)}}},Be=(w,y,S,q,j=null)=>{const{el:J,type:ce,transition:ue,children:ae,shapeFlag:ne}=w;if(ne&6){Be(w.component.subTree,y,S,q);return}if(ne&128){w.suspense.move(y,S,q);return}if(ne&64){ce.move(w,y,S,Pt);return}if(ce===re){l(J,y,S);for(let le=0;leue.enter(J),j));else{const{leave:le,delayLeave:Te,afterLeave:Ae}=ue,Ue=()=>{w.ctx.isUnmounted?u(J):l(J,y,S)},Ge=()=>{const qe=J._isLeaving||!!J[Un];J._isLeaving&&J[Un](!0),ue.persisted&&!qe?Ue():le(J,()=>{Ue(),Ae&&Ae()})};Te?Te(J,Ue,Ge):Ge()}else l(J,y,S)},He=(w,y,S,q=!1,j=!1)=>{const{type:J,props:ce,ref:ue,children:ae,dynamicChildren:ne,shapeFlag:_e,patchFlag:le,dirs:Te,cacheIndex:Ae,memo:Ue}=w;if(le===-2&&(j=!1),ue!=null&&(di(),Zs(ue,null,S,w,!0),fi()),Ae!=null&&(y.renderCache[Ae]=void 0),_e&256){y.ctx.deactivate(w);return}const Ge=_e&1&&Te,qe=!is(w);let ht;if(qe&&(ht=ce&&ce.onVnodeBeforeUnmount)&&si(ht,y,w),_e&6)Ee(w.component,S,q);else{if(_e&128){w.suspense.unmount(S,q);return}Ge&&wo(w,null,y,"beforeUnmount"),_e&64?w.type.remove(w,y,S,Pt,q):ne&&!ne.hasOnce&&(J!==re||le>0&&le&64)?Re(ne,y,S,!1,!0):(J===re&&le&384||!j&&_e&16)&&Re(ae,y,S),q&&xt(w)}const ft=Ue!=null&&Ae==null;(qe&&(ht=ce&&ce.onVnodeUnmounted)||Ge||ft)&&dn(()=>{ht&&si(ht,y,w),Ge&&wo(w,null,y,"unmounted"),ft&&(w.el=null)},S)},xt=w=>{const{type:y,el:S,anchor:q,transition:j}=w;if(y===re){st(S,q);return}if(y===Ar){de(w);return}const J=()=>{u(S),j&&!j.persisted&&j.afterLeave&&j.afterLeave()};if(w.shapeFlag&1&&j&&!j.persisted){const{leave:ce,delayLeave:ue}=j,ae=()=>ce(S,J);ue?ue(w.el,J,ae):ae()}else J()},st=(w,y)=>{let S;for(;w!==y;)S=Z(w),u(w),w=S;u(y)},Ee=(w,y,S)=>{const{bum:q,scope:j,job:J,subTree:ce,um:ue,m:ae,a:ne}=w;Wl(ae),Wl(ne),q&&Ea(q),j.stop(),J&&(J.flags|=8,He(ce,w,y,S)),ue&&dn(ue,y),dn(()=>{w.isUnmounted=!0},y)},Re=(w,y,S,q=!1,j=!1,J=0)=>{for(let ce=J;ce{if(w.shapeFlag&6)return zt(w.component.subTree);if(w.shapeFlag&128)return w.suspense.next();const y=Z(w.anchor||w.el),S=y&&y[fc];return S?Z(S):y};let At=!1;const Ut=(w,y,S)=>{let q;w==null?y._vnode&&(He(y._vnode,null,null,!0),q=y._vnode.component):I(y._vnode||null,w,y,null,null,null,S),y._vnode=w,At||(At=!0,zl(q),ac(),At=!1)},Pt={p:I,um:He,m:Be,r:xt,mt:M,mc:Ze,pc:he,pbc:te,n:zt,o:t};return{render:Ut,hydrate:void 0,createApp:zf(Ut)}}function Lr({type:t,props:i},s){return s==="svg"&&t==="foreignObject"||s==="mathml"&&t==="annotation-xml"&&i&&i.encoding&&i.encoding.includes("html")?void 0:s}function ko({effect:t,job:i},s){s?(t.flags|=32,i.flags|=4):(t.flags&=-33,i.flags&=-5)}function qf(t,i){return(!t||t&&!t.pendingBranch)&&i&&!i.persisted}function fl(t,i,s=!1){const l=t.children,u=i.children;if(Fe(l)&&Fe(u))for(let f=0;f>1,t[s[_]]0&&(i[l]=s[f-1]),s[f]=l)}}for(f=s.length,h=s[f-1];f-- >0;)s[f]=h,h=i[h];return s}function Nc(t){const i=t.subTree.component;if(i)return i.asyncDep&&!i.asyncResolved?i:Nc(i)}function Wl(t){if(t)for(let i=0;it.__isSuspense;function Jf(t,i){i&&i.pendingBranch?Fe(t)?i.effects.push(...t):i.effects.push(t):nf(t)}const re=Symbol.for("v-fgt"),tr=Symbol.for("v-txt"),sn=Symbol.for("v-cmt"),Ar=Symbol.for("v-stc"),js=[];let zn=null;function p(t=!1){js.push(zn=t?null:[])}function Xf(){js.pop(),zn=js[js.length-1]||null}let Ys=1;function Da(t,i=!1){Ys+=t,t<0&&zn&&i&&(zn.hasOnce=!0)}function Rc(t){return t.dynamicChildren=Ys>0?zn||es:null,Xf(),Ys>0&&zn&&zn.push(t),t}function m(t,i,s,l,u,f){return Rc(a(t,i,s,l,u,f,!0))}function nt(t,i,s,l,u){return Rc(A(t,i,s,l,u,!0))}function Js(t){return t?t.__v_isVNode===!0:!1}function Lo(t,i){return t.type===i.type&&t.key===i.key}const Bc=({key:t})=>t??null,Oa=({ref:t,ref_key:i,ref_for:s})=>(typeof t=="number"&&(t=""+t),t!=null?Tt(t)||rn(t)||We(t)?{i:an,r:t,k:i,f:!!s}:t:null);function a(t,i=null,s=null,l=0,u=null,f=t===re?0:1,h=!1,_=!1){const b={__v_isVNode:!0,__v_skip:!0,type:t,props:i,key:i&&Bc(i),ref:i&&Oa(i),scopeId:lc,slotScopeIds:null,children:s,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:f,patchFlag:l,dynamicProps:u,dynamicChildren:null,appContext:null,ctx:an};return _?(Ra(b,s),f&128&&t.normalize(b)):s&&(b.shapeFlag|=Tt(s)?8:16),Ys>0&&!h&&zn&&(b.patchFlag>0||f&6)&&b.patchFlag!==32&&zn.push(b),b}const A=Qf;function Qf(t,i=null,s=null,l=0,u=null,f=!1){if((!t||t===Sf)&&(t=sn),Js(t)){const _=Qi(t,i,!0);return s&&Ra(_,s),Ys>0&&!f&&zn&&(_.shapeFlag&6?zn[zn.indexOf(t)]=_:zn.push(_)),_.patchFlag=-2,_}if(uh(t)&&(t=t.__vccOpts),i){i=eh(i);let{class:_,style:b}=i;_&&!Tt(_)&&(i.class=Ce(_)),dt(b)&&(ll(b)&&!Fe(b)&&(b=Kt({},b)),i.style=Eo(b))}const h=Tt(t)?1:Dc(t)?128:hc(t)?64:dt(t)?4:We(t)?2:0;return a(t,i,s,l,u,h,f,!0)}function eh(t){return t?ll(t)||Mc(t)?Kt({},t):t:null}function Qi(t,i,s=!1,l=!1){const{props:u,ref:f,patchFlag:h,children:_,transition:b}=t,C=i?th(u||{},i):u,T={__v_isVNode:!0,__v_skip:!0,type:t.type,props:C,key:C&&Bc(C),ref:i&&i.ref?s&&f?Fe(f)?f.concat(Oa(i)):[f,Oa(i)]:Oa(i):f,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:_,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:i&&t.type!==re?h===-1?16:h|16:h,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:b,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Qi(t.ssContent),ssFallback:t.ssFallback&&Qi(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return b&&l&&qs(T,b.clone(T)),T}function z(t=" ",i=0){return A(tr,null,t,i)}function $(t="",i=!1){return i?(p(),nt(sn,null,t)):A(sn,null,t)}function li(t){return t==null||typeof t=="boolean"?A(sn):Fe(t)?A(re,null,t.slice()):Js(t)?Ci(t):A(tr,null,String(t))}function Ci(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Qi(t)}function Ra(t,i){let s=0;const{shapeFlag:l}=t;if(i==null)i=null;else if(Fe(i))s=16;else if(typeof i=="object")if(l&65){const u=i.default;u&&(u._c&&(u._d=!1),Ra(t,u()),u._c&&(u._d=!0));return}else{s=32;const u=i._;!u&&!Mc(i)?i._ctx=an:u===3&&an&&(an.slots._===1?i._=1:(i._=2,t.patchFlag|=1024))}else if(We(i)){if(l&65){Ra(t,{default:i});return}i={default:i,_ctx:an},s=32}else i=String(i),l&64?(s=16,i=[z(i)]):s=8;t.children=i,t.shapeFlag|=s}function th(...t){const i={};for(let s=0;shn||an;let Ba,Kr;{const t=qa(),i=(s,l)=>{let u;return(u=t[s])||(u=t[s]=[]),u.push(l),f=>{u.length>1?u.forEach(h=>h(f)):u[0](f)}};Ba=i("__VUE_INSTANCE_SETTERS__",s=>hn=s),Kr=i("__VUE_SSR_SETTERS__",s=>Xs=s)}const na=t=>{const i=hn;return Ba(t),t.scope.on(),()=>{t.scope.off(),Ba(i)}},Kl=()=>{hn&&hn.scope.off(),Ba(null)};function Vc(t){return t.vnode.shapeFlag&4}let Xs=!1;function sh(t,i=!1,s=!1){i&&Kr(i);const{props:l,children:u}=t.vnode,f=Vc(t);Uf(t,l,f,i),jf(t,u,s||i);const h=f?ah(t,i):void 0;return i&&Kr(!1),h}function ah(t,i){const s=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Pf);const{setup:l}=s;if(l){di();const u=t.setupContext=l.length>1?lh(t):null,f=na(t),h=ta(l,t,0,[t.props,u]),_=$u(h);if(fi(),f(),(_||t.sp)&&!is(t)&&bc(t),_){if(h.then(Kl,Kl),i)return h.then(b=>{Gl(t,b)}).catch(b=>{Ja(b,t,0)});t.asyncDep=h}else Gl(t,h)}else Zc(t)}function Gl(t,i,s){We(i)?t.type.__ssrInlineRender?t.ssrRender=i:t.render=i:dt(i)&&(t.setupState=nc(i)),Zc(t)}function Zc(t,i,s){const l=t.type;t.render||(t.render=l.render||ci);{const u=na(t);di();try{Cf(t)}finally{fi(),u()}}}const rh={get(t,i){return on(t,"get",""),t[i]}};function lh(t){const i=s=>{t.exposed=s||{}};return{attrs:new Proxy(t.attrs,rh),slots:t.slots,emit:t.emit,expose:i}}function nr(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(nc(Wd(t.exposed)),{get(i,s){if(s in i)return i[s];if(s in Hs)return Hs[s](t)},has(i,s){return s in i||s in Hs}})):t.proxy}function uh(t){return We(t)&&"__vccOpts"in t}const fe=(t,i)=>Jd(t,i,Xs);function ch(t,i,s){try{Da(-1);const l=arguments.length;return l===2?dt(i)&&!Fe(i)?Js(i)?A(t,null,[i]):A(t,i):A(t,null,i):(l>3?s=Array.prototype.slice.call(arguments,2):l===3&&Js(s)&&(s=[s]),A(t,i,s))}finally{Da(1)}}const dh="3.5.39";/** +* @vue/runtime-dom v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Gr;const ql=typeof window<"u"&&window.trustedTypes;if(ql)try{Gr=ql.createPolicy("vue",{createHTML:t=>t})}catch{}const Hc=Gr?t=>Gr.createHTML(t):t=>t,fh="http://www.w3.org/2000/svg",hh="http://www.w3.org/1998/Math/MathML",Pi=typeof document<"u"?document:null,Yl=Pi&&Pi.createElement("template"),ph={insert:(t,i,s)=>{i.insertBefore(t,s||null)},remove:t=>{const i=t.parentNode;i&&i.removeChild(t)},createElement:(t,i,s,l)=>{const u=i==="svg"?Pi.createElementNS(fh,t):i==="mathml"?Pi.createElementNS(hh,t):s?Pi.createElement(t,{is:s}):Pi.createElement(t);return t==="select"&&l&&l.multiple!=null&&u.setAttribute("multiple",l.multiple),u},createText:t=>Pi.createTextNode(t),createComment:t=>Pi.createComment(t),setText:(t,i)=>{t.nodeValue=i},setElementText:(t,i)=>{t.textContent=i},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Pi.querySelector(t),setScopeId(t,i){t.setAttribute(i,"")},insertStaticContent(t,i,s,l,u,f){const h=s?s.previousSibling:i.lastChild;if(u&&(u===f||u.nextSibling))for(;i.insertBefore(u.cloneNode(!0),s),!(u===f||!(u=u.nextSibling)););else{Yl.innerHTML=Hc(l==="svg"?`${t}`:l==="mathml"?`${t}`:t);const _=Yl.content;if(l==="svg"||l==="mathml"){const b=_.firstChild;for(;b.firstChild;)_.appendChild(b.firstChild);_.removeChild(b)}i.insertBefore(_,s)}return[h?h.nextSibling:i.firstChild,s?s.previousSibling:i.lastChild]}},Gi="transition",zs="animation",Qs=Symbol("_vtc"),jc={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},mh=Kt({},pc,jc),gh=t=>(t.displayName="Transition",t.props=mh,t),vh=gh((t,{slots:i})=>ch(hf,_h(t),i)),So=(t,i=[])=>{Fe(t)?t.forEach(s=>s(...i)):t&&t(...i)},Jl=t=>t?Fe(t)?t.some(i=>i.length>1):t.length>1:!1;function _h(t){const i={};for(const F in t)F in jc||(i[F]=t[F]);if(t.css===!1)return i;const{name:s="v",type:l,duration:u,enterFromClass:f=`${s}-enter-from`,enterActiveClass:h=`${s}-enter-active`,enterToClass:_=`${s}-enter-to`,appearFromClass:b=f,appearActiveClass:C=h,appearToClass:T=_,leaveFromClass:E=`${s}-leave-from`,leaveActiveClass:Z=`${s}-leave-active`,leaveToClass:U=`${s}-leave-to`}=t,G=bh(u),I=G&&G[0],R=G&&G[1],{onBeforeEnter:Q,onEnter:K,onEnterCancelled:ke,onLeave:de,onLeaveCancelled:xe,onBeforeAppear:Le=Q,onAppear:Me=K,onAppearCancelled:Ze=ke}=i,ve=(F,se,M,H)=>{F._enterCancelled=H,To(F,se?T:_),To(F,se?C:h),M&&M()},te=(F,se)=>{F._isLeaving=!1,To(F,E),To(F,U),To(F,Z),se&&se()},B=F=>(se,M)=>{const H=F?Me:K,Pe=()=>ve(se,F,M);So(H,[se,Pe]),Xl(()=>{To(se,F?b:f),Ti(se,F?T:_),Jl(H)||Ql(se,l,I,Pe)})};return Kt(i,{onBeforeEnter(F){So(Q,[F]),Ti(F,f),Ti(F,h)},onBeforeAppear(F){So(Le,[F]),Ti(F,b),Ti(F,C)},onEnter:B(!1),onAppear:B(!0),onLeave(F,se){F._isLeaving=!0;const M=()=>te(F,se);Ti(F,E),F._enterCancelled?(Ti(F,Z),nu(F)):(nu(F),Ti(F,Z)),Xl(()=>{F._isLeaving&&(To(F,E),Ti(F,U),Jl(de)||Ql(F,l,R,M))}),So(de,[F,M])},onEnterCancelled(F){ve(F,!1,void 0,!0),So(ke,[F])},onAppearCancelled(F){ve(F,!0,void 0,!0),So(Ze,[F])},onLeaveCancelled(F){te(F),So(xe,[F])}})}function bh(t){if(t==null)return null;if(dt(t))return[Mr(t.enter),Mr(t.leave)];{const i=Mr(t);return[i,i]}}function Mr(t){return _d(t)}function Ti(t,i){i.split(/\s+/).forEach(s=>s&&t.classList.add(s)),(t[Qs]||(t[Qs]=new Set)).add(i)}function To(t,i){i.split(/\s+/).forEach(l=>l&&t.classList.remove(l));const s=t[Qs];s&&(s.delete(i),s.size||(t[Qs]=void 0))}function Xl(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let yh=0;function Ql(t,i,s,l){const u=t._endId=++yh,f=()=>{u===t._endId&&l()};if(s!=null)return setTimeout(f,s);const{type:h,timeout:_,propCount:b}=xh(t,i);if(!h)return l();const C=h+"end";let T=0;const E=()=>{t.removeEventListener(C,Z),f()},Z=U=>{U.target===t&&++T>=b&&E()};setTimeout(()=>{T(s[G]||"").split(", "),u=l(`${Gi}Delay`),f=l(`${Gi}Duration`),h=eu(u,f),_=l(`${zs}Delay`),b=l(`${zs}Duration`),C=eu(_,b);let T=null,E=0,Z=0;i===Gi?h>0&&(T=Gi,E=h,Z=f.length):i===zs?C>0&&(T=zs,E=C,Z=b.length):(E=Math.max(h,C),T=E>0?h>C?Gi:zs:null,Z=T?T===Gi?f.length:b.length:0);const U=T===Gi&&/\b(?:transform|all)(?:,|$)/.test(l(`${Gi}Property`).toString());return{type:T,timeout:E,propCount:Z,hasTransform:U}}function eu(t,i){for(;t.lengthtu(s)+tu(t[l])))}function tu(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function nu(t){return(t?t.ownerDocument:document).body.offsetHeight}function wh(t,i,s){const l=t[Qs];l&&(i=(i?[i,...l]:[...l]).join(" ")),i==null?t.removeAttribute("class"):s?t.setAttribute("class",i):t.className=i}const Ua=Symbol("_vod"),Wc=Symbol("_vsh"),kh={name:"show",beforeMount(t,{value:i},{transition:s}){t[Ua]=t.style.display==="none"?"":t.style.display,s&&i?s.beforeEnter(t):$s(t,i)},mounted(t,{value:i},{transition:s}){s&&i&&s.enter(t)},updated(t,{value:i,oldValue:s},{transition:l}){!i!=!s&&(l?i?(l.beforeEnter(t),$s(t,!0),l.enter(t)):l.leave(t,()=>{$s(t,!1)}):$s(t,i))},beforeUnmount(t,{value:i}){$s(t,i)}};function $s(t,i){t.style.display=i?t[Ua]:"none",t[Wc]=!i}const Sh=Symbol(""),Th=/(?:^|;)\s*display\s*:/;function Ph(t,i,s){const l=t.style,u=Tt(s);let f=!1;if(s&&!u){if(i)if(Tt(i))for(const h of i.split(";")){const _=h.slice(0,h.indexOf(":")).trim();s[_]==null&&Fs(l,_,"")}else for(const h in i)s[h]==null&&Fs(l,h,"");for(const h in s){h==="display"&&(f=!0);const _=s[h];_!=null?Lh(t,h,!Tt(i)&&i?i[h]:void 0,_)||Fs(l,h,_):Fs(l,h,"")}}else if(u){if(i!==s){const h=l[Sh];h&&(s+=";"+h),l.cssText=s,f=Th.test(s)}}else i&&t.removeAttribute("style");Ua in t&&(t[Ua]=f?l.display:"",t[Wc]&&(l.display="none"))}const iu=/\s*!important$/;function Fs(t,i,s){if(Fe(s))s.forEach(l=>Fs(t,i,l));else if(s==null&&(s=""),i.startsWith("--"))t.setProperty(i,s);else{const l=Ch(t,i);iu.test(s)?t.setProperty(to(l),s.replace(iu,""),"important"):t[l]=s}}const ou=["Webkit","Moz","ms"],Er={};function Ch(t,i){const s=Er[i];if(s)return s;let l=Jn(i);if(l!=="filter"&&l in t)return Er[i]=l;l=Fu(l);for(let u=0;uOr||($h.then(()=>Or=0),Or=Date.now());function Nh(t,i){const s=l=>{if(!l._vts)l._vts=Date.now();else if(l._vts<=s.attached)return;const u=s.value;if(Fe(u)){const f=l.stopImmediatePropagation;l.stopImmediatePropagation=()=>{f.call(l),l._stopped=!0};const h=u.slice(),_=[l];for(let b=0;bt.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Fh=(t,i,s,l,u,f)=>{const h=u==="svg";i==="class"?wh(t,l,h):i==="style"?Ph(t,s,l):ja(i)?Wa(i)||Mh(t,i,s,l,f):(i[0]==="."?(i=i.slice(1),!0):i[0]==="^"?(i=i.slice(1),!1):Dh(t,i,l,h))?(ru(t,i,l),!t.tagName.includes("-")&&(i==="value"||i==="checked"||i==="selected")&&au(t,i,l,h,f,i!=="value")):t._isVueCE&&(Rh(t,i)||t._def.__asyncLoader&&(/[A-Z]/.test(i)||!Tt(l)))?ru(t,Jn(i),l,f,i):(i==="true-value"?t._trueValue=l:i==="false-value"&&(t._falseValue=l),au(t,i,l,h))};function Dh(t,i,s,l){if(l)return!!(i==="innerHTML"||i==="textContent"||i in t&&uu(i)&&We(s));if(i==="spellcheck"||i==="draggable"||i==="translate"||i==="autocorrect"||i==="sandbox"&&t.tagName==="IFRAME"||i==="form"||i==="list"&&t.tagName==="INPUT"||i==="type"&&t.tagName==="TEXTAREA")return!1;if(i==="width"||i==="height"){const u=t.tagName;if(u==="IMG"||u==="VIDEO"||u==="CANVAS"||u==="SOURCE")return!1}return uu(i)&&Tt(s)?!1:i in t}function Rh(t,i){const s=t._def.props;if(!s)return!1;const l=Jn(i);return Array.isArray(s)?s.some(u=>Jn(u)===l):Object.keys(s).some(u=>Jn(u)===l)}const eo=t=>{const i=t.props["onUpdate:modelValue"]||!1;return Fe(i)?s=>Ea(i,s):i};function Bh(t){t.target.composing=!0}function cu(t){const i=t.target;i.composing&&(i.composing=!1,i.dispatchEvent(new Event("input")))}const Zn=Symbol("_assign");function du(t,i,s){return i&&(t=t.trim()),s&&(t=Ga(t)),t}const ge={created(t,{modifiers:{lazy:i,trim:s,number:l}},u){t[Zn]=eo(u);const f=l||u.props&&u.props.type==="number";Mi(t,i?"change":"input",h=>{h.target.composing||t[Zn](du(t.value,s,f))}),(s||f)&&Mi(t,"change",()=>{t.value=du(t.value,s,f)}),i||(Mi(t,"compositionstart",Bh),Mi(t,"compositionend",cu),Mi(t,"change",cu))},mounted(t,{value:i}){t.value=i??""},beforeUpdate(t,{value:i,oldValue:s,modifiers:{lazy:l,trim:u,number:f}},h){if(t[Zn]=eo(h),t.composing)return;const _=(f||t.type==="number")&&!/^0\d/.test(t.value)?Ga(t.value):t.value,b=i??"";if(_===b)return;const C=t.getRootNode();(C instanceof Document||C instanceof ShadowRoot)&&C.activeElement===t&&t.type!=="range"&&(l&&i===s||u&&t.value.trim()===b)||(t.value=b)}},Va={deep:!0,created(t,i,s){t[Zn]=eo(s),Mi(t,"change",()=>{const l=t._modelValue,u=rs(t),f=t.checked,h=t[Zn];if(Fe(l)){const _=tl(l,u),b=_!==-1;if(f&&!b)h(l.concat(u));else if(!f&&b){const C=[...l];C.splice(_,1),h(C)}}else if(ls(l)){const _=new Set(l);f?_.add(u):_.delete(u),h(_)}else h(Kc(t,f))})},mounted:fu,beforeUpdate(t,i,s){t[Zn]=eo(s),fu(t,i,s)}};function fu(t,{value:i,oldValue:s},l){t._modelValue=i;let u;if(Fe(i))u=tl(i,l.props.value)>-1;else if(ls(i))u=i.has(l.props.value);else{if(i===s)return;u=Xi(i,Kc(t,!0))}t.checked!==u&&(t.checked=u)}const Uh={created(t,{value:i},s){t.checked=Xi(i,s.props.value),t[Zn]=eo(s),Mi(t,"change",()=>{t[Zn](rs(t))})},beforeUpdate(t,{value:i,oldValue:s},l){t[Zn]=eo(l),i!==s&&(t.checked=Xi(i,l.props.value))}},Ot={deep:!0,created(t,{value:i,modifiers:{number:s}},l){const u=ls(i);Mi(t,"change",()=>{const f=Array.prototype.filter.call(t.options,h=>h.selected).map(h=>s?Ga(rs(h)):rs(h));t[Zn](t.multiple?u?new Set(f):f:f[0]),t._assigning=!0,oc(()=>{t._assigning=!1})}),t[Zn]=eo(l)},mounted(t,{value:i}){hu(t,i)},beforeUpdate(t,i,s){t[Zn]=eo(s)},updated(t,{value:i}){t._assigning||hu(t,i)}};function hu(t,i){const s=t.multiple,l=Fe(i);if(!(s&&!l&&!ls(i))){for(let u=0,f=t.options.length;uString(C)===String(_)):h.selected=tl(i,_)>-1}else h.selected=i.has(_);else if(Xi(rs(h),i)){t.selectedIndex!==u&&(t.selectedIndex=u);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function rs(t){return"_value"in t?t._value:t.value}function Kc(t,i){const s=i?"_trueValue":"_falseValue";return s in t?t[s]:i}const Vh={created(t,i,s){Aa(t,i,s,null,"created")},mounted(t,i,s){Aa(t,i,s,null,"mounted")},beforeUpdate(t,i,s,l){Aa(t,i,s,l,"beforeUpdate")},updated(t,i,s,l){Aa(t,i,s,l,"updated")}};function Zh(t,i){switch(t){case"SELECT":return Ot;case"TEXTAREA":return ge;default:switch(i){case"checkbox":return Va;case"radio":return Uh;default:return ge}}}function Aa(t,i,s,l,u){const h=Zh(t.tagName,s.props&&s.props.type)[u];h&&h(t,i,s,l)}const Hh=["ctrl","shift","alt","meta"],jh={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,i)=>Hh.some(s=>t[`${s}Key`]&&!i.includes(s))},hl=(t,i)=>{if(!t)return t;const s=t._withMods||(t._withMods={}),l=i.join(".");return s[l]||(s[l]=((u,...f)=>{for(let h=0;h{const s=t._withKeys||(t._withKeys={}),l=i.join(".");return s[l]||(s[l]=(u=>{if(!("key"in u))return;const f=to(u.key);if(i.some(h=>h===f||Wh[h]===f))return t(u)}))},Kh=Kt({patchProp:Fh},ph);let mu;function Gh(){return mu||(mu=Kf(Kh))}const qh=((...t)=>{const i=Gh().createApp(...t),{mount:s}=i;return i.mount=l=>{const u=Jh(l);if(!u)return;const f=i._component;!We(f)&&!f.render&&!f.template&&(f.template=u.innerHTML),u.nodeType===1&&(u.textContent="");const h=s(u,!1,Yh(u));return u instanceof Element&&(u.removeAttribute("v-cloak"),u.setAttribute("data-v-app","")),h},i});function Yh(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Jh(t){return Tt(t)?document.querySelector(t):t}const Gc="pv_theme",gu={light:"#EEF0F3",dark:"#0B1730"},Za=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;function qc(){return Za&&Za.matches?"dark":"light"}function Xh(){try{return localStorage.getItem(Gc)||"light"}catch{return"light"}}function Yc(t){return t==="system"?qc():t}function Jc(t){const i=document.documentElement;i.setAttribute("data-theme",t),i.style.backgroundColor=gu[t]||gu.light}const Oo=Y(Xh()),ss=Y(Yc(Oo.value));function Ha(t){Oo.value=t;const i=Yc(t);ss.value=i,Jc(i);try{localStorage.setItem(Gc,t)}catch{}}function vu(){Ha(ss.value==="dark"?"light":"dark")}Za&&Za.addEventListener("change",()=>{if(Oo.value==="system"){const t=qc();ss.value=t,Jc(t)}});async function Qh(){try{const t=await fetch("/bff/config");return t.ok?await t.json():{apiBase:""}}catch{return{apiBase:""}}}async function _u(){try{const t=await fetch("/bff/me");return t.ok?await t.json():null}catch{return null}}async function ep(t,i,s){const l=await fetch("/bff/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,apiBase:s})});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function tp(){try{await fetch("/bff/logout",{method:"POST"})}catch{}}async function np(){try{const t=await fetch("/bff/devices");return t.ok?await t.json():[]}catch{return[]}}async function ip(){try{const t=await fetch("/bff/users");return t.ok?{ok:!0,status:200,users:(await t.json()).users||[]}:{ok:!1,status:t.status,users:[]}}catch{return{ok:!1,status:0,users:[]}}}async function op(t,i,s,l){const u=await fetch("/bff/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,role:s,organization:l})});return{ok:u.ok,status:u.status,body:await u.json().catch(()=>({}))}}async function sp(t,i){const s=await fetch(`/bff/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function ap(t){const i=await fetch(`/bff/users/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function rp(){try{const t=await fetch("/bff/orgs");return t.ok?{ok:!0,status:200,organizations:(await t.json()).organizations||[]}:{ok:!1,status:t.status,organizations:[]}}catch{return{ok:!1,status:0,organizations:[]}}}async function lp(t){const i=await fetch("/bff/orgs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t})});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function up(t,i){const s=await fetch(`/bff/orgs/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function cp(t){const i=await fetch(`/bff/orgs/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function dp(){try{const t=await fetch("/bff/preferences");if(!t.ok)return null;const i=await t.json();return i&&typeof i.preferences=="object"?i.preferences:null}catch{return null}}async function fp(t){try{return(await fetch("/bff/preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({preferences:t})})).ok}catch{return!1}}async function hp(){try{const t=await fetch("/bff/integrations/opensky");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function bu(t){const i=await fetch("/bff/integrations/opensky",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function pp(t){const i=t?`?bbox=${encodeURIComponent(t)}`:"",s=await fetch(`/bff/integrations/opensky/health${i}`,{method:"POST"});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function mp(t){try{const i=t?`?bbox=${encodeURIComponent(t)}`:"",s=await fetch(`/bff/integrations/opensky/states${i}`);if(!s.ok)return{states:[],unavailable:!0,detail:"OpenSky unavailable"};const l=await s.json();return{states:l.states||[],time:l.time,unavailable:!!l.unavailable,detail:l.detail||"",plan:l.plan||"",recommendedInterval:l.recommendedInterval||0}}catch{return{states:[],unavailable:!0,detail:"OpenSky unavailable"}}}async function gp(){try{const t=await fetch("/bff/integrations/filetransfer");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function yu(t){const i=await fetch("/bff/integrations/filetransfer",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function vp(){const t=await fetch("/bff/integrations/filetransfer/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function _p(){try{const t=await fetch("/bff/integrations/localstorage");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function Ma(t){const i=await fetch("/bff/integrations/localstorage",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function bp(){const t=await fetch("/bff/integrations/localstorage/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function yp(){try{const t=await fetch("/bff/integrations/webdav");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function xu(t){const i=await fetch("/bff/integrations/webdav",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function xp(){const t=await fetch("/bff/integrations/webdav/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function wp(){try{const t=await fetch("/bff/integrations/openweather");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function wu(t){const i=await fetch("/bff/integrations/openweather",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function kp(){const t=await fetch("/bff/integrations/openweather/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function Sp(t,i){try{const s=t!=null&&i!=null?`?lat=${encodeURIComponent(t)}&lon=${encodeURIComponent(i)}`:"",l=await fetch(`/bff/integrations/openweather/current${s}`);return l.ok?await l.json():{unavailable:!0,detail:"Weather unavailable"}}catch{return{unavailable:!0,detail:"Weather unavailable"}}}async function pl(){try{const t=await fetch("/bff/drones");return t.ok?{ok:!0,status:200,drones:(await t.json()).drones||[]}:{ok:!1,status:t.status,drones:[]}}catch{return{ok:!1,status:0,drones:[]}}}async function Tp(t){const i=await fetch("/bff/drones",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Pp(t){try{const i=await fetch("/bff/drones/auto",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function Cp(t,i){const s=await fetch(`/bff/drones/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function Lp(t){const i=await fetch(`/bff/drones/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Ap(){try{const t=await fetch("/bff/flights");return t.ok?{ok:!0,status:200,flights:(await t.json()).flights||[]}:{ok:!1,status:t.status,flights:[]}}catch{return{ok:!1,status:0,flights:[]}}}async function Mp(t){const i=await fetch("/bff/flights",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Ep(t,i){const s=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function Op(t){const i=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function zp(){return"/bff/logbook/export"}async function $p(){try{const t=await fetch("/bff/routes");return t.ok?{ok:!0,status:200,routes:(await t.json()).routes||[]}:{ok:!1,status:t.status,routes:[]}}catch{return{ok:!1,status:0,routes:[]}}}async function Ip(t){try{const i=t!=null&&t!==""?`?expiring=${encodeURIComponent(t)}`:"",s=await fetch(`/bff/documents${i}`);return s.ok?{ok:!0,status:200,documents:(await s.json()).documents||[]}:{ok:!1,status:s.status,documents:[]}}catch{return{ok:!1,status:0,documents:[]}}}async function Np(t,i){const s=new FormData;Object.entries(t).forEach(([u,f])=>{f!=null&&f!==""&&s.append(u,f)}),i&&s.append("file",i);const l=await fetch("/bff/documents",{method:"POST",body:s});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function Fp(t,i){const s=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function Dp(t){const i=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function zr(t){return`/bff/documents/${encodeURIComponent(t)}/file`}function Rp(t){return`/bff/documents/${encodeURIComponent(t)}/file?inline=1`}async function Bp(t,i,s){const l=await fetch(`/bff/devices/${encodeURIComponent(t)}/command`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:i,payload:s})});return{ok:l.ok,body:await l.json().catch(()=>({}))}}const Xc="pv_prefs",qr={name:"",username:"",displayName:"",bio:"",avatar:"",showEmail:!1,fontSize:"md",language:"en",region:"US",dateFormat:"MDY",timeFormat:"24",reduceMotion:!1,showAirTraffic:!0,autoBbox:!0,airTrafficInterval:"auto",twoFactor:!1};function Up(){try{return{...qr,...JSON.parse(localStorage.getItem(Xc)||"{}")||{}}}catch{return{...qr}}}const ye=mt(Up());function Qc(){try{localStorage.setItem(Xc,JSON.stringify(ye))}catch{}}function ed(t){if(!t||typeof t!="object")return!1;for(const i of Object.keys(qr))i in t&&(ye[i]=t[i]);return!0}const Vp={sm:15,md:16,lg:18};function ml(t){document.documentElement.style.fontSize=(Vp[t]||16)+"px"}function gl(t){document.documentElement.classList.toggle("reduce-motion",!!t)}function td(t){const i=new Date(t),s=i.getFullYear(),l=String(i.getMonth()+1).padStart(2,"0"),u=String(i.getDate()).padStart(2,"0");let f;switch(ye.dateFormat){case"DMY":f=`${u}/${l}/${s}`;break;case"YMD":f=`${s}/${l}/${u}`;break;case"ISO":f=`${s}-${l}-${u}`;break;default:f=`${l}/${u}/${s}`}let h;return ye.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:f,time:h}}function ku(t){return td(t).time}function Su(t){const i=td(t);return`${i.date} ${i.time}`}let vl=!1,Yr=!1,Jr=null;function Zp(){return{...JSON.parse(JSON.stringify(ye)),themeMode:Oo.value}}function _l(){!vl||Yr||(clearTimeout(Jr),Jr=setTimeout(()=>{fp(Zp())},600))}function Hp(t){Yr=!0;try{ed(t),t.themeMode&&Ha(t.themeMode),ml(ye.fontSize),gl(ye.reduceMotion),Qc()}finally{Yr=!1}}async function Tu(){vl=!0;const t=await dp();t&&Object.keys(t).length?Hp(t):_l()}function jp(){vl=!1,clearTimeout(Jr)}Bt(ye,()=>{Qc(),_l()},{deep:!0});Bt(Oo,_l);Bt(()=>ye.fontSize,ml,{immediate:!0});Bt(()=>ye.reduceMotion,gl,{immediate:!0});const Wp=["width","height"],nd={__name:"BrandMark",props:{size:{type:[Number,String],default:28}},setup(t){return(i,s)=>(p(),m("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none","aria-hidden":"true"},[...s[0]||(s[0]=[a("g",{"stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"},[a("polyline",{points:"8,30 19,17 30,30",stroke:"var(--accent)"}),a("polyline",{points:"18,33 29,20 40,33",stroke:"currentColor"})],-1)])],8,Wp))}},Kp=["title","aria-label"],Gp={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},qp={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Yp={__name:"ThemeToggle",setup(t){return(i,s)=>(p(),m("button",{class:"btn-icon",type:"button",title:Ie(ss)==="dark"?"Switch to light":"Switch to dark","aria-label":Ie(ss)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:s[0]||(s[0]=(...l)=>Ie(vu)&&Ie(vu)(...l))},[Ie(ss)==="dark"?(p(),m("svg",Gp,[...s[1]||(s[1]=[a("circle",{cx:"12",cy:"12",r:"4"},null,-1),a("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)])])):(p(),m("svg",qp,[...s[2]||(s[2]=[a("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z"},null,-1)])]))],8,Kp))}},Jp={class:"relative grid h-full place-items-center p-5"},Xp={class:"absolute right-5 top-5"},Qp={class:"mb-6 flex items-center gap-3 text-ink"},em={class:"relative mb-1"},tm=["type"],nm=["aria-label","title"],im={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]"},om={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]"},sm={key:0,class:"mt-4"},am={key:1,class:"mt-4 rounded border border-line bg-danger-soft px-3 py-2 text-sm text-danger-fg"},rm=["disabled"],lm={__name:"LoginView",props:{defaultApiBase:{type:String,default:""}},emits:["signed-in"],setup(t,{emit:i}){const s=t,l=i,u=Y(""),f=Y(""),h=Y(localStorage.getItem("api_url")||s.defaultApiBase||"http://localhost:8080"),_=Y(!1),b=Y(!1),C=Y(!1),T=Y("");async function E(){C.value=!0,T.value="",localStorage.setItem("api_url",h.value.trim());const{ok:Z,status:U,body:G}=await ep(u.value.trim(),f.value,h.value.trim());if(C.value=!1,Z){l("signed-in",G.email);return}T.value=U===400?"Invalid email or password.":U===502?"API server can't reach PocketBase.":G.message||G.error||"Cannot reach the API server."}return(Z,U)=>(p(),m("div",Jp,[a("div",Xp,[A(Yp)]),a("form",{class:"panel w-[380px] p-8 shadow-md",onSubmit:hl(E,["prevent"])},[a("div",Qp,[A(nd,{size:34}),U[5]||(U[5]=a("div",{class:"leading-tight"},[a("div",{class:"text-mode"},"PilotVault"),a("div",{class:"eyebrow mt-0.5"},"Control panel")],-1))]),U[9]||(U[9]=a("label",{class:"eyebrow mb-1.5 block"},"Email",-1)),oe(a("input",{"onUpdate:modelValue":U[0]||(U[0]=G=>u.value=G),type:"email",autocomplete:"username",required:"",class:"field mb-4",placeholder:"you@example.com"},null,512),[[ge,u.value]]),U[10]||(U[10]=a("label",{class:"eyebrow mb-1.5 block"},"Password",-1)),a("div",em,[oe(a("input",{"onUpdate:modelValue":U[1]||(U[1]=G=>f.value=G),type:b.value?"text":"password",autocomplete:"current-password",required:"",class:"field w-full pr-10",placeholder:"••••••••"},null,8,tm),[[Vh,f.value]]),a("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":b.value?"Hide password":"Show password",title:b.value?"Hide password":"Show password",onClick:U[2]||(U[2]=G=>b.value=!b.value)},[b.value?(p(),m("svg",im,[...U[6]||(U[6]=[a("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),a("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])])):(p(),m("svg",om,[...U[7]||(U[7]=[a("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),a("circle",{cx:"12",cy:"12",r:"3"},null,-1)])]))],8,nm)]),_.value?(p(),m("div",sm,[U[8]||(U[8]=a("label",{class:"eyebrow mb-1.5 block"},"API Server",-1)),oe(a("input",{"onUpdate:modelValue":U[3]||(U[3]=G=>h.value=G),type:"text",class:"field font-mono",placeholder:"10.2.1.101:8080"},null,512),[[ge,h.value]])])):$("",!0),T.value?(p(),m("p",am,x(T.value),1)):$("",!0),a("button",{type:"submit",class:"btn-accent mt-6 w-full",disabled:C.value},x(C.value?"Signing in…":"Sign in"),9,rm),a("button",{type:"button",class:"mx-auto mt-3 block text-xs text-ink-muted transition hover:text-ink-secondary",onClick:U[4]||(U[4]=G=>_.value=!_.value)},x(_.value?"Hide server settings":"Server settings"),1)],32)]))}};function um(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ds={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 cm=Ds.exports,Pu;function dm(){return Pu||(Pu=1,(function(t,i){(function(s,l){l(i)})(cm,(function(s){var l="1.9.4";function u(e){var n,o,r,d;for(o=1,r=arguments.length;o"u"||!L||!L.Mixin)){e=ke(e)?e:[e];for(var n=0;n0?Math.floor(e):Math.ceil(e)};he.prototype={clone:function(){return new he(this.x,this.y)},add:function(e){return this.clone()._add(pe(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(pe(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},scaleBy:function(e){return new he(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new he(this.x/e.x,this.y/e.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=St(this.x),this.y=St(this.y),this},distanceTo:function(e){e=pe(e);var n=e.x-this.x,o=e.y-this.y;return Math.sqrt(n*n+o*o)},equals:function(e){return e=pe(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=pe(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+Z(this.x)+", "+Z(this.y)+")"}};function pe(e,n,o){return e instanceof he?e:ke(e)?new he(e[0],e[1]):e==null?e:typeof e=="object"&&"x"in e&&"y"in e?new he(e.x,e.y):new he(e,n,o)}function Be(e,n){if(e)for(var o=n?[e,n]:e,r=0,d=o.length;r=this.min.x&&o.x<=this.max.x&&n.y>=this.min.y&&o.y<=this.max.y},intersects:function(e){e=He(e);var n=this.min,o=this.max,r=e.min,d=e.max,v=d.x>=n.x&&r.x<=o.x,P=d.y>=n.y&&r.y<=o.y;return v&&P},overlaps:function(e){e=He(e);var n=this.min,o=this.max,r=e.min,d=e.max,v=d.x>n.x&&r.xn.y&&r.y=n.lat&&d.lat<=o.lat&&r.lng>=n.lng&&d.lng<=o.lng},intersects:function(e){e=st(e);var n=this._southWest,o=this._northEast,r=e.getSouthWest(),d=e.getNorthEast(),v=d.lat>=n.lat&&r.lat<=o.lat,P=d.lng>=n.lng&&r.lng<=o.lng;return v&&P},overlaps:function(e){e=st(e);var n=this._southWest,o=this._northEast,r=e.getSouthWest(),d=e.getNorthEast(),v=d.lat>n.lat&&r.latn.lng&&r.lng1,jn=(function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",E,n),window.removeEventListener("testPassiveEventSupport",E,n)}catch{}return e})(),V=(function(){return!!document.createElement("canvas").getContext})(),O=!!(document.createElementNS&&q("svg").createSVGRect),ze=!!O&&(function(){var e=document.createElement("div");return e.innerHTML="",(e.firstChild&&e.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),tt=!O&&(function(){try{var e=document.createElement("div");e.innerHTML='';var n=e.firstChild;return n.style.behavior="url(#default#VML)",n&&typeof n.adj=="object"}catch{return!1}})(),It=navigator.platform.indexOf("Mac")===0,kt=navigator.platform.indexOf("Linux")===0;function Et(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var W={ie:ce,ielt9:ue,edge:ae,webkit:ne,android:_e,android23:le,androidStock:Ae,opera:Ue,chrome:Ge,gecko:qe,safari:ht,phantom:ft,opera12:Vt,win:Jt,ie3d:Zt,webkit3d:pn,gecko3d:Ct,any3d:$t,mobile:kn,mobileWebkit:zi,mobileWebkit3d:at,msPointer:Sn,pointer:$i,touch:hi,touchNative:rt,mobileOpera:pi,mobileGecko:Ii,retina:Gt,passiveEvents:jn,canvas:V,svg:O,vml:tt,inlineSvg:ze,mac:It,linux:kt},vt=W.msPointer?"MSPointerDown":"pointerdown",_t=W.msPointer?"MSPointerMove":"pointermove",oa=W.msPointer?"MSPointerUp":"pointerup",cs=W.msPointer?"MSPointerCancel":"pointercancel",no={touchstart:vt,touchmove:_t,touchend:oa,touchcancel:cs},sa={touchstart:ds,touchmove:Wn,touchend:Wn,touchcancel:Wn},Ni={},aa=!1;function ir(e,n,o){return n==="touchstart"&<(),sa[n]?(o=sa[n].bind(this,o),e.addEventListener(no[n],o,!1),o):(console.warn("wrong event specified:",n),E)}function ra(e,n,o){if(!no[n]){console.warn("wrong event specified:",n);return}e.removeEventListener(no[n],o,!1)}function or(e){Ni[e.pointerId]=e}function sr(e){Ni[e.pointerId]&&(Ni[e.pointerId]=e)}function la(e){delete Ni[e.pointerId]}function lt(){aa||(document.addEventListener(vt,or,!0),document.addEventListener(_t,sr,!0),document.addEventListener(oa,la,!0),document.addEventListener(cs,la,!0),aa=!0)}function Wn(e,n){if(n.pointerType!==(n.MSPOINTER_TYPE_MOUSE||"mouse")){n.touches=[];for(var o in Ni)n.touches.push(Ni[o]);n.changedTouches=[n],e(n)}}function ds(e,n){n.MSPOINTER_TYPE_TOUCH&&n.pointerType===n.MSPOINTER_TYPE_TOUCH&&Dt(n),Wn(e,n)}function Xt(e){var n={},o,r;for(r in e)o=e[r],n[r]=o&&o.bind?o.bind(e):o;return e=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var io=200;function zo(e,n){e.addEventListener("dblclick",n);var o=0,r;function d(v){if(v.detail!==1){r=v.detail;return}if(!(v.pointerType==="mouse"||v.sourceCapabilities&&!v.sourceCapabilities.firesTouchEvents)){var P=da(v);if(!(P.some(function(D){return D instanceof HTMLLabelElement&&D.attributes.for})&&!P.some(function(D){return D instanceof HTMLInputElement||D instanceof HTMLSelectElement}))){var N=Date.now();N-o<=io?(r++,r===2&&n(Xt(v))):r=1,o=N}}}return e.addEventListener("click",d),{dblclick:n,simDblclick:d}}function $o(e,n){e.removeEventListener("dblclick",n.dblclick),e.removeEventListener("click",n.simDblclick)}var Tn=Do(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),$n=Do(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ua=$n==="webkitTransition"||$n==="OTransition"?$n+"End":"transitionend";function Io(e){return typeof e=="string"?document.getElementById(e):e}function mi(e,n){var o=e.style[n]||e.currentStyle&&e.currentStyle[n];if((!o||o==="auto")&&document.defaultView){var r=document.defaultView.getComputedStyle(e,null);o=r?r[n]:null}return o==="auto"?null:o}function it(e,n,o){var r=document.createElement(e);return r.className=n||"",o&&o.appendChild(r),r}function ot(e){var n=e.parentNode;n&&n.removeChild(e)}function Pn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Cn(e){var n=e.parentNode;n&&n.lastChild!==e&&n.appendChild(e)}function qt(e){var n=e.parentNode;n&&n.firstChild!==e&&n.insertBefore(e,n.firstChild)}function No(e,n){if(e.classList!==void 0)return e.classList.contains(n);var o=Fo(e);return o.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(o)}function je(e,n){if(e.classList!==void 0)for(var o=G(n),r=0,d=o.length;r0?2*window.devicePixelRatio:1;function fa(e){return W.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/vs:e.deltaY&&e.deltaMode===1?-e.deltaY*20:e.deltaY&&e.deltaMode===2?-e.deltaY*60:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?-e.detail*20:e.detail?e.detail/-32765*60:0}function Oe(e,n){var o=n.relatedTarget;if(!o)return!0;try{for(;o&&o!==e;)o=o.parentNode}catch{return!1}return o!==e}var Vi={__proto__:null,on:Ne,off:Je,stopPropagation:_i,disableScrollPropagation:gs,disableClickPropagation:Bi,preventDefault:Dt,stop:bi,getPropagationPath:da,getMousePosition:Ui,getWheelDelta:fa,isExternalTarget:Oe,addListener:Ne,removeListener:Je},so=me.extend({run:function(e,n,o,r){this.stop(),this._el=e,this._inProgress=!0,this._duration=o||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=Xe(e),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=B(this._animate,this),this._step()},_step:function(e){var n=+new Date-this._startTime,o=this._duration*1e3;nthis.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,n){this._enforcingBounds=!0;var o=this.getCenter(),r=this._limitCenter(o,this._zoom,st(e));return o.equals(r)||this.panTo(r,n),this._enforcingBounds=!1,this},panInside:function(e,n){n=n||{};var o=pe(n.paddingTopLeft||n.padding||[0,0]),r=pe(n.paddingBottomRight||n.padding||[0,0]),d=this.project(this.getCenter()),v=this.project(e),P=this.getPixelBounds(),N=He([P.min.add(o),P.max.subtract(r)]),D=N.getSize();if(!N.contains(v)){this._enforcingBounds=!0;var ie=v.subtract(N.getCenter()),be=N.extend(v).getSize().subtract(D);d.x+=ie.x<0?-be.x:be.x,d.y+=ie.y<0?-be.y:be.y,this.panTo(this.unproject(d),n),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=u({animate:!1,pan:!0},e===!0?{animate:!0}:e);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),r=n.divideBy(2).round(),d=o.divideBy(2).round(),v=r.subtract(d);return!v.x&&!v.y?this:(e.animate&&e.pan?this.panBy(v):(e.pan&&this._rawPanBy(v),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(h(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:o}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=u({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=h(this._handleGeolocationResponse,this),o=h(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,o,e):navigator.geolocation.getCurrentPosition(n,o,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var n=e.code,o=e.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: "+o+"."})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var n=e.coords.latitude,o=e.coords.longitude,r=new Ee(n,o),d=r.toBounds(e.coords.accuracy*2),v=this._locateOptions;if(v.setView){var P=this.getBoundsZoom(d);this.setView(r,v.maxZoom?Math.min(P,v.maxZoom):P)}var N={latlng:r,bounds:d,timestamp:e.timestamp};for(var D in e.coords)typeof e.coords[D]=="number"&&(N[D]=e.coords[D]);this.fire("locationfound",N)}},addHandler:function(e,n){if(!n)return this;var o=this[e]=new n(this);return this._handlers.push(o),this.options[e]&&o.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(),ot(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(F(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var e;for(e in this._layers)this._layers[e].remove();for(e in this._panes)ot(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,n){var o="leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),r=it("div",o,n||this._mapPane);return e&&(this._panes[e]=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 e=this.getPixelBounds(),n=this.unproject(e.getBottomLeft()),o=this.unproject(e.getTopRight());return new xt(n,o)},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(e,n,o){e=st(e),o=pe(o||[0,0]);var r=this.getZoom()||0,d=this.getMinZoom(),v=this.getMaxZoom(),P=e.getNorthWest(),N=e.getSouthEast(),D=this.getSize().subtract(o),ie=He(this.project(N,r),this.project(P,r)).getSize(),be=W.any3d?this.options.zoomSnap:1,De=D.x/ie.x,et=D.y/ie.y,un=n?Math.max(De,et):Math.min(De,et);return r=this.getScaleZoom(un,r),be&&(r=Math.round(r/(be/100))*(be/100),r=n?Math.ceil(r/be)*be:Math.floor(r/be)*be),Math.max(d,Math.min(v,r))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new he(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,n){var o=this._getTopLeftPoint(e,n);return new Be(o,o.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(e===void 0?this.getZoom():e)},getPane:function(e){return typeof e=="string"?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,n){var o=this.options.crs;return n=n===void 0?this._zoom:n,o.scale(e)/o.scale(n)},getScaleZoom:function(e,n){var o=this.options.crs;n=n===void 0?this._zoom:n;var r=o.zoom(e*o.scale(n));return isNaN(r)?1/0:r},project:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.latLngToPoint(Re(e),n)},unproject:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.pointToLatLng(pe(e),n)},layerPointToLatLng:function(e){var n=pe(e).add(this.getPixelOrigin());return this.unproject(n)},latLngToLayerPoint:function(e){var n=this.project(Re(e))._round();return n._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(Re(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(st(e))},distance:function(e,n){return this.options.crs.distance(Re(e),Re(n))},containerPointToLayerPoint:function(e){return pe(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return pe(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var n=this.containerPointToLayerPoint(pe(e));return this.layerPointToLatLng(n)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Re(e)))},mouseEventToContainerPoint:function(e){return Ui(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var n=this._container=Io(e);if(n){if(n._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Ne(n,"scroll",this._onScroll,this),this._containerId=b(n)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&W.any3d,je(e,"leaflet-container"+(W.touch?" leaflet-touch":"")+(W.retina?" leaflet-retina":"")+(W.ielt9?" leaflet-oldie":"")+(W.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var n=mi(e,"position");n!=="absolute"&&n!=="relative"&&n!=="fixed"&&n!=="sticky"&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Mt(this._mapPane,new he(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(je(e.markerPane,"leaflet-zoom-hide"),je(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,n,o){Mt(this._mapPane,new he(0,0));var r=!this._loaded;this._loaded=!0,n=this._limitZoom(n),this.fire("viewprereset");var d=this._zoom!==n;this._moveStart(d,o)._move(e,n)._moveEnd(d),this.fire("viewreset"),r&&this.fire("load")},_moveStart:function(e,n){return e&&this.fire("zoomstart"),n||this.fire("movestart"),this},_move:function(e,n,o,r){n===void 0&&(n=this._zoom);var d=this._zoom!==n;return this._zoom=n,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),r?o&&o.pinch&&this.fire("zoom",o):((d||o&&o.pinch)&&this.fire("zoom",o),this.fire("move",o)),this},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return F(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){Mt(this._mapPane,this._getMapPanePos().subtract(e))},_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(e){this._targets={},this._targets[b(this._container)]=this;var n=e?Je:Ne;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),W.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){F(this._resizeRequest),this._resizeRequest=B(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,n){for(var o=[],r,d=n==="mouseout"||n==="mouseover",v=e.target||e.srcElement,P=!1;v;){if(r=this._targets[b(v)],r&&(n==="click"||n==="preclick")&&this._draggableMoved(r)){P=!0;break}if(r&&r.listens(n,!0)&&(d&&!Oe(v,e)||(o.push(r),d))||v===this._container)break;v=v.parentNode}return!o.length&&!P&&!d&&this.listens(n,!0)&&(o=[this]),o},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var n=e.target||e.srcElement;if(!(!this._loaded||n._leaflet_disable_events||e.type==="click"&&this._isClickDisabled(n))){var o=e.type;o==="mousedown"&&Ro(n),this._fireDOMEvent(e,o)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,n,o){if(e.type==="click"){var r=u({},e);r.type="preclick",this._fireDOMEvent(r,r.type,o)}var d=this._findEventTargets(e,n);if(o){for(var v=[],P=0;P0?Math.round(e-n)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(n))},_limitZoom:function(e){var n=this.getMinZoom(),o=this.getMaxZoom(),r=W.any3d?this.options.zoomSnap:1;return r&&(e=Math.round(e/r)*r),Math.max(n,Math.min(o,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Lt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,n){var o=this._getCenterOffset(e)._trunc();return(n&&n.animate)!==!0&&!this.getSize().contains(o)?!1:(this.panBy(o,n),!0)},_createAnimProxy:function(){var e=this._proxy=it("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(n){var o=Tn,r=this._proxy.style[o];gi(this._proxy,this.project(n.center,n.zoom),this.getZoomScale(n.zoom,1)),r===this._proxy.style[o]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ot(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),n=this.getZoom();gi(this._proxy,this.project(e,n),this.getZoomScale(n,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,n,o){if(this._animatingZoom)return!0;if(o=o||{},!this._zoomAnimated||o.animate===!1||this._nothingToAnimate()||Math.abs(n-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(n),d=this._getCenterOffset(e)._divideBy(1-1/r);return o.animate!==!0&&!this.getSize().contains(d)?!1:(B(function(){this._moveStart(!0,o.noMoveStart||!1)._animateZoom(e,n,!0)},this),!0)},_animateZoom:function(e,n,o,r){this._mapPane&&(o&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=n,je(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,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&&Lt(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 Vo(e,n){return new Ye(e,n)}var en=M.extend({options:{position:"topright"},initialize:function(e){I(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var n=this._map;return n&&n.removeControl(this),this.options.position=e,n&&n.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var n=this._container=this.onAdd(e),o=this.getPosition(),r=e._controlCorners[o];return je(n,"leaflet-control"),o.indexOf("bottom")!==-1?r.insertBefore(n,r.firstChild):r.appendChild(n),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ot(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),ln=function(e){return new en(e)};Ye.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},n="leaflet-",o=this._controlContainer=it("div",n+"control-container",this._container);function r(d,v){var P=n+d+" "+n+v;e[d+v]=it("div",P,o)}r("top","left"),r("top","right"),r("bottom","left"),r("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)ot(this._controlCorners[e]);ot(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var yi=en.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,n,o,r){return o1,this._baseLayersList.style.display=e?"":"none"),this._separator.style.display=n&&e?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var n=this._getLayer(b(e.target)),o=n.overlay?e.type==="add"?"overlayadd":"overlayremove":e.type==="add"?"baselayerchange":null;o&&this._map.fire(o,n)},_createRadioElement:function(e,n){var o='",r=document.createElement("div");return r.innerHTML=o,r.firstChild},_addItem:function(e){var n=document.createElement("label"),o=this._map.hasLayer(e.layer),r;e.overlay?(r=document.createElement("input"),r.type="checkbox",r.className="leaflet-control-layers-selector",r.defaultChecked=o):r=this._createRadioElement("leaflet-base-layers_"+b(this),o),this._layerControlInputs.push(r),r.layerId=b(e.layer),Ne(r,"click",this._onInputClick,this);var d=document.createElement("span");d.innerHTML=" "+e.name;var v=document.createElement("span");n.appendChild(v),v.appendChild(r),v.appendChild(d);var P=e.overlay?this._overlaysList:this._baseLayersList;return P.appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var e=this._layerControlInputs,n,o,r=[],d=[];this._handlingClick=!0;for(var v=e.length-1;v>=0;v--)n=e[v],o=this._getLayer(n.layerId).layer,n.checked?r.push(o):n.checked||d.push(o);for(v=0;v=0;d--)n=e[d],o=this._getLayer(n.layerId).layer,n.disabled=o.options.minZoom!==void 0&&ro.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,Ne(e,"click",Dt),this.expand();var n=this;setTimeout(function(){Je(e,"click",Dt),n._preventClick=!1})}}),ao=function(e,n,o){return new yi(e,n,o)},Zo=en.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(e){var n="leaflet-control-zoom",o=it("div",n+" leaflet-bar"),r=this.options;return this._zoomInButton=this._createButton(r.zoomInText,r.zoomInTitle,n+"-in",o,this._zoomIn),this._zoomOutButton=this._createButton(r.zoomOutText,r.zoomOutTitle,n+"-out",o,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),o},onRemove:function(e){e.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(e){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,n,o,r,d){var v=it("a",o,r);return v.innerHTML=e,v.href="#",v.title=n,v.setAttribute("role","button"),v.setAttribute("aria-label",n),Bi(v),Ne(v,"click",bi),Ne(v,"click",d,this),Ne(v,"click",this._refocusOnMap,this),v},_updateDisabled:function(){var e=this._map,n="leaflet-disabled";Lt(this._zoomInButton,n),Lt(this._zoomOutButton,n),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(je(this._zoomOutButton,n),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(je(this._zoomInButton,n),this._zoomInButton.setAttribute("aria-disabled","true"))}});Ye.mergeOptions({zoomControl:!0}),Ye.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Zo,this.addControl(this.zoomControl))});var _s=function(e){return new Zo(e)},Ho=en.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var n="leaflet-control-scale",o=it("div",n),r=this.options;return this._addScales(r,n+"-line",o),e.on(r.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),o},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,n,o){e.metric&&(this._mScale=it("div",n,o)),e.imperial&&(this._iScale=it("div",n,o))},_update:function(){var e=this._map,n=e.getSize().y/2,o=e.distance(e.containerPointToLatLng([0,n]),e.containerPointToLatLng([this.options.maxWidth,n]));this._updateScales(o)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var n=this._getRoundNum(e),o=n<1e3?n+" m":n/1e3+" km";this._updateScale(this._mScale,o,n/e)},_updateImperial:function(e){var n=e*3.2808399,o,r,d;n>5280?(o=n/5280,r=this._getRoundNum(o),this._updateScale(this._iScale,r+" mi",r/o)):(d=this._getRoundNum(n),this._updateScale(this._iScale,d+" ft",d/n))},_updateScale:function(e,n,o){e.style.width=Math.round(this.options.maxWidth*o)+"px",e.innerHTML=n},_getRoundNum:function(e){var n=Math.pow(10,(Math.floor(e)+"").length-1),o=e/n;return o=o>=10?10:o>=5?5:o>=3?3:o>=2?2:1,n*o}}),ar=function(e){return new Ho(e)},gn='',Zi=en.extend({options:{position:"bottomright",prefix:''+(W.inlineSvg?gn+" ":"")+"Leaflet"},initialize:function(e){I(this,e),this._attributions={}},onAdd:function(e){e.attributionControl=this,this._container=it("div","leaflet-control-attribution"),Bi(this._container);for(var n in e._layers)e._layers[n].getAttribution&&this.addAttribution(e._layers[n].getAttribution());return this._update(),e.on("layeradd",this._addAttribution,this),this._container},onRemove:function(e){e.off("layeradd",this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once("remove",function(){this.removeAttribution(e.layer.getAttribution())},this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e?(this._attributions[e]&&(this._attributions[e]--,this._update()),this):this},_update:function(){if(this._map){var e=[];for(var n in this._attributions)this._attributions[n]&&e.push(n);var o=[];this.options.prefix&&o.push(this.options.prefix),e.length&&o.push(e.join(", ")),this._container.innerHTML=o.join(' ')}}});Ye.mergeOptions({attributionControl:!0}),Ye.addInitHook(function(){this.options.attributionControl&&new Zi().addTo(this)});var ha=function(e){return new Zi(e)};en.Layers=yi,en.Zoom=Zo,en.Scale=Ho,en.Attribution=Zi,ln.layers=ao,ln.zoom=_s,ln.scale=ar,ln.attribution=ha;var An=M.extend({initialize:function(e){this._map=e},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}});An.addTo=function(e,n){return e.addHandler(n,this),this};var rr={Events:Pe},bs=W.touch?"touchstart mousedown":"mousedown",vn=me.extend({options:{clickTolerance:3},initialize:function(e,n,o,r){I(this,r),this._element=e,this._dragStartTarget=n||e,this._preventOutline=o},enable:function(){this._enabled||(Ne(this._dragStartTarget,bs,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(vn._dragging===this&&this.finishDrag(!0),Je(this._dragStartTarget,bs,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!No(this._element,"leaflet-zoom-anim"))){if(e.touches&&e.touches.length!==1){vn._dragging===this&&this.finishDrag();return}if(!(vn._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(vn._dragging=this,this._preventOutline&&Ro(this._element),Fi(),In(),!this._moving)){this.fire("down");var n=e.touches?e.touches[0]:e,o=Bo(this._element);this._startPoint=new he(n.clientX,n.clientY),this._startPos=Xe(this._element),this._parentScale=hs(o);var r=e.type==="mousedown";Ne(document,r?"mousemove":"touchmove",this._onMove,this),Ne(document,r?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(e){if(this._enabled){if(e.touches&&e.touches.length>1){this._moved=!0;return}var n=e.touches&&e.touches.length===1?e.touches[0]:e,o=new he(n.clientX,n.clientY)._subtract(this._startPoint);!o.x&&!o.y||Math.abs(o.x)+Math.abs(o.y)v&&(P=N,v=D);v>o&&(n[P]=1,ws(e,n,o,r,P),ws(e,n,o,P,d))}function va(e,n){for(var o=[e[0]],r=1,d=0,v=e.length;rn&&(o.push(e[r]),d=r);return dn.max.x&&(o|=2),e.yn.max.y&&(o|=8),o}function ks(e,n){var o=n.x-e.x,r=n.y-e.y;return o*o+r*r}function Ke(e,n,o,r){var d=n.x,v=n.y,P=o.x-d,N=o.y-v,D=P*P+N*N,ie;return D>0&&(ie=((e.x-d)*P+(e.y-v)*N)/D,ie>1?(d=o.x,v=o.y):ie>0&&(d+=P*ie,v+=N*ie)),P=e.x-d,N=e.y-v,r?P*P+N*N:new he(d,v)}function bt(e){return!ke(e[0])||typeof e[0][0]!="object"&&typeof e[0][0]<"u"}function xi(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),bt(e)}function Ss(e,n){var o,r,d,v,P,N,D,ie;if(!e||e.length===0)throw new Error("latlngs not passed");bt(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var be=Re([0,0]),De=st(e),et=De.getNorthWest().distanceTo(De.getSouthWest())*De.getNorthEast().distanceTo(De.getNorthWest());et<1700&&(be=ys(e));var un=e.length,Wt=[];for(o=0;or){D=(v-r)/d,ie=[N.x-D*(N.x-P.x),N.y-D*(N.y-P.y)];break}var xn=n.unproject(pe(ie));return Re([xn.lat+be.lat,xn.lng+be.lng])}var dr={__proto__:null,simplify:xs,pointToSegmentDistance:ga,closestPointOnSegment:ur,clipSegment:jo,_getEdgeIntersection:Hi,_getBitCode:Nn,_sqClosestPointOnSegment:Ke,isFlat:bt,_flat:xi,polylineCenter:Ss},ro={project:function(e){return new he(e.lng,e.lat)},unproject:function(e){return new Ee(e.y,e.x)},bounds:new Be([-180,-90],[180,90])},Ts={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Be([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(e){var n=Math.PI/180,o=this.R,r=e.lat*n,d=this.R_MINOR/o,v=Math.sqrt(1-d*d),P=v*Math.sin(r),N=Math.tan(Math.PI/4-r/2)/Math.pow((1-P)/(1+P),v/2);return r=-o*Math.log(Math.max(N,1e-10)),new he(e.lng*n*o,r)},unproject:function(e){for(var n=180/Math.PI,o=this.R,r=this.R_MINOR/o,d=Math.sqrt(1-r*r),v=Math.exp(-e.y/o),P=Math.PI/2-2*Math.atan(v),N=0,D=.1,ie;N<15&&Math.abs(D)>1e-7;N++)ie=d*Math.sin(P),ie=Math.pow((1-ie)/(1+ie),d/2),D=Math.PI/2-2*Math.atan(v*ie)-P,P+=D;return new Ee(P*n,e.x*n/o)}},fr={__proto__:null,LonLat:ro,Mercator:Ts,SphericalMercator:Pt},hr=u({},At,{code:"EPSG:3395",projection:Ts,transformation:(function(){var e=.5/(Math.PI*Ts.R);return w(e,.5,-e,.5)})()}),ba=u({},At,{code:"EPSG:4326",projection:ro,transformation:w(1/180,1,-1/180,.5)}),lo=u({},zt,{projection:ro,transformation:w(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,n){var o=n.lng-e.lng,r=n.lat-e.lat;return Math.sqrt(o*o+r*r)},infinite:!0});zt.Earth=At,zt.EPSG3395=hr,zt.EPSG3857=y,zt.EPSG900913=S,zt.EPSG4326=ba,zt.Simple=lo;var _n=me.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[b(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[b(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var n=e.target;if(n.hasLayer(this)){if(this._map=n,this._zoomAnimated=n._zoomAnimated,this.getEvents){var o=this.getEvents();n.on(o,this),this.once("remove",function(){n.off(o,this)},this)}this.onAdd(n),this.fire("add"),n.fire("layeradd",{layer:this})}}});Ye.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var n=b(e);return this._layers[n]?this:(this._layers[n]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e),this)},removeLayer:function(e){var n=b(e);return this._layers[n]?(this._loaded&&e.onRemove(this),delete this._layers[n],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return b(e)in this._layers},eachLayer:function(e,n){for(var o in this._layers)e.call(n,this._layers[o]);return this},_addLayers:function(e){e=e?ke(e)?e:[e]:[];for(var n=0,o=e.length;nthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&n[0]instanceof Ee&&n[0].equals(n[o-1])&&n.pop(),n},_setLatLngs:function(e){tn.prototype._setLatLngs.call(this,e),bt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return bt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,n=this.options.weight,o=new he(n,n);if(e=new Be(e.min.subtract(o),e.max.add(o)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}for(var r=0,d=this._rings.length,v;re.y!=d.y>e.y&&e.x<(d.x-r.x)*(e.y-r.y)/(d.y-r.y)+r.x&&(n=!n);return n||tn.prototype._containsPoint.call(this,e,!0)}});function ya(e,n){return new Fn(e,n)}var yn=bn.extend({initialize:function(e,n){I(this,n),this._layers={},e&&this.addData(e)},addData:function(e){var n=ke(e)?e:e.features,o,r,d;if(n){for(o=0,r=n.length;o0&&d.push(d[0].slice()),d}function Qe(e,n){return e.feature?u({},e.feature,{geometry:n}):En(n)}function En(e){return e.type==="Feature"||e.type==="FeatureCollection"?e:{type:"Feature",properties:{},geometry:e}}var Ki={toGeoJSON:function(e){return Qe(this,{type:"Point",coordinates:Ls(this.getLatLng(),e)})}};Wo.include(Ki),Wi.include(Ki),wi.include(Ki),tn.include({toGeoJSON:function(e){var n=!bt(this._latlngs),o=Go(this._latlngs,n?1:0,!1,e);return Qe(this,{type:(n?"Multi":"")+"LineString",coordinates:o})}}),Fn.include({toGeoJSON:function(e){var n=!bt(this._latlngs),o=n&&!bt(this._latlngs[0]),r=Go(this._latlngs,o?2:n?1:0,!0,e);return n||(r=[r]),Qe(this,{type:(o?"Multi":"")+"Polygon",coordinates:r})}}),qn.include({toMultiPoint:function(e){var n=[];return this.eachLayer(function(o){n.push(o.toGeoJSON(e).geometry.coordinates)}),Qe(this,{type:"MultiPoint",coordinates:n})},toGeoJSON:function(e){var n=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(n==="MultiPoint")return this.toMultiPoint(e);var o=n==="GeometryCollection",r=[];return this.eachLayer(function(d){if(d.toGeoJSON){var v=d.toGeoJSON(e);if(o)r.push(v.geometry);else{var P=En(v);P.type==="FeatureCollection"?r.push.apply(r,P.features):r.push(P)}}}),o?Qe(this,{geometries:r,type:"GeometryCollection"}):{type:"FeatureCollection",features:r}}});function qo(e,n){return new yn(e,n)}var gr=qo,ho=_n.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,n,o){this._url=e,this._bounds=st(n),I(this,o)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(je(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ot(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&Cn(this._image),this},bringToBack:function(){return this._map&&qt(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=st(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e=this._url.tagName==="IMG",n=this._image=e?this._url:it("img");if(je(n,"leaflet-image-layer"),this._zoomAnimated&&je(n,"leaflet-zoom-animated"),this.options.className&&je(n,this.options.className),n.onselectstart=E,n.onmousemove=E,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(),e){this._url=n.src;return}n.src=this._url,n.alt=this.options.alt},_animateZoom:function(e){var n=this._map.getZoomScale(e.zoom),o=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;gi(this._image,o,n)},_reset:function(){var e=this._image,n=new Be(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),o=n.getSize();Mt(e,n.min),e.style.width=o.x+"px",e.style.height=o.y+"px"},_updateOpacity:function(){mn(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 e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),vr=function(e,n,o){return new ho(e,n,o)},po=ho.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e=this._url.tagName==="VIDEO",n=this._image=e?this._url:it("video");if(je(n,"leaflet-image-layer"),this._zoomAnimated&&je(n,"leaflet-zoom-animated"),this.options.className&&je(n,this.options.className),n.onselectstart=E,n.onmousemove=E,n.onloadeddata=h(this.fire,this,"load"),e){for(var o=n.getElementsByTagName("source"),r=[],d=0;d0?r:[n.src];return}ke(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 v=0;vd?(n.height=d+"px",je(e,v)):Lt(e,v),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var n=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),o=this._getAnchor();Mt(this._container,n.add(o))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var e=this._map,n=parseInt(mi(this._container,"marginBottom"),10)||0,o=this._container.offsetHeight+n,r=this._containerWidth,d=new he(this._containerLeft,-o-this._containerBottom);d._add(Xe(this._container));var v=e.layerPointToContainerPoint(d),P=pe(this.options.autoPanPadding),N=pe(this.options.autoPanPaddingTopLeft||P),D=pe(this.options.autoPanPaddingBottomRight||P),ie=e.getSize(),be=0,De=0;v.x+r+D.x>ie.x&&(be=v.x+r-ie.x+D.x),v.x-be-N.x<0&&(be=v.x-N.x),v.y+o+D.y>ie.y&&(De=v.y+o-ie.y+D.y),v.y-De-N.y<0&&(De=v.y-N.y),(be||De)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([be,De]))}},_getAnchor:function(){return pe(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),As=function(e,n){return new Dn(e,n)};Ye.mergeOptions({closePopupOnClick:!0}),Ye.include({openPopup:function(e,n,o){return this._initOverlay(Dn,e,n,o).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),_n.include({bindPopup:function(e,n){return this._popup=this._initOverlay(Dn,this._popup,e,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(e){return this._popup&&(this instanceof bn||(this._popup._source=this),this._popup._prepareOpen(e||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(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(!(!this._popup||!this._map)){bi(e);var n=e.layer||e.target;if(this._popup._source===n&&!(n instanceof ni)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng);return}this._popup._source=n,this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){e.originalEvent.keyCode===13&&this._openPopup(e)}});var _o=Nt.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){Nt.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(e){Nt.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var e=Nt.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e="leaflet-tooltip",n=e+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=it("div",n),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+b(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var n,o,r=this._map,d=this._container,v=r.latLngToContainerPoint(r.getCenter()),P=r.layerPointToContainerPoint(e),N=this.options.direction,D=d.offsetWidth,ie=d.offsetHeight,be=pe(this.options.offset),De=this._getAnchor();N==="top"?(n=D/2,o=ie):N==="bottom"?(n=D/2,o=0):N==="center"?(n=D/2,o=ie/2):N==="right"?(n=0,o=ie/2):N==="left"?(n=D,o=ie/2):P.xthis.options.maxZoom||or?this._retainParent(d,v,P,r):!1)},_retainChildren:function(e,n,o,r){for(var d=2*e;d<2*e+2;d++)for(var v=2*n;v<2*n+2;v++){var P=new he(d,v);P.z=o+1;var N=this._tileCoordsToKey(P),D=this._tiles[N];if(D&&D.active){D.retain=!0;continue}else D&&D.loaded&&(D.retain=!0);o+1this.options.maxZoom||this.options.minZoom!==void 0&&d1){this._setView(e,o);return}for(var De=d.min.y;De<=d.max.y;De++)for(var et=d.min.x;et<=d.max.x;et++){var un=new he(et,De);if(un.z=this._tileZoom,!!this._isValidTile(un)){var Wt=this._tiles[this._tileCoordsToKey(un)];Wt?Wt.current=!0:P.push(un)}}if(P.sort(function(xn,Jo){return xn.distanceTo(v)-Jo.distanceTo(v)}),P.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Rn=document.createDocumentFragment();for(et=0;eto.max.x)||!n.wrapLat&&(e.yo.max.y))return!1}if(!this.options.bounds)return!0;var r=this._tileCoordsToBounds(e);return st(this.options.bounds).overlaps(r)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var n=this._map,o=this.getTileSize(),r=e.scaleBy(o),d=r.add(o),v=n.unproject(r,e.z),P=n.unproject(d,e.z);return[v,P]},_tileCoordsToBounds:function(e){var n=this._tileCoordsToNwSe(e),o=new xt(n[0],n[1]);return this.options.noWrap||(o=this._map.wrapLatLngBounds(o)),o},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var n=e.split(":"),o=new he(+n[0],+n[1]);return o.z=+n[2],o},_removeTile:function(e){var n=this._tiles[e];n&&(ot(n.el),delete this._tiles[e],this.fire("tileunload",{tile:n.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){je(e,"leaflet-tile");var n=this.getTileSize();e.style.width=n.x+"px",e.style.height=n.y+"px",e.onselectstart=E,e.onmousemove=E,W.ielt9&&this.options.opacity<1&&mn(e,this.options.opacity)},_addTile:function(e,n){var o=this._getTilePos(e),r=this._tileCoordsToKey(e),d=this.createTile(this._wrapCoords(e),h(this._tileReady,this,e));this._initTile(d),this.createTile.length<2&&B(h(this._tileReady,this,e,null,d)),Mt(d,o),this._tiles[r]={el:d,coords:e,current:!0},n.appendChild(d),this.fire("tileloadstart",{tile:d,coords:e})},_tileReady:function(e,n,o){n&&this.fire("tileerror",{error:n,tile:o,coords:e});var r=this._tileCoordsToKey(e);o=this._tiles[r],o&&(o.loaded=+new Date,this._map._fadeAnimated?(mn(o.el,0),F(this._fadeFrame),this._fadeFrame=B(this._updateOpacity,this)):(o.active=!0,this._pruneTiles()),n||(je(o.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:o.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),W.ielt9||!this._map._fadeAnimated?B(this._pruneTiles,this):setTimeout(h(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var n=new he(this._wrapX?T(e.x,this._wrapX):e.x,this._wrapY?T(e.y,this._wrapY):e.y);return n.z=e.z,n},_pxBoundsToTileRange:function(e){var n=this.getTileSize();return new Be(e.min.unscaleBy(n).floor(),e.max.unscaleBy(n).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}});function br(e){return new bo(e)}var Yn=bo.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,n){this._url=e,n=I(this,n),n.detectRetina&&W.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(e,n){return this._url===e&&n===void 0&&(n=!0),this._url=e,n||this.redraw(),this},createTile:function(e,n){var o=document.createElement("img");return Ne(o,"load",h(this._tileOnLoad,this,n,o)),Ne(o,"error",h(this._tileOnError,this,n,o)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(o.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(o.referrerPolicy=this.options.referrerPolicy),o.alt="",o.src=this.getTileUrl(e),o},getTileUrl:function(e){var n={r:W.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var o=this._globalTileRange.max.y-e.y;this.options.tms&&(n.y=o),n["-y"]=o}return K(this._url,u(n,this.options))},_tileOnLoad:function(e,n){W.ielt9?setTimeout(h(e,this,null,n),0):e(null,n)},_tileOnError:function(e,n,o){var r=this.options.errorTileUrl;r&&n.getAttribute("src")!==r&&(n.src=r),e(o,n)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,n=this.options.maxZoom,o=this.options.zoomReverse,r=this.options.zoomOffset;return o&&(e=n-e),e+r},_getSubdomain:function(e){var n=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[n]},_abortLoading:function(){var e,n;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&(n=this._tiles[e].el,n.onload=E,n.onerror=E,!n.complete)){n.src=xe;var o=this._tiles[e].coords;ot(n),delete this._tiles[e],this.fire("tileabort",{tile:n,coords:o})}},_removeTile:function(e){var n=this._tiles[e];if(n)return n.el.setAttribute("src",xe),bo.prototype._removeTile.call(this,e)},_tileReady:function(e,n,o){if(!(!this._map||o&&o.getAttribute("src")===xe))return bo.prototype._tileReady.call(this,e,n,o)}});function wa(e,n){return new Yn(e,n)}var pt=Yn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,n){this._url=e;var o=u({},this.defaultWmsParams);for(var r in n)r in this.options||(o[r]=n[r]);n=I(this,n);var d=n.detectRetina&&W.retina?2:1,v=this.getTileSize();o.width=v.x*d,o.height=v.y*d,this.wmsParams=o},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var n=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[n]=this._crs.code,Yn.prototype.onAdd.call(this,e)},getTileUrl:function(e){var n=this._tileCoordsToNwSe(e),o=this._crs,r=He(o.project(n[0]),o.project(n[1])),d=r.min,v=r.max,P=(this._wmsVersion>=1.3&&this._crs===ba?[d.y,d.x,v.y,v.x]:[d.x,d.y,v.x,v.y]).join(","),N=Yn.prototype.getTileUrl.call(this,e);return N+R(this.wmsParams,N,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+P},setParams:function(e,n){return u(this.wmsParams,e),n||this.redraw(),this}});function yo(e,n){return new pt(e,n)}Yn.WMS=pt,wa.wms=yo;var On=_n.extend({options:{padding:.1},initialize:function(e){I(this,e),b(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),je(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 e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,n){var o=this._map.getZoomScale(n,this._zoom),r=this._map.getSize().multiplyBy(.5+this.options.padding),d=this._map.project(this._center,n),v=r.multiplyBy(-o).add(d).subtract(this._map._getNewPixelOrigin(e,n));W.any3d?gi(this._container,v,o):Mt(this._container,v)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var e in this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,n=this._map.getSize(),o=this._map.containerPointToLayerPoint(n.multiplyBy(-e)).round();this._bounds=new Be(o,o.add(n.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Yo=On.extend({options:{tolerance:0},getEvents:function(){var e=On.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){On.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");Ne(e,"mousemove",this._onMouseMove,this),Ne(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ne(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){F(this._redrawRequest),delete this._ctx,ot(this._container),Je(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var e;this._redrawBounds=null;for(var n in this._layers)e=this._layers[n],e._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){On.prototype._update.call(this);var e=this._bounds,n=this._container,o=e.getSize(),r=W.retina?2:1;Mt(n,e.min),n.width=r*o.x,n.height=r*o.y,n.style.width=o.x+"px",n.style.height=o.y+"px",W.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){On.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[b(e)]=e;var n=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=n),this._drawLast=n,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var n=e._order,o=n.next,r=n.prev;o?o.prev=r:this._drawLast=r,r?r.next=o:this._drawFirst=o,delete e._order,delete this._layers[b(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if(typeof e.options.dashArray=="string"){var n=e.options.dashArray.split(/[, ]+/),o=[],r,d;for(d=0;d')}}catch{}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),g={_initContainer:function(){this._container=it("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(On.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var n=e._container=xo("shape");je(n,"leaflet-vml-shape "+(this.options.className||"")),n.coordsize="1 1",e._path=xo("path"),n.appendChild(e._path),this._updateStyle(e),this._layers[b(e)]=e},_addPath:function(e){var n=e._container;this._container.appendChild(n),e.options.interactive&&e.addInteractiveTarget(n)},_removePath:function(e){var n=e._container;ot(n),e.removeInteractiveTarget(n),delete this._layers[b(e)]},_updateStyle:function(e){var n=e._stroke,o=e._fill,r=e.options,d=e._container;d.stroked=!!r.stroke,d.filled=!!r.fill,r.stroke?(n||(n=e._stroke=xo("stroke")),d.appendChild(n),n.weight=r.weight+"px",n.color=r.color,n.opacity=r.opacity,r.dashArray?n.dashStyle=ke(r.dashArray)?r.dashArray.join(" "):r.dashArray.replace(/( *, *)/g," "):n.dashStyle="",n.endcap=r.lineCap.replace("butt","flat"),n.joinstyle=r.lineJoin):n&&(d.removeChild(n),e._stroke=null),r.fill?(o||(o=e._fill=xo("fill")),d.appendChild(o),o.color=r.fillColor||r.color,o.opacity=r.fillOpacity):o&&(d.removeChild(o),e._fill=null)},_updateCircle:function(e){var n=e._point.round(),o=Math.round(e._radius),r=Math.round(e._radiusY||o);this._setPath(e,e._empty()?"M0 0":"AL "+n.x+","+n.y+" "+o+","+r+" 0,"+65535*360)},_setPath:function(e,n){e._path.v=n},_bringToFront:function(e){Cn(e._container)},_bringToBack:function(e){qt(e._container)}},c=W.vml?xo:q,X=On.extend({_initContainer:function(){this._container=c("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=c("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ot(this._container),Je(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){On.prototype._update.call(this);var e=this._bounds,n=e.getSize(),o=this._container;(!this._svgSize||!this._svgSize.equals(n))&&(this._svgSize=n,o.setAttribute("width",n.x),o.setAttribute("height",n.y)),Mt(o,e.min),o.setAttribute("viewBox",[e.min.x,e.min.y,n.x,n.y].join(" ")),this.fire("update")}},_initPath:function(e){var n=e._path=c("path");e.options.className&&je(n,e.options.className),e.options.interactive&&je(n,"leaflet-interactive"),this._updateStyle(e),this._layers[b(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){ot(e._path),e.removeInteractiveTarget(e._path),delete this._layers[b(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var n=e._path,o=e.options;n&&(o.stroke?(n.setAttribute("stroke",o.color),n.setAttribute("stroke-opacity",o.opacity),n.setAttribute("stroke-width",o.weight),n.setAttribute("stroke-linecap",o.lineCap),n.setAttribute("stroke-linejoin",o.lineJoin),o.dashArray?n.setAttribute("stroke-dasharray",o.dashArray):n.removeAttribute("stroke-dasharray"),o.dashOffset?n.setAttribute("stroke-dashoffset",o.dashOffset):n.removeAttribute("stroke-dashoffset")):n.setAttribute("stroke","none"),o.fill?(n.setAttribute("fill",o.fillColor||o.color),n.setAttribute("fill-opacity",o.fillOpacity),n.setAttribute("fill-rule",o.fillRule||"evenodd")):n.setAttribute("fill","none"))},_updatePoly:function(e,n){this._setPath(e,j(e._parts,n))},_updateCircle:function(e){var n=e._point,o=Math.max(Math.round(e._radius),1),r=Math.max(Math.round(e._radiusY),1)||o,d="a"+o+","+r+" 0 1,0 ",v=e._empty()?"M0 0":"M"+(n.x-o)+","+n.y+d+o*2+",0 "+d+-o*2+",0 ";this._setPath(e,v)},_setPath:function(e,n){e._path.setAttribute("d",n)},_bringToFront:function(e){Cn(e._path)},_bringToBack:function(e){qt(e._path)}});W.vml&&X.include(g);function k(e){return W.svg||W.vml?new X(e):null}Ye.include({getRenderer:function(e){var n=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return n||(n=this._renderer=this._createRenderer()),this.hasLayer(n)||this.addLayer(n),n},_getPaneRenderer:function(e){if(e==="overlayPane"||e===void 0)return!1;var n=this._paneRenderers[e];return n===void 0&&(n=this._createRenderer({pane:e}),this._paneRenderers[e]=n),n},_createRenderer:function(e){return this.options.preferCanvas&&ka(e)||k(e)}});var Ve=Fn.extend({initialize:function(e,n){Fn.prototype.initialize.call(this,this._boundsToLatLngs(e),n)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=st(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function id(e,n){return new Ve(e,n)}X.create=c,X.pointsToPath=j,yn.geometryToLayer=ii,yn.coordsToLatLng=oi,yn.coordsToLatLngs=ki,yn.latLngToCoords=Ls,yn.latLngsToCoords=Go,yn.getFeature=Qe,yn.asFeature=En,Ye.mergeOptions({boxZoom:!0});var bl=An.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on("unload",this._destroy,this)},addHooks:function(){Ne(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Je(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ot(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(e){if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),In(),Fi(),this._startPoint=this._map.mouseEventToContainerPoint(e),Ne(document,{contextmenu:bi,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=it("div","leaflet-zoom-box",this._container),je(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var n=new Be(this._point,this._startPoint),o=n.getSize();Mt(this._box,n.min),this._box.style.width=o.x+"px",this._box.style.height=o.y+"px"},_finish:function(){this._moved&&(ot(this._box),Lt(this._container,"leaflet-crosshair")),vi(),Di(),Je(document,{contextmenu:bi,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if(!(e.which!==1&&e.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(h(this._resetState,this),0);var n=new xt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(n).fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(e){e.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Ye.addInitHook("addHandler","boxZoom",bl),Ye.mergeOptions({doubleClickZoom:!0});var yl=An.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var n=this._map,o=n.getZoom(),r=n.options.zoomDelta,d=e.originalEvent.shiftKey?o-r:o+r;n.options.doubleClickZoom==="center"?n.setZoom(d):n.setZoomAround(e.containerPoint,d)}});Ye.addInitHook("addHandler","doubleClickZoom",yl),Ye.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var xl=An.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new vn(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),e.on("zoomend",this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}je(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Lt(this._map._container,"leaflet-grab"),Lt(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 e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var n=st(this._map.options.maxBounds);this._offsetLimit=He(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;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var n=this._lastTime=+new Date,o=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(o),this._times.push(n),this._prunePositions(n)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),n=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=n.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,n){return e-(e-n)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var e=this._draggable._newPos.subtract(this._draggable._startPos),n=this._offsetLimit;e.xn.max.x&&(e.x=this._viscousLimit(e.x,n.max.x)),e.y>n.max.y&&(e.y=this._viscousLimit(e.y,n.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,n=Math.round(e/2),o=this._initialWorldOffset,r=this._draggable._newPos.x,d=(r-n+o)%e+n-o,v=(r+n+o)%e-n-o,P=Math.abs(d+o)0?v:-v))-n;this._delta=0,this._startTime=null,P&&(e.options.scrollWheelZoom==="center"?e.setZoom(n+P):e.setZoomAround(this._lastMousePos,n+P))}});Ye.addInitHook("addHandler","scrollWheelZoom",kl);var od=600;Ye.mergeOptions({tapHold:W.touchNative&&W.safari&&W.mobile,tapTolerance:15});var Sl=An.extend({addHooks:function(){Ne(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Je(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),e.touches.length===1){var n=e.touches[0];this._startPos=this._newPos=new he(n.clientX,n.clientY),this._holdTimeout=setTimeout(h(function(){this._cancel(),this._isTapValid()&&(Ne(document,"touchend",Dt),Ne(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",n))},this),od),Ne(document,"touchend touchcancel contextmenu",this._cancel,this),Ne(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){Je(document,"touchend",Dt),Je(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),Je(document,"touchend touchcancel contextmenu",this._cancel,this),Je(document,"touchmove",this._onMove,this)},_onMove:function(e){var n=e.touches[0];this._newPos=new he(n.clientX,n.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,n){var o=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY});o._simulated=!0,n.target.dispatchEvent(o)}});Ye.addInitHook("addHandler","tapHold",Sl),Ye.mergeOptions({touchZoom:W.touch,bounceAtZoomLimits:!0});var Tl=An.extend({addHooks:function(){je(this._map._container,"leaflet-touch-zoom"),Ne(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Lt(this._map._container,"leaflet-touch-zoom"),Je(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var n=this._map;if(!(!e.touches||e.touches.length!==2||n._animatingZoom||this._zooming)){var o=n.mouseEventToContainerPoint(e.touches[0]),r=n.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=n.getSize()._divideBy(2),this._startLatLng=n.containerPointToLatLng(this._centerPoint),n.options.touchZoom!=="center"&&(this._pinchStartLatLng=n.containerPointToLatLng(o.add(r)._divideBy(2))),this._startDist=o.distanceTo(r),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),Ne(document,"touchmove",this._onTouchMove,this),Ne(document,"touchend touchcancel",this._onTouchEnd,this),Dt(e)}},_onTouchMove:function(e){if(!(!e.touches||e.touches.length!==2||!this._zooming)){var n=this._map,o=n.mouseEventToContainerPoint(e.touches[0]),r=n.mouseEventToContainerPoint(e.touches[1]),d=o.distanceTo(r)/this._startDist;if(this._zoom=n.getScaleZoom(d,this._startZoom),!n.options.bounceAtZoomLimits&&(this._zoomn.getMaxZoom()&&d>1)&&(this._zoom=n._limitZoom(this._zoom)),n.options.touchZoom==="center"){if(this._center=this._startLatLng,d===1)return}else{var v=o._add(r)._divideBy(2)._subtract(this._centerPoint);if(d===1&&v.x===0&&v.y===0)return;this._center=n.unproject(n.project(this._pinchStartLatLng,this._zoom).subtract(v),this._zoom)}this._moved||(n._moveStart(!0,!1),this._moved=!0),F(this._animRequest);var P=h(n._move,n,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=B(P,this,!0),Dt(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,F(this._animRequest),Je(document,"touchmove",this._onTouchMove,this),Je(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Ye.addInitHook("addHandler","touchZoom",Tl),Ye.BoxZoom=bl,Ye.DoubleClickZoom=yl,Ye.Drag=xl,Ye.Keyboard=wl,Ye.ScrollWheelZoom=kl,Ye.TapHold=Sl,Ye.TouchZoom=Tl,s.Bounds=Be,s.Browser=W,s.CRS=zt,s.Canvas=Yo,s.Circle=Wi,s.CircleMarker=wi,s.Class=M,s.Control=en,s.DivIcon=Ms,s.DivOverlay=Nt,s.DomEvent=Vi,s.DomUtil=Ln,s.Draggable=vn,s.Evented=me,s.FeatureGroup=bn,s.GeoJSON=yn,s.GridLayer=bo,s.Handler=An,s.Icon=ji,s.ImageOverlay=ho,s.LatLng=Ee,s.LatLngBounds=xt,s.Layer=_n,s.LayerGroup=qn,s.LineUtil=dr,s.Map=Ye,s.Marker=Wo,s.Mixin=rr,s.Path=ni,s.Point=he,s.PolyUtil=lr,s.Polygon=Fn,s.Polyline=tn,s.Popup=Dn,s.PosAnimation=so,s.Projection=fr,s.Rectangle=Ve,s.Renderer=On,s.SVG=X,s.SVGOverlay=go,s.TileLayer=Yn,s.Tooltip=_o,s.Transformation=wt,s.Util=se,s.VideoOverlay=po,s.bind=h,s.bounds=He,s.canvas=ka,s.circle=Rt,s.circleMarker=fo,s.control=ln,s.divIcon=xa,s.extend=u,s.featureGroup=Ps,s.geoJSON=qo,s.geoJson=gr,s.gridLayer=br,s.icon=pr,s.imageOverlay=vr,s.latLng=Re,s.latLngBounds=st,s.layerGroup=uo,s.map=Vo,s.marker=mr,s.point=pe,s.polygon=ya,s.polyline=Ko,s.popup=As,s.rectangle=id,s.setOptions=I,s.stamp=b,s.svg=k,s.svgOverlay=vo,s.tileLayer=wa,s.tooltip=_r,s.transformation=w,s.version=l,s.videoOverlay=mo;var sd=window.L;s.noConflict=function(){return window.L=sd,this},window.L=s}))})(Ds,Ds.exports)),Ds.exports}var fm=dm();const qi=um(fm),Cu={__name:"DeviceMap",props:{position:{type:Object,default:null},trail:{type:Array,default:()=>[]},aircraft:{type:Array,default:()=>[]}},setup(t){const i=t,s=Y(null);let l,u,f,h;const _=new Map;function b(G,I){const R=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0",Q=I?"#8a94a6":R,K=typeof G=="number"?G:0;return qi.divIcon({className:"plane-marker",iconSize:[22,22],iconAnchor:[11,11],html:``})}function C(G){const R=[`${G.callsign||G.icao24||"aircraft"}`];return G.country&&R.push(G.country),typeof G.altitude=="number"&&R.push(`${Math.round(G.altitude)} m`),typeof G.velocity=="number"&&R.push(`${Math.round(G.velocity*3.6)} km/h`),G.onGround&&R.push("on ground"),R.join(" · ")}function T(){if(!l)return;h||(h=qi.layerGroup().addTo(l));const G=new Set;for(const I of i.aircraft){if(typeof I.lat!="number"||typeof I.lng!="number")continue;G.add(I.icao24);const R=[I.lat,I.lng];let Q=_.get(I.icao24);Q?(Q.setLatLng(R),Q.setIcon(b(I.heading,I.onGround)),Q.setTooltipContent(C(I))):(Q=qi.marker(R,{icon:b(I.heading,I.onGround)}).bindTooltip(C(I)),Q.addTo(h),_.set(I.icao24,Q))}for(const[I,R]of _)G.has(I)||(h.removeLayer(R),_.delete(I))}function E(){if(!l)return;const G=i.position;if(G&&(G.lat||G.lng)){const I=[G.lat,G.lng];u?u.setLatLng(I):(u=qi.marker(I).addTo(l),l.setView(I,17))}if(f&&f.remove(),i.trail.length){const I=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0";f=qi.polyline(i.trail,{color:I,weight:3}).addTo(l)}}ti(()=>{l=qi.map(s.value,{zoomControl:!0}).setView([20,0],2),qi.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",maxZoom:19}).addTo(l),setTimeout(()=>l.invalidateSize(),60),E(),T(),(!i.position||!i.position.lat&&!i.position.lng)&&i.aircraft.length&&U()});let Z=!1;function U(){if(Z||!l||!i.aircraft.length)return;const G=i.aircraft.filter(I=>typeof I.lat=="number"&&typeof I.lng=="number").map(I=>[I.lat,I.lng]);G.length&&(l.fitBounds(qi.latLngBounds(G).pad(.2)),Z=!0)}return us(()=>{l&&l.remove(),l=null}),Bt(()=>i.position,E,{deep:!0}),Bt(()=>i.trail,E,{deep:!0}),Bt(()=>i.aircraft,()=>{T(),(!i.position||!i.position.lat&&!i.position.lng)&&U()},{deep:!0}),(G,I)=>(p(),m("div",{ref_key:"el",ref:s,class:"h-[320px] w-full rounded-lg"},null,512))}},hm=["width","height","stroke-width"],pm=["d"],ee={__name:"Icon",props:{name:{type:String,required:!0},size:{type:[Number,String],default:18},stroke:{type:[Number,String],default:2}},setup(t){const l=({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",eye:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7z M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",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"}[t.name]||"").split(" M").map((u,f)=>f?"M"+u:u);return(u,f)=>(p(),m("svg",{width:t.size,height:t.size,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":t.stroke,"stroke-linecap":"round","stroke-linejoin":"round",style:{flex:"none"},"aria-hidden":"true"},[(p(!0),m(re,null,$e(Ie(l),(h,_)=>(p(),m("path",{key:_,d:h},null,8,pm))),128))],8,hm))}},mm=["aria-checked","disabled"],nn={__name:"Toggle",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:i}){const s=i;return(l,u)=>(p(),m("button",{type:"button",role:"switch","aria-checked":t.modelValue,disabled:t.disabled,class:Ce(["relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition disabled:opacity-40",t.modelValue?"bg-accent":"bg-surface-2 border border-line-strong"]),onClick:u[0]||(u[0]=f=>s("update:modelValue",!t.modelValue))},[a("span",{class:Ce(["inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition",t.modelValue?"translate-x-6":"translate-x-1"])},null,2)],10,mm))}},gm={class:"inline-flex rounded-[10px] border border-line bg-surface-2 p-0.5"},vm=["onClick"],wn={__name:"Segmented",props:{modelValue:{type:[String,Number],default:""},options:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:i}){const s=i;return(l,u)=>(p(),m("div",gm,[(p(!0),m(re,null,$e(t.options,f=>(p(),m("button",{key:f.value,type:"button",class:Ce(["inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] font-semibold transition",t.modelValue===f.value?"bg-surface-1 text-ink shadow-xs":"text-ink-secondary hover:text-ink"]),onClick:h=>s("update:modelValue",f.value)},[f.icon?(p(),nt(ee,{key:0,name:f.icon,size:15},null,8,["name"])):$("",!0),z(" "+x(f.label),1)],10,vm))),128))]))}},_m={class:"text-sm font-semibold text-ink"},bm={key:0,class:"mt-0.5 text-xs text-ink-muted"},Se={__name:"Row",props:{title:{type:String,default:""},desc:{type:String,default:""},keywords:{type:String,default:""},block:{type:Boolean,default:!1}},setup(t){const i=t,s=Vs("settingsSearch",{value:""}),l=fe(()=>{const u=(s.value||"").trim().toLowerCase();return u?`${i.title} ${i.desc} ${i.keywords}`.toLowerCase().includes(u):!0});return(u,f)=>l.value?(p(),m("div",{key:0,class:Ce(["border-b border-line py-4 last:border-0",t.block?"":"flex items-center justify-between gap-6"])},[a("div",{class:Ce(t.block?"mb-3":"min-w-0")},[a("div",_m,x(t.title),1),t.desc?(p(),m("div",bm,x(t.desc),1)):$("",!0)],2),a("div",{class:Ce(t.block?"":"shrink-0")},[Tf(u.$slots,"default")],2)],2)):$("",!0)}},ia=[{code:"AL",name:"Albania",continent:"EU",bbox:"39.6,19.3,42.7,21.1"},{code:"AD",name:"Andorra",continent:"EU",bbox:"42.4,1.4,42.7,1.8"},{code:"AT",name:"Austria",continent:"EU",bbox:"46.4,9.5,49.0,17.2"},{code:"BY",name:"Belarus",continent:"EU",bbox:"51.2,23.2,56.2,32.8"},{code:"BE",name:"Belgium",continent:"EU",bbox:"49.5,2.5,51.5,6.4"},{code:"BA",name:"Bosnia and Herzegovina",continent:"EU",bbox:"42.6,15.7,45.3,19.6"},{code:"BG",name:"Bulgaria",continent:"EU",bbox:"41.2,22.4,44.2,28.6"},{code:"HR",name:"Croatia",continent:"EU",bbox:"42.4,13.5,46.6,19.4"},{code:"CY",name:"Cyprus",continent:"EU",bbox:"34.6,32.3,35.7,34.6"},{code:"CZ",name:"Czechia",continent:"EU",bbox:"48.6,12.1,51.1,18.9"},{code:"DK",name:"Denmark",continent:"EU",bbox:"54.6,8.1,57.8,12.7"},{code:"EE",name:"Estonia",continent:"EU",bbox:"57.5,21.8,59.7,28.2"},{code:"FI",name:"Finland",continent:"EU",bbox:"59.8,20.6,70.1,31.6"},{code:"FR",name:"France",continent:"EU",bbox:"41.3,-5.2,51.1,9.6"},{code:"DE",name:"Germany",continent:"EU",bbox:"47.2,5.8,55.1,15.1"},{code:"GR",name:"Greece",continent:"EU",bbox:"34.8,19.4,41.8,28.3"},{code:"HU",name:"Hungary",continent:"EU",bbox:"45.7,16.1,48.6,22.9"},{code:"IS",name:"Iceland",continent:"EU",bbox:"63.3,-24.6,66.6,-13.5"},{code:"IE",name:"Ireland",continent:"EU",bbox:"51.4,-10.6,55.4,-6.0"},{code:"IT",name:"Italy",continent:"EU",bbox:"36.6,6.6,47.1,18.6"},{code:"XK",name:"Kosovo",continent:"EU",bbox:"41.8,20.0,43.3,21.8"},{code:"LV",name:"Latvia",continent:"EU",bbox:"55.7,20.9,58.1,28.2"},{code:"LI",name:"Liechtenstein",continent:"EU",bbox:"47.0,9.4,47.3,9.6"},{code:"LT",name:"Lithuania",continent:"EU",bbox:"53.9,20.9,56.5,26.9"},{code:"LU",name:"Luxembourg",continent:"EU",bbox:"49.4,5.7,50.2,6.5"},{code:"MT",name:"Malta",continent:"EU",bbox:"35.8,14.1,36.1,14.6"},{code:"MD",name:"Moldova",continent:"EU",bbox:"45.4,26.6,48.5,30.2"},{code:"MC",name:"Monaco",continent:"EU",bbox:"43.72,7.40,43.75,7.44"},{code:"ME",name:"Montenegro",continent:"EU",bbox:"41.8,18.4,43.6,20.4"},{code:"NL",name:"Netherlands",continent:"EU",bbox:"50.7,3.3,53.7,7.2"},{code:"MK",name:"North Macedonia",continent:"EU",bbox:"40.8,20.4,42.4,23.0"},{code:"NO",name:"Norway",continent:"EU",bbox:"57.9,4.6,71.2,31.1"},{code:"PL",name:"Poland",continent:"EU",bbox:"49.0,14.1,54.9,24.2"},{code:"PT",name:"Portugal",continent:"EU",bbox:"36.9,-9.5,42.2,-6.2"},{code:"RO",name:"Romania",continent:"EU",bbox:"43.6,20.2,48.3,29.7"},{code:"SM",name:"San Marino",continent:"EU",bbox:"43.89,12.40,43.99,12.52"},{code:"RS",name:"Serbia",continent:"EU",bbox:"42.2,18.8,46.2,23.0"},{code:"SK",name:"Slovakia",continent:"EU",bbox:"47.7,16.8,49.6,22.6"},{code:"SI",name:"Slovenia",continent:"EU",bbox:"45.4,13.4,46.9,16.6"},{code:"ES",name:"Spain",continent:"EU",bbox:"35.9,-9.4,43.8,3.4"},{code:"SE",name:"Sweden",continent:"EU",bbox:"55.3,11.1,69.1,24.2"},{code:"CH",name:"Switzerland",continent:"EU",bbox:"45.8,5.9,47.8,10.5"},{code:"UA",name:"Ukraine",continent:"EU",bbox:"44.4,22.1,52.4,40.2"},{code:"GB",name:"United Kingdom",continent:"EU",bbox:"49.9,-8.7,60.9,1.8"},{code:"VA",name:"Vatican City",continent:"EU",bbox:"41.900,12.445,41.908,12.458"},{code:"RU",name:"Russia",continent:"EU",bbox:"41.2,19.6,81.9,180"},{code:"TR",name:"Turkey",continent:"EU",bbox:"35.8,25.7,42.3,44.8"},{code:"AF",name:"Afghanistan",continent:"AS",bbox:"29.4,60.5,38.5,74.9"},{code:"AM",name:"Armenia",continent:"AS",bbox:"38.8,43.4,41.3,46.6"},{code:"AZ",name:"Azerbaijan",continent:"AS",bbox:"38.4,44.8,41.9,50.4"},{code:"BH",name:"Bahrain",continent:"AS",bbox:"25.8,50.4,26.3,50.7"},{code:"BD",name:"Bangladesh",continent:"AS",bbox:"20.7,88.0,26.6,92.7"},{code:"BT",name:"Bhutan",continent:"AS",bbox:"26.7,88.7,28.3,92.1"},{code:"BN",name:"Brunei",continent:"AS",bbox:"4.0,114.0,5.1,115.4"},{code:"KH",name:"Cambodia",continent:"AS",bbox:"10.4,102.3,14.7,107.6"},{code:"CN",name:"China",continent:"AS",bbox:"18.2,73.5,53.6,134.8"},{code:"GE",name:"Georgia",continent:"AS",bbox:"41.0,40.0,43.6,46.7"},{code:"IN",name:"India",continent:"AS",bbox:"6.7,68.1,35.5,97.4"},{code:"ID",name:"Indonesia",continent:"AS",bbox:"-11.0,95.0,6.1,141.0"},{code:"IR",name:"Iran",continent:"AS",bbox:"25.0,44.0,39.8,63.3"},{code:"IQ",name:"Iraq",continent:"AS",bbox:"29.1,38.8,37.4,48.6"},{code:"IL",name:"Israel",continent:"AS",bbox:"29.5,34.2,33.3,35.9"},{code:"JP",name:"Japan",continent:"AS",bbox:"24.0,122.9,45.5,145.8"},{code:"JO",name:"Jordan",continent:"AS",bbox:"29.2,34.9,33.4,39.3"},{code:"KZ",name:"Kazakhstan",continent:"AS",bbox:"40.6,46.5,55.4,87.3"},{code:"KW",name:"Kuwait",continent:"AS",bbox:"28.5,46.5,30.1,48.4"},{code:"KG",name:"Kyrgyzstan",continent:"AS",bbox:"39.2,69.3,43.3,80.3"},{code:"LA",name:"Laos",continent:"AS",bbox:"13.9,100.1,22.5,107.7"},{code:"LB",name:"Lebanon",continent:"AS",bbox:"33.0,35.1,34.7,36.6"},{code:"MY",name:"Malaysia",continent:"AS",bbox:"0.9,99.6,7.4,119.3"},{code:"MV",name:"Maldives",continent:"AS",bbox:"-0.7,72.7,7.1,73.7"},{code:"MN",name:"Mongolia",continent:"AS",bbox:"41.6,87.7,52.1,119.9"},{code:"MM",name:"Myanmar",continent:"AS",bbox:"9.8,92.2,28.5,101.2"},{code:"NP",name:"Nepal",continent:"AS",bbox:"26.3,80.1,30.4,88.2"},{code:"KP",name:"North Korea",continent:"AS",bbox:"37.7,124.2,43.0,130.7"},{code:"OM",name:"Oman",continent:"AS",bbox:"16.6,52.0,26.4,59.8"},{code:"PK",name:"Pakistan",continent:"AS",bbox:"23.7,60.9,37.1,77.8"},{code:"PH",name:"Philippines",continent:"AS",bbox:"4.6,116.9,21.1,126.6"},{code:"QA",name:"Qatar",continent:"AS",bbox:"24.5,50.7,26.2,51.6"},{code:"SA",name:"Saudi Arabia",continent:"AS",bbox:"16.4,34.6,32.2,55.7"},{code:"SG",name:"Singapore",continent:"AS",bbox:"1.2,103.6,1.5,104.1"},{code:"KR",name:"South Korea",continent:"AS",bbox:"33.1,125.9,38.6,129.6"},{code:"LK",name:"Sri Lanka",continent:"AS",bbox:"5.9,79.7,9.8,81.9"},{code:"SY",name:"Syria",continent:"AS",bbox:"32.3,35.7,37.3,42.4"},{code:"TW",name:"Taiwan",continent:"AS",bbox:"21.9,120.0,25.3,122.0"},{code:"TJ",name:"Tajikistan",continent:"AS",bbox:"36.7,67.4,41.0,75.2"},{code:"TH",name:"Thailand",continent:"AS",bbox:"5.6,97.3,20.5,105.6"},{code:"TL",name:"Timor-Leste",continent:"AS",bbox:"-9.5,124.0,-8.1,127.3"},{code:"TM",name:"Turkmenistan",continent:"AS",bbox:"35.1,52.4,42.8,66.7"},{code:"AE",name:"United Arab Emirates",continent:"AS",bbox:"22.6,51.5,26.1,56.4"},{code:"UZ",name:"Uzbekistan",continent:"AS",bbox:"37.2,55.9,45.6,73.1"},{code:"VN",name:"Vietnam",continent:"AS",bbox:"8.2,102.1,23.4,109.5"},{code:"YE",name:"Yemen",continent:"AS",bbox:"12.1,42.5,19.0,54.5"},{code:"DZ",name:"Algeria",continent:"AF",bbox:"18.9,-8.7,37.1,12.0"},{code:"AO",name:"Angola",continent:"AF",bbox:"-18.0,11.6,-4.4,24.1"},{code:"BJ",name:"Benin",continent:"AF",bbox:"6.2,0.8,12.4,3.9"},{code:"BW",name:"Botswana",continent:"AF",bbox:"-26.9,20.0,-17.8,29.4"},{code:"BF",name:"Burkina Faso",continent:"AF",bbox:"9.4,-5.5,15.1,2.4"},{code:"BI",name:"Burundi",continent:"AF",bbox:"-4.5,29.0,-2.3,30.8"},{code:"CV",name:"Cabo Verde",continent:"AF",bbox:"14.8,-25.4,17.2,-22.7"},{code:"CM",name:"Cameroon",continent:"AF",bbox:"1.7,8.5,13.1,16.2"},{code:"CF",name:"Central African Republic",continent:"AF",bbox:"2.2,14.4,11.0,27.5"},{code:"TD",name:"Chad",continent:"AF",bbox:"7.4,13.5,23.4,24.0"},{code:"KM",name:"Comoros",continent:"AF",bbox:"-12.4,43.2,-11.4,44.5"},{code:"CG",name:"Congo",continent:"AF",bbox:"-5.0,11.1,3.7,18.6"},{code:"CD",name:"DR Congo",continent:"AF",bbox:"-13.5,12.2,5.4,31.3"},{code:"DJ",name:"Djibouti",continent:"AF",bbox:"10.9,41.7,12.7,43.4"},{code:"EG",name:"Egypt",continent:"AF",bbox:"22.0,25.0,31.7,36.9"},{code:"GQ",name:"Equatorial Guinea",continent:"AF",bbox:"0.9,9.3,3.8,11.4"},{code:"ER",name:"Eritrea",continent:"AF",bbox:"12.4,36.4,18.0,43.1"},{code:"SZ",name:"Eswatini",continent:"AF",bbox:"-27.3,30.8,-25.7,32.1"},{code:"ET",name:"Ethiopia",continent:"AF",bbox:"3.4,33.0,14.9,48.0"},{code:"GA",name:"Gabon",continent:"AF",bbox:"-4.0,8.7,2.3,14.5"},{code:"GM",name:"Gambia",continent:"AF",bbox:"13.1,-16.8,13.8,-13.8"},{code:"GH",name:"Ghana",continent:"AF",bbox:"4.7,-3.3,11.2,1.2"},{code:"GN",name:"Guinea",continent:"AF",bbox:"7.2,-15.1,12.7,-7.6"},{code:"GW",name:"Guinea-Bissau",continent:"AF",bbox:"10.9,-16.7,12.7,-13.6"},{code:"CI",name:"Ivory Coast",continent:"AF",bbox:"4.4,-8.6,10.7,-2.5"},{code:"KE",name:"Kenya",continent:"AF",bbox:"-4.7,33.9,5.5,41.9"},{code:"LS",name:"Lesotho",continent:"AF",bbox:"-30.7,27.0,-28.6,29.5"},{code:"LR",name:"Liberia",continent:"AF",bbox:"4.3,-11.5,8.6,-7.4"},{code:"LY",name:"Libya",continent:"AF",bbox:"19.5,9.3,33.2,25.2"},{code:"MG",name:"Madagascar",continent:"AF",bbox:"-25.6,43.2,-11.9,50.5"},{code:"MW",name:"Malawi",continent:"AF",bbox:"-17.1,32.7,-9.4,35.9"},{code:"ML",name:"Mali",continent:"AF",bbox:"10.1,-12.3,25.0,4.3"},{code:"MR",name:"Mauritania",continent:"AF",bbox:"14.7,-17.1,27.3,-4.8"},{code:"MU",name:"Mauritius",continent:"AF",bbox:"-20.5,57.3,-19.9,57.8"},{code:"MA",name:"Morocco",continent:"AF",bbox:"27.7,-13.2,35.9,-1.0"},{code:"MZ",name:"Mozambique",continent:"AF",bbox:"-26.9,30.2,-10.5,40.8"},{code:"NA",name:"Namibia",continent:"AF",bbox:"-28.9,11.7,-16.9,25.3"},{code:"NE",name:"Niger",continent:"AF",bbox:"11.7,0.2,23.5,16.0"},{code:"NG",name:"Nigeria",continent:"AF",bbox:"4.3,2.7,13.9,14.7"},{code:"RW",name:"Rwanda",continent:"AF",bbox:"-2.8,28.9,-1.1,30.9"},{code:"SN",name:"Senegal",continent:"AF",bbox:"12.3,-17.5,16.7,-11.4"},{code:"SL",name:"Sierra Leone",continent:"AF",bbox:"6.9,-13.3,10.0,-10.3"},{code:"SO",name:"Somalia",continent:"AF",bbox:"-1.7,40.9,12.0,51.4"},{code:"ZA",name:"South Africa",continent:"AF",bbox:"-34.8,16.5,-22.1,32.9"},{code:"SS",name:"South Sudan",continent:"AF",bbox:"3.5,24.1,12.2,35.9"},{code:"SD",name:"Sudan",continent:"AF",bbox:"8.7,21.8,22.2,38.6"},{code:"TZ",name:"Tanzania",continent:"AF",bbox:"-11.7,29.3,-1.0,40.4"},{code:"TG",name:"Togo",continent:"AF",bbox:"6.1,-0.1,11.1,1.8"},{code:"TN",name:"Tunisia",continent:"AF",bbox:"30.2,7.5,37.5,11.6"},{code:"UG",name:"Uganda",continent:"AF",bbox:"-1.5,29.6,4.2,35.0"},{code:"ZM",name:"Zambia",continent:"AF",bbox:"-18.1,21.9,-8.2,33.7"},{code:"ZW",name:"Zimbabwe",continent:"AF",bbox:"-22.4,25.2,-15.6,33.1"},{code:"CA",name:"Canada",continent:"NA",bbox:"41.7,-141.0,83.1,-52.6"},{code:"US",name:"United States",continent:"NA",bbox:"24.4,-125.0,49.4,-66.9"},{code:"MX",name:"Mexico",continent:"NA",bbox:"14.5,-118.4,32.7,-86.7"},{code:"GT",name:"Guatemala",continent:"NA",bbox:"13.7,-92.2,17.8,-88.2"},{code:"BZ",name:"Belize",continent:"NA",bbox:"15.9,-89.2,18.5,-87.8"},{code:"SV",name:"El Salvador",continent:"NA",bbox:"13.1,-90.1,14.4,-87.7"},{code:"HN",name:"Honduras",continent:"NA",bbox:"12.9,-89.4,16.5,-83.1"},{code:"NI",name:"Nicaragua",continent:"NA",bbox:"10.7,-87.7,15.0,-83.1"},{code:"CR",name:"Costa Rica",continent:"NA",bbox:"8.0,-85.9,11.2,-82.5"},{code:"PA",name:"Panama",continent:"NA",bbox:"7.2,-83.1,9.6,-77.2"},{code:"CU",name:"Cuba",continent:"NA",bbox:"19.8,-85.0,23.3,-74.1"},{code:"DO",name:"Dominican Republic",continent:"NA",bbox:"17.5,-72.0,19.9,-68.3"},{code:"HT",name:"Haiti",continent:"NA",bbox:"18.0,-74.5,20.1,-71.6"},{code:"JM",name:"Jamaica",continent:"NA",bbox:"17.7,-78.4,18.5,-76.2"},{code:"BS",name:"Bahamas",continent:"NA",bbox:"20.9,-79.0,27.3,-72.7"},{code:"TT",name:"Trinidad and Tobago",continent:"NA",bbox:"10.0,-61.9,11.4,-60.5"},{code:"AR",name:"Argentina",continent:"SA",bbox:"-55.1,-73.6,-21.8,-53.6"},{code:"BO",name:"Bolivia",continent:"SA",bbox:"-22.9,-69.6,-9.7,-57.5"},{code:"BR",name:"Brazil",continent:"SA",bbox:"-33.8,-74.0,5.3,-34.8"},{code:"CL",name:"Chile",continent:"SA",bbox:"-55.9,-75.6,-17.5,-66.4"},{code:"CO",name:"Colombia",continent:"SA",bbox:"-4.2,-79.0,12.5,-66.9"},{code:"EC",name:"Ecuador",continent:"SA",bbox:"-5.0,-81.1,1.4,-75.2"},{code:"GY",name:"Guyana",continent:"SA",bbox:"1.2,-61.4,8.6,-56.5"},{code:"PY",name:"Paraguay",continent:"SA",bbox:"-27.6,-62.6,-19.3,-54.3"},{code:"PE",name:"Peru",continent:"SA",bbox:"-18.4,-81.3,0.0,-68.7"},{code:"SR",name:"Suriname",continent:"SA",bbox:"1.8,-58.1,6.0,-54.0"},{code:"UY",name:"Uruguay",continent:"SA",bbox:"-35.0,-58.4,-30.1,-53.1"},{code:"VE",name:"Venezuela",continent:"SA",bbox:"0.6,-73.4,12.2,-59.8"},{code:"AU",name:"Australia",continent:"OC",bbox:"-43.6,113.3,-10.7,153.6"},{code:"NZ",name:"New Zealand",continent:"OC",bbox:"-47.3,166.4,-34.4,178.6"},{code:"PG",name:"Papua New Guinea",continent:"OC",bbox:"-11.7,140.8,-1.3,155.9"},{code:"FJ",name:"Fiji",continent:"OC",bbox:"-19.2,177.0,-16.0,180.0"}],ym=new Map(ia.map(t=>[t.code,t]));function xm(t){const i=String(t||"").split(",").map(s=>Number(s.trim()));return i.length!==4||i.some(s=>Number.isNaN(s))?null:i}function wm(t){const i=ym.get(t);return i?i.bbox:""}function $r(t,i){if(typeof t!="number"||typeof i!="number"||Number.isNaN(t)||Number.isNaN(i))return null;let s=null,l=1/0;for(const u of ia){const f=xm(u.bbox);if(!f)continue;const[h,_,b,C]=f;if(tb||i<_||i>C)continue;const T=Math.abs(b-h)*Math.abs(C-_);Tt.continent==="EU").slice().sort((t,i)=>t.name.localeCompare(i.name)).map(t=>({value:t.bbox,label:t.name}))}function Sm(){return ia.slice().sort((t,i)=>t.name.localeCompare(i.name)).map(t=>[t.code,t.name])}const Tm=[["EU","European countries"],["AS","Asian countries"],["AF","African countries"],["NA","North American countries"],["SA","South American countries"],["OC","Oceanian countries"]];function Pm(){return Tm.map(([t,i])=>({label:i,options:ia.filter(s=>s.continent===t).slice().sort((s,l)=>s.name.localeCompare(l.name)).map(s=>({value:s.bbox,label:s.name}))}))}const Cm=(t,i)=>{const s=t.__vccOpts||t;for(const[l,u]of i)s[l]=u;return s},Lm={class:"mx-auto max-w-[1280px] p-7"},Am={class:"mb-5 flex flex-wrap items-end justify-between gap-4"},Mm={class:"flex h-10 w-full max-w-[280px] items-center gap-2 rounded border border-line-strong bg-surface-1 px-3"},Em={class:"grid grid-cols-[210px_1fr] gap-6 max-[760px]:grid-cols-1"},Om={class:"flex flex-col gap-0.5 max-[760px]:flex-row max-[760px]:overflow-x-auto"},zm=["onClick"],$m={class:"whitespace-nowrap"},Im={class:"min-w-0"},Nm={key:0,class:"panel p-10 text-center text-sm text-ink-muted"},Fm={key:0,class:"eyebrow mb-2 mt-5 first:mt-0 flex items-center gap-2"},Dm={key:1,class:"panel mb-5 p-5"},Rm={class:"flex items-center gap-1"},Bm={class:"flex items-center gap-2"},Um={class:"font-mono text-sm text-ink"},Vm={class:"inline-flex items-center gap-1 rounded-full bg-amber-soft px-2 py-0.5 text-[11px] font-semibold text-amber-fg"},Zm={key:0,class:"mt-2 text-xs text-ink-muted"},Hm={class:"grid max-w-[420px] gap-2"},jm={class:"flex items-center gap-3"},Wm={key:2,class:"panel mb-5 p-5"},Km=["value"],Gm=["value"],qm=["value"],Ym={class:"font-mono text-sm text-ink"},Jm={key:3},Xm={key:0,class:"mb-5 flex items-center gap-1 overflow-x-auto border-b border-line"},Qm=["onClick"],eg={class:"panel mb-5 p-5"},tg={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},ng={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},ig={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"},sg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},ag={key:0},rg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},lg={class:"font-semibold text-ink-secondary"},ug={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},cg={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"},dg={class:"flex items-center justify-between gap-3"},fg={class:"flex items-center gap-2 text-sm font-semibold text-ink"},hg={key:0,class:"text-[11px] text-ink-muted"},pg={class:"mt-2 flex items-baseline gap-1.5"},mg={class:"font-mono text-2xl font-semibold text-ink"},gg={class:"text-sm text-ink-muted"},vg={class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},_g={class:"mt-2 text-xs text-ink-muted"},bg={class:"mt-2 text-sm text-ink"},yg={class:"font-semibold"},xg={class:"mt-1 text-xs text-ink-muted"},wg={key:1,class:"mt-2 text-xs text-ink-muted"},kg={key:0,class:"inline-flex items-center gap-2 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"},Tg={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"},Cg={key:1,class:"flex flex-col items-end gap-2"},Lg={key:0,value:"__auto__"},Ag=["label"],Mg=["value"],Eg={key:0,class:"w-64 text-right text-[11px] leading-snug text-ink-muted"},Og={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},zg={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"},Ig={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"},Ng={key:8,class:"border-b border-line py-3 text-xs text-amber-fg"},Fg={class:"mt-4 flex flex-wrap items-center gap-3"},Dg=["disabled"],Rg={key:1,class:"flex items-center gap-2",title:"Bounding box used for Test connection — smaller areas cost fewer OpenSky credits"},Bg=["label"],Ug=["value"],Vg=["disabled"],Zg={key:3,class:"text-xs text-danger-fg"},Hg={class:"panel mb-5 p-5"},jg={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Wg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Kg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Gg={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"},qg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Yg={key:0},Jg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Xg={class:"font-semibold text-ink-secondary"},Qg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},ev={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},tv={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"},nv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},iv={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"},ov={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},sv={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"},av={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},rv={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"},lv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},uv={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"},cv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},dv={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"},fv={key:7,class:"my-4 rounded-lg border border-line bg-surface-2 p-4","data-keywords":"usage quota rate limit calls per minute remaining left api"},hv={class:"flex items-center justify-between gap-3"},pv={class:"flex items-center gap-2 text-sm font-semibold text-ink"},mv={key:0,class:"text-[11px] text-ink-muted"},gv={class:"mt-2 flex items-baseline gap-1.5"},vv={class:"font-mono text-2xl font-semibold text-ink"},_v={class:"text-sm text-ink-muted"},bv={key:0,class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},yv={class:"mt-2 text-xs text-ink-muted"},xv={key:1,class:"mt-2 text-xs text-ink-muted"},wv={class:"mt-4 flex flex-wrap items-center gap-3"},kv=["disabled"],Sv=["disabled"],Tv={key:2,class:"text-xs text-danger-fg"},Pv={key:3,class:"text-[11px] text-ink-muted"},Cv={class:"panel mb-5 p-5"},Lv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Av={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Mv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Ev={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"},Ov={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},zv={key:0},$v={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Iv={class:"font-semibold text-ink-secondary"},Nv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Fv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Dv={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"},Rv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Bv={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"},Uv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Vv={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"},Zv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Hv={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"},jv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Wv={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"},Kv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Gv={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"},qv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Yv={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"},Jv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Xv={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"},Qv={key:0,class:"inline-flex items-center gap-2 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"},t_={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},n_={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"},i_={class:"mt-4 flex flex-wrap items-center gap-3"},o_=["disabled"],s_=["disabled"],a_={key:2,class:"text-xs text-danger-fg"},r_={key:3,class:"text-[11px] text-ink-muted"},l_={class:"panel mb-5 p-5"},u_={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},c_={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},d_={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},f_={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"},h_={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},p_={key:0},m_={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},g_={class:"font-semibold text-ink-secondary"},v_={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},__={key:0,class:"inline-flex items-center gap-2 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"},y_={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},x_={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"},w_={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},k_={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"},S_={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},T_={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"},P_={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},C_={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"},L_={class:"mt-4 flex flex-wrap items-center gap-3"},A_=["disabled"],M_=["disabled"],E_={key:2,class:"text-xs text-danger-fg"},O_={key:3,class:"text-[11px] text-ink-muted"},z_={key:3,class:"panel mb-5 p-5"},$_={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},I_={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},N_={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},F_={key:1,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},D_={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"},R_={key:5,class:"border-b border-line py-3 text-xs text-amber-fg"},B_={key:0},U_={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},V_={class:"font-semibold text-ink-secondary"},Z_={key:7,class:"border-b border-line py-3 text-xs text-ink-muted"},H_={class:"flex w-full flex-col gap-2"},j_={class:"break-all font-mono text-sm text-ink"},W_={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"},K_={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"},G_={key:0,class:"text-xs text-ink-muted"},q_={key:1,class:"border-b border-line py-3 text-xs text-ink-muted"},Y_={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},J_={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_={class:"mt-4 flex flex-wrap items-center gap-3"},Q_=["disabled"],e1=["disabled"],t1={key:2,class:"text-xs text-danger-fg"},n1={key:3,class:"text-[11px] text-ink-muted"},i1={key:4,class:"panel mb-5 p-5"},o1={class:"flex items-center gap-4"},s1=["src"],a1={key:1,class:"grid h-16 w-16 place-items-center rounded-full bg-[var(--navy-800)] text-lg font-bold text-white"},r1={class:"flex gap-2"},l1={class:"btn-ghost cursor-pointer"},u1={class:"mt-1 text-right text-[11px] text-ink-muted"},c1={key:5,class:"panel mb-5 p-5"},d1={class:"flex items-center gap-3"},f1={key:0,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},h1={class:"flex flex-wrap items-center gap-4"},p1={class:"min-w-0"},m1={class:"mt-1 select-all font-mono text-sm font-bold text-ink"},g1={class:"mt-3 flex items-center gap-2"},v1={key:0,class:"mt-2 text-xs text-danger-fg"},_1={key:1,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},b1={class:"mt-2 grid grid-cols-2 gap-1 font-mono text-xs text-ink-secondary sm:grid-cols-4"},y1={class:"rounded-lg border border-line bg-surface-2 p-3"},x1={class:"flex items-center gap-3"},w1={class:"grid h-9 w-9 place-items-center rounded-full bg-accent-soft text-accent-soft-fg"},k1={class:"min-w-0 flex-1"},S1={class:"text-sm font-semibold text-ink"},T1={class:"font-mono text-[11px] text-ink-muted"},P1={key:6,class:"mb-5"},C1={key:0,class:"panel mb-5 p-5"},L1={class:"grid max-w-[520px] gap-2"},A1={class:"flex flex-wrap gap-2"},M1=["disabled","title"],E1=["value"],O1=["value"],z1={class:"flex items-center gap-2 py-1 text-sm text-ink-secondary"},$1={class:"flex items-center gap-3"},I1=["disabled"],N1={key:0,class:"text-xs text-danger-fg"},F1={key:1,class:"text-xs text-ink-muted"},D1={key:1,class:"panel mb-5 p-5"},R1={class:"grid max-w-[520px] gap-2"},B1={class:"flex flex-wrap gap-2"},U1=["value"],V1=["value"],Z1={key:1,class:"text-xs text-ink-muted"},H1={class:"font-semibold text-ink-secondary"},j1={class:"flex items-center gap-3"},W1=["disabled"],K1={key:0,class:"text-xs text-danger-fg"},G1={class:"panel overflow-hidden p-0"},q1={class:"flex items-center justify-between px-5 py-4"},Y1=["disabled"],J1={key:0,class:"px-5 pb-5 text-sm text-danger-fg"},X1={key:1,class:"px-5 pb-8 text-sm text-ink-muted"},Q1={key:2,class:"overflow-x-auto"},eb={class:"w-full border-collapse text-sm"},tb={class:"text-left"},nb={class:"px-5 py-3"},ib={class:"text-ink"},ob={key:0,class:"ml-1.5 text-[11px] text-ink-muted"},sb={class:"px-5 py-3"},ab={class:"px-5 py-3"},rb={class:"px-5 py-3"},lb={class:"px-5 py-3 text-right"},ub=["onClick"],cb={key:1,class:"inline-flex items-center gap-1.5"},db=["onClick"],fb=["onClick"],hb={key:7,class:"mb-5"},pb={key:0,class:"panel mb-5 p-5"},mb={class:"grid max-w-[520px] gap-2"},gb={class:"flex items-center gap-3"},vb={key:0,class:"text-xs text-danger-fg"},_b={key:1,class:"panel mb-5 p-5"},bb={class:"grid max-w-[520px] gap-2"},yb={class:"flex items-center gap-3"},xb=["disabled"],wb={key:0,class:"text-xs text-danger-fg"},kb={class:"panel overflow-hidden p-0"},Sb={key:0,class:"px-5 pb-8 text-sm text-ink-muted"},Tb={key:1,class:"overflow-x-auto"},Pb={class:"w-full border-collapse text-sm"},Cb={class:"text-left"},Lb={class:"px-5 py-3"},Ab={class:"inline-flex items-center gap-2 text-ink"},Mb={class:"px-5 py-3 text-ink-secondary"},Eb={class:"px-5 py-3 text-right"},Ob=["onClick"],zb={key:1,class:"inline-flex items-center gap-1.5"},$b=["onClick"],Ib=["disabled","title","onClick"],Nb={key:8,class:"mb-5"},Fb={class:"panel mb-5 p-5"},Db={class:"btn-ghost cursor-pointer"},Rb={key:0,class:"mt-2 text-xs text-ink-muted"},Bb={class:"rounded-lg border p-5",style:{"border-color":"color-mix(in srgb, var(--danger) 35%, transparent)",background:"var(--danger-soft)"}},Ub={class:"flex items-center gap-2 text-danger-fg"},Vb={class:"mt-4 rounded-lg border border-line bg-surface-1 p-4"},Zb={class:"mt-3 flex items-start gap-2 text-sm text-ink-secondary"},Hb={class:"mt-3"},jb={class:"eyebrow mb-1 block"},Wb={class:"text-ink"},Kb=["placeholder"],Gb={class:"mt-4 flex flex-wrap items-center gap-3"},qb=["disabled"],Yb=["disabled"],Jb={key:2,class:"text-xs text-ink-muted"},Xb={key:0,class:"mt-3 rounded border border-line bg-surface-2 px-3 py-2 text-xs text-ink-secondary"},Qb={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"},Lu="pv.opensky.health",Au="pv.filetransfer.health",Mu="pv.webdav.health",Eu="pv.openweather.health",Ou="pv.localstorage.health",ey={__name:"Settings",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(t,{emit:i}){const s=t,l=i,u=fe(()=>s.role==="superadmin"),f=fe(()=>s.role==="admin"||s.role==="superadmin");function h(g){return g==="superadmin"?"Superadmin":g==="admin"?"Admin":"User"}function _(g){return g==="superadmin"||g==="admin"?"shield":"user"}function b(g){return g==="superadmin"||g==="admin"?C.accent:C.neutral}const C={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"},T=fe(()=>{const g=[{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 openweather weather forecast temperature api key units calls per minute usage limit quota"},{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 f.value&&g.push({id:"team",label:"User management",icon:"users",kw:"users team members add remove create delete role admin permissions rights organization"}),u.value&&g.push({id:"organizations",label:"Organizations",icon:"grid",kw:"organization org tenant company create rename delete members"}),g.push({id:"advanced",label:"Advanced",icon:"alertTriangle",kw:"export import data delete account danger zone",danger:!0}),g}),E=Y("account"),Z=Y("");uc("settingsSearch",Z);const U=fe(()=>Z.value.trim().length>0),G=fe(()=>Z.value.trim().toLowerCase());function I(g){return G.value?(g.label+" "+g.kw).toLowerCase().includes(G.value)||Q(g.id):!0}const R={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","openweather weather forecast","api key units metric imperial","default latitude longitude language","calls per minute limit usage quota","api call usage today rate limit"],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 Q(g){return G.value?(R[g]||[]).some(c=>c.includes(G.value)):!0}const K=fe(()=>U.value?T.value.filter(I):T.value.filter(g=>g.id===E.value)),ke=fe({get:()=>Oo.value,set:g=>Ha(g)}),de=[{value:"light",label:"Light",icon:"sun"},{value:"dark",label:"Dark",icon:"moon"},{value:"system",label:"System",icon:"monitor"}],xe=[{value:"sm",label:"Small"},{value:"md",label:"Default"},{value:"lg",label:"Large"}],Le=[{value:"12",label:"12-hour"},{value:"24",label:"24-hour"}],Me=[["en","English"],["es","Español"],["de","Deutsch"],["fr","Français"],["pl","Polski"],["ja","日本語"]],Ze=Sm(),ve=fe(()=>(Ze.find(([g])=>g===ye.region)||[null,ye.region])[1]),te=[["MDY","MM/DD/YYYY"],["DMY","DD/MM/YYYY"],["YMD","YYYY/MM/DD"],["ISO","YYYY-MM-DD"]],B=Y(Date.now());let F=null;const se=fe(()=>Su(B.value)),M=mt({loaded:!1,available:!1,orgEnabled:!0,allowAnonymous:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),H=Y("user"),Pe=mt({clientId:"",clientSecret:"",plan:"",bbox:""}),me=Y(""),he=Y(!1),St=Y(!1),pe=Y(null),Be=Y(null),He=fe(()=>pe.value&&pe.value.credits||null),xt=fe(()=>{const g=He.value;return!g||!g.daily||g.remaining==null?null:Math.max(0,Math.min(100,Math.round(g.remaining/g.daily*100)))}),st=fe(()=>{const g=xt.value;return g==null?"bg-accent":g<=10?"bg-danger":g<=30?"bg-amber":"bg-success"});function Ee(g){return typeof g=="number"?g.toLocaleString():g}function Re(){if(!Be.value)return"";const g=Math.max(0,Math.round((Date.now()-Be.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const X=Math.round(c/60);return X<24?`${X} h ago`:`${Math.round(X/24)} d ago`}function zt(){try{pe.value&&localStorage.setItem(Lu,JSON.stringify({health:pe.value,ts:Be.value}))}catch{}}function At(){try{const g=localStorage.getItem(Lu);if(!g)return;const c=JSON.parse(g);c&&c.health&&(pe.value=c.health,Be.value=c.ts||null)}catch{}}const Ut=[{value:"",label:"Not set"},{value:"anonymous",label:"Anonymous"},{value:"standard",label:"Standard"},{value:"contributor",label:"Contributor"}],Pt=[{value:"user",label:"My settings",icon:"user"},{value:"org",label:"Organization",icon:"users"}],wt=[{label:"World",options:[{value:"-90,-180,90,180",label:"World"}]},{label:"Continents",options:[{value:"34,-25,72,45",label:"Europe"},{value:"-35,-18,38,52",label:"Africa"},{value:"5,25,82,180",label:"Asia"},{value:"7,-168,72,-52",label:"North America"},{value:"-56,-82,13,-34",label:"South America"},{value:"-48,110,-10,180",label:"Oceania"}]},{label:"European countries",options:km()},{label:"Other countries",options:[{value:"24,-125,49.5,-66.5",label:"United States"},{value:"41.7,-141,83.1,-52.6",label:"Canada"},{value:"-43.6,113.3,-10.7,153.6",label:"Australia"},{value:"24,122.9,45.5,145.8",label:"Japan"}]}],w=wt.flatMap(g=>g.options);function y(g){const c=String(g||"").split(",").map(k=>k.trim());if(c.length!==4)return"";const X=c.map(Number);return X.some(k=>Number.isNaN(k))?"":X.join(",")}function S(g){const c=y(g),X=c&&w.find(k=>y(k.value)===c);return X?X.label:""}const q=Y(!1),j=fe({get(){if(!_e.value&&ye.autoBbox)return"__auto__";if(q.value)return"__custom__";const g=y(Pe.bbox),c=g&&w.find(X=>y(X.value)===g);return c?c.value:"__custom__"},set(g){if(g==="__auto__"){_e.value||(ye.autoBbox=!0),q.value=!1;return}if(_e.value||(ye.autoBbox=!1),g==="__custom__"){q.value=!0;return}q.value=!1,Pe.bbox=g}}),J=fe(()=>j.value==="__custom__"),ce=fe(()=>j.value==="__auto__"),ue=fe(()=>M.isSuperadmin),ae=fe(()=>M.isSuperadmin?"user":H.value),ne=fe(()=>M.scopes[ae.value]||{editableLayer:"user",fields:{}}),_e=fe(()=>ae.value==="org");function le(g){return ne.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function Te(g){return ue.value||le(g).locked}function Ae(g){const c=le(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function Ue(){Pe.clientId=le("clientId").own||"",Pe.clientSecret=le("clientSecret").own||"",Pe.plan=le("plan").own||"",Pe.bbox=le("bbox").own||"",q.value=!1}function Ge(g){M.available=!!g.available,M.orgEnabled=g.orgEnabled!==!1,M.allowAnonymous=!!g.allowAnonymous,M.enabled=!!g.enabled,M.canEditOrg=!!g.canEditOrg,M.isSuperadmin=!!g.isSuperadmin,M.scopes=g.scopes||{},H.value==="org"&&!M.canEditOrg&&(H.value="user"),Ue(),M.loaded=!0}Bt(H,()=>{me.value="",Ue()});async function qe(){At();const{ok:g,body:c}=await hp();g&&Ge(c)}async function ht(g){const c=_e.value;c?M.orgEnabled=g:M.enabled=g;const{ok:X,body:k}=await bu(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});X?(Ge(k),Ke(c?g?"OpenSky enabled for your organization.":"OpenSky disabled for your organization.":g?"OpenSky enabled.":"OpenSky disabled.")):(c?M.orgEnabled=!g:M.enabled=!g,Ke(k.error||"Could not update."))}async function ft(){me.value="",he.value=!0;const g={};for(const Ve of["clientId","clientSecret","plan","bbox"])Te(Ve)||(g[Ve]=Pe[Ve]);const c={scope:ae.value,config:g};_e.value||(c.enabled=M.enabled);const{ok:X,body:k}=await bu(c);if(he.value=!1,!X){me.value=k.error||"Could not save settings.";return}Ge(k),Ke(_e.value?"Organization OpenSky settings saved.":"OpenSky settings saved.")}const Vt=[{label:"World",options:[{value:"-90,-180,90,180",label:"World"}]},{label:"Continents",options:[{value:"34,-25,72,45",label:"Europe"},{value:"-35,-18,38,52",label:"Africa"},{value:"5,25,82,180",label:"Asia"},{value:"7,-168,72,-52",label:"North America"},{value:"-56,-82,13,-34",label:"South America"},{value:"-48,110,-10,180",label:"Oceania"}]},...Pm()],Jt=Vt.flatMap(g=>g.options),Zt=Y(""),pn=Y(!1),Ct=fe({get(){if(pn.value)return"__custom__";if(!Zt.value)return"__default__";const g=y(Zt.value),c=g&&Jt.find(X=>y(X.value)===g);return c?c.value:"__custom__"},set(g){if(g==="__default__"){pn.value=!1,Zt.value="";return}if(g==="__custom__"){pn.value=!0;return}pn.value=!1,Zt.value=g}}),$t=fe(()=>Ct.value==="__custom__");async function kn(){St.value=!0,pe.value=null;const{ok:g,body:c}=await pp((Zt.value||"").trim()||void 0);St.value=!1,pe.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."},Be.value=Date.now(),zt()}function zi(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const at=mt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Sn=Y("user"),$i=["protocol","host","port","username","password","privateKey","keyPassphrase","hostKeyFingerprint","insecureSkipVerify","basePath"],rt=mt(Object.fromEntries($i.map(g=>[g,""]))),hi=Y(""),pi=Y(!1),Ii=Y(!1),Gt=Y(null),jn=Y(null),V=[{value:"sftp",label:"SFTP"},{value:"ftps",label:"FTPS"},{value:"ftp",label:"FTP"}],O=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],ze=fe(()=>at.isSuperadmin),tt=fe(()=>at.isSuperadmin?"user":Sn.value),It=fe(()=>at.scopes[tt.value]||{editableLayer:"user",fields:{}}),kt=fe(()=>tt.value==="org"),Et=fe(()=>(vt("protocol")?W("protocol").effective:rt.protocol)||"sftp");function W(g){return It.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function vt(g){return ze.value||W(g).locked}function _t(g){const c=W(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function oa(g){return(V.find(c=>c.value===g)||{}).label||g||"—"}function cs(){for(const g of $i)rt[g]=W(g).own||"";rt.protocol||(rt.protocol="sftp"),rt.insecureSkipVerify||(rt.insecureSkipVerify="false")}function no(g){at.available=!!g.available,at.orgEnabled=g.orgEnabled!==!1,at.enabled=!!g.enabled,at.canEditOrg=!!g.canEditOrg,at.isSuperadmin=!!g.isSuperadmin,at.scopes=g.scopes||{},Sn.value==="org"&&!at.canEditOrg&&(Sn.value="user"),cs(),at.loaded=!0}Bt(Sn,()=>{hi.value="",cs()});function sa(){if(!jn.value)return"";const g=Math.max(0,Math.round((Date.now()-jn.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const X=Math.round(c/60);return X<24?`${X} h ago`:`${Math.round(X/24)} d ago`}function Ni(){try{Gt.value&&localStorage.setItem(Au,JSON.stringify({health:Gt.value,ts:jn.value}))}catch{}}function aa(){try{const g=localStorage.getItem(Au);if(!g)return;const c=JSON.parse(g);c&&c.health&&(Gt.value=c.health,jn.value=c.ts||null)}catch{}}async function ir(){aa();const{ok:g,body:c}=await gp();g&&no(c)}async function ra(g){const c=kt.value;c?at.orgEnabled=g:at.enabled=g;const{ok:X,body:k}=await yu(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});X?(no(k),Ke(c?g?"File transfer enabled for your organization.":"File transfer disabled for your organization.":g?"File transfer enabled.":"File transfer disabled.")):(c?at.orgEnabled=!g:at.enabled=!g,Ke(k.error||"Could not update."))}async function or(){hi.value="",pi.value=!0;const g={};for(const Ve of $i)vt(Ve)||(g[Ve]=rt[Ve]);const c={scope:tt.value,config:g};kt.value||(c.enabled=at.enabled);const{ok:X,body:k}=await yu(c);if(pi.value=!1,!X){hi.value=k.error||"Could not save settings.";return}no(k),Ke(kt.value?"Organization file-transfer settings saved.":"File-transfer settings saved.")}async function sr(){Ii.value=!0,Gt.value=null;const{ok:g,body:c}=await vp();Ii.value=!1,Gt.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."},jn.value=Date.now(),Ni()}function la(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const lt=mt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Wn=Y("user"),ds=["baseURL","username","password","insecureSkipVerify","basePath"],Xt=mt(Object.fromEntries(ds.map(g=>[g,""]))),io=Y(""),zo=Y(!1),$o=Y(!1),Tn=Y(null),$n=Y(null),ua=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],Io=fe(()=>lt.isSuperadmin),mi=fe(()=>lt.isSuperadmin?"user":Wn.value),it=fe(()=>lt.scopes[mi.value]||{editableLayer:"user",fields:{}}),ot=fe(()=>mi.value==="org");function Pn(g){return it.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function Cn(g){return Io.value||Pn(g).locked}function qt(g){const c=Pn(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function No(){for(const g of ds)Xt[g]=Pn(g).own||"";Xt.insecureSkipVerify||(Xt.insecureSkipVerify="false")}function je(g){lt.available=!!g.available,lt.orgEnabled=g.orgEnabled!==!1,lt.enabled=!!g.enabled,lt.canEditOrg=!!g.canEditOrg,lt.isSuperadmin=!!g.isSuperadmin,lt.scopes=g.scopes||{},Wn.value==="org"&&!lt.canEditOrg&&(Wn.value="user"),No(),lt.loaded=!0}Bt(Wn,()=>{io.value="",No()});function Lt(){if(!$n.value)return"";const g=Math.max(0,Math.round((Date.now()-$n.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const X=Math.round(c/60);return X<24?`${X} h ago`:`${Math.round(X/24)} d ago`}function fs(){try{Tn.value&&localStorage.setItem(Mu,JSON.stringify({health:Tn.value,ts:$n.value}))}catch{}}function Fo(){try{const g=localStorage.getItem(Mu);if(!g)return;const c=JSON.parse(g);c&&c.health&&(Tn.value=c.health,$n.value=c.ts||null)}catch{}}async function mn(){Fo();const{ok:g,body:c}=await yp();g&&je(c)}async function ca(g){const c=ot.value;c?lt.orgEnabled=g:lt.enabled=g;const{ok:X,body:k}=await xu(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});X?(je(k),Ke(c?g?"WebDAV enabled for your organization.":"WebDAV disabled for your organization.":g?"WebDAV enabled.":"WebDAV disabled.")):(c?lt.orgEnabled=!g:lt.enabled=!g,Ke(k.error||"Could not update."))}async function Do(){io.value="",zo.value=!0;const g={};for(const Ve of ds)Cn(Ve)||(g[Ve]=Xt[Ve]);const c={scope:mi.value,config:g};ot.value||(c.enabled=lt.enabled);const{ok:X,body:k}=await xu(c);if(zo.value=!1,!X){io.value=k.error||"Could not save settings.";return}je(k),Ke(ot.value?"Organization WebDAV settings saved.":"WebDAV settings saved.")}async function gi(){$o.value=!0,Tn.value=null;const{ok:g,body:c}=await xp();$o.value=!1,Tn.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."},$n.value=Date.now(),fs()}function Mt(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const Xe=mt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),In=Y("user"),vi=["apiKey","units","lat","lon","lang","callsPerMinute"],Ht=mt(Object.fromEntries(vi.map(g=>[g,""]))),Kn=Y(""),Fi=Y(!1),Di=Y(!1),Qt=Y(null),Gn=Y(null),Ro=[{value:"",label:"Not set"},{value:"metric",label:"Metric (°C)"},{value:"imperial",label:"Imperial (°F)"},{value:"standard",label:"Standard (K)"}],Ri=fe(()=>Xe.isSuperadmin),Bo=fe(()=>Xe.isSuperadmin?"user":In.value),hs=fe(()=>Xe.scopes[Bo.value]||{editableLayer:"user",fields:{}}),Ln=fe(()=>Bo.value==="org");function Ne(g){return hs.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function jt(g){return Ri.value||Ne(g).locked}function Je(g){const c=Ne(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function ps(){for(const g of vi)Ht[g]=Ne(g).own||""}function oo(g){Xe.available=!!g.available,Xe.orgEnabled=g.orgEnabled!==!1,Xe.enabled=!!g.enabled,Xe.canEditOrg=!!g.canEditOrg,Xe.isSuperadmin=!!g.isSuperadmin,Xe.scopes=g.scopes||{},In.value==="org"&&!Xe.canEditOrg&&(In.value="user"),ps(),Xe.loaded=!0}Bt(In,()=>{Kn.value="",ps()});function Uo(){if(!Gn.value)return"";const g=Math.max(0,Math.round((Date.now()-Gn.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const X=Math.round(c/60);return X<24?`${X} h ago`:`${Math.round(X/24)} d ago`}function ms(){try{Qt.value&&localStorage.setItem(Eu,JSON.stringify({health:Qt.value,ts:Gn.value}))}catch{}}function _i(){try{const g=localStorage.getItem(Eu);if(!g)return;const c=JSON.parse(g);c&&c.health&&(Qt.value=c.health,Gn.value=c.ts||null)}catch{}}async function gs(){_i();const{ok:g,body:c}=await wp();g&&oo(c)}async function Bi(g){const c=Ln.value;c?Xe.orgEnabled=g:Xe.enabled=g;const{ok:X,body:k}=await wu(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});X?(oo(k),Ke(c?g?"OpenWeather enabled for your organization.":"OpenWeather disabled for your organization.":g?"OpenWeather enabled.":"OpenWeather disabled.")):(c?Xe.orgEnabled=!g:Xe.enabled=!g,Ke(k.error||"Could not update."))}async function Dt(){Kn.value="",Fi.value=!0;const g={};for(const Ve of vi)jt(Ve)||(g[Ve]=Ht[Ve]);const c={scope:Bo.value,config:g};Ln.value||(c.enabled=Xe.enabled);const{ok:X,body:k}=await wu(c);if(Fi.value=!1,!X){Kn.value=k.error||"Could not save settings.";return}oo(k),Ke(Ln.value?"Organization OpenWeather settings saved.":"OpenWeather settings saved.")}async function bi(){Di.value=!0,Qt.value=null;const{ok:g,body:c}=await kp();Di.value=!1,Qt.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."},Gn.value=Date.now(),ms()}function da(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const Ui=fe(()=>Qt.value&&Qt.value.usage||null),vs=fe(()=>{const g=Ui.value;return!g||!g.minuteLimit?null:Math.max(0,Math.min(100,Math.round(g.minuteUsed/g.minuteLimit*100)))}),fa=fe(()=>{const g=vs.value;return g==null?"bg-accent":g>=90?"bg-danger":g>=70?"bg-amber":"bg-success"}),Oe=mt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,isOrgUser:!1,mounts:[],privateFolder:!1,privateEnabled:!1,allowPrivate:!0,rootConfigured:!1,scopes:{}}),Vi=Y("user"),so=Y(""),Ye=Y(""),Vo=Y(!1),en=Y(!1),ln=Y(null),yi=Y(null),ao=Y({}),Zo=[{value:"",label:"Inherit"},{value:"false",label:"Read-write"},{value:"true",label:"Read-only"}],_s=fe(()=>Oe.isSuperadmin),Ho=fe(()=>Oe.isSuperadmin?"user":Vi.value),ar=fe(()=>Oe.scopes[Ho.value]||{editableLayer:"user",fields:{}}),gn=fe(()=>Ho.value==="org");function Zi(g){return ar.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function ha(g){return _s.value||Zi(g).locked}function An(g){const c=Zi(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function rr(g){return(Zo.find(c=>c.value===g)||{}).label||"Inherit"}function bs(){so.value=Zi("readOnly").own||""}function vn(g){Oe.available=!!g.available,Oe.orgEnabled=g.orgEnabled!==!1,Oe.enabled=!!g.enabled,Oe.canEditOrg=!!g.canEditOrg,Oe.isSuperadmin=!!g.isSuperadmin,Oe.isOrgUser=!!g.isOrgUser,Oe.mounts=Array.isArray(g.mounts)?g.mounts:[],Oe.privateFolder=!!g.privateFolder,Oe.privateEnabled=!!g.privateEnabled,Oe.allowPrivate=g.allowPrivate!==!1,Oe.rootConfigured=!!g.rootConfigured,Oe.scopes=g.scopes||{},Vi.value==="org"&&!Oe.canEditOrg&&(Vi.value="user"),bs(),Oe.loaded=!0}Bt(Vi,()=>{Ye.value="",bs()});function pa(){if(!yi.value)return"";const g=Math.max(0,Math.round((Date.now()-yi.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const X=Math.round(c/60);return X<24?`${X} h ago`:`${Math.round(X/24)} d ago`}function ma(){try{ln.value&&localStorage.setItem(Ou,JSON.stringify({health:ln.value,ts:yi.value}))}catch{}}function ys(){try{const g=localStorage.getItem(Ou);if(!g)return;const c=JSON.parse(g);c&&c.health&&(ln.value=c.health,yi.value=c.ts||null)}catch{}}async function lr(){ys();const{ok:g,body:c}=await _p();g&&vn(c)}async function xs(g){const c=gn.value;c?Oe.orgEnabled=g:Oe.enabled=g;const{ok:X,body:k}=await Ma(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});X?(vn(k),Ke(c?g?"Local storage enabled for your organization.":"Local storage disabled for your organization.":g?"Local storage enabled.":"Local storage disabled.")):(c?Oe.orgEnabled=!g:Oe.enabled=!g,Ke(k.error||"Could not update."))}async function ga(g){Oe.privateFolder=g;const{ok:c,body:X}=await Ma({scope:"user",privateFolder:g});c?(vn(X),Ke(g?"Private folder enabled.":"Private folder disabled.")):(Oe.privateFolder=!g,Ke(X.error||"Could not update."))}async function ur(g){Oe.allowPrivate=g;const{ok:c,body:X}=await Ma({scope:"org",allowPrivate:g});c?(vn(X),Ke(g?"Members may now create private folders.":"Private folders disabled for your organization.")):(Oe.allowPrivate=!g,Ke(X.error||"Could not update."))}async function cr(){Ye.value="",Vo.value=!0;const g={};ha("readOnly")||(g.readOnly=so.value);const c={scope:Ho.value,config:g};gn.value||(c.enabled=Oe.enabled);const{ok:X,body:k}=await Ma(c);if(Vo.value=!1,!X){Ye.value=k.error||"Could not save settings.";return}vn(k),Ke(gn.value?"Organization local-storage settings saved.":"Local-storage settings saved.")}async function ws(){en.value=!0,ln.value=null,ao.value={};const{ok:g,body:c}=await bp();en.value=!1,ln.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."};const X={};if(Array.isArray(c.mounts))for(const k of c.mounts)X[k.id]={status:k.status,detail:k.detail};ao.value=X,yi.value=Date.now(),ma()}function va(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const _a=[{id:"apis-external",label:"APIs — External",icon:"globe"},{id:"drives-external",label:"Drives — External",icon:"server"},{id:"drives-local",label:"Drives — Local",icon:"monitor"}],jo=Y("apis-external");function Hi(g){return U.value||jo.value===g}const Nn=Y("");let ks=null;function Ke(g){Nn.value=g,clearTimeout(ks),ks=setTimeout(()=>Nn.value="",2200)}const bt=mt({current:"",next:"",confirm:""}),xi=Y(""),Ss=Y(!1);function dr(){if(Ss.value=!1,!bt.current)return xi.value="Enter your current password.";if(bt.next.length<8)return xi.value="New password must be at least 8 characters.";if(bt.next!==bt.confirm)return xi.value="New passwords do not match.";xi.value="Validated. Connecting to the account service is pending — no password endpoint yet.",bt.current=bt.next=bt.confirm=""}const ro=Y("");function Ts(){ro.value="Verification link would be sent once the account service is wired up."}function fr(g){const c=g.target.files&&g.target.files[0];if(!c)return;if(c.size>1.5*1024*1024){Ke("Image too large (max ~1.5 MB).");return}const X=new FileReader;X.onload=()=>{ye.avatar=String(X.result),Ke("Photo updated.")},X.readAsDataURL(c)}function hr(){ye.avatar="",Ke("Photo removed.")}const ba=fe(()=>{var X,k,Ve;const c=(ye.displayName||ye.name||s.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((X=c[0])==null?void 0:X[0])||"P")+(((k=c[1])==null?void 0:k[0])||((Ve=c[0])==null?void 0:Ve[1])||"V")).toUpperCase()}),lo=Y(!1),_n=Y(""),qn=Y(""),uo=Y(""),bn=Y([]);function Ps(g){const c="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let X="";for(let k=0;kPs(4).toLowerCase()+"-"+Ps(4).toLowerCase()),uo.value=""}function co(){ye.twoFactor=!1,bn.value=[],lo.value=!1}const Mn=navigator.userAgent;function Wo(){return/Edg\//.test(Mn)?"Edge":/OPR\//.test(Mn)?"Opera":/Chrome\//.test(Mn)?"Chrome":/Firefox\//.test(Mn)?"Firefox":/Safari\//.test(Mn)?"Safari":"Browser"}function mr(){return/Windows/.test(Mn)?"Windows":/Mac OS X/.test(Mn)?"macOS":/Android/.test(Mn)?"Android":/iPhone|iPad/.test(Mn)?"iOS":/Linux/.test(Mn)?"Linux":"Unknown OS"}const ni=Date.now(),wi=Y([]),fo=Y(!1),Wi=Y(""),Rt=mt({email:"",password:"",role:"user",organization:""}),tn=Y(""),Ko=Y(!1),Fn=Y(""),ya=fe(()=>{const g=[{value:"user",label:"User"},{value:"admin",label:"Admin"}];return u.value&&g.push({value:"superadmin",label:"Superadmin"}),g}),yn=Y([]);async function ii(){if(!f.value)return;const g=await rp();g.ok&&(yn.value=g.organizations.slice().sort((c,X)=>c.name.localeCompare(X.name)))}const Cs=fe(()=>{const g=yn.value.map(c=>({value:c.id,label:c.name}));return u.value&&g.unshift({value:"",label:"No organization"}),g});async function oi(){if(!f.value)return;fo.value=!0,Wi.value="";const g=await ip();if(fo.value=!1,!g.ok){Wi.value=g.status===403?"Manager role required.":"Could not load users.";return}wi.value=g.users.slice().sort((c,X)=>c.email.localeCompare(X.email))}function ki(g){try{const c=g.data||{},X=Object.keys(c)[0];return X&&c[X]&&c[X].message||g.message||g.error||"Invalid input."}catch{return g.error||"Could not create user."}}async function Ls(){tn.value="";const g=Rt.email.trim().toLowerCase();if(!g.includes("@"))return tn.value="Enter a valid email.";if(Rt.password.length<8)return tn.value="Password must be at least 8 characters.";Ko.value=!0;const c=u.value?Rt.organization:s.organization,{ok:X,body:k}=await op(g,Rt.password,Rt.role,c);if(Ko.value=!1,!X)return tn.value=ki(k);Rt.email="",Rt.password="",Rt.role="user",Rt.organization="",Ke("User created."),oi()}async function Go(g){const{ok:c,body:X}=await ap(g.id);if(Fn.value="",!c)return Ke(X.error||"Could not remove user.");Ke("User removed."),oi()}const Qe=mt({id:"",email:"",role:"user",verified:!1,password:"",organization:""}),En=Y(""),Ki=Y(!1),qo=fe(()=>!!Qe.id&&Qe.email===s.email);function gr(g){Fn.value="",Qe.id=g.id,Qe.email=g.email,Qe.role=g.role||"user",Qe.verified=!!g.verified,Qe.password="",Qe.organization=g.organization||"",En.value=""}function ho(){Qe.id="",En.value=""}async function vr(){En.value="";const g=Qe.email.trim().toLowerCase();if(!g.includes("@"))return En.value="Enter a valid email.";if(Qe.password&&Qe.password.length<8)return En.value="New password must be at least 8 characters (or leave blank).";const c={email:g,role:Qe.role,verified:Qe.verified};u.value&&(c.organization=Qe.organization),Qe.password&&(c.password=Qe.password),Ki.value=!0;const{ok:X,body:k}=await sp(Qe.id,c);if(Ki.value=!1,!X)return En.value=ki(k);Ke("User updated."),ho(),oi()}const po=mt({name:""}),mo=Y(""),go=Y(!1),vo=Y(""),Nt=mt({id:"",name:""}),Dn=Y(""),As=fe(()=>{const g={};for(const c of wi.value)c.organization&&(g[c.organization]=(g[c.organization]||0)+1);return g});async function _o(){mo.value="";const g=po.name.trim();if(!g)return mo.value="Enter an organization name.";go.value=!0;const{ok:c,body:X}=await lp(g);if(go.value=!1,!c)return mo.value=ki(X);po.name="",Ke("Organization created."),ii()}function _r(g){vo.value="",Nt.id=g.id,Nt.name=g.name,Dn.value=""}function Ms(){Nt.id="",Dn.value=""}async function xa(){Dn.value="";const g=Nt.name.trim();if(!g)return Dn.value="Enter an organization name.";const{ok:c,body:X}=await up(Nt.id,g);if(!c)return Dn.value=ki(X);Ke("Organization renamed."),Ms(),ii(),oi()}async function bo(g){const{ok:c,body:X}=await cp(g.id);if(vo.value="",!c)return Ke(X.error||"Could not delete organization.");Ke("Organization deleted."),ii()}function br(){const g={_app:"PilotVault",_kind:"settings-export",exportedAt:new Date().toISOString(),email:s.email,prefs:{...ye},themeMode:Oo.value},c=new Blob([JSON.stringify(g,null,2)],{type:"application/json"}),X=URL.createObjectURL(c),k=document.createElement("a");k.href=X,k.download=`pilotvault-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(k),k.click(),k.remove(),URL.revokeObjectURL(X),Ke("Settings exported.")}const Yn=Y("");function wa(g){const c=g.target.files&&g.target.files[0];if(!c)return;const X=new FileReader;X.onload=()=>{try{const k=JSON.parse(String(X.result)),Ve=k.prefs||k;if(!ed(Ve))throw new Error("bad shape");k.themeMode&&Ha(k.themeMode),ml(ye.fontSize),gl(ye.reduceMotion),Yn.value="Settings imported and applied."}catch{Yn.value="That file is not a valid PilotVault settings export."}},X.readAsText(c),g.target.value=""}const pt=mt({understand:!1,typed:"",cooldown:0,armed:!1,msg:""});let yo=null;const On=fe(()=>s.email||"DELETE MY ACCOUNT"),Yo=fe(()=>pt.understand&&pt.typed===On.value);function ka(){Yo.value&&(pt.armed=!0,pt.cooldown=5,clearInterval(yo),yo=setInterval(()=>{pt.cooldown--,pt.cooldown<=0&&clearInterval(yo)},1e3))}Bt(Yo,g=>{!g&&pt.armed&&(pt.armed=!1,pt.cooldown=0,clearInterval(yo))});function xo(){if(!(!pt.armed||pt.cooldown>0)){try{localStorage.removeItem("pv_prefs")}catch{}pt.msg="Account deletion requires the account service. Local data was cleared and you were signed out.",setTimeout(()=>l("logout"),900)}}return ti(()=>{F=setInterval(()=>B.value=Date.now(),1e3),ii(),oi(),qe(),ir(),mn(),gs(),lr()}),us(()=>{clearInterval(F),clearInterval(yo),clearTimeout(ks)}),(g,c)=>(p(),m("div",Lm,[a("div",Am,[c[72]||(c[72]=a("div",null,[a("div",{class:"eyebrow"},"Preferences"),a("h2",{class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},"Settings")],-1)),a("div",Mm,[A(ee,{name:"search",size:16,class:"text-ink-muted"}),oe(a("input",{"onUpdate:modelValue":c[0]||(c[0]=X=>Z.value=X),placeholder:"Search settings…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ge,Z.value]]),Z.value?(p(),m("button",{key:0,class:"text-ink-muted hover:text-ink","aria-label":"Clear search",onClick:c[1]||(c[1]=X=>Z.value="")},[A(ee,{name:"x",size:15})])):$("",!0)])]),a("div",Em,[oe(a("nav",Om,[(p(!0),m(re,null,$e(T.value,X=>(p(),m("button",{key:X.id,class:Ce(["flex items-center gap-2.5 rounded px-3 py-2.5 text-left text-sm transition",[E.value===X.id?X.danger?"bg-danger-soft font-semibold text-danger-fg":"bg-accent-soft font-semibold text-accent-soft-fg":X.danger?"font-medium text-danger-fg hover:bg-danger-soft":"font-medium text-ink-secondary hover:bg-surface-2"]]),onClick:k=>E.value=X.id},[A(ee,{name:X.icon,size:17},null,8,["name"]),a("span",$m,x(X.label),1)],10,zm))),128))],512),[[kh,!U.value]]),a("div",Im,[U.value&&!K.value.length?(p(),m("div",Nm," No settings match “"+x(Z.value)+"”. ",1)):$("",!0),(p(!0),m(re,null,$e(K.value,X=>(p(),m(re,{key:X.id},[U.value?(p(),m("div",Fm,[A(ee,{name:X.icon,size:14},null,8,["name"]),z(" "+x(X.label),1)])):$("",!0),X.id==="account"?(p(),m("div",Dm,[A(Se,{title:"Full name",desc:"Shown to your team on flights and audit logs.",keywords:"full name account"},{default:we(()=>[oe(a("input",{"onUpdate:modelValue":c[2]||(c[2]=k=>Ie(ye).name=k),class:"field w-56",placeholder:"Jane Operator",onBlur:c[3]||(c[3]=k=>Ke("Saved."))},null,544),[[ge,Ie(ye).name]])]),_:1}),A(Se,{title:"Username",desc:"Your unique handle within PilotVault.",keywords:"username handle"},{default:we(()=>[a("div",Rm,[c[73]||(c[73]=a("span",{class:"text-sm text-ink-muted"},"@",-1)),oe(a("input",{"onUpdate:modelValue":c[4]||(c[4]=k=>Ie(ye).username=k),class:"field w-48",placeholder:"jane",onBlur:c[5]||(c[5]=k=>Ke("Saved."))},null,544),[[ge,Ie(ye).username]])])]),_:1}),A(Se,{title:"Email address",desc:"Used for sign-in and notifications.",keywords:"email verification verify"},{default:we(()=>[a("div",Bm,[a("span",Um,x(t.email||"—"),1),a("span",Vm,[A(ee,{name:"mail",size:12}),c[74]||(c[74]=z(" Unverified ",-1))])])]),_:1}),A(Se,{title:"Role",desc:"Your access level in PilotVault.",keywords:"role admin user superadmin access rights permissions"},{default:we(()=>[a("span",{class:Ce(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",b(t.role)])},[A(ee,{name:_(t.role),size:12},null,8,["name"]),z(x(h(t.role)),1)],2)]),_:1}),A(Se,{title:"Organization",desc:"The organization your account belongs to.",keywords:"organization org tenant company"},{default:we(()=>[a("span",{class:Ce(["text-sm",t.organizationName?"text-ink":"text-ink-muted"])},x(t.organizationName||(u.value?"All organizations":"None")),3)]),_:1}),A(Se,{block:"",title:"Verify email",desc:"Confirm ownership to enable password resets and alerts.",keywords:"verify email resend"},{default:we(()=>[a("button",{class:"btn-ghost",onClick:Ts},"Send verification link"),ro.value?(p(),m("p",Zm,x(ro.value),1)):$("",!0)]),_:1}),A(Se,{block:"",title:"Change password",desc:"Use at least 8 characters.",keywords:"password change current new"},{default:we(()=>[a("div",Hm,[oe(a("input",{"onUpdate:modelValue":c[6]||(c[6]=k=>bt.current=k),type:"password",class:"field",placeholder:"Current password"},null,512),[[ge,bt.current]]),oe(a("input",{"onUpdate:modelValue":c[7]||(c[7]=k=>bt.next=k),type:"password",class:"field",placeholder:"New password"},null,512),[[ge,bt.next]]),oe(a("input",{"onUpdate:modelValue":c[8]||(c[8]=k=>bt.confirm=k),type:"password",class:"field",placeholder:"Confirm new password"},null,512),[[ge,bt.confirm]]),a("div",jm,[a("button",{class:"btn-accent",onClick:dr},"Update password"),xi.value?(p(),m("span",{key:0,class:Ce(["text-xs",Ss.value?"text-success-fg":"text-ink-muted"])},x(xi.value),3)):$("",!0)])])]),_:1})])):X.id==="appearance"?(p(),m("div",Wm,[A(Se,{title:"Theme",desc:"Light, dark, or follow your system.",keywords:"theme light dark system appearance"},{default:we(()=>[A(wn,{modelValue:ke.value,"onUpdate:modelValue":c[9]||(c[9]=k=>ke.value=k),options:de},null,8,["modelValue"])]),_:1}),A(Se,{title:"Font size",desc:"Scales the entire interface for readability.",keywords:"font size accessibility text"},{default:we(()=>[A(wn,{modelValue:Ie(ye).fontSize,"onUpdate:modelValue":c[10]||(c[10]=k=>Ie(ye).fontSize=k),options:xe},null,8,["modelValue"])]),_:1}),A(Se,{title:"Reduce motion",desc:"Minimise animations and transitions.",keywords:"reduce motion accessibility animation"},{default:we(()=>[A(nn,{modelValue:Ie(ye).reduceMotion,"onUpdate:modelValue":c[11]||(c[11]=k=>Ie(ye).reduceMotion=k)},null,8,["modelValue"])]),_:1}),A(Se,{title:"Language",desc:"Interface language.",keywords:"language locale"},{default:we(()=>[oe(a("select",{"onUpdate:modelValue":c[12]||(c[12]=k=>Ie(ye).language=k),class:"field w-48"},[(p(),m(re,null,$e(Me,([k,Ve])=>a("option",{key:k,value:k},x(Ve),9,Km)),64))],512),[[Ot,Ie(ye).language]])]),_:1}),A(Se,{title:"Region",desc:"Affects number, unit and date defaults.",keywords:"region country locale"},{default:we(()=>[oe(a("select",{"onUpdate:modelValue":c[13]||(c[13]=k=>Ie(ye).region=k),class:"field w-48"},[(p(!0),m(re,null,$e(Ie(Ze),([k,Ve])=>(p(),m("option",{key:k,value:k},x(Ve),9,Gm))),128))],512),[[Ot,Ie(ye).region]])]),_:1}),A(Se,{title:"Date format",desc:"How calendar dates are displayed.",keywords:"date format"},{default:we(()=>[oe(a("select",{"onUpdate:modelValue":c[14]||(c[14]=k=>Ie(ye).dateFormat=k),class:"field w-48"},[(p(),m(re,null,$e(te,([k,Ve])=>a("option",{key:k,value:k},x(Ve),9,qm)),64))],512),[[Ot,Ie(ye).dateFormat]])]),_:1}),A(Se,{title:"Time format",desc:"12- or 24-hour clock.",keywords:"time format clock 12 24 hour"},{default:we(()=>[A(wn,{modelValue:Ie(ye).timeFormat,"onUpdate:modelValue":c[15]||(c[15]=k=>Ie(ye).timeFormat=k),options:Le},null,8,["modelValue"])]),_:1}),A(Se,{title:"Preview",desc:"How timestamps appear across the app.",keywords:"preview date time"},{default:we(()=>[a("span",Ym,x(se.value),1)]),_:1}),c[75]||(c[75]=a("p",{class:"mt-3 text-xs text-ink-muted"}," Language & region are stored now; full localisation ships with the account service. ",-1))])):X.id==="integrations"?(p(),m("div",Jm,[U.value?$("",!0):(p(),m("div",Xm,[(p(),m(re,null,$e(_a,k=>a("button",{key:k.id,type:"button",class:Ce(["-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",jo.value===k.id?"border-accent text-ink":"border-transparent text-ink-secondary hover:text-ink"]),onClick:Ve=>jo.value=k.id},[A(ee,{name:k.icon,size:16},null,8,["name"]),z(x(k.label),1)],10,Qm)),64))])),Hi("apis-external")?(p(),m(re,{key:1},[a("div",eg,[a("div",tg,[a("div",ng,[A(ee,{name:"radio",size:20})]),c[76]||(c[76]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"OpenSky Network"),a("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))]),M.loaded&&!M.available?(p(),m("div",ig,[A(ee,{name:"lock",size:14,class:"mr-1 inline"}),c[77]||(c[77]=z(" OpenSky is currently disabled by your administrator. Contact them to enable it. ",-1))])):$("",!0),M.canEditOrg?(p(),m("div",og,[c[78]||(c[78]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(wn,{modelValue:H.value,"onUpdate:modelValue":c[16]||(c[16]=k=>H.value=k),options:Pt},null,8,["modelValue"])])):$("",!0),_e.value?(p(),nt(Se,{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:we(()=>[A(nn,{"model-value":M.orgEnabled,disabled:!M.available,"onUpdate:modelValue":ht},null,8,["model-value","disabled"])]),_:1})):(p(),nt(Se,{key:3,title:"Enable OpenSky",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin opensky"},{default:we(()=>[A(nn,{"model-value":M.enabled,disabled:!M.available||!M.orgEnabled,"onUpdate:modelValue":ht},null,8,["model-value","disabled"])]),_:1})),!_e.value&&M.available&&!M.orgEnabled?(p(),m("div",sg,[A(ee,{name:"lock",size:13,class:"mr-1 inline"}),c[80]||(c[80]=z("OpenSky is turned off for your organization",-1)),M.canEditOrg?(p(),m("span",ag,[...c[79]||(c[79]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):$("",!0),c[81]||(c[81]=z(". ",-1))])):$("",!0),_e.value?(p(),m("div",rg,[A(ee,{name:"users",size:13,class:"mr-1 inline"}),c[82]||(c[82]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",lg,x(t.organizationName||"your organization"),1),c[83]||(c[83]=z(". Leave a field blank to let each user choose their own; a value set here overrides the user's. ",-1))])):ue.value?(p(),m("div",ug," As a superadmin you manage the global OpenSky configuration in the API Server panel. The effective configuration is shown below. ")):$("",!0),M.available&&!_e.value?(p(),m("div",cg,[a("div",dg,[a("div",fg,[A(ee,{name:"signal",size:15}),c[84]||(c[84]=z("Credit usage ",-1))]),Be.value?(p(),m("span",hg,"Checked "+x(Re()),1)):$("",!0)]),He.value?(p(),m(re,{key:0},[He.value.remaining!=null?(p(),m(re,{key:0},[a("div",pg,[a("span",mg,x(Ee(He.value.remaining)),1),a("span",gg,"/ "+x(Ee(He.value.daily))+" credits left today",1)]),a("div",vg,[a("div",{class:Ce(["h-full rounded-full transition-all",st.value]),style:Eo({width:xt.value+"%"})},null,6)]),a("div",_g," Used "+x(Ee(He.value.daily-He.value.remaining))+" today · "+x(He.value.probeCost)+" credit"+x(He.value.probeCost===1?"":"s")+" per query · "+x(He.value.mode),1)],64)):(p(),m(re,{key:1},[a("div",bg,[c[85]||(c[85]=z("Daily allowance: ",-1)),a("span",yg,x(Ee(He.value.daily)),1),c[86]||(c[86]=z(" credits",-1))]),a("div",xg,x(He.value.probeCost)+" credit"+x(He.value.probeCost===1?"":"s")+" per query · "+x(He.value.mode)+". OpenSky only reports live remaining credits for authenticated requests — add OAuth2 credentials below to track usage. ",1)],64))],64)):(p(),m("div",wg,[...c[87]||(c[87]=[z(" Run ",-1),a("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),z(" below to fetch your live OpenSky credit balance. ",-1)])]))])):$("",!0),A(Se,{title:"OpenSky plan",desc:"Your account tier — sets the daily credit allowance.",keywords:"plan tier credits"},{default:we(()=>[Te("plan")?(p(),m("span",kg,[z(x((Ut.find(k=>k.value===le("plan").effective)||{}).label||le("plan").effective||"—")+" ",1),Ae("plan")?(p(),m("span",Sg,[A(ee,{name:"lock",size:10}),z(x(Ae("plan")),1)])):$("",!0)])):(p(),nt(wn,{key:1,modelValue:Pe.plan,"onUpdate:modelValue":c[17]||(c[17]=k=>Pe.plan=k),options:Ut},null,8,["modelValue"]))]),_:1}),A(Se,{title:"Default bounding box",desc:"Automatic follows your location; or pick a region, or enter lamin,lomin,lamax,lomax by hand.",keywords:"bounding box bbox area region country continent world europe custom coordinates automatic location drone"},{default:we(()=>[Te("bbox")?(p(),m("span",Tg,[z(x(S(le("bbox").effective)||le("bbox").effective||"—")+" ",1),Ae("bbox")?(p(),m("span",Pg,[A(ee,{name:"lock",size:10}),z(x(Ae("bbox")),1)])):$("",!0)])):(p(),m("div",Cg,[oe(a("select",{"onUpdate:modelValue":c[18]||(c[18]=k=>j.value=k),class:"field w-64"},[_e.value?$("",!0):(p(),m("option",Lg,"Automatic (by location)")),(p(),m(re,null,$e(wt,k=>a("optgroup",{key:k.label,label:k.label},[(p(!0),m(re,null,$e(k.options,Ve=>(p(),m("option",{key:Ve.value,value:Ve.value},x(Ve.label),9,Mg))),128))],8,Ag)),64)),c[88]||(c[88]=a("option",{value:"__custom__"},"Custom…",-1))],512),[[Ot,j.value]]),ce.value?(p(),m("p",Eg," Live map follows drone location → your device location → your Region ("+x(ve.value)+"). ",1)):$("",!0),J.value?oe((p(),m("input",{key:1,"onUpdate:modelValue":c[19]||(c[19]=k=>Pe.bbox=k),class:"field w-64 font-mono",placeholder:"50.5,3.2,53.7,7.3"},null,512)),[[ge,Pe.bbox]]):$("",!0)]))]),_:1}),A(Se,{title:"OAuth2 client ID",desc:"Optional — leave blank for anonymous access (lower limits).",keywords:"oauth client id credentials"},{default:we(()=>[Te("clientId")?(p(),m("span",Og,[z(x(le("clientId").effective||"—")+" ",1),Ae("clientId")?(p(),m("span",zg,[A(ee,{name:"lock",size:10}),z(x(Ae("clientId")),1)])):$("",!0)])):oe((p(),m("input",{key:1,"onUpdate:modelValue":c[20]||(c[20]=k=>Pe.clientId=k),class:"field w-64",placeholder:"your-api-client"},null,512)),[[ge,Pe.clientId]])]),_:1}),A(Se,{title:"OAuth2 client secret",desc:"Paired with the client ID for authenticated access.",keywords:"oauth client secret credentials password"},{default:we(()=>[Te("clientSecret")?(p(),m("span",$g,[z(x(le("clientSecret").effective||"—")+" ",1),Ae("clientSecret")?(p(),m("span",Ig,[A(ee,{name:"lock",size:10}),z(x(Ae("clientSecret")),1)])):$("",!0)])):oe((p(),m("input",{key:1,"onUpdate:modelValue":c[21]||(c[21]=k=>Pe.clientSecret=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ge,Pe.clientSecret]])]),_:1}),M.available&&!M.allowAnonymous?(p(),m("div",Ng," Anonymous access is disabled by the administrator — OpenSky needs OAuth2 credentials from some layer to work. ")):$("",!0),a("div",Fg,[ue.value?$("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:he.value||!M.available,onClick:ft},x(he.value?"Saving…":_e.value?"Save organization settings":"Save settings"),9,Dg)),_e.value?$("",!0):(p(),m("div",Rg,[c[91]||(c[91]=a("label",{class:"text-xs text-ink-muted"},"Test area",-1)),oe(a("select",{"onUpdate:modelValue":c[22]||(c[22]=k=>Ct.value=k),class:"field w-44"},[c[89]||(c[89]=a("option",{value:"__default__"},"Default bounding box",-1)),(p(),m(re,null,$e(Vt,k=>a("optgroup",{key:k.label,label:k.label},[(p(!0),m(re,null,$e(k.options,Ve=>(p(),m("option",{key:Ve.value,value:Ve.value},x(Ve.label),9,Ug))),128))],8,Bg)),64)),c[90]||(c[90]=a("option",{value:"__custom__"},"Custom…",-1))],512),[[Ot,Ct.value]]),$t.value?oe((p(),m("input",{key:0,"onUpdate:modelValue":c[23]||(c[23]=k=>Zt.value=k),class:"field w-44 font-mono",placeholder:"lamin,lomin,lamax,lomax"},null,512)),[[ge,Zt.value]]):$("",!0)])),_e.value?$("",!0):(p(),m("button",{key:2,class:"btn-ghost",disabled:St.value||!M.available,onClick:kn},x(St.value?"Testing…":"Test connection"),9,Vg)),me.value?(p(),m("span",Zg,x(me.value),1)):$("",!0),pe.value&&!_e.value?(p(),m("span",{key:4,class:Ce(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",zi(pe.value.status)])},[c[92]||(c[92]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(pe.value.detail||pe.value.status),1)],2)):$("",!0)])]),a("div",Hg,[a("div",jg,[a("div",Wg,[A(ee,{name:"sun",size:20})]),c[93]||(c[93]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"OpenWeather"),a("div",{class:"mt-0.5 text-xs text-ink-muted"}," Current conditions and forecast from the OpenWeather API. Configure the API key and default location your account uses. ")],-1))]),Xe.loaded&&!Xe.available?(p(),m("div",Kg,[A(ee,{name:"lock",size:14,class:"mr-1 inline"}),c[94]||(c[94]=z(" OpenWeather is currently disabled by your administrator. Contact them to enable it. ",-1))])):$("",!0),Xe.canEditOrg?(p(),m("div",Gg,[c[95]||(c[95]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(wn,{modelValue:In.value,"onUpdate:modelValue":c[24]||(c[24]=k=>In.value=k),options:Pt},null,8,["modelValue"])])):$("",!0),Ln.value?(p(),nt(Se,{key:2,title:"Enable OpenWeather (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin openweather weather organization"},{default:we(()=>[A(nn,{"model-value":Xe.orgEnabled,disabled:!Xe.available,"onUpdate:modelValue":Bi},null,8,["model-value","disabled"])]),_:1})):(p(),nt(Se,{key:3,title:"Enable OpenWeather",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin openweather weather"},{default:we(()=>[A(nn,{"model-value":Xe.enabled,disabled:!Xe.available||!Xe.orgEnabled,"onUpdate:modelValue":Bi},null,8,["model-value","disabled"])]),_:1})),!Ln.value&&Xe.available&&!Xe.orgEnabled?(p(),m("div",qg,[A(ee,{name:"lock",size:13,class:"mr-1 inline"}),c[97]||(c[97]=z("OpenWeather is turned off for your organization",-1)),Xe.canEditOrg?(p(),m("span",Yg,[...c[96]||(c[96]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):$("",!0),c[98]||(c[98]=z(". ",-1))])):$("",!0),Ln.value?(p(),m("div",Jg,[A(ee,{name:"users",size:13,class:"mr-1 inline"}),c[99]||(c[99]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",Xg,x(t.organizationName||"your organization"),1),c[100]||(c[100]=z(". Leave the API key blank to let each user configure their own; a key set here overrides the user's. ",-1))])):Ri.value?(p(),m("div",Qg," As a superadmin you manage the global OpenWeather configuration in the API Server panel. The effective configuration is shown below. ")):$("",!0),A(Se,{title:"API key",desc:"Your OpenWeather API key (the appid parameter). Required — OpenWeather has no anonymous tier.",keywords:"api key appid secret credentials token openweather"},{default:we(()=>[jt("apiKey")?(p(),m("span",ev,[z(x(Ne("apiKey").effective||"—")+" ",1),Je("apiKey")?(p(),m("span",tv,[A(ee,{name:"lock",size:10}),z(x(Je("apiKey")),1)])):$("",!0)])):oe((p(),m("input",{key:1,"onUpdate:modelValue":c[25]||(c[25]=k=>Ht.apiKey=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ge,Ht.apiKey]])]),_:1}),A(Se,{title:"Units",desc:"Measurement system for temperatures and wind speed.",keywords:"units metric imperial standard celsius fahrenheit kelvin"},{default:we(()=>[jt("units")?(p(),m("span",nv,[z(x((Ro.find(k=>k.value===Ne("units").effective)||{}).label||Ne("units").effective||"—")+" ",1),Je("units")?(p(),m("span",iv,[A(ee,{name:"lock",size:10}),z(x(Je("units")),1)])):$("",!0)])):(p(),nt(wn,{key:1,modelValue:Ht.units,"onUpdate:modelValue":c[26]||(c[26]=k=>Ht.units=k),options:Ro},null,8,["modelValue"]))]),_:1}),A(Se,{title:"Default latitude",desc:"Latitude used by the health probe and calls with no location (−90…90).",keywords:"latitude location coordinates default"},{default:we(()=>[jt("lat")?(p(),m("span",ov,[z(x(Ne("lat").effective||"—")+" ",1),Je("lat")?(p(),m("span",sv,[A(ee,{name:"lock",size:10}),z(x(Je("lat")),1)])):$("",!0)])):oe((p(),m("input",{key:1,"onUpdate:modelValue":c[27]||(c[27]=k=>Ht.lat=k),inputmode:"decimal",class:"field w-40 font-mono",placeholder:"52.2297"},null,512)),[[ge,Ht.lat]])]),_:1}),A(Se,{title:"Default longitude",desc:"Longitude used by the health probe and calls with no location (−180…180).",keywords:"longitude location coordinates default"},{default:we(()=>[jt("lon")?(p(),m("span",av,[z(x(Ne("lon").effective||"—")+" ",1),Je("lon")?(p(),m("span",rv,[A(ee,{name:"lock",size:10}),z(x(Je("lon")),1)])):$("",!0)])):oe((p(),m("input",{key:1,"onUpdate:modelValue":c[28]||(c[28]=k=>Ht.lon=k),inputmode:"decimal",class:"field w-40 font-mono",placeholder:"21.0122"},null,512)),[[ge,Ht.lon]])]),_:1}),A(Se,{title:"Language",desc:"Optional ISO code for human-readable weather descriptions, e.g. en, pl, de.",keywords:"language locale description"},{default:we(()=>[jt("lang")?(p(),m("span",lv,[z(x(Ne("lang").effective||"—")+" ",1),Je("lang")?(p(),m("span",uv,[A(ee,{name:"lock",size:10}),z(x(Je("lang")),1)])):$("",!0)])):oe((p(),m("input",{key:1,"onUpdate:modelValue":c[29]||(c[29]=k=>Ht.lang=k),class:"field w-24 font-mono",placeholder:"en"},null,512)),[[ge,Ht.lang]])]),_:1}),A(Se,{title:"Calls per minute limit",desc:"Your plan's per-minute limit (free tier is 60). Only used to gauge app usage below. Leave blank to inherit; the app falls back to 60.",keywords:"calls per minute limit rate quota plan usage"},{default:we(()=>[jt("callsPerMinute")?(p(),m("span",cv,[z(x(Ne("callsPerMinute").effective||"60")+" ",1),Je("callsPerMinute")?(p(),m("span",dv,[A(ee,{name:"lock",size:10}),z(x(Je("callsPerMinute")),1)])):$("",!0)])):oe((p(),m("input",{key:1,"onUpdate:modelValue":c[30]||(c[30]=k=>Ht.callsPerMinute=k),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"60"},null,512)),[[ge,Ht.callsPerMinute]])]),_:1}),Xe.available&&!Ln.value?(p(),m("div",fv,[a("div",hv,[a("div",pv,[A(ee,{name:"signal",size:15}),c[101]||(c[101]=z("API call usage ",-1))]),Gn.value?(p(),m("span",mv,"Checked "+x(Uo()),1)):$("",!0)]),Ui.value?(p(),m(re,{key:0},[a("div",gv,[a("span",vv,x(Ui.value.minuteUsed),1),a("span",_v,"/ "+x(Ui.value.minuteLimit||"—")+" calls this minute",1)]),vs.value!=null?(p(),m("div",bv,[a("div",{class:Ce(["h-full rounded-full transition-all",fa.value]),style:Eo({width:vs.value+"%"})},null,6)])):$("",!0),a("div",yv,x(Ui.value.dayUsed)+" calls today · counts only requests PilotVault makes with this key, since server start. OpenWeather does not report remaining quota — check your account dashboard for the authoritative total. ",1)],64)):(p(),m("div",xv,[...c[102]||(c[102]=[z(" Run ",-1),a("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),z(" below to record and show call usage. ",-1)])]))])):$("",!0),a("div",wv,[Ri.value?$("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:Fi.value||!Xe.available,onClick:Dt},x(Fi.value?"Saving…":Ln.value?"Save organization settings":"Save settings"),9,kv)),Ln.value?$("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:Di.value||!Xe.available,onClick:bi},x(Di.value?"Testing…":"Test connection"),9,Sv)),Kn.value?(p(),m("span",Tv,x(Kn.value),1)):$("",!0),Gn.value&&!Ln.value?(p(),m("span",Pv,"Checked "+x(Uo()),1)):$("",!0),Qt.value&&!Ln.value?(p(),m("span",{key:4,class:Ce(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",da(Qt.value.status)])},[c[103]||(c[103]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(Qt.value.detail||Qt.value.status),1)],2)):$("",!0)])])],64)):$("",!0),Hi("drives-external")?(p(),m(re,{key:2},[a("div",Cv,[a("div",Lv,[a("div",Av,[A(ee,{name:"server",size:20})]),c[104]||(c[104]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"File Transfer (FTP / SFTP)"),a("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))]),at.loaded&&!at.available?(p(),m("div",Mv,[A(ee,{name:"lock",size:14,class:"mr-1 inline"}),c[105]||(c[105]=z(" File transfer is currently disabled by your administrator. Contact them to enable it. ",-1))])):$("",!0),at.canEditOrg?(p(),m("div",Ev,[c[106]||(c[106]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(wn,{modelValue:Sn.value,"onUpdate:modelValue":c[31]||(c[31]=k=>Sn.value=k),options:Pt},null,8,["modelValue"])])):$("",!0),kt.value?(p(),nt(Se,{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:we(()=>[A(nn,{"model-value":at.orgEnabled,disabled:!at.available,"onUpdate:modelValue":ra},null,8,["model-value","disabled"])]),_:1})):(p(),nt(Se,{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:we(()=>[A(nn,{"model-value":at.enabled,disabled:!at.available||!at.orgEnabled,"onUpdate:modelValue":ra},null,8,["model-value","disabled"])]),_:1})),!kt.value&&at.available&&!at.orgEnabled?(p(),m("div",Ov,[A(ee,{name:"lock",size:13,class:"mr-1 inline"}),c[108]||(c[108]=z("File transfer is turned off for your organization",-1)),at.canEditOrg?(p(),m("span",zv,[...c[107]||(c[107]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):$("",!0),c[109]||(c[109]=z(". ",-1))])):$("",!0),kt.value?(p(),m("div",$v,[A(ee,{name:"users",size:13,class:"mr-1 inline"}),c[110]||(c[110]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",Iv,x(t.organizationName||"your organization"),1),c[111]||(c[111]=z(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):ze.value?(p(),m("div",Nv," As a superadmin you manage the global file-transfer configuration in the API Server panel. The effective configuration is shown below. ")):$("",!0),A(Se,{title:"Protocol",desc:"SFTP (over SSH), FTPS (FTP over TLS), or plain FTP.",keywords:"protocol sftp ftps ftp"},{default:we(()=>[vt("protocol")?(p(),m("span",Fv,[z(x(oa(W("protocol").effective))+" ",1),_t("protocol")?(p(),m("span",Dv,[A(ee,{name:"lock",size:10}),z(x(_t("protocol")),1)])):$("",!0)])):(p(),nt(wn,{key:1,modelValue:rt.protocol,"onUpdate:modelValue":c[32]||(c[32]=k=>rt.protocol=k),options:V},null,8,["modelValue"]))]),_:1}),A(Se,{title:"Host",desc:"Server hostname or IP address.",keywords:"host server address"},{default:we(()=>[vt("host")?(p(),m("span",Rv,[z(x(W("host").effective||"—")+" ",1),_t("host")?(p(),m("span",Bv,[A(ee,{name:"lock",size:10}),z(x(_t("host")),1)])):$("",!0)])):oe((p(),m("input",{key:1,"onUpdate:modelValue":c[33]||(c[33]=k=>rt.host=k),class:"field w-64",placeholder:"files.example.com"},null,512)),[[ge,rt.host]])]),_:1}),A(Se,{title:"Port",desc:"Leave blank for the protocol default (22 for SFTP, 21 for FTP/FTPS).",keywords:"port"},{default:we(()=>[vt("port")?(p(),m("span",Uv,[z(x(W("port").effective||"default")+" ",1),_t("port")?(p(),m("span",Vv,[A(ee,{name:"lock",size:10}),z(x(_t("port")),1)])):$("",!0)])):oe((p(),m("input",{key:1,"onUpdate:modelValue":c[34]||(c[34]=k=>rt.port=k),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"22"},null,512)),[[ge,rt.port]])]),_:1}),A(Se,{title:"Username",desc:"Account used to authenticate.",keywords:"username login account"},{default:we(()=>[vt("username")?(p(),m("span",Zv,[z(x(W("username").effective||"—")+" ",1),_t("username")?(p(),m("span",Hv,[A(ee,{name:"lock",size:10}),z(x(_t("username")),1)])):$("",!0)])):oe((p(),m("input",{key:1,"onUpdate:modelValue":c[35]||(c[35]=k=>rt.username=k),class:"field w-64",placeholder:"user"},null,512)),[[ge,rt.username]])]),_:1}),A(Se,{title:"Password",desc:"Password auth for FTP/FTPS, or SFTP password login. Leave blank to use a key.",keywords:"password secret credentials"},{default:we(()=>[vt("password")?(p(),m("span",jv,[z(x(W("password").effective||"—")+" ",1),_t("password")?(p(),m("span",Wv,[A(ee,{name:"lock",size:10}),z(x(_t("password")),1)])):$("",!0)])):oe((p(),m("input",{key:1,"onUpdate:modelValue":c[36]||(c[36]=k=>rt.password=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ge,rt.password]])]),_:1}),Et.value==="sftp"?(p(),nt(Se,{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:we(()=>[vt("privateKey")?(p(),m("span",Kv,[z(x(W("privateKey").effective||"—")+" ",1),_t("privateKey")?(p(),m("span",Gv,[A(ee,{name:"lock",size:10}),z(x(_t("privateKey")),1)])):$("",!0)])):oe((p(),m("textarea",{key:1,"onUpdate:modelValue":c[37]||(c[37]=k=>rt.privateKey=k),rows:"3",class:"field w-full font-mono text-xs",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512)),[[ge,rt.privateKey]])]),_:1})):$("",!0),Et.value==="sftp"?(p(),nt(Se,{key:8,title:"Private key passphrase",desc:"Passphrase protecting the SSH private key, if any.",keywords:"passphrase key secret"},{default:we(()=>[vt("keyPassphrase")?(p(),m("span",qv,[z(x(W("keyPassphrase").effective||"—")+" ",1),_t("keyPassphrase")?(p(),m("span",Yv,[A(ee,{name:"lock",size:10}),z(x(_t("keyPassphrase")),1)])):$("",!0)])):oe((p(),m("input",{key:1,"onUpdate:modelValue":c[38]||(c[38]=k=>rt.keyPassphrase=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ge,rt.keyPassphrase]])]),_:1})):$("",!0),Et.value==="sftp"?(p(),nt(Se,{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:we(()=>[vt("hostKeyFingerprint")?(p(),m("span",Jv,[z(x(W("hostKeyFingerprint").effective||"—")+" ",1),_t("hostKeyFingerprint")?(p(),m("span",Xv,[A(ee,{name:"lock",size:10}),z(x(_t("hostKeyFingerprint")),1)])):$("",!0)])):oe((p(),m("input",{key:1,"onUpdate:modelValue":c[39]||(c[39]=k=>rt.hostKeyFingerprint=k),class:"field w-full font-mono text-xs",placeholder:"SHA256:…"},null,512)),[[ge,rt.hostKeyFingerprint]])]),_:1})):$("",!0),Et.value==="ftps"?(p(),nt(Se,{key:10,title:"TLS verification",desc:"Skip only for self-signed test servers.",keywords:"tls certificate verify insecure ftps"},{default:we(()=>[vt("insecureSkipVerify")?(p(),m("span",Qv,[z(x(W("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),_t("insecureSkipVerify")?(p(),m("span",e_,[A(ee,{name:"lock",size:10}),z(x(_t("insecureSkipVerify")),1)])):$("",!0)])):(p(),nt(wn,{key:1,modelValue:rt.insecureSkipVerify,"onUpdate:modelValue":c[40]||(c[40]=k=>rt.insecureSkipVerify=k),options:O},null,8,["modelValue"]))]),_:1})):$("",!0),A(Se,{title:"Base path",desc:"Working directory and health-check target, e.g. /uploads.",keywords:"base path directory folder root"},{default:we(()=>[vt("basePath")?(p(),m("span",t_,[z(x(W("basePath").effective||"—")+" ",1),_t("basePath")?(p(),m("span",n_,[A(ee,{name:"lock",size:10}),z(x(_t("basePath")),1)])):$("",!0)])):oe((p(),m("input",{key:1,"onUpdate:modelValue":c[41]||(c[41]=k=>rt.basePath=k),class:"field w-64 font-mono",placeholder:"/uploads"},null,512)),[[ge,rt.basePath]])]),_:1}),a("div",i_,[ze.value?$("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:pi.value||!at.available,onClick:or},x(pi.value?"Saving…":kt.value?"Save organization settings":"Save settings"),9,o_)),kt.value?$("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:Ii.value||!at.available,onClick:sr},x(Ii.value?"Testing…":"Test connection"),9,s_)),hi.value?(p(),m("span",a_,x(hi.value),1)):$("",!0),jn.value&&!kt.value?(p(),m("span",r_,"Checked "+x(sa()),1)):$("",!0),Gt.value&&!kt.value?(p(),m("span",{key:4,class:Ce(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",la(Gt.value.status)])},[c[112]||(c[112]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(Gt.value.detail||Gt.value.status),1)],2)):$("",!0)])]),a("div",l_,[a("div",u_,[a("div",c_,[A(ee,{name:"cloud",size:20})]),c[113]||(c[113]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"WebDAV"),a("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))]),lt.loaded&&!lt.available?(p(),m("div",d_,[A(ee,{name:"lock",size:14,class:"mr-1 inline"}),c[114]||(c[114]=z(" WebDAV is currently disabled by your administrator. Contact them to enable it. ",-1))])):$("",!0),lt.canEditOrg?(p(),m("div",f_,[c[115]||(c[115]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(wn,{modelValue:Wn.value,"onUpdate:modelValue":c[42]||(c[42]=k=>Wn.value=k),options:Pt},null,8,["modelValue"])])):$("",!0),ot.value?(p(),nt(Se,{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:we(()=>[A(nn,{"model-value":lt.orgEnabled,disabled:!lt.available,"onUpdate:modelValue":ca},null,8,["model-value","disabled"])]),_:1})):(p(),nt(Se,{key:3,title:"Enable WebDAV",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin webdav"},{default:we(()=>[A(nn,{"model-value":lt.enabled,disabled:!lt.available||!lt.orgEnabled,"onUpdate:modelValue":ca},null,8,["model-value","disabled"])]),_:1})),!ot.value&<.available&&!lt.orgEnabled?(p(),m("div",h_,[A(ee,{name:"lock",size:13,class:"mr-1 inline"}),c[117]||(c[117]=z("WebDAV is turned off for your organization",-1)),lt.canEditOrg?(p(),m("span",p_,[...c[116]||(c[116]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):$("",!0),c[118]||(c[118]=z(". ",-1))])):$("",!0),ot.value?(p(),m("div",m_,[A(ee,{name:"users",size:13,class:"mr-1 inline"}),c[119]||(c[119]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",g_,x(t.organizationName||"your organization"),1),c[120]||(c[120]=z(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):Io.value?(p(),m("div",v_," As a superadmin you manage the global WebDAV configuration in the API Server panel. The effective configuration is shown below. ")):$("",!0),A(Se,{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:we(()=>[Cn("baseURL")?(p(),m("span",__,[z(x(Pn("baseURL").effective||"—")+" ",1),qt("baseURL")?(p(),m("span",b_,[A(ee,{name:"lock",size:10}),z(x(qt("baseURL")),1)])):$("",!0)])):oe((p(),m("input",{key:1,"onUpdate:modelValue":c[43]||(c[43]=k=>Xt.baseURL=k),class:"field w-full font-mono text-xs",placeholder:"https://cloud.example.com/remote.php/dav/files/alice/"},null,512)),[[ge,Xt.baseURL]])]),_:1}),A(Se,{title:"Username",desc:"Account used to authenticate (leave blank for a public share).",keywords:"username login account"},{default:we(()=>[Cn("username")?(p(),m("span",y_,[z(x(Pn("username").effective||"—")+" ",1),qt("username")?(p(),m("span",x_,[A(ee,{name:"lock",size:10}),z(x(qt("username")),1)])):$("",!0)])):oe((p(),m("input",{key:1,"onUpdate:modelValue":c[44]||(c[44]=k=>Xt.username=k),class:"field w-64",placeholder:"user"},null,512)),[[ge,Xt.username]])]),_:1}),A(Se,{title:"Password",desc:"Password or app-specific token for HTTP Basic auth.",keywords:"password secret credentials token"},{default:we(()=>[Cn("password")?(p(),m("span",w_,[z(x(Pn("password").effective||"—")+" ",1),qt("password")?(p(),m("span",k_,[A(ee,{name:"lock",size:10}),z(x(qt("password")),1)])):$("",!0)])):oe((p(),m("input",{key:1,"onUpdate:modelValue":c[45]||(c[45]=k=>Xt.password=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ge,Xt.password]])]),_:1}),A(Se,{title:"TLS verification",desc:"Only affects HTTPS. Skip only for self-signed test servers.",keywords:"tls certificate verify insecure https"},{default:we(()=>[Cn("insecureSkipVerify")?(p(),m("span",S_,[z(x(Pn("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),qt("insecureSkipVerify")?(p(),m("span",T_,[A(ee,{name:"lock",size:10}),z(x(qt("insecureSkipVerify")),1)])):$("",!0)])):(p(),nt(wn,{key:1,modelValue:Xt.insecureSkipVerify,"onUpdate:modelValue":c[46]||(c[46]=k=>Xt.insecureSkipVerify=k),options:ua},null,8,["modelValue"]))]),_:1}),A(Se,{title:"Base path",desc:"Working directory under the server URL and health-check target, e.g. /Documents.",keywords:"base path directory folder root"},{default:we(()=>[Cn("basePath")?(p(),m("span",P_,[z(x(Pn("basePath").effective||"—")+" ",1),qt("basePath")?(p(),m("span",C_,[A(ee,{name:"lock",size:10}),z(x(qt("basePath")),1)])):$("",!0)])):oe((p(),m("input",{key:1,"onUpdate:modelValue":c[47]||(c[47]=k=>Xt.basePath=k),class:"field w-64 font-mono",placeholder:"/Documents"},null,512)),[[ge,Xt.basePath]])]),_:1}),a("div",L_,[Io.value?$("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:zo.value||!lt.available,onClick:Do},x(zo.value?"Saving…":ot.value?"Save organization settings":"Save settings"),9,A_)),ot.value?$("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:$o.value||!lt.available,onClick:gi},x($o.value?"Testing…":"Test connection"),9,M_)),io.value?(p(),m("span",E_,x(io.value),1)):$("",!0),$n.value&&!ot.value?(p(),m("span",O_,"Checked "+x(Lt()),1)):$("",!0),Tn.value&&!ot.value?(p(),m("span",{key:4,class:Ce(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Mt(Tn.value.status)])},[c[121]||(c[121]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(Tn.value.detail||Tn.value.status),1)],2)):$("",!0)])])],64)):$("",!0),Hi("drives-local")?(p(),m("div",z_,[a("div",$_,[a("div",I_,[A(ee,{name:"monitor",size:20})]),c[122]||(c[122]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"Local Storage"),a("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))]),Oe.loaded&&!Oe.available?(p(),m("div",N_,[A(ee,{name:"lock",size:14,class:"mr-1 inline"}),c[123]||(c[123]=z(" Local storage is currently disabled by your administrator. Contact them to enable it. ",-1))])):Oe.loaded&&!Oe.rootConfigured?(p(),m("div",F_,[A(ee,{name:"alertTriangle",size:14,class:"mr-1 inline"}),c[124]||(c[124]=z(" No storage root has been configured by your administrator yet. ",-1))])):$("",!0),Oe.canEditOrg?(p(),m("div",D_,[c[125]||(c[125]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(wn,{modelValue:Vi.value,"onUpdate:modelValue":c[48]||(c[48]=k=>Vi.value=k),options:Pt},null,8,["modelValue"])])):$("",!0),gn.value?(p(),nt(Se,{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:we(()=>[A(nn,{"model-value":Oe.orgEnabled,disabled:!Oe.available,"onUpdate:modelValue":xs},null,8,["model-value","disabled"])]),_:1})):(p(),nt(Se,{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:we(()=>[A(nn,{"model-value":Oe.enabled,disabled:!Oe.available||!Oe.orgEnabled,"onUpdate:modelValue":xs},null,8,["model-value","disabled"])]),_:1})),!gn.value&&Oe.available&&!Oe.orgEnabled?(p(),m("div",R_,[A(ee,{name:"lock",size:13,class:"mr-1 inline"}),c[127]||(c[127]=z("Local storage is turned off for your organization",-1)),Oe.canEditOrg?(p(),m("span",B_,[...c[126]||(c[126]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):$("",!0),c[128]||(c[128]=z(". ",-1))])):$("",!0),gn.value?(p(),m("div",U_,[A(ee,{name:"users",size:13,class:"mr-1 inline"}),c[129]||(c[129]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",V_,x(t.organizationName||"your organization"),1),c[130]||(c[130]=z(", who all share the organization folder. Members can additionally enable a private folder inside it. ",-1))])):_s.value?(p(),m("div",Z_," As a superadmin you manage the global storage root in the API Server panel. The effective configuration is shown below. ")):$("",!0),gn.value?(p(),nt(Se,{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:we(()=>[A(nn,{"model-value":Oe.allowPrivate,disabled:!Oe.available,"onUpdate:modelValue":ur},null,8,["model-value","disabled"])]),_:1})):$("",!0),gn.value?$("",!0):(p(),m(re,{key:9},[A(Se,{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:we(()=>[a("div",H_,[(p(!0),m(re,null,$e(Oe.mounts,k=>(p(),m("div",{key:k.id,class:"flex flex-wrap items-center gap-2"},[a("span",j_,x(k.path),1),k.kind==="shared"?(p(),m("span",W_,[A(ee,{name:"users",size:10}),c[131]||(c[131]=z("Shared with your organization",-1))])):(p(),m("span",K_,[A(ee,{name:"lock",size:10}),c[132]||(c[132]=z("Private to you",-1))])),ao.value[k.id]?(p(),m("span",{key:2,class:Ce(["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold",va(ao.value[k.id].status)])},[c[133]||(c[133]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(ao.value[k.id].status),1)],2)):$("",!0)]))),128)),Oe.mounts.length?$("",!0):(p(),m("div",G_,x(Oe.rootConfigured?"No folder assigned yet.":"Waiting for the administrator to configure a storage root."),1))])]),_:1}),Oe.isOrgUser&&Oe.allowPrivate?(p(),nt(Se,{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:we(()=>[A(nn,{"model-value":Oe.privateFolder,disabled:!Oe.available||!Oe.orgEnabled,"onUpdate:modelValue":ga},null,8,["model-value","disabled"])]),_:1})):Oe.isOrgUser&&!Oe.allowPrivate?(p(),m("div",q_,[A(ee,{name:"lock",size:13,class:"mr-1 inline"}),c[134]||(c[134]=z("Private folders are turned off by your organization. ",-1))])):$("",!0)],64)),A(Se,{title:"Access mode",desc:"Read-only prevents uploads, deletes and folder creation.",keywords:"read only write access mode permission"},{default:we(()=>[ha("readOnly")?(p(),m("span",Y_,[z(x(rr(Zi("readOnly").effective))+" ",1),An("readOnly")?(p(),m("span",J_,[A(ee,{name:"lock",size:10}),z(x(An("readOnly")),1)])):$("",!0)])):(p(),nt(wn,{key:1,modelValue:so.value,"onUpdate:modelValue":c[49]||(c[49]=k=>so.value=k),options:Zo},null,8,["modelValue"]))]),_:1}),a("div",X_,[_s.value?$("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:Vo.value||!Oe.available,onClick:cr},x(Vo.value?"Saving…":gn.value?"Save organization settings":"Save settings"),9,Q_)),gn.value?$("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:en.value||!Oe.available,onClick:ws},x(en.value?"Testing…":"Test folder"),9,e1)),Ye.value?(p(),m("span",t1,x(Ye.value),1)):$("",!0),yi.value&&!gn.value?(p(),m("span",n1,"Checked "+x(pa()),1)):$("",!0),ln.value&&!gn.value?(p(),m("span",{key:4,class:Ce(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",va(ln.value.status)])},[c[135]||(c[135]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(ln.value.detail||ln.value.status),1)],2)):$("",!0)])])):$("",!0)])):X.id==="profile"?(p(),m("div",i1,[A(Se,{block:"",title:"Profile photo",desc:"PNG or JPG, up to ~1.5 MB. Stored on this device.",keywords:"avatar photo picture"},{default:we(()=>[a("div",o1,[Ie(ye).avatar?(p(),m("img",{key:0,src:Ie(ye).avatar,alt:"Avatar",class:"h-16 w-16 rounded-full object-cover"},null,8,s1)):(p(),m("div",a1,x(ba.value),1)),a("div",r1,[a("label",l1,[A(ee,{name:"upload",size:15,class:"mr-1.5 inline"}),c[136]||(c[136]=z("Upload ",-1)),a("input",{type:"file",accept:"image/*",class:"hidden",onChange:fr},null,32)]),Ie(ye).avatar?(p(),m("button",{key:0,class:"btn-ghost",onClick:hr},"Remove")):$("",!0)])])]),_:1}),A(Se,{title:"Display name",desc:"The name shown on your public profile.",keywords:"display name profile"},{default:we(()=>[oe(a("input",{"onUpdate:modelValue":c[50]||(c[50]=k=>Ie(ye).displayName=k),class:"field w-56",placeholder:"Jane O.",onBlur:c[51]||(c[51]=k=>Ke("Saved."))},null,544),[[ge,Ie(ye).displayName]])]),_:1}),A(Se,{block:"",title:"Bio",desc:"A short description others can see.",keywords:"bio about description"},{default:we(()=>[oe(a("textarea",{"onUpdate:modelValue":c[52]||(c[52]=k=>Ie(ye).bio=k),rows:"3",maxlength:"240",class:"field w-full resize-none",placeholder:"Flight director, North yard operations…",onBlur:c[53]||(c[53]=k=>Ke("Saved."))},null,544),[[ge,Ie(ye).bio]]),a("div",u1,x((Ie(ye).bio||"").length)+"/240",1)]),_:1}),A(Se,{title:"Show email on profile",desc:"Let teammates see your email address.",keywords:"show email public visibility"},{default:we(()=>[A(nn,{modelValue:Ie(ye).showEmail,"onUpdate:modelValue":c[54]||(c[54]=k=>Ie(ye).showEmail=k)},null,8,["modelValue"])]),_:1})])):X.id==="security"?(p(),m("div",c1,[A(Se,{block:"",title:"Two-factor authentication",desc:"Require a one-time code at sign-in.",keywords:"two factor 2fa authentication security"},{default:we(()=>[a("div",d1,[a("span",{class:Ce(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Ie(ye).twoFactor?"bg-success-soft text-success-fg":"bg-surface-2 text-ink-secondary"])},[c[137]||(c[137]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(Ie(ye).twoFactor?"Enabled":"Disabled"),1)],2),!Ie(ye).twoFactor&&!lo.value?(p(),m("button",{key:0,class:"btn-accent",onClick:ji},"Enable 2FA")):Ie(ye).twoFactor?(p(),m("button",{key:1,class:"btn-ghost",onClick:co},"Disable")):$("",!0)]),lo.value?(p(),m("div",f1,[a("div",h1,[c[139]||(c[139]=a("div",{class:"grid h-28 w-28 place-items-center rounded bg-white p-2"},[a("svg",{viewBox:"0 0 100 100",class:"h-full w-full"},[a("rect",{width:"100",height:"100",fill:"#fff"}),a("g",{fill:"#0F1E3D"},[a("rect",{x:"6",y:"6",width:"24",height:"24"}),a("rect",{x:"70",y:"6",width:"24",height:"24"}),a("rect",{x:"6",y:"70",width:"24",height:"24"}),a("rect",{x:"12",y:"12",width:"12",height:"12",fill:"#fff"}),a("rect",{x:"76",y:"12",width:"12",height:"12",fill:"#fff"}),a("rect",{x:"12",y:"76",width:"12",height:"12",fill:"#fff"}),a("rect",{x:"40",y:"10",width:"8",height:"8"}),a("rect",{x:"52",y:"20",width:"8",height:"8"}),a("rect",{x:"40",y:"40",width:"8",height:"8"}),a("rect",{x:"60",y:"44",width:"8",height:"8"}),a("rect",{x:"44",y:"60",width:"8",height:"8"}),a("rect",{x:"70",y:"60",width:"8",height:"8"}),a("rect",{x:"80",y:"72",width:"8",height:"8"}),a("rect",{x:"60",y:"80",width:"8",height:"8"})])])],-1)),a("div",p1,[c[138]||(c[138]=a("div",{class:"text-xs text-ink-secondary"},"Scan with an authenticator app, or enter this secret:",-1)),a("div",m1,x(_n.value),1),a("div",g1,[oe(a("input",{"onUpdate:modelValue":c[55]||(c[55]=k=>qn.value=k),inputmode:"numeric",maxlength:"6",class:"field w-28 font-mono tracking-[0.3em]",placeholder:"000000"},null,512),[[ge,qn.value]]),a("button",{class:"btn-accent",onClick:pr},"Verify & enable")]),uo.value?(p(),m("p",v1,x(uo.value),1)):$("",!0)])])])):$("",!0),Ie(ye).twoFactor&&bn.value.length?(p(),m("div",_1,[c[140]||(c[140]=a("div",{class:"text-xs font-semibold text-ink"},"Recovery codes",-1)),c[141]||(c[141]=a("div",{class:"mt-0.5 text-xs text-ink-muted"},"Store these somewhere safe — each works once.",-1)),a("div",b1,[(p(!0),m(re,null,$e(bn.value,k=>(p(),m("span",{key:k,class:"select-all"},x(k),1))),128))])])):$("",!0),c[142]||(c[142]=a("p",{class:"mt-2 text-xs text-ink-muted"},"Prototype — codes are generated locally until the account service verifies them.",-1))]),_:1}),A(Se,{block:"",title:"Active sessions",desc:"Devices currently signed in to your account.",keywords:"sessions devices logout sign out remote"},{default:we(()=>[a("div",y1,[a("div",x1,[a("div",w1,[A(ee,{name:"monitor",size:18})]),a("div",k1,[a("div",S1,[z(x(Wo())+" on "+x(mr())+" ",1),c[143]||(c[143]=a("span",{class:"ml-1 rounded-full bg-success-soft px-2 py-0.5 text-[10px] font-semibold text-success-fg"},"This device",-1))]),a("div",T1,"Signed in "+x(Ie(Su)(Ie(ni))),1)]),a("button",{class:"btn-ghost",onClick:c[56]||(c[56]=k=>l("logout"))},"Log out")])]),c[144]||(c[144]=a("button",{class:"btn-ghost mt-2 opacity-60",disabled:"",title:"Requires the account service"}," Log out all other devices ",-1)),c[145]||(c[145]=a("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})])):X.id==="team"?(p(),m("div",P1,[Qe.id?(p(),m("div",C1,[A(Se,{block:"",title:`Edit user — ${Qe.email}`,desc:"Update details, change role, reset password, or set verified.",keywords:"edit user update role password verified organization"},{default:we(()=>[a("div",L1,[a("div",A1,[oe(a("input",{"onUpdate:modelValue":c[57]||(c[57]=k=>Qe.email=k),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ge,Qe.email]]),oe(a("select",{"onUpdate:modelValue":c[58]||(c[58]=k=>Qe.role=k),class:"field w-32",disabled:qo.value,title:qo.value?"You cannot change your own role":""},[(p(!0),m(re,null,$e(ya.value,k=>(p(),m("option",{key:k.value,value:k.value},x(k.label),9,E1))),128))],8,M1),[[Ot,Qe.role]])]),u.value?oe((p(),m("select",{key:0,"onUpdate:modelValue":c[59]||(c[59]=k=>Qe.organization=k),class:"field",title:"Organization"},[(p(!0),m(re,null,$e(Cs.value,k=>(p(),m("option",{key:k.value,value:k.value},x(k.label),9,O1))),128))],512)),[[Ot,Qe.organization]]):$("",!0),oe(a("input",{"onUpdate:modelValue":c[60]||(c[60]=k=>Qe.password=k),type:"password",class:"field",placeholder:"New password (leave blank to keep current)"},null,512),[[ge,Qe.password]]),a("label",z1,[A(nn,{modelValue:Qe.verified,"onUpdate:modelValue":c[61]||(c[61]=k=>Qe.verified=k)},null,8,["modelValue"]),c[146]||(c[146]=z(" Email verified ",-1))]),a("div",$1,[a("button",{class:"btn-accent",disabled:Ki.value,onClick:vr},x(Ki.value?"Saving…":"Save changes"),9,I1),a("button",{class:"btn-ghost",onClick:ho},"Cancel"),En.value?(p(),m("span",N1,x(En.value),1)):$("",!0),qo.value?(p(),m("span",F1,"Editing your own account — role locked.")):$("",!0)])])]),_:1},8,["title"])])):(p(),m("div",D1,[A(Se,{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:we(()=>[a("div",R1,[a("div",B1,[oe(a("input",{"onUpdate:modelValue":c[62]||(c[62]=k=>Rt.email=k),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ge,Rt.email]]),oe(a("select",{"onUpdate:modelValue":c[63]||(c[63]=k=>Rt.role=k),class:"field w-32"},[(p(!0),m(re,null,$e(ya.value,k=>(p(),m("option",{key:k.value,value:k.value},x(k.label),9,U1))),128))],512),[[Ot,Rt.role]])]),u.value?oe((p(),m("select",{key:0,"onUpdate:modelValue":c[64]||(c[64]=k=>Rt.organization=k),class:"field",title:"Organization"},[(p(!0),m(re,null,$e(Cs.value,k=>(p(),m("option",{key:k.value,value:k.value},x(k.label),9,V1))),128))],512)),[[Ot,Rt.organization]]):(p(),m("div",Z1,[c[147]||(c[147]=z(" New users join your organization: ",-1)),a("span",H1,x(t.organizationName||"—"),1)])),oe(a("input",{"onUpdate:modelValue":c[65]||(c[65]=k=>Rt.password=k),type:"password",class:"field",placeholder:"Temporary password (min 8 chars)"},null,512),[[ge,Rt.password]]),a("div",j1,[a("button",{class:"btn-accent",disabled:Ko.value,onClick:Ls},x(Ko.value?"Creating…":"Create user"),9,W1),tn.value?(p(),m("span",K1,x(tn.value),1)):$("",!0)])])]),_:1})])),a("div",G1,[a("div",q1,[c[148]||(c[148]=a("div",null,[a("div",{class:"eyebrow"},"Team"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All users")],-1)),a("button",{class:"btn-ghost",disabled:fo.value,onClick:oi},x(fo.value?"Loading…":"Refresh"),9,Y1)]),Wi.value?(p(),m("div",J1,x(Wi.value),1)):!wi.value.length&&!fo.value?(p(),m("div",X1,"No users yet.")):(p(),m("div",Q1,[a("table",eb,[a("thead",null,[a("tr",tb,[(p(),m(re,null,$e(["User","Role","Organization","Status",""],k=>a("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"},x(k),1)),64))])]),a("tbody",null,[(p(!0),m(re,null,$e(wi.value,k=>(p(),m("tr",{key:k.id,class:Ce(["border-b border-line last:border-0",Qe.id===k.id?"bg-accent-soft":""])},[a("td",nb,[a("span",ib,x(k.email),1),k.email===t.email?(p(),m("span",ob,"(you)")):$("",!0)]),a("td",sb,[a("span",{class:Ce(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",b(k.role||"user")])},[A(ee,{name:_(k.role||"user"),size:12},null,8,["name"]),z(x(h(k.role||"user")),1)],2)]),a("td",ab,[a("span",{class:Ce(["text-sm",k.organizationName?"text-ink-secondary":"text-ink-muted"])},x(k.organizationName||"—"),3)]),a("td",rb,[a("span",{class:Ce(["text-xs",k.verified?"text-success-fg":"text-ink-muted"])},x(k.verified?"Verified":"Unverified"),3)]),a("td",lb,[Fn.value===k.id?(p(),m(re,{key:0},[c[149]||(c[149]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Remove?",-1)),a("button",{class:"btn-ghost mr-1",onClick:c[66]||(c[66]=Ve=>Fn.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Ve=>Go(k)}," Remove ",8,ub)],64)):(p(),m("div",cb,[a("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Ve=>gr(k)},[A(ee,{name:"settings",size:14}),c[150]||(c[150]=z(" Edit ",-1))],8,db),k.email!==t.email?(p(),m("button",{key:0,class:"btn-ghost inline-flex items-center gap-1.5",onClick:Ve=>Fn.value=k.id},[A(ee,{name:"trash",size:14}),c[151]||(c[151]=z(" Remove ",-1))],8,fb)):$("",!0)]))])],2))),128))])])]))])])):X.id==="organizations"?(p(),m("div",hb,[Nt.id?(p(),m("div",pb,[A(Se,{block:"",title:"Rename organization",desc:"Update the organization's display name.",keywords:"rename organization edit"},{default:we(()=>[a("div",mb,[oe(a("input",{"onUpdate:modelValue":c[67]||(c[67]=k=>Nt.name=k),class:"field",placeholder:"Organization name",onKeyup:pu(xa,["enter"])},null,544),[[ge,Nt.name]]),a("div",gb,[a("button",{class:"btn-accent",onClick:xa},"Save changes"),a("button",{class:"btn-ghost",onClick:Ms},"Cancel"),Dn.value?(p(),m("span",vb,x(Dn.value),1)):$("",!0)])])]),_:1})])):(p(),m("div",_b,[A(Se,{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:we(()=>[a("div",bb,[oe(a("input",{"onUpdate:modelValue":c[68]||(c[68]=k=>po.name=k),class:"field",placeholder:"e.g. Northwind Aerial",onKeyup:pu(_o,["enter"])},null,544),[[ge,po.name]]),a("div",yb,[a("button",{class:"btn-accent",disabled:go.value,onClick:_o},x(go.value?"Creating…":"Create organization"),9,xb),mo.value?(p(),m("span",wb,x(mo.value),1)):$("",!0)])])]),_:1})])),a("div",kb,[a("div",{class:"flex items-center justify-between px-5 py-4"},[c[152]||(c[152]=a("div",null,[a("div",{class:"eyebrow"},"Tenancy"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All organizations")],-1)),a("button",{class:"btn-ghost",onClick:ii},"Refresh")]),yn.value.length?(p(),m("div",Tb,[a("table",Pb,[a("thead",null,[a("tr",Cb,[(p(),m(re,null,$e(["Organization","Members",""],k=>a("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"},x(k),1)),64))])]),a("tbody",null,[(p(!0),m(re,null,$e(yn.value,k=>(p(),m("tr",{key:k.id,class:Ce(["border-b border-line last:border-0",Nt.id===k.id?"bg-accent-soft":""])},[a("td",Lb,[a("span",Ab,[A(ee,{name:"grid",size:14,class:"text-ink-muted"}),z(x(k.name),1)])]),a("td",Mb,x(As.value[k.id]||0),1),a("td",Eb,[vo.value===k.id?(p(),m(re,{key:0},[c[153]||(c[153]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),a("button",{class:"btn-ghost mr-1",onClick:c[69]||(c[69]=Ve=>vo.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Ve=>bo(k)}," Delete ",8,Ob)],64)):(p(),m("div",zb,[a("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Ve=>_r(k)},[A(ee,{name:"settings",size:14}),c[154]||(c[154]=z(" Rename ",-1))],8,$b),a("button",{class:"btn-ghost inline-flex items-center gap-1.5",disabled:(As.value[k.id]||0)>0,title:(As.value[k.id]||0)>0?"Reassign or remove members first":"",onClick:Ve=>vo.value=k.id},[A(ee,{name:"trash",size:14}),c[155]||(c[155]=z(" Delete ",-1))],8,Ib)]))])],2))),128))])])])):(p(),m("div",Sb,"No organizations yet."))])])):X.id==="advanced"?(p(),m("div",Nb,[a("div",Fb,[A(Se,{title:"Export data",desc:"Download your settings and profile as JSON.",keywords:"export data download backup"},{default:we(()=>[a("button",{class:"btn-ghost",onClick:br},[A(ee,{name:"download",size:15,class:"mr-1.5 inline"}),c[156]||(c[156]=z("Export",-1))])]),_:1}),A(Se,{block:"",title:"Import data",desc:"Restore settings from a previous export.",keywords:"import data upload restore"},{default:we(()=>[a("label",Db,[A(ee,{name:"upload",size:15,class:"mr-1.5 inline"}),c[157]||(c[157]=z("Choose file… ",-1)),a("input",{type:"file",accept:"application/json,.json",class:"hidden",onChange:wa},null,32)]),Yn.value?(p(),m("p",Rb,x(Yn.value),1)):$("",!0)]),_:1})]),a("div",Bb,[a("div",Ub,[A(ee,{name:"alertTriangle",size:18}),c[158]||(c[158]=a("h3",{class:"text-sm font-bold uppercase tracking-caps"},"Danger zone",-1))]),c[163]||(c[163]=a("p",{class:"mt-1 text-xs text-ink-secondary"},"Deleting your account is permanent and cannot be undone.",-1)),a("div",Vb,[c[162]||(c[162]=a("div",{class:"text-sm font-semibold text-ink"},"Delete account",-1)),a("label",Zb,[oe(a("input",{"onUpdate:modelValue":c[70]||(c[70]=k=>pt.understand=k),type:"checkbox",class:"mt-0.5 h-4 w-4 accent-[var(--danger)]"},null,512),[[Va,pt.understand]]),c[159]||(c[159]=z(" I understand this permanently deletes my account and all associated data. ",-1))]),a("div",Hb,[a("label",jb,[c[160]||(c[160]=z("Type ",-1)),a("span",Wb,x(On.value),1),c[161]||(c[161]=z(" to confirm",-1))]),oe(a("input",{"onUpdate:modelValue":c[71]||(c[71]=k=>pt.typed=k),class:"field w-full max-w-[360px] font-mono",placeholder:On.value},null,8,Kb),[[ge,pt.typed]])]),a("div",Gb,[pt.armed?(p(),m("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:pt.cooldown>0,onClick:xo},x(pt.cooldown>0?`Confirm in ${pt.cooldown}s…`:"Permanently delete account"),9,Yb)):(p(),m("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:!Yo.value,onClick:ka}," Delete account… ",8,qb)),pt.armed&&pt.cooldown>0?(p(),m("span",Jb,"Cooling-off period — read once more.")):$("",!0)]),pt.msg?(p(),m("p",Xb,x(pt.msg),1)):$("",!0)])])])):$("",!0)],64))),128))])]),A(vh,{name:"fade"},{default:we(()=>[Nn.value?(p(),m("div",Qb,[A(ee,{name:"check",size:16,class:"text-success-fg"}),z(x(Nn.value),1)])):$("",!0)]),_:1})]))}},ty=Cm(ey,[["__scopeId","data-v-7522b856"]]),ny={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},iy={class:"flex flex-wrap items-center gap-3"},oy={class:"ml-auto flex items-center gap-2"},sy=["href"],ay={class:"grid grid-cols-3 gap-4 max-[900px]:grid-cols-1"},ry={class:"eyebrow"},ly={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},uy={key:1,class:"panel p-5"},cy={class:"mb-4 flex items-center justify-between"},dy={class:"eyebrow"},fy={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},hy={class:"block"},py={class:"block"},my={class:"block"},gy={class:"block"},vy={key:0,value:""},_y=["value"],by={class:"block"},yy={class:"block"},xy={class:"block"},wy={class:"block"},ky={class:"block"},Sy=["value"],Ty={class:"block"},Py=["value"],Cy={class:"block"},Ly=["value"],Ay={class:"block"},My={class:"mt-3 block"},Ey={key:0,class:"mt-3 grid grid-cols-2 gap-3 max-[760px]:grid-cols-1"},Oy={class:"block"},zy={class:"block"},$y={class:"block"},Iy={class:"block"},Ny={class:"col-span-2 block max-[760px]:col-span-1"},Fy={class:"mt-4 flex items-center gap-3"},Dy=["disabled"],Ry={key:0,class:"text-sm text-danger-fg"},By={class:"panel overflow-hidden p-0"},Uy={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Vy={key:1,class:"grid place-items-center px-5 py-16 text-center"},Zy={key:2,class:"overflow-x-auto"},Hy={class:"w-full border-collapse text-sm"},jy={class:"text-left"},Wy={class:"whitespace-nowrap px-5 py-3 font-mono text-ink"},Ky={key:0,class:"text-ink-muted"},Gy={class:"px-5 py-3 text-ink-secondary"},qy=["title"],Yy={class:"px-5 py-3 font-mono text-ink-secondary"},Jy={class:"px-5 py-3 text-ink-secondary"},Xy={class:"px-5 py-3"},Qy=["onClick"],ex={class:"whitespace-nowrap px-5 py-3 text-right"},tx=["onClick"],nx=["onClick"],ix=["onClick"],ox={key:0,class:"border-b border-line bg-surface-2"},sx={colspan:"7",class:"px-5 py-3"},ax={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},rx={class:"text-ink-secondary"},lx={class:"text-ink"},ux={class:"text-ink-secondary"},cx={class:"text-ink"},dx={class:"text-ink-secondary"},fx={class:"font-mono text-ink"},hx={key:0,class:"text-ink-secondary"},px={class:"text-ink"},mx={key:0,class:"mt-2 space-y-1"},gx={key:1,class:"mt-2 text-xs text-success-fg"},vx={__name:"Logbook",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},setup(t){const i=t,s={success:"bg-success-soft text-success-fg",danger:"bg-danger-soft text-danger-fg",neutral:"bg-surface-2 text-ink-secondary"},l=Y([]),u=Y([]),f=Y(!1),h=Y("");async function _(){f.value=!0,h.value="";const[se,M]=await Promise.all([pl(),Ap()]);(!se.ok||!M.ok)&&(h.value=se.status===503||M.status===503?"Logbook storage is not configured on the API Server (service account missing).":"Could not load the logbook."),l.value=se.drones,u.value=M.flights,f.value=!1}ti(_);function b(se){const M=se.compliance||{};return M.exempt?{tone:"neutral",label:"Exempt"}:(M.redFlags||[]).length?{tone:"danger",label:`${M.redFlags.length} issue${M.redFlags.length>1?"s":""}`}:{tone:"success",label:"Compliant"}}const C=Y("");function T(se){C.value=C.value===se?"":se}const E=[{value:"open",label:"Open"},{value:"specific",label:"Specific"},{value:"certified",label:"Certified"}],Z=[{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"}],U=[{value:"",label:"Auto (from drone)"},{value:"manual",label:"Manual"},{value:"automatic_flyapp",label:"Automatic — Fly App (FDR)"},{value:"automatic_flyagentapp",label:"Automatic — Fly Agent (Remote ID)"}],G=se=>{var M;return((M=U.find(H=>H.value===se))==null?void 0:M.label)||se||"—"};function I(){var se;return{operationDate:new Date().toISOString().slice(0,10),startTime:"",endTime:"",drone:((se=l.value[0])==null?void 0:se.id)||"",areaRoute:"",maxAltitudeAgl:"",pilotName:i.email,certificateRef:"",category:"open",purpose:"commercial",loggingPath:"",rawFdrLogUrl:"",authorisationRef:"",weather:"",airspaceRef:"",observer:"",incidents:"",notes:""}}const R=Y(!1),Q=Y(""),K=mt(I()),ke=Y(""),de=Y(!1),xe=Y(!1);function Le(){Object.assign(K,I()),Q.value="",ke.value="",xe.value=!1,R.value=!0}function Me(se){Object.assign(K,{operationDate:(se.operationDate||"").slice(0,10),startTime:se.startTime||"",endTime:se.endTime||"",drone:se.drone||"",areaRoute:se.areaRoute||"",maxAltitudeAgl:se.maxAltitudeAgl||"",pilotName:se.pilotName||"",certificateRef:se.certificateRef||"",category:se.category||"open",purpose:se.purpose||"commercial",loggingPath:se.loggingPath||"",rawFdrLogUrl:se.rawFdrLogUrl||"",authorisationRef:se.authorisationRef||"",weather:se.weather||"",airspaceRef:se.airspaceRef||"",observer:se.observer||"",incidents:se.incidents||"",notes:se.notes||""}),Q.value=se.id,ke.value="",xe.value=!!(se.weather||se.airspaceRef||se.observer||se.incidents||se.notes),R.value=!0}function Ze(){R.value=!1,Q.value=""}async function ve(){var H;if(ke.value="",!K.drone){ke.value="Select a drone first (add one in the Drones section).";return}de.value=!0;const se={...K,maxAltitudeAgl:Number(K.maxAltitudeAgl)||0},M=Q.value?await Ep(Q.value,se):await Mp(se);if(de.value=!1,!M.ok){ke.value=((H=M.body)==null?void 0:H.error)||"Could not save the flight.";return}R.value=!1,await _()}const te=Y("");async function B(se){const M=await Op(se.id);te.value="",M.ok&&await _()}const F=fe(()=>{const se=u.value.length,M=u.value.filter(Pe=>{var me;return(((me=Pe.compliance)==null?void 0:me.redFlags)||[]).length}).length,H=u.value.filter(Pe=>{var me;return(me=Pe.compliance)==null?void 0:me.required}).length;return{total:se,flagged:M,required:H}});return(se,M)=>(p(),m("div",ny,[a("div",iy,[M[22]||(M[22]=a("div",null,[a("div",{class:"eyebrow"},"Logbook"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Flights (BEK 1649 §5)")],-1)),a("div",oy,[a("a",{href:Ie(zp)(),class:"btn-ghost inline-flex items-center gap-2",title:"Download a compliance CSV (Trafikstyrelsen / police disclosure)"},[A(ee,{name:"download",size:15}),M[20]||(M[20]=z(" Export CSV ",-1))],8,sy),a("button",{class:"btn-accent inline-flex items-center gap-2",onClick:Le},[A(ee,{name:"plus",size:15}),M[21]||(M[21]=z(" Log flight ",-1))])])]),a("div",ay,[(p(!0),m(re,null,$e([{label:"Flights logged",value:F.value.total,tone:"neutral"},{label:"Require logbook",value:F.value.required,tone:"neutral"},{label:"Compliance flags",value:F.value.flagged,tone:F.value.flagged?"danger":"success"}],H=>(p(),m("div",{key:H.label,class:"panel p-5"},[a("div",ry,x(H.label),1),a("div",{class:Ce(["mt-2 text-[30px] font-bold leading-none tracking-tightest",H.tone==="danger"?"text-danger-fg":H.tone==="success"?"text-success-fg":"text-ink"])},x(H.value),3)]))),128))]),h.value?(p(),m("div",ly,x(h.value),1)):$("",!0),R.value?(p(),m("div",uy,[a("div",cy,[a("div",null,[a("div",dy,x(Q.value?"Edit entry":"New entry"),1),M[23]||(M[23]=a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Logbook flight (BEK 1649 §5)",-1))]),a("button",{class:"btn-icon",onClick:Ze},[A(ee,{name:"x",size:16})])]),a("div",fy,[a("label",hy,[M[24]||(M[24]=a("span",{class:"eyebrow mb-1 block"},"Date",-1)),oe(a("input",{"onUpdate:modelValue":M[0]||(M[0]=H=>K.operationDate=H),type:"date",class:"field"},null,512),[[ge,K.operationDate]])]),a("label",py,[M[25]||(M[25]=a("span",{class:"eyebrow mb-1 block"},"Start",-1)),oe(a("input",{"onUpdate:modelValue":M[1]||(M[1]=H=>K.startTime=H),type:"time",class:"field"},null,512),[[ge,K.startTime]])]),a("label",my,[M[26]||(M[26]=a("span",{class:"eyebrow mb-1 block"},"End",-1)),oe(a("input",{"onUpdate:modelValue":M[2]||(M[2]=H=>K.endTime=H),type:"time",class:"field"},null,512),[[ge,K.endTime]])]),a("label",gy,[M[27]||(M[27]=a("span",{class:"eyebrow mb-1 block"},"Drone",-1)),oe(a("select",{"onUpdate:modelValue":M[3]||(M[3]=H=>K.drone=H),class:"field"},[l.value.length?$("",!0):(p(),m("option",vy,"— add a drone first —")),(p(!0),m(re,null,$e(l.value,H=>(p(),m("option",{key:H.id,value:H.id},x(H.displayName),9,_y))),128))],512),[[Ot,K.drone]])]),a("label",by,[M[28]||(M[28]=a("span",{class:"eyebrow mb-1 block"},"Max altitude (m AGL)",-1)),oe(a("input",{"onUpdate:modelValue":M[4]||(M[4]=H=>K.maxAltitudeAgl=H),type:"number",min:"0",class:"field",placeholder:"120"},null,512),[[ge,K.maxAltitudeAgl]])]),a("label",yy,[M[29]||(M[29]=a("span",{class:"eyebrow mb-1 block"},"Area / route",-1)),oe(a("input",{"onUpdate:modelValue":M[5]||(M[5]=H=>K.areaRoute=H),class:"field",placeholder:"Field N of Roskilde, grid survey"},null,512),[[ge,K.areaRoute]])]),a("label",xy,[M[30]||(M[30]=a("span",{class:"eyebrow mb-1 block"},"Remote pilot name",-1)),oe(a("input",{"onUpdate:modelValue":M[6]||(M[6]=H=>K.pilotName=H),class:"field",placeholder:"Full name"},null,512),[[ge,K.pilotName]])]),a("label",wy,[M[31]||(M[31]=a("span",{class:"eyebrow mb-1 block"},"Certificate ref",-1)),oe(a("input",{"onUpdate:modelValue":M[7]||(M[7]=H=>K.certificateRef=H),class:"field",placeholder:"A2 / STS cert no."},null,512),[[ge,K.certificateRef]])]),a("label",ky,[M[32]||(M[32]=a("span",{class:"eyebrow mb-1 block"},"Logging path",-1)),oe(a("select",{"onUpdate:modelValue":M[8]||(M[8]=H=>K.loggingPath=H),class:"field"},[(p(),m(re,null,$e(U,H=>a("option",{key:H.value,value:H.value},x(H.label),9,Sy)),64))],512),[[Ot,K.loggingPath]])]),a("label",Ty,[M[33]||(M[33]=a("span",{class:"eyebrow mb-1 block"},"Category",-1)),oe(a("select",{"onUpdate:modelValue":M[9]||(M[9]=H=>K.category=H),class:"field"},[(p(),m(re,null,$e(E,H=>a("option",{key:H.value,value:H.value},x(H.label),9,Py)),64))],512),[[Ot,K.category]])]),a("label",Cy,[M[34]||(M[34]=a("span",{class:"eyebrow mb-1 block"},"Purpose",-1)),oe(a("select",{"onUpdate:modelValue":M[10]||(M[10]=H=>K.purpose=H),class:"field"},[(p(),m(re,null,$e(Z,H=>a("option",{key:H.value,value:H.value},x(H.label),9,Ly)),64))],512),[[Ot,K.purpose]])]),a("label",Ay,[M[35]||(M[35]=a("span",{class:"eyebrow mb-1 block"},"Authorisation ref",-1)),oe(a("input",{"onUpdate:modelValue":M[11]||(M[11]=H=>K.authorisationRef=H),class:"field",placeholder:"Specific-category ref"},null,512),[[ge,K.authorisationRef]])])]),a("label",My,[M[36]||(M[36]=a("span",{class:"eyebrow mb-1 block"},"FDR log URL (Fly App path)",-1)),oe(a("input",{"onUpdate:modelValue":M[12]||(M[12]=H=>K.rawFdrLogUrl=H),class:"field",placeholder:"Link to the stored flight-data-recorder export"},null,512),[[ge,K.rawFdrLogUrl]])]),a("button",{class:"mt-4 flex items-center gap-1.5 text-sm font-semibold text-accent",onClick:M[13]||(M[13]=H=>xe.value=!xe.value)},[A(ee,{name:xe.value?"x":"plus",size:14},null,8,["name"]),M[37]||(M[37]=z(" Operational details (weather, airspace, incidents) ",-1))]),xe.value?(p(),m("div",Ey,[a("label",Oy,[M[38]||(M[38]=a("span",{class:"eyebrow mb-1 block"},"Weather / wind",-1)),oe(a("input",{"onUpdate:modelValue":M[14]||(M[14]=H=>K.weather=H),class:"field",placeholder:"6 m/s NW, CAVOK"},null,512),[[ge,K.weather]])]),a("label",zy,[M[39]||(M[39]=a("span",{class:"eyebrow mb-1 block"},"Airspace / NOTAM ref",-1)),oe(a("input",{"onUpdate:modelValue":M[15]||(M[15]=H=>K.airspaceRef=H),class:"field"},null,512),[[ge,K.airspaceRef]])]),a("label",$y,[M[40]||(M[40]=a("span",{class:"eyebrow mb-1 block"},"Observer",-1)),oe(a("input",{"onUpdate:modelValue":M[16]||(M[16]=H=>K.observer=H),class:"field"},null,512),[[ge,K.observer]])]),a("label",Iy,[M[41]||(M[41]=a("span",{class:"eyebrow mb-1 block"},"Incidents / anomalies",-1)),oe(a("input",{"onUpdate:modelValue":M[17]||(M[17]=H=>K.incidents=H),class:"field",placeholder:"RTH trigger, GPS dropout…"},null,512),[[ge,K.incidents]])]),a("label",Ny,[M[42]||(M[42]=a("span",{class:"eyebrow mb-1 block"},"Notes",-1)),oe(a("textarea",{"onUpdate:modelValue":M[18]||(M[18]=H=>K.notes=H),rows:"2",class:"field"},null,512),[[ge,K.notes]])])])):$("",!0),a("div",Fy,[a("button",{class:"btn-accent",disabled:de.value,onClick:ve},x(de.value?"Saving…":Q.value?"Save changes":"Log flight"),9,Dy),a("button",{class:"btn-ghost",onClick:Ze},"Cancel"),ke.value?(p(),m("span",Ry,x(ke.value),1)):$("",!0)])])):$("",!0),a("div",By,[f.value?(p(),m("div",Uy,"Loading…")):u.value.length?(p(),m("div",Zy,[a("table",Hy,[a("thead",null,[a("tr",jy,[(p(),m(re,null,$e(["Date","Drone","Area / route","Alt","Pilot","Compliance",""],H=>a("th",{key:H,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"},x(H),1)),64))])]),a("tbody",null,[(p(!0),m(re,null,$e(u.value,H=>{var Pe,me,he,St;return p(),m(re,{key:H.id},[a("tr",{class:Ce(["border-b border-line last:border-0",Q.value===H.id?"bg-accent-soft":""])},[a("td",Wy,[z(x((H.operationDate||"").slice(0,10))+" ",1),H.startTime?(p(),m("span",Ky,x(H.startTime),1)):$("",!0)]),a("td",Gy,x(H.droneName||"—"),1),a("td",{class:"max-w-[220px] truncate px-5 py-3 text-ink-secondary",title:H.areaRoute},x(H.areaRoute||"—"),9,qy),a("td",Yy,x(H.maxAltitudeAgl?H.maxAltitudeAgl+" m":"—"),1),a("td",Jy,x(H.pilotName||"—"),1),a("td",Xy,[a("button",{class:Ce(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",s[b(H).tone]]),onClick:pe=>T(H.id)},[b(H).tone==="danger"?(p(),nt(ee,{key:0,name:"alertTriangle",size:12})):b(H).tone==="success"?(p(),nt(ee,{key:1,name:"check",size:12})):$("",!0),z(" "+x(b(H).label),1)],10,Qy)]),a("td",ex,[te.value===H.id?(p(),m(re,{key:0},[M[45]||(M[45]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),a("button",{class:"btn-ghost mr-1",onClick:M[19]||(M[19]=pe=>te.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:pe=>B(H)},"Delete",8,tx)],64)):(p(),m(re,{key:1},[a("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:pe=>Me(H)},[A(ee,{name:"sliders",size:13}),M[46]||(M[46]=z(" Edit",-1))],8,nx),a("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:pe=>te.value=H.id},[A(ee,{name:"trash",size:13})],8,ix)],64))])],2),C.value===H.id?(p(),m("tr",ox,[a("td",sx,[a("div",ax,[a("span",rx,[M[47]||(M[47]=z("Logging path: ",-1)),a("b",lx,x(G((Pe=H.compliance)==null?void 0:Pe.loggingPath)),1)]),a("span",ux,[M[48]||(M[48]=z("Category: ",-1)),a("b",cx,x(H.category||"—"),1)]),a("span",dx,[M[49]||(M[49]=z("Retain until: ",-1)),a("b",fx,x((H.retentionUntil||"").slice(0,10)||"—"),1)]),(me=H.compliance)!=null&&me.exempt?(p(),m("span",hx,[M[50]||(M[50]=z("Exempt: ",-1)),a("b",px,x(H.compliance.exemptReason),1)])):$("",!0)]),(((he=H.compliance)==null?void 0:he.redFlags)||[]).length?(p(),m("ul",mx,[(p(!0),m(re,null,$e(H.compliance.redFlags,(pe,Be)=>(p(),m("li",{key:Be,class:"flex items-start gap-2 text-xs text-danger-fg"},[A(ee,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),z(" "+x(pe),1)]))),128))])):(St=H.compliance)!=null&&St.exempt?$("",!0):(p(),m("div",gx,"No compliance gaps detected."))])])):$("",!0)],64)}),128))])])])):(p(),m("div",Vy,[A(ee,{name:"book",size:26,class:"text-ink-muted"}),M[43]||(M[43]=a("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No flights logged yet",-1)),M[44]||(M[44]=a("div",{class:"mt-1 text-xs text-ink-muted"},"Log your first operation to start the 5-year retention record.",-1))]))])]))}},_x={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},bx={class:"flex flex-wrap items-center gap-3"},yx={class:"ml-auto flex items-center gap-2"},xx={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},wx={class:"eyebrow"},kx={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},Sx={key:1,class:"panel p-5"},Tx={class:"mb-4 flex items-center justify-between"},Px={class:"eyebrow"},Cx={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},Lx={class:"block"},Ax={class:"block"},Mx={class:"block"},Ex={class:"block"},Ox={class:"block"},zx={class:"block"},$x={class:"block"},Ix={class:"block"},Nx={class:"block"},Fx={class:"block"},Dx=["value"],Rx={class:"mt-3 flex flex-wrap gap-6"},Bx={class:"flex items-center gap-2 text-sm text-ink-secondary"},Ux={class:"flex items-center gap-2 text-sm text-ink-secondary"},Vx={class:"mt-4 flex items-center gap-3"},Zx=["disabled"],Hx={key:0,class:"text-sm text-danger-fg"},jx={class:"panel overflow-hidden p-0"},Wx={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Kx={key:1,class:"grid place-items-center px-5 py-16 text-center"},Gx={key:2,class:"overflow-x-auto"},qx={class:"w-full border-collapse text-sm"},Yx={class:"text-left"},Jx={class:"px-5 py-3"},Xx={class:"flex items-center gap-2"},Qx={class:"font-semibold text-ink"},e0={key:0,class:"text-xs text-ink-muted"},t0={key:1,class:"text-xs text-ink-muted"},n0={class:"px-5 py-3 font-mono text-xs text-ink-secondary"},i0={key:0,class:"text-[11px] text-ink-muted",title:"Flight controller SN — reported by the aircraft, not its registered serial"},o0={class:"px-5 py-3 font-mono text-xs text-ink-secondary"},s0={class:"px-5 py-3 font-mono text-xs text-ink-secondary"},a0={class:"px-5 py-3 font-mono text-xs text-ink-secondary"},r0={class:"px-5 py-3"},l0={key:1,class:"text-ink-muted"},u0={class:"whitespace-nowrap px-5 py-3 text-right"},c0=["onClick"],d0=["onClick"],f0=["onClick"],h0={__name:"Drones",props:{connectedFcSerials:{type:Array,default:()=>[]}},emits:["deleted"],setup(t,{expose:i,emit:s}){const l=t,u=s,f={success:"bg-success-soft text-success-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},h=Y([]),_=Y(!1),b=Y("");async function C(){_.value=!0,b.value="";const te=await pl();te.ok||(b.value=te.status===503?"Drone storage is not configured on the API Server (service account missing).":"Could not load your drones."),h.value=te.drones,_.value=!1}ti(C),i({reload:C});const T=fe(()=>new Set(l.connectedFcSerials.filter(Boolean)));function E(te){return!!te.flightControllerSerial&&T.value.has(te.flightControllerSerial)}const Z=["","C0","C1","C2","C3","C4","C5","C6"];function U(){return{name:"",model:"",serial:"",flightControllerSerial:"",firmware:"",controllerFirmware:"",registration:"",operatorNumber:"",mtomGrams:"",isToy:!1,autologsFlights:!1,cClass:""}}const G=Y(!1),I=Y(""),R=mt(U()),Q=Y(""),K=Y(!1);function ke(){Object.assign(R,U()),I.value="",Q.value="",G.value=!0}function de(te){Object.assign(R,{name:te.name||"",model:te.model||"",serial:te.serial||"",flightControllerSerial:te.flightControllerSerial||"",firmware:te.firmware||"",controllerFirmware:te.controllerFirmware||"",registration:te.registration||"",operatorNumber:te.operatorNumber||"",mtomGrams:te.mtomGrams||"",isToy:!!te.isToy,autologsFlights:!!te.autologsFlights,cClass:te.cClass||""}),I.value=te.id,Q.value="",G.value=!0}function xe(){G.value=!1,I.value=""}async function Le(){var F;if(Q.value="",!R.name.trim()&&!R.model.trim()&&!R.serial.trim()&&!R.flightControllerSerial.trim()){Q.value="Give the drone a custom name, model or serial.";return}K.value=!0;const te={...R,mtomGrams:Number(R.mtomGrams)||0},B=I.value?await Cp(I.value,te):await Tp(te);if(K.value=!1,!B.ok){Q.value=((F=B.body)==null?void 0:F.error)||"Could not save the drone.";return}G.value=!1,await C()}const Me=Y("");async function Ze(te){var F;const B=await Lp(te.id);Me.value="",B.ok?(u("deleted",te.flightControllerSerial),await C()):Q.value=((F=B.body)==null?void 0:F.error)||"Could not delete the drone."}const ve=fe(()=>({fleet:h.value.length,connected:h.value.filter(E).length,unnamed:h.value.filter(te=>!(te.name||"").trim()).length,unregistered:h.value.filter(te=>!(te.registration||"").trim()).length}));return(te,B)=>(p(),m("div",_x,[a("div",bx,[B[14]||(B[14]=a("div",null,[a("div",{class:"eyebrow"},"Fleet"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Drones you fly")],-1)),a("div",yx,[a("button",{class:"btn-accent inline-flex items-center gap-2",onClick:ke},[A(ee,{name:"plus",size:15}),B[13]||(B[13]=z(" Add drone ",-1))])])]),a("div",xx,[(p(!0),m(re,null,$e([{label:"Drones in fleet",value:ve.value.fleet,tone:"neutral"},{label:"Connected now",value:ve.value.connected,tone:ve.value.connected?"success":"neutral"},{label:"Awaiting a name",value:ve.value.unnamed,tone:"neutral"},{label:"No registration",value:ve.value.unregistered,tone:"neutral"}],F=>(p(),m("div",{key:F.label,class:"panel p-5"},[a("div",wx,x(F.label),1),a("div",{class:Ce(["mt-2 text-[30px] font-bold leading-none tracking-tightest",F.tone==="success"?"text-success-fg":"text-ink"])},x(F.value),3)]))),128))]),b.value?(p(),m("div",kx,x(b.value),1)):$("",!0),G.value?(p(),m("div",Sx,[a("div",Tx,[a("div",null,[a("div",Px,x(I.value?"Edit drone":"New drone"),1),B[15]||(B[15]=a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft registry",-1))]),a("button",{class:"btn-icon",onClick:xe},[A(ee,{name:"x",size:16})])]),a("div",Cx,[a("label",Lx,[B[16]||(B[16]=a("span",{class:"eyebrow mb-1 block"},"Custom name",-1)),oe(a("input",{"onUpdate:modelValue":B[0]||(B[0]=F=>R.name=F),class:"field",placeholder:"Mavic-01"},null,512),[[ge,R.name]])]),a("label",Ax,[B[17]||(B[17]=a("span",{class:"eyebrow mb-1 block"},"Model",-1)),oe(a("input",{"onUpdate:modelValue":B[1]||(B[1]=F=>R.model=F),class:"field",placeholder:"DJI Mavic 3 Enterprise"},null,512),[[ge,R.model]])]),a("label",Mx,[B[18]||(B[18]=a("span",{class:"eyebrow mb-1 block"},"Serial number",-1)),oe(a("input",{"onUpdate:modelValue":B[2]||(B[2]=F=>R.serial=F),class:"field",placeholder:"08QDE3H012032E"},null,512),[[ge,R.serial]]),B[19]||(B[19]=a("span",{class:"mt-1 block text-xs text-ink-muted"},"From the sticker on the airframe.",-1))]),a("label",Ex,[B[20]||(B[20]=a("span",{class:"eyebrow mb-1 block"},"Flight controller SN",-1)),oe(a("input",{"onUpdate:modelValue":B[3]||(B[3]=F=>R.flightControllerSerial=F),class:"field",placeholder:"08RDE1J00103H1"},null,512),[[ge,R.flightControllerSerial]]),B[21]||(B[21]=a("span",{class:"mt-1 block text-xs text-ink-muted"},"Auto-filled on connect.",-1))]),a("label",Ox,[B[22]||(B[22]=a("span",{class:"eyebrow mb-1 block"},"Drone firmware",-1)),oe(a("input",{"onUpdate:modelValue":B[4]||(B[4]=F=>R.firmware=F),class:"field",placeholder:"03.02.35.05"},null,512),[[ge,R.firmware]])]),a("label",zx,[B[23]||(B[23]=a("span",{class:"eyebrow mb-1 block"},"Controller firmware",-1)),oe(a("input",{"onUpdate:modelValue":B[5]||(B[5]=F=>R.controllerFirmware=F),class:"field",placeholder:"01.03.0800"},null,512),[[ge,R.controllerFirmware]])]),a("label",$x,[B[24]||(B[24]=a("span",{class:"eyebrow mb-1 block"},"Registration (FAA/CAA)",-1)),oe(a("input",{"onUpdate:modelValue":B[6]||(B[6]=F=>R.registration=F),class:"field",placeholder:"FA3X7K9PLM"},null,512),[[ge,R.registration]])]),a("label",Ix,[B[25]||(B[25]=a("span",{class:"eyebrow mb-1 block"},"Operator no. (EU)",-1)),oe(a("input",{"onUpdate:modelValue":B[7]||(B[7]=F=>R.operatorNumber=F),class:"field",placeholder:"DNK…"},null,512),[[ge,R.operatorNumber]])]),a("label",Nx,[B[26]||(B[26]=a("span",{class:"eyebrow mb-1 block"},"MTOM (grams)",-1)),oe(a("input",{"onUpdate:modelValue":B[8]||(B[8]=F=>R.mtomGrams=F),type:"number",min:"0",class:"field",placeholder:"920"},null,512),[[ge,R.mtomGrams]])]),a("label",Fx,[B[27]||(B[27]=a("span",{class:"eyebrow mb-1 block"},"C-class",-1)),oe(a("select",{"onUpdate:modelValue":B[9]||(B[9]=F=>R.cClass=F),class:"field"},[(p(),m(re,null,$e(Z,F=>a("option",{key:F,value:F},x(F||"— none —"),9,Dx)),64))],512),[[Ot,R.cClass]])])]),B[30]||(B[30]=a("p",{class:"mt-3 text-xs text-ink-muted"}," Model, flight controller SN and both firmware versions fill themselves in when the drone connects — anything you type here is kept as-is. The serial number is the one you register the drone under, and only you can supply it: the SDK cannot read it off the aircraft. ",-1)),a("div",Rx,[a("label",Bx,[oe(a("input",{"onUpdate:modelValue":B[10]||(B[10]=F=>R.autologsFlights=F),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[Va,R.autologsFlights]]),B[28]||(B[28]=z(" Auto-logs flights (onboard FDR) ",-1))]),a("label",Ux,[oe(a("input",{"onUpdate:modelValue":B[11]||(B[11]=F=>R.isToy=F),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[Va,R.isToy]]),B[29]||(B[29]=z(" Toy drone (logbook-exempt) ",-1))])]),a("div",Vx,[a("button",{class:"btn-accent",disabled:K.value,onClick:Le},x(K.value?"Saving…":I.value?"Save changes":"Add drone"),9,Zx),a("button",{class:"btn-ghost",onClick:xe},"Cancel"),Q.value?(p(),m("span",Hx,x(Q.value),1)):$("",!0)])])):$("",!0),a("div",jx,[_.value?(p(),m("div",Wx,"Loading…")):h.value.length?(p(),m("div",Gx,[a("table",qx,[a("thead",null,[a("tr",Yx,[(p(),m(re,null,$e(["Drone","Serial","Firmware","Ctrl FW","Registration","Class",""],F=>a("th",{key:F,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"},x(F),1)),64))])]),a("tbody",null,[(p(!0),m(re,null,$e(h.value,F=>(p(),m("tr",{key:F.id,class:Ce(["border-b border-line last:border-0",I.value===F.id?"bg-accent-soft":""])},[a("td",Jx,[a("div",Xx,[a("span",Qx,x(F.displayName),1),E(F)?(p(),m("span",{key:0,class:Ce(["inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-semibold",f.success])},[A(ee,{name:"signal",size:11}),B[33]||(B[33]=z(" connected ",-1))],2)):$("",!0)]),F.name&&F.model?(p(),m("div",e0,x(F.model),1)):F.name?$("",!0):(p(),m("div",t0,"no custom name yet"))]),a("td",n0,[z(x(F.serial||"—")+" ",1),F.flightControllerSerial?(p(),m("div",i0," FC "+x(F.flightControllerSerial),1)):$("",!0)]),a("td",o0,x(F.firmware||"—"),1),a("td",s0,x(F.controllerFirmware||"—"),1),a("td",a0,x(F.registration||"—"),1),a("td",r0,[F.cClass?(p(),m("span",{key:0,class:Ce(["inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",f.accent])},x(F.cClass),3)):(p(),m("span",l0,"—")),F.isToy?(p(),m("span",{key:2,class:Ce(["ml-1 inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",f.neutral])},"toy",2)):$("",!0)]),a("td",u0,[Me.value===F.id?(p(),m(re,{key:0},[B[34]||(B[34]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),a("button",{class:"btn-ghost mr-1",onClick:B[12]||(B[12]=se=>Me.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:se=>Ze(F)},"Delete",8,c0)],64)):(p(),m(re,{key:1},[a("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:se=>de(F)},[A(ee,{name:"sliders",size:13}),B[35]||(B[35]=z(" Edit",-1))],8,d0),a("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:se=>Me.value=F.id},[A(ee,{name:"trash",size:13})],8,f0)],64))])],2))),128))])])])):(p(),m("div",Kx,[A(ee,{name:"drone",size:26,class:"text-ink-muted"}),B[31]||(B[31]=a("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No drones yet",-1)),B[32]||(B[32]=a("div",{class:"mt-1 text-xs text-ink-muted"}," Connect a drone in the Fly App and it lands here by itself — or add one by hand. ",-1))]))])]))}},p0={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},m0={class:"flex flex-wrap items-center gap-3"},g0={class:"inline-flex flex-wrap rounded-lg border border-line bg-surface-1 p-0.5"},v0=["onClick"],_0={class:"ml-auto"},b0={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},y0={class:"eyebrow"},x0={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},w0={key:1,class:"panel p-5"},k0={class:"mb-4 flex items-center justify-between"},S0={class:"eyebrow"},T0={class:"mt-0.5 text-base font-semibold text-ink"},P0={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},C0={class:"col-span-2 block max-[760px]:col-span-1"},L0={class:"block"},A0=["value"],M0={class:"block"},E0=["value"],O0={class:"block"},z0=["value"],$0={class:"block"},I0={class:"block"},N0={class:"block"},F0={class:"block"},D0=["value"],R0={class:"block"},B0={class:"block"},U0={class:"block"},V0=["value"],Z0={class:"mt-3 block"},H0={key:0,class:"mt-3"},j0={class:"eyebrow mb-1 block"},W0={key:1,class:"mt-3 text-xs text-ink-muted"},K0={class:"mt-4 flex items-center gap-3"},G0=["disabled"],q0={key:0,class:"text-sm text-danger-fg"},Y0={class:"panel overflow-hidden p-0"},J0={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},X0={key:1,class:"grid place-items-center px-5 py-16 text-center"},Q0={class:"mt-3 text-sm font-medium text-ink-secondary"},ew={class:"mt-1 text-xs text-ink-muted"},tw={key:2,class:"overflow-x-auto"},nw={class:"w-full border-collapse text-sm"},iw={class:"text-left"},ow={class:"px-5 py-3"},sw={class:"font-semibold text-ink"},aw={key:0,class:"font-mono text-[11px] text-ink-muted"},rw={class:"px-5 py-3 text-ink-secondary"},lw={class:"px-5 py-3 text-ink-secondary"},uw={class:"px-5 py-3"},cw=["onClick"],dw={key:0,class:"mt-0.5 font-mono text-[10.5px] text-ink-muted"},fw={class:"px-5 py-3 font-mono text-ink-secondary"},hw={class:"whitespace-nowrap px-5 py-3 text-right"},pw=["onClick"],mw=["onClick"],gw=["href"],vw=["onClick"],_w=["onClick"],bw=["onClick"],yw={key:0,class:"border-b border-line bg-surface-2"},xw={colspan:"6",class:"px-5 py-3"},ww={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},kw={class:"text-ink-secondary"},Sw={class:"text-ink"},Tw={class:"text-ink-secondary"},Pw={class:"text-ink"},Cw={key:0,class:"text-ink-secondary"},Lw={class:"text-ink"},Aw={key:1,class:"text-ink-secondary"},Mw={class:"font-mono text-ink"},Ew={key:2,class:"text-ink-secondary"},Ow={class:"font-mono text-ink"},zw={class:"text-ink-secondary"},$w={class:"text-ink"},Iw={key:0,class:"mt-2 space-y-1"},Nw={key:1,class:"mt-2 text-xs text-success-fg"},Fw={key:2,class:"mt-2 text-xs text-ink-secondary"},Dw={class:"flex max-h-[90vh] w-full max-w-[920px] flex-col overflow-hidden rounded-lg border border-line bg-surface-1 shadow-2xl"},Rw={class:"flex items-center gap-3 border-b border-line px-5 py-3"},Bw={class:"min-w-0"},Uw={class:"truncate text-sm font-semibold text-ink"},Vw={class:"truncate font-mono text-[11px] text-ink-muted"},Zw={class:"ml-auto flex items-center gap-2"},Hw=["href"],jw=["href"],Ww={class:"flex-1 overflow-auto bg-surface-2"},Kw=["src","alt"],Gw=["src","title"],qw={key:2,class:"grid place-items-center px-6 py-16 text-center"},Yw={class:"mt-1 text-xs text-ink-muted"},Jw=["href"],Xw={__name:"Documents",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},setup(t){const i={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"},s=[{value:"certificate",label:"Pilot certificate"},{value:"medical",label:"Medical / training"},{value:"insurance",label:"Insurance / liability"},{value:"background_check",label:"Background check / waiver"},{value:"registration",label:"Aircraft registration"},{value:"maintenance",label:"Maintenance log"},{value:"conformity",label:"Conformity / compliance"},{value:"firmware",label:"Firmware / software"},{value:"incident",label:"Incident / repair report"},{value:"flight_log",label:"Flight log"},{value:"checklist",label:"Pre-flight checklist"},{value:"airspace_auth",label:"Airspace authorisation"},{value:"mission_plan",label:"Mission plan / flight path"},{value:"risk_assessment",label:"Risk assessment / survey"},{value:"contract",label:"Contract / SOW"},{value:"client_insurance",label:"Client insurance cert"},{value:"delivery_report",label:"Delivery / media handoff"},{value:"other",label:"Other"}],l=Object.fromEntries(s.map(w=>[w.value,w.label])),u=[{value:"pilot",label:"Pilot"},{value:"aircraft",label:"Aircraft"},{value:"organization",label:"Organization"},{value:"client",label:"Client"},{value:"other",label:"Other"}],f=[{value:"active",label:"Active"},{value:"pending_review",label:"Pending review"},{value:"archived",label:"Archived"}],h=[{value:"pilot",label:"Pilot"},{value:"ops",label:"Ops manager"},{value:"admin",label:"Admin"},{value:"client",label:"Client-facing"}],_=Y([]),b=Y([]),C=Y(!1),T=Y("");async function E(){C.value=!0,T.value="";const[w,y]=await Promise.all([Ip(),pl()]);w.ok||(T.value=w.status===503?"Document storage is not configured on the API Server (service account missing).":"Could not load documents."),_.value=w.documents,b.value=y.drones||[],C.value=!1}ti(E);const Z=Y("all"),U=[["all","All"],["expiring","Expiring soon"],["expired","Expired"],["pending","Pending review"],["archived","Archived"]],G=fe(()=>{const w=_.value;switch(Z.value){case"expiring":return w.filter(y=>{var S;return((S=y.expiry)==null?void 0:S.state)==="expiring_soon"&&y.status!=="archived"});case"expired":return w.filter(y=>{var S;return((S=y.expiry)==null?void 0:S.state)==="expired"&&y.status!=="archived"});case"pending":return w.filter(y=>y.status==="pending_review");case"archived":return w.filter(y=>y.status==="archived");default:return w.filter(y=>y.status!=="archived")}});function I(w){if(w.status==="archived")return{tone:"neutral",label:"Superseded",icon:""};const y=w.expiry||{};return y.state==="expired"?{tone:"danger",label:"Expired",icon:"alertTriangle"}:y.state==="expiring_soon"?{tone:"warning",label:`Expires in ${y.daysUntilExpiry}d`,icon:"clock"}:y.state==="valid"?{tone:"success",label:"Valid",icon:"check"}:{tone:"neutral",label:"No expiry",icon:""}}const R=Y("");function Q(w){R.value=R.value===w?"":w}function K(w){return w.ownerDrone?w.ownerDroneName||"Aircraft":w.ownerRef?w.ownerRef:w.ownerType==="pilot"?"Pilot":w.ownerType?w.ownerType.charAt(0).toUpperCase()+w.ownerType.slice(1):"—"}const ke=["png","jpg","jpeg","gif","webp","svg","bmp","avif"],de=["pdf","txt","csv","log","json","md","html","htm","xml"];function xe(w){const y=(w||"").split(".").pop().toLowerCase();return ke.includes(y)?"image":de.includes(y)?"frame":"none"}const Le=Y(null),Me=fe(()=>Le.value?xe(Le.value.fileName):"none"),Ze=fe(()=>Le.value?Rp(Le.value.id):"");function ve(w){Le.value=w}function te(){Le.value=null}function B(w){w.key==="Escape"&&Le.value&&te()}ti(()=>window.addEventListener("keydown",B)),us(()=>window.removeEventListener("keydown",B));function F(){return{title:"",docType:"certificate",ownerType:"pilot",ownerDrone:"",ownerRef:"",reference:"",jurisdiction:"",issueDate:"",expiryDate:"",status:"active",accessTier:"ops",notes:""}}const se=Y(!1),M=Y(""),H=Y(""),Pe=Y(""),me=mt(F()),he=Y(null),St=Y(null),pe=Y(""),Be=Y(!1);function He(){he.value=null,St.value&&(St.value.value="")}function xt(){Object.assign(me,F()),M.value="",H.value="",Pe.value="",He(),pe.value="",se.value=!0}function st(w){Object.assign(me,{title:w.title||"",docType:w.docType||"certificate",ownerType:w.ownerType||"pilot",ownerDrone:w.ownerDrone||"",ownerRef:w.ownerRef||"",reference:w.reference||"",jurisdiction:w.jurisdiction||"",issueDate:w.issueDate||"",expiryDate:w.expiryDate||"",status:w.status||"active",accessTier:w.accessTier||"ops",notes:w.notes||""}),M.value=w.id,H.value="",Pe.value="",He(),pe.value="",se.value=!0}function Ee(w){st(w),M.value="",H.value=w.id,Pe.value=w.title,me.status="active"}function Re(){se.value=!1,M.value="",H.value=""}function zt(w){var y;he.value=((y=w.target.files)==null?void 0:y[0])||null}async function At(){var y;if(pe.value="",!me.title.trim()){pe.value="Give the document a title.";return}Be.value=!0;let w;if(M.value)w=await Fp(M.value,{...me});else{const S={...me};H.value&&(S.replaces=H.value),w=await Np(S,he.value)}if(Be.value=!1,!w.ok){pe.value=((y=w.body)==null?void 0:y.error)||"Could not save the document.";return}se.value=!1,M.value="",H.value="",await E()}const Ut=Y("");async function Pt(w){var S;const y=await Dp(w.id);Ut.value="",y.ok?await E():pe.value=((S=y.body)==null?void 0:S.error)||"Could not delete the document."}const wt=fe(()=>{const w=_.value.filter(y=>y.status!=="archived");return{total:w.length,expiring:w.filter(y=>{var S;return((S=y.expiry)==null?void 0:S.state)==="expiring_soon"}).length,expired:w.filter(y=>{var S;return((S=y.expiry)==null?void 0:S.state)==="expired"}).length,pending:_.value.filter(y=>y.status==="pending_review").length}});return(w,y)=>(p(),m("div",p0,[a("div",m0,[a("div",g0,[(p(),m(re,null,$e(U,S=>a("button",{key:S[0],class:Ce(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",Z.value===S[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:q=>Z.value=S[0]},x(S[1]),11,v0)),64))]),a("div",_0,[a("button",{class:"btn-accent inline-flex items-center gap-2",onClick:xt},[A(ee,{name:"upload",size:15}),y[13]||(y[13]=z(" Add document ",-1))])])]),a("div",b0,[(p(!0),m(re,null,$e([{label:"Documents on file",value:wt.value.total,tone:"neutral"},{label:"Expiring soon",value:wt.value.expiring,tone:wt.value.expiring?"warning":"neutral"},{label:"Expired",value:wt.value.expired,tone:wt.value.expired?"danger":"success"},{label:"Pending review",value:wt.value.pending,tone:wt.value.pending?"accent":"neutral"}],S=>(p(),m("div",{key:S.label,class:"panel p-5"},[a("div",y0,x(S.label),1),a("div",{class:Ce(["mt-2 text-[30px] font-bold leading-none tracking-tightest",S.tone==="danger"?"text-danger-fg":S.tone==="warning"?"text-amber-fg":S.tone==="success"?"text-success-fg":S.tone==="accent"?"text-accent-soft-fg":"text-ink"])},x(S.value),3)]))),128))]),T.value?(p(),m("div",x0,x(T.value),1)):$("",!0),se.value?(p(),m("div",w0,[a("div",k0,[a("div",null,[a("div",S0,x(M.value?"Edit document":H.value?"New version":"New document"),1),a("div",T0,x(H.value?`Supersedes “${Pe.value}”`:"Compliance & operational document"),1)]),a("button",{class:"btn-icon",onClick:Re},[A(ee,{name:"x",size:16})])]),a("div",P0,[a("label",C0,[y[14]||(y[14]=a("span",{class:"eyebrow mb-1 block"},"Title",-1)),oe(a("input",{"onUpdate:modelValue":y[0]||(y[0]=S=>me.title=S),class:"field",placeholder:"A2 Remote Pilot Certificate — J. Dariusz"},null,512),[[ge,me.title]])]),a("label",L0,[y[15]||(y[15]=a("span",{class:"eyebrow mb-1 block"},"Type",-1)),oe(a("select",{"onUpdate:modelValue":y[1]||(y[1]=S=>me.docType=S),class:"field"},[(p(),m(re,null,$e(s,S=>a("option",{key:S.value,value:S.value},x(S.label),9,A0)),64))],512),[[Ot,me.docType]])]),a("label",M0,[y[16]||(y[16]=a("span",{class:"eyebrow mb-1 block"},"Owner type",-1)),oe(a("select",{"onUpdate:modelValue":y[2]||(y[2]=S=>me.ownerType=S),class:"field"},[(p(),m(re,null,$e(u,S=>a("option",{key:S.value,value:S.value},x(S.label),9,E0)),64))],512),[[Ot,me.ownerType]])]),a("label",O0,[y[18]||(y[18]=a("span",{class:"eyebrow mb-1 block"},"Aircraft (if any)",-1)),oe(a("select",{"onUpdate:modelValue":y[3]||(y[3]=S=>me.ownerDrone=S),class:"field"},[y[17]||(y[17]=a("option",{value:""},"— none —",-1)),(p(!0),m(re,null,$e(b.value,S=>(p(),m("option",{key:S.id,value:S.id},x(S.name)+x(S.model?` · ${S.model}`:""),9,z0))),128))],512),[[Ot,me.ownerDrone]])]),a("label",$0,[y[19]||(y[19]=a("span",{class:"eyebrow mb-1 block"},"Owner reference",-1)),oe(a("input",{"onUpdate:modelValue":y[4]||(y[4]=S=>me.ownerRef=S),class:"field",placeholder:"Client name / serial / site"},null,512),[[ge,me.ownerRef]])]),a("label",I0,[y[20]||(y[20]=a("span",{class:"eyebrow mb-1 block"},"Reference / number",-1)),oe(a("input",{"onUpdate:modelValue":y[5]||(y[5]=S=>me.reference=S),class:"field",placeholder:"Cert / registration / policy no."},null,512),[[ge,me.reference]])]),a("label",N0,[y[21]||(y[21]=a("span",{class:"eyebrow mb-1 block"},"Jurisdiction",-1)),oe(a("input",{"onUpdate:modelValue":y[6]||(y[6]=S=>me.jurisdiction=S),class:"field",placeholder:"DK / EASA / FAA"},null,512),[[ge,me.jurisdiction]])]),a("label",F0,[y[22]||(y[22]=a("span",{class:"eyebrow mb-1 block"},"Access tier",-1)),oe(a("select",{"onUpdate:modelValue":y[7]||(y[7]=S=>me.accessTier=S),class:"field"},[(p(),m(re,null,$e(h,S=>a("option",{key:S.value,value:S.value},x(S.label),9,D0)),64))],512),[[Ot,me.accessTier]])]),a("label",R0,[y[23]||(y[23]=a("span",{class:"eyebrow mb-1 block"},"Issue date",-1)),oe(a("input",{"onUpdate:modelValue":y[8]||(y[8]=S=>me.issueDate=S),type:"date",class:"field"},null,512),[[ge,me.issueDate]])]),a("label",B0,[y[24]||(y[24]=a("span",{class:"eyebrow mb-1 block"},"Expiry date",-1)),oe(a("input",{"onUpdate:modelValue":y[9]||(y[9]=S=>me.expiryDate=S),type:"date",class:"field"},null,512),[[ge,me.expiryDate]])]),a("label",U0,[y[25]||(y[25]=a("span",{class:"eyebrow mb-1 block"},"Status",-1)),oe(a("select",{"onUpdate:modelValue":y[10]||(y[10]=S=>me.status=S),class:"field"},[(p(),m(re,null,$e(f,S=>a("option",{key:S.value,value:S.value},x(S.label),9,V0)),64))],512),[[Ot,me.status]])])]),a("label",Z0,[y[26]||(y[26]=a("span",{class:"eyebrow mb-1 block"},"Notes",-1)),oe(a("textarea",{"onUpdate:modelValue":y[11]||(y[11]=S=>me.notes=S),rows:"2",class:"field",placeholder:"Conditions, renewal contacts, anything worth recording"},null,512),[[ge,me.notes]])]),M.value?(p(),m("div",W0,[...y[28]||(y[28]=[z(" Editing updates metadata only. To replace the file, close this and use ",-1),a("b",{class:"text-ink-secondary"},"New version",-1),z(" on the document — the old version is kept for audit. ",-1)])])):(p(),m("div",H0,[a("span",j0,"File "+x(H.value?"(new version)":"(optional)"),1),a("input",{ref_key:"fileInput",ref:St,type:"file",class:"field",onChange:zt},null,544),y[27]||(y[27]=a("p",{class:"mt-1 text-xs text-ink-muted"}," Stored in PocketBase for now (object storage later). Max 50 MB. ",-1))])),a("div",K0,[a("button",{class:"btn-accent",disabled:Be.value,onClick:At},x(Be.value?"Saving…":M.value?"Save changes":H.value?"Upload new version":"Add document"),9,G0),a("button",{class:"btn-ghost",onClick:Re},"Cancel"),pe.value?(p(),m("span",q0,x(pe.value),1)):$("",!0)])])):$("",!0),a("div",Y0,[C.value?(p(),m("div",J0,"Loading…")):G.value.length?(p(),m("div",tw,[a("table",nw,[a("thead",null,[a("tr",iw,[(p(),m(re,null,$e(["Title","Type","Owner","Expiry","Ver",""],S=>a("th",{key:S,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"},x(S),1)),64))])]),a("tbody",null,[(p(!0),m(re,null,$e(G.value,S=>{var q,j;return p(),m(re,{key:S.id},[a("tr",{class:Ce(["border-b border-line last:border-0",M.value===S.id?"bg-accent-soft":""])},[a("td",ow,[a("div",sw,x(S.title),1),S.reference?(p(),m("div",aw,x(S.reference),1)):$("",!0)]),a("td",rw,x(Ie(l)[S.docType]||S.docType||"—"),1),a("td",lw,x(K(S)),1),a("td",uw,[a("button",{class:Ce(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",i[I(S).tone]]),onClick:J=>Q(S.id)},[I(S).icon?(p(),nt(ee,{key:0,name:I(S).icon,size:12},null,8,["name"])):$("",!0),z(" "+x(I(S).label),1)],10,cw),S.expiryDate?(p(),m("div",dw,x(S.expiryDate),1)):$("",!0)]),a("td",fw,"v"+x(S.version||1),1),a("td",hw,[Ut.value===S.id?(p(),m(re,{key:0},[y[29]||(y[29]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),a("button",{class:"btn-ghost mr-1",onClick:y[12]||(y[12]=J=>Ut.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:J=>Pt(S)},"Delete",8,pw)],64)):(p(),m(re,{key:1},[S.hasFile?(p(),m("button",{key:0,class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Preview",onClick:J=>ve(S)},[A(ee,{name:"eye",size:13})],8,mw)):$("",!0),S.hasFile?(p(),m("a",{key:1,href:Ie(zr)(S.id),class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Download file"},[A(ee,{name:"download",size:13})],8,gw)):$("",!0),a("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Upload new version",onClick:J=>Ee(S)},[A(ee,{name:"upload",size:13})],8,vw),a("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:J=>st(S)},[A(ee,{name:"sliders",size:13}),y[30]||(y[30]=z(" Edit",-1))],8,_w),a("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:J=>Ut.value=S.id},[A(ee,{name:"trash",size:13})],8,bw)],64))])],2),R.value===S.id?(p(),m("tr",yw,[a("td",xw,[a("div",ww,[a("span",kw,[y[31]||(y[31]=z("Status: ",-1)),a("b",Sw,x(S.status||"—"),1)]),a("span",Tw,[y[32]||(y[32]=z("Access: ",-1)),a("b",Pw,x(S.accessTier||"—"),1)]),S.jurisdiction?(p(),m("span",Cw,[y[33]||(y[33]=z("Jurisdiction: ",-1)),a("b",Lw,x(S.jurisdiction),1)])):$("",!0),S.issueDate?(p(),m("span",Aw,[y[34]||(y[34]=z("Issued: ",-1)),a("b",Mw,x(S.issueDate),1)])):$("",!0),S.expiryDate?(p(),m("span",Ew,[y[35]||(y[35]=z("Expires: ",-1)),a("b",Ow,x(S.expiryDate),1)])):$("",!0),a("span",zw,[y[36]||(y[36]=z("File: ",-1)),a("b",$w,x(S.hasFile?S.fileName:"none"),1)])]),(((q=S.expiry)==null?void 0:q.flags)||[]).length?(p(),m("ul",Iw,[(p(!0),m(re,null,$e(S.expiry.flags,(J,ce)=>(p(),m("li",{key:ce,class:Ce(["flex items-start gap-2 text-xs",S.expiry.state==="expired"?"text-danger-fg":S.expiry.state==="expiring_soon"?"text-amber-fg":"text-ink-secondary"])},[A(ee,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),z(" "+x(J),1)],2))),128))])):((j=S.expiry)==null?void 0:j.state)==="valid"?(p(),m("div",Nw,"In force — no action needed.")):$("",!0),S.notes?(p(),m("div",Fw,[y[37]||(y[37]=a("span",{class:"text-ink-muted"},"Notes:",-1)),z(" "+x(S.notes),1)])):$("",!0)])])):$("",!0)],64)}),128))])])])):(p(),m("div",X0,[A(ee,{name:"fileText",size:26,class:"text-ink-muted"}),a("div",Q0,x(Z.value==="all"?"No documents on file yet":"Nothing in this view"),1),a("div",ew,x(Z.value==="all"?"Add certificates, registrations, insurance and authorisations to track their expiry.":"Try a different filter."),1)]))]),(p(),nt(cf,{to:"body"},[Le.value?(p(),m("div",{key:0,class:"fixed inset-0 z-50 grid place-items-center p-4",style:{background:"color-mix(in srgb, black 60%, transparent)"},onClick:hl(te,["self"])},[a("div",Dw,[a("div",Rw,[a("div",Bw,[a("div",Uw,x(Le.value.title),1),a("div",Vw,x(Le.value.fileName),1)]),a("div",Zw,[a("a",{href:Ze.value,target:"_blank",rel:"noopener",class:"btn-ghost inline-flex items-center gap-1.5",title:"Open in new tab"},[A(ee,{name:"globe",size:14}),y[38]||(y[38]=z(" New tab ",-1))],8,Hw),a("a",{href:Ie(zr)(Le.value.id),class:"btn-ghost inline-flex items-center gap-1.5",title:"Download"},[A(ee,{name:"download",size:14}),y[39]||(y[39]=z(" Download ",-1))],8,jw),a("button",{class:"btn-icon",title:"Close",onClick:te},[A(ee,{name:"x",size:16})])])]),a("div",Ww,[Me.value==="image"?(p(),m("img",{key:0,src:Ze.value,alt:Le.value.title,class:"mx-auto block max-w-full"},null,8,Kw)):Me.value==="frame"?(p(),m("iframe",{key:1,src:Ze.value,class:"h-[74vh] w-full border-0 bg-white",title:Le.value.title},null,8,Gw)):(p(),m("div",qw,[A(ee,{name:"fileText",size:28,class:"text-ink-muted"}),y[41]||(y[41]=a("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"Preview isn't available for this file type",-1)),a("div",Yw,x(Le.value.fileName),1),a("a",{href:Ie(zr)(Le.value.id),class:"btn-accent mt-4 inline-flex items-center gap-2"},[A(ee,{name:"download",size:15}),y[40]||(y[40]=z(" Download instead ",-1))],8,Jw)]))])])])):$("",!0)]))]))}},Qw={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},e2={class:"flex flex-wrap items-center gap-3"},t2={class:"ml-auto flex items-center gap-2"},n2=["disabled"],i2={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},o2={class:"eyebrow"},s2={class:"mt-2 text-[30px] font-bold leading-none tracking-tightest text-ink"},a2={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},r2={class:"panel overflow-hidden p-0"},l2={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},u2={key:1,class:"grid place-items-center px-5 py-16 text-center"},c2={key:2,class:"overflow-x-auto"},d2={class:"w-full border-collapse text-sm"},f2={class:"text-left"},h2=["onClick"],p2={class:"px-5 py-3"},m2={class:"flex items-center gap-2"},g2={class:"font-semibold text-ink"},v2={key:0,class:"inline-flex rounded-full bg-surface-2 px-2 py-0.5 text-[11px] font-semibold text-ink-secondary"},_2={class:"px-5 py-3 font-mono text-xs text-ink-secondary"},b2={class:"px-5 py-3 font-mono text-xs text-ink-secondary"},y2={class:"px-5 py-3 font-mono text-xs text-ink-secondary"},x2={class:"px-5 py-3 font-mono text-xs text-ink-secondary"},w2={class:"px-5 py-3 text-xs text-ink-secondary"},k2={class:"whitespace-nowrap px-5 py-3 text-xs text-ink-muted"},S2={key:0,class:"border-b border-line bg-surface-2"},T2={colspan:"7",class:"px-5 py-3"},P2={class:"w-full text-xs"},C2={class:"text-left text-ink-muted"},L2={class:"font-mono text-ink-secondary"},A2={class:"py-1 pr-4"},M2={class:"py-1 pr-4"},E2={class:"py-1 pr-4"},O2={class:"py-1 pr-4"},z2={class:"py-1 pr-4"},$2={class:"py-1 pr-4"},I2={class:"py-1 pr-4"},N2={__name:"Routes",setup(t){const i=Y([]),s=Y(!1),l=Y(""),u=Y("");async function f(){s.value=!0,l.value="";const I=await $p();I.ok||(l.value=I.status===503?"Route storage is not configured on the API Server (service account missing).":"Could not load your routes."),i.value=I.routes,s.value=!1}ti(f);function h(I,R){const K=Le=>Le*Math.PI/180,ke=K(R.lat-I.lat),de=K(R.lon-I.lon),xe=Math.sin(ke/2)**2+Math.cos(K(I.lat))*Math.cos(K(R.lat))*Math.sin(de/2)**2;return 2*6371e3*Math.asin(Math.sqrt(xe))}function _(I){var R;return Array.isArray((R=I.spec)==null?void 0:R.points)?I.spec.points:[]}function b(I){const R=_(I);let Q=0;for(let K=1;K=1e3?`${(I/1e3).toFixed(2)} km`:`${Math.round(I)} m`}function T(I){var K;const R=Number((K=I.spec)==null?void 0:K.cruiseSpeed)||0;if(!R)return"—";const Q=Math.round(b(I)/R);return Q>=60?`${Math.floor(Q/60)} min ${Q%60} s`:`${Q} s`}function E(I){const R=new Date(I);return Number.isNaN(R.getTime())?"—":R.toLocaleString()}const Z={goHome:"Return to home",hover:"Hover",land:"Land",firstWaypoint:"Back to first WP"},U={none:"—",photo:"Photo",startRecord:"Start recording",stopRecord:"Stop recording"},G=fe(()=>{const I=i.value;return{count:I.length,mine:I.filter(R=>R.mine).length,waypoints:I.reduce((R,Q)=>R+_(Q).length,0),distance:I.reduce((R,Q)=>R+b(Q),0)}});return(I,R)=>(p(),m("div",Qw,[a("div",e2,[R[1]||(R[1]=a("div",null,[a("div",{class:"eyebrow"},"Mission library"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Waypoint routes")],-1)),a("div",t2,[a("button",{class:"btn-ghost inline-flex items-center gap-2",disabled:s.value,onClick:f},[A(ee,{name:"download",size:14}),R[0]||(R[0]=z(" Refresh ",-1))],8,n2)])]),a("div",i2,[(p(!0),m(re,null,$e([{label:"Routes",value:G.value.count},{label:"Yours",value:G.value.mine},{label:"Waypoints",value:G.value.waypoints},{label:"Total distance",value:C(G.value.distance)}],Q=>(p(),m("div",{key:Q.label,class:"panel p-5"},[a("div",o2,x(Q.label),1),a("div",s2,x(Q.value),1)]))),128))]),l.value?(p(),m("div",a2,x(l.value),1)):$("",!0),a("div",r2,[s.value&&!i.value.length?(p(),m("div",l2,"Loading…")):i.value.length?(p(),m("div",c2,[a("table",d2,[a("thead",null,[a("tr",f2,[(p(),m(re,null,$e(["Route","Waypoints","Length","Est. time","Speed","On finish","Updated"],Q=>a("th",{key:Q,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"},x(Q),1)),64))])]),a("tbody",null,[(p(!0),m(re,null,$e(i.value,Q=>{var K,ke,de;return p(),m(re,{key:Q.id},[a("tr",{class:Ce(["cursor-pointer border-b border-line last:border-0 hover:bg-surface-2",u.value===Q.id?"bg-accent-soft":""]),onClick:xe=>u.value=u.value===Q.id?"":Q.id},[a("td",p2,[a("div",m2,[A(ee,{name:"chevronRight",size:13,class:Ce(["text-ink-muted transition",u.value===Q.id?"rotate-90":""])},null,8,["class"]),a("span",g2,x(Q.name||"Route"),1),Q.mine?$("",!0):(p(),m("span",v2," another pilot "))])]),a("td",_2,x(_(Q).length),1),a("td",b2,x(C(b(Q))),1),a("td",y2,x(T(Q)),1),a("td",x2,x(((K=Q.spec)==null?void 0:K.cruiseSpeed)??"—")+" m/s",1),a("td",w2,x(Z[(ke=Q.spec)==null?void 0:ke.finishAction]||((de=Q.spec)==null?void 0:de.finishAction)||"—"),1),a("td",k2,x(E(Q.updatedAt)),1)],10,h2),u.value===Q.id?(p(),m("tr",S2,[a("td",T2,[a("table",P2,[a("thead",null,[a("tr",C2,[(p(),m(re,null,$e(["#","Latitude","Longitude","Altitude","Speed","Gimbal","Action"],xe=>a("th",{key:xe,class:"py-1 pr-4 font-mono text-[10.5px] font-normal uppercase tracking-caps"},x(xe),1)),64))])]),a("tbody",L2,[(p(!0),m(re,null,$e(_(Q),(xe,Le)=>(p(),m("tr",{key:Le},[a("td",A2,x(Le+1),1),a("td",M2,x(Number(xe.lat).toFixed(6)),1),a("td",E2,x(Number(xe.lon).toFixed(6)),1),a("td",O2,x(xe.altitude)+" m",1),a("td",z2,x(xe.speed!=null?`${xe.speed} m/s`:"cruise"),1),a("td",$2,x(xe.gimbalPitch!=null?`${xe.gimbalPitch}°`:"—"),1),a("td",I2,x(U[xe.action]||xe.action||"—")+x(xe.hoverSeconds?` · hover ${xe.hoverSeconds} s`:""),1)]))),128))])]),R[4]||(R[4]=a("div",{class:"mt-2 text-xs text-ink-muted"},"Edit this route in the Fly App; changes sync here.",-1))])])):$("",!0)],64)}),128))])])])):(p(),m("div",u2,[A(ee,{name:"route",size:26,class:"text-ink-muted"}),R[2]||(R[2]=a("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No routes yet",-1)),R[3]||(R[3]=a("div",{class:"mt-1 text-xs text-ink-muted"}," Save a route in the Fly App's Waypoints mission library while signed in and it shows up here. ",-1))]))])]))}},F2={class:"grid h-full grid-cols-[248px_1fr] max-[900px]:grid-cols-1"},D2={class:"flex flex-col border-r border-line bg-surface-1 px-4 py-5 max-[900px]:hidden"},R2={class:"flex items-center gap-2.5 px-2 pb-5"},B2={class:"flex flex-col gap-0.5"},U2=["onClick"],V2={class:"mt-auto flex flex-col gap-2.5"},Z2={class:"rounded-lg bg-surface-2 p-3"},H2={class:"flex items-center gap-2"},j2={class:"text-xs font-semibold text-ink"},W2={class:"mt-1.5 block font-mono text-[10.5px] text-ink-muted"},K2={class:"flex items-center gap-2.5 px-2 py-1"},G2={class:"grid h-8 w-8 place-items-center rounded-full bg-[var(--navy-800)] text-xs font-bold text-white"},q2={class:"min-w-0 flex-1"},Y2={class:"truncate text-[13px] font-semibold text-ink"},J2={class:"flex items-center gap-1.5 text-[11px] text-ink-muted"},X2=["title"],Q2={class:"overflow-y-auto"},ek={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)"}},tk={class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},nk={class:"ml-auto flex items-center gap-3"},ik={class:"flex h-10 w-60 items-center gap-2 rounded border border-line-strong bg-surface-1 px-3 max-[1100px]:hidden"},ok={key:0,class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},sk={class:"grid grid-cols-4 gap-4 max-[1100px]:grid-cols-2 max-[560px]:grid-cols-1"},ak={class:"flex items-center justify-between"},rk={class:"eyebrow"},lk={class:"mt-2.5 text-[34px] font-bold leading-none tracking-tightest text-ink"},uk={class:"grid grid-cols-[1.6fr_1fr] gap-5 max-[1100px]:grid-cols-1"},ck={class:"panel p-5"},dk={class:"mb-3.5 flex items-center justify-between"},fk={class:"flex items-center gap-2"},hk={class:"relative z-[1200]"},pk={class:"panel absolute right-0 z-[1200] mt-1.5 w-72 p-3.5 shadow-lg"},mk={class:"flex items-center justify-between gap-3"},gk={class:"mb-1.5 flex items-center justify-between"},vk={class:"font-mono text-[11px] text-ink-muted"},_k=["value"],bk={key:0,class:"mt-1.5 text-[11px] text-ink-muted"},yk={key:0,class:"mt-2.5 text-xs text-ink-muted"},xk={key:1,class:"mt-2.5 text-xs text-ink-muted"},wk={key:2,class:"mt-2.5 text-xs text-ink-muted"},kk={class:"flex flex-col gap-5"},Sk={class:"panel p-5"},Tk={class:"mb-3.5 flex items-center justify-between"},Pk={class:"flex items-center gap-3"},Ck={class:"text-5xl leading-none"},Lk={class:"min-w-0"},Ak={class:"flex items-baseline gap-1"},Mk={class:"text-[34px] font-bold leading-none tracking-tightest text-ink"},Ek={class:"text-lg font-semibold text-ink-secondary"},Ok={class:"mt-1 truncate text-sm capitalize text-ink-secondary"},zk={class:"mt-1.5 truncate text-xs text-ink-muted"},$k={class:"mt-4 grid grid-cols-2 gap-2.5"},Ik={class:"rounded-lg bg-surface-2 px-3 py-2"},Nk={class:"mt-0.5 font-mono text-sm text-ink"},Fk={class:"rounded-lg bg-surface-2 px-3 py-2"},Dk={class:"mt-0.5 font-mono text-sm text-ink"},Rk={class:"rounded-lg bg-surface-2 px-3 py-2"},Bk={class:"mt-0.5 font-mono text-sm text-ink"},Uk={key:0},Vk={class:"rounded-lg bg-surface-2 px-3 py-2"},Zk={class:"mt-0.5 font-mono text-sm text-ink"},Hk={key:0},jk={key:0,class:"mt-3 text-[11px] text-ink-muted"},Wk={key:1,class:"grid place-items-center py-8 text-center"},Kk={class:"mt-0.5 text-xs text-ink-muted"},Gk={key:2,class:"grid place-items-center py-8 text-center text-sm text-ink-muted"},qk={class:"panel p-5"},Yk={class:"mb-3.5 flex items-center justify-between"},Jk={class:"grid place-items-center py-10 text-center"},Xk={class:"panel overflow-hidden p-0"},Qk={class:"flex items-center justify-between px-5 py-4"},eS={class:"flex gap-2"},tS={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},nS={key:1,class:"overflow-x-auto"},iS={class:"w-full border-collapse text-sm"},oS={class:"text-left"},sS=["onClick"],aS={class:"px-5 py-3 font-mono font-bold text-ink"},rS={class:"px-5 py-3 text-ink-secondary"},lS={class:"px-5 py-3"},uS={class:"px-5 py-3 font-mono text-ink-secondary"},cS={class:"px-5 py-3"},dS={key:0,class:"flex items-center gap-2"},fS={class:"h-1.5 w-12 overflow-hidden rounded bg-surface-2"},hS={class:"font-mono text-xs text-ink-secondary"},pS={key:1,class:"font-mono text-xs text-ink-muted"},mS={class:"px-5 py-3 font-mono text-ink-secondary"},gS={class:"px-5 py-3 text-right"},vS=["onClick"],_S={key:1,class:"p-7"},bS={class:"mb-4 flex flex-wrap items-center gap-3"},yS={class:"font-mono text-mode font-bold text-ink"},xS={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"},wS={key:1,class:"ml-auto flex flex-wrap gap-1.5"},kS=["onClick"],SS={key:0,class:"panel grid place-items-center p-16 text-center"},TS={class:"pill"},PS={class:"pill"},CS={class:"pill"},LS={class:"mt-1 text-sm font-semibold text-ink"},AS={class:"pill"},MS={class:"mt-1 font-mono text-sm font-bold tabular text-ink"},ES={class:"grid grid-cols-2 gap-4 max-[820px]:grid-cols-1"},OS={class:"panel p-4"},zS={class:"flex items-center gap-4"},$S={class:"h-9 flex-1 overflow-hidden rounded border border-line bg-surface-2"},IS={class:"readout"},NS={class:"panel p-4"},FS={class:"readout"},DS={class:"panel p-4"},RS={class:"space-y-1.5 text-sm"},BS={class:"flex justify-between"},US={class:"text-ink"},VS={class:"flex justify-between"},ZS={class:"text-ink"},HS={class:"flex justify-between"},jS={class:"font-mono tabular text-ink"},WS={class:"flex justify-between"},KS={class:"font-mono tabular text-ink"},GS={class:"panel p-4"},qS={class:"space-y-1.5 text-sm"},YS={class:"flex justify-between"},JS={class:"font-mono tabular text-ink"},XS={class:"flex justify-between"},QS={class:"font-mono tabular text-ink"},e5={class:"flex justify-between"},t5={class:"font-mono tabular text-ink"},n5={class:"panel col-span-2 p-4 max-[820px]:col-span-1"},i5={class:"panel p-4"},o5={class:"flex flex-wrap gap-2"},s5={class:"mt-2 min-h-[16px] text-xs text-ink-muted"},a5={class:"panel p-4"},r5={class:"h-[180px] overflow-y-auto font-mono text-xs"},l5={class:"text-ink-muted"},u5={class:"font-semibold text-accent"},c5={class:"break-all text-ink"},d5={key:7,class:"p-7"},f5={class:"panel grid place-items-center p-16 text-center"},h5={class:"mt-3 text-sm font-medium text-ink-secondary"},p5={key:0,class:"mt-1 text-xs text-ink-muted"},m5={key:1,class:"mt-1 text-xs text-ink-muted"},g5="34,-25,72,45",v5=600*1e3,_5={__name:"Dashboard",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(t,{emit:i}){const s=t,l=i,u=mt({}),f=mt({}),h=Y(null),_=Y(!1),b=mt([]),C=Y(""),T=Y([]),E=mt({unavailable:!1,detail:"",loaded:!1,plan:"",recommendedInterval:30}),Z=fe(()=>T.value.filter(V=>!V.onGround).length),U=Y(!1);let G=null;const I=[{value:"auto",label:"Auto"},{value:5,label:"5s"},{value:10,label:"10s"},{value:15,label:"15s"},{value:30,label:"30s"},{value:60,label:"60s"},{value:120,label:"120s"}],R=fe(()=>{if(ye.airTrafficInterval==="auto")return E.recommendedInterval||30;const V=Number(ye.airTrafficInterval);return Number.isFinite(V)&&V>0?V:30}),Q=Y(null);let K=!1;function ke(){if(!(K||Q.value!==null)){if(typeof navigator>"u"||!navigator.geolocation){Q.value=!1;return}K=!0,navigator.geolocation.getCurrentPosition(V=>{Q.value={lat:V.coords.latitude,lng:V.coords.longitude},K=!1},()=>{Q.value=!1,K=!1},{timeout:8e3,maximumAge:6e5})}}function de(V,O,ze){const tt=V&&V.telemetry||{},It=tt[O],kt=tt[ze];return typeof It=="number"&&typeof kt=="number"&&(It||kt)?{lat:It,lng:kt}:null}function xe(){const V=de(q.value,"latitude","longitude")||S.value.map(tt=>de(u[tt],"latitude","longitude")).find(Boolean);if(V){const tt=$r(V.lat,V.lng);if(tt)return tt.bbox}const O=de(q.value,"phoneLatitude","phoneLongitude")||S.value.map(tt=>de(u[tt],"phoneLatitude","phoneLongitude")).find(Boolean);if(O){const tt=$r(O.lat,O.lng);if(tt)return tt.bbox}if(ke(),Q.value){const tt=$r(Q.value.lat,Q.value.lng);if(tt)return tt.bbox}const ze=wm(ye.region);return ze||g5}async function Le(){if(!ye.showAirTraffic)return;const V=ye.autoBbox?xe():void 0,{states:O,unavailable:ze,detail:tt,plan:It,recommendedInterval:kt}=await mp(V);T.value=O,E.unavailable=ze,E.detail=tt,E.plan=It||"",kt&&(E.recommendedInterval=kt),E.loaded=!0}function Me(){G&&clearInterval(G),G=setInterval(()=>{Ee.value==="Overview"&&ye.showAirTraffic&&Le()},R.value*1e3)}function Ze(){Le(),Me()}function ve(){G&&clearInterval(G),G=null}const te=mt({loaded:!1,unavailable:!1,detail:"",data:null,units:"metric",source:"",updatedAt:0});let B=null;function F(){const V=de(q.value,"latitude","longitude")||S.value.map(ze=>de(u[ze],"latitude","longitude")).find(Boolean);if(V)return{lat:V.lat,lng:V.lng,source:"drone"};const O=de(q.value,"phoneLatitude","phoneLongitude")||S.value.map(ze=>de(u[ze],"phoneLatitude","phoneLongitude")).find(Boolean);return O?{lat:O.lat,lng:O.lng,source:"phone"}:Q.value?{lat:Q.value.lat,lng:Q.value.lng,source:"browser"}:null}async function se(){const V=F(),O=await Sp(V?V.lat:void 0,V?V.lng:void 0);if(te.loaded=!0,te.units=O.units||"metric",O.unavailable||!O.weather){te.unavailable=!0,te.detail=O.detail||"Weather is unavailable.",te.data=null;return}te.unavailable=!1,te.detail="",te.data=O.weather,te.source=V?V.source:"default",te.updatedAt=Date.now()}function M(){B&&clearInterval(B),B=setInterval(()=>{Ee.value==="Overview"&&se()},v5)}function H(){se(),M()}function Pe(){B&&clearInterval(B),B=null}const me=fe(()=>te.units==="imperial"?"°F":te.units==="standard"?"K":"°C"),he=fe(()=>te.units==="imperial"?"mph":"m/s");function St(V){const O=(V||"").slice(0,2);return O==="01"?(V||"").endsWith("n")?"🌙":"☀️":{"02":"🌤️","03":"⛅","04":"☁️","09":"🌧️",10:"🌦️",11:"⛈️",13:"❄️",50:"🌫️"}[O]||"🌡️"}const pe=fe(()=>St(te.data&&te.data.icon)),Be=fe(()=>{const V=te.data;return V?V.country?`${V.location}, ${V.country}`:V.location||"Unknown location":""}),He=fe(()=>te.source==="drone"?"at aircraft location":te.source==="phone"||te.source==="browser"?"at your location":"default location"),xt=fe(()=>te.updatedAt?new Date(te.updatedAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"");function st(V,O=0){return typeof V=="number"?V.toFixed(O):"—"}const Ee=Y("Overview"),Re=[["grid","Overview"],["radio","Live flights"],["route","Routes"],["calendar","Schedule"],["drone","Drones"],["book","Logbook"],["fileText","Documents"],["server","Drives"],["settings","Settings"]],zt=fe(()=>(Re.find(([,V])=>V===Ee.value)||["grid"])[0]),At=Y(""),Ut=Y(""),Pt=Y("");let wt=null,w=null,y=!1;const S=fe(()=>Object.keys(u).sort((V,O)=>(u[O].online?1:0)-(u[V].online?1:0)||V.localeCompare(O))),q=fe(()=>h.value?u[h.value]:null),j=fe(()=>q.value&&q.value.telemetry||{}),J=fe(()=>!!(q.value&&q.value.online)),ce=fe(()=>{const V=j.value;return typeof V.latitude=="number"&&typeof V.longitude=="number"&&(V.latitude||V.longitude)?{lat:V.latitude,lng:V.longitude}:null}),ue=fe(()=>h.value&&f[h.value]||[]),ae=fe(()=>{const V=j.value;return typeof V.velocityX=="number"&&typeof V.velocityY=="number"?Math.hypot(V.velocityX,V.velocityY):null});function ne(V){return V.online?V.connected?["In flight","success"]:["Standby","accent"]:["Offline","neutral"]}function _e(V){const O=V&&V.telemetry||{};return typeof O.velocityX=="number"&&typeof O.velocityY=="number"?Math.hypot(O.velocityX,O.velocityY):null}const le=fe(()=>S.value.map(V=>{const O=u[V],ze=O.telemetry||{},[tt,It]=ne(O);return{id:V,mission:O.model||(O.connected?"Drone linked":O.online?"App online":"No signal"),status:tt,tone:It,alt:typeof ze.altitude=="number"?ze.altitude.toFixed(0)+" m":"—",battery:typeof ze.batteryPercent=="number"?ze.batteryPercent:null,speed:_e(O)}})),Te=fe(()=>S.value.map(V=>u[V].connected?u[V].flightControllerSerial:"").filter(Boolean)),Ae=fe(()=>S.value.filter(V=>u[V].online).length),Ue=fe(()=>S.value.filter(V=>u[V].online&&u[V].connected).length),Ge=fe(()=>S.value.filter(V=>!u[V].online).length),qe=fe(()=>{const V=S.value.map(O=>{var ze;return(ze=u[O].telemetry)==null?void 0:ze.batteryPercent}).filter(O=>typeof O=="number");return V.length?Math.round(V.reduce((O,ze)=>O+ze,0)/V.length):null}),ht=fe(()=>[{label:"Active flights",value:String(Ue.value),delta:`${Ae.value} online`,tone:"success",icon:"radio"},{label:"Avg battery",value:qe.value==null?"—":qe.value+"%",delta:qe.value==null?"no telemetry":qe.value<40?"low — watch":"nominal",tone:qe.value!=null&&qe.value<40?"danger":"neutral",icon:"battery"},{label:"Fleet size",value:String(S.value.length),delta:`${Ue.value} in flight`,tone:"neutral",icon:"grid"},{label:"Offline",value:String(Ge.value),delta:Ge.value?"needs attention":"all reachable",tone:Ge.value?"warning":"success",icon:"signal"}]),ft={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"},Vt={success:"text-success-fg",danger:"text-danger-fg",warning:"text-amber-fg",neutral:"text-ink-muted",accent:"text-accent-soft-fg"},Jt=fe(()=>{var ze,tt,It;const O=(s.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((ze=O[0])==null?void 0:ze[0])||"P")+(((tt=O[1])==null?void 0:tt[0])||((It=O[0])==null?void 0:It[1])||"V")).toUpperCase()}),Zt={superadmin:"Superadmin",admin:"Admin",user:"Operator"},pn=fe(()=>Zt[s.role]||"Operator"),Ct=fe(()=>s.organizationName||(s.role==="superadmin"?"All organizations":"No organization")),$t=new Set,kn=Y(null);async function zi(V){var It,kt,Et;if(!V.connected||!V.flightControllerSerial)return;const O={flightControllerSerial:V.flightControllerSerial,model:V.model||"",firmware:V.firmware||"",controllerFirmware:V.controllerFirmware||""},ze=[O.flightControllerSerial,O.model,O.firmware,O.controllerFirmware].join("|");if($t.has(ze))return;$t.add(ze);const tt=await Pp(O);if(!tt.ok){(tt.status===0||tt.status>=500)&&$t.delete(ze);return}((It=tt.body)!=null&&It.created||(kt=tt.body)!=null&&kt.updated)&&((Et=kn.value)==null||Et.reload())}function at(V){if(V)for(const O of $t)O.startsWith(`${V}|`)&&$t.delete(O)}function Sn(V){var ze;u[V.deviceId]=V,zi(V);const O=V.telemetry||{};typeof O.latitude=="number"&&typeof O.longitude=="number"&&(O.latitude||O.longitude)&&(f[V.deviceId]||(f[V.deviceId]=[]),f[V.deviceId].push([O.latitude,O.longitude]),f[V.deviceId].length>1e3&&f[V.deviceId].shift()),(!h.value||V.online&&!((ze=u[h.value])!=null&&ze.online))&&(h.value=V.deviceId)}function $i(V){delete u[V],delete f[V],h.value===V&&(h.value=S.value[0]||null)}function rt(V){b.unshift({t:ku(Date.now()),tag:V.type||"?",text:JSON.stringify(hi(V))}),b.length>200&&b.pop()}function hi(V){const O={...V};return delete O.type,O}function pi(){const V=location.protocol==="https:"?"wss":"ws";wt=new WebSocket(`${V}://${location.host}/bff/ws`),wt.onopen=()=>_.value=!0,wt.onclose=()=>{_.value=!1,y||(w=setTimeout(pi,1500))},wt.onerror=()=>wt&&wt.close(),wt.onmessage=O=>{let ze;try{ze=JSON.parse(O.data)}catch{return}ze.type==="snapshot"?(ze.devices||[]).forEach(Sn):ze.type==="update"&&ze.device?(Sn(ze.device),ze.event&&ze.device.deviceId===h.value&&rt(ze.event)):ze.type==="removed"&&ze.deviceId&&$i(ze.deviceId)}}async function Ii(){if(!h.value)return Pt.value="No device selected.";if(!At.value.trim())return Pt.value="Enter a command name.";let V;if(Ut.value.trim())try{V=JSON.parse(Ut.value)}catch{return Pt.value="Payload is not valid JSON."}const{ok:O,body:ze}=await Bp(h.value,At.value.trim(),V);Pt.value=O?`Sent "${At.value.trim()}".`:`Error: ${ze.error||"failed"}`}function Gt(V,O,ze=""){return typeof V=="number"?V.toFixed(O)+ze:"—"}function jn(V){h.value=V,Ee.value="Live flights"}return Bt(Ee,V=>{V==="Overview"&&(Le(),se())}),Bt(()=>ye.showAirTraffic,V=>{V?Le():T.value=[]}),Bt(R,Me),ti(async()=>{(await np()).forEach(Sn),pi(),Ze(),H()}),us(()=>{y=!0,w&&clearTimeout(w),wt&&wt.close(),ve(),Pe()}),(V,O)=>{var ze,tt,It,kt,Et;return p(),m("div",F2,[a("aside",D2,[a("div",R2,[A(nd,{size:26}),O[11]||(O[11]=a("span",{class:"text-[19px] tracking-tightest"},[a("span",{class:"font-medium text-ink-secondary"},"Pilot"),a("span",{class:"font-bold text-ink"},"Vault")],-1))]),a("nav",B2,[(p(),m(re,null,$e(Re,([W,vt])=>a("button",{key:vt,class:Ce(["flex items-center gap-3 rounded px-3 py-2.5 text-left text-sm transition",Ee.value===vt?"bg-accent-soft font-semibold text-accent-soft-fg":"font-medium text-ink-secondary hover:bg-surface-2"]),onClick:_t=>Ee.value=vt},[A(ee,{name:W,size:18,stroke:Ee.value===vt?2.2:1.8},null,8,["name","stroke"]),z(" "+x(vt),1)],10,U2)),64))]),a("div",V2,[a("div",Z2,[a("div",H2,[a("span",{class:Ce(["h-2 w-2 rounded-full",_.value?"bg-ready":"bg-caution"])},null,2),a("span",j2,x(_.value?"Link healthy":"Reconnecting…"),1)]),a("span",W2,"API gateway · "+x(_.value?"streaming":"retrying"),1)]),a("div",K2,[a("div",G2,x(Jt.value),1),a("div",q2,[a("div",Y2,x(t.email||"Operator"),1),a("div",J2,[A(ee,{name:"grid",size:11,class:"shrink-0"}),a("span",{class:"truncate",title:`${pn.value} · ${Ct.value}`},x(pn.value)+" · "+x(Ct.value),9,X2)])]),a("button",{class:"text-ink-muted transition hover:text-ink",title:"Log out","aria-label":"Log out",onClick:O[0]||(O[0]=W=>l("logout"))},[A(ee,{name:"logout",size:16})])])])]),a("main",Q2,[a("header",ek,[a("div",null,[O[12]||(O[12]=a("div",{class:"eyebrow"},"Live operations",-1)),a("h1",tk,x(Ee.value),1)]),a("div",nk,[a("div",ik,[A(ee,{name:"search",size:16,class:"text-ink-muted"}),oe(a("input",{"onUpdate:modelValue":O[1]||(O[1]=W=>C.value=W),placeholder:"Search drones, routes…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ge,C.value]])]),a("button",{class:"btn-accent flex items-center gap-2",onClick:O[2]||(O[2]=W=>Ee.value="Live flights")},[A(ee,{name:"radio",size:16}),O[13]||(O[13]=z(" Live flights ",-1))])])]),Ee.value==="Overview"?(p(),m("div",ok,[a("div",sk,[(p(!0),m(re,null,$e(ht.value,W=>(p(),m("div",{key:W.label,class:"panel p-5"},[a("div",ak,[a("span",rk,x(W.label),1),A(ee,{name:W.icon,size:16,class:"text-ink-muted"},null,8,["name"])]),a("div",lk,x(W.value),1),a("span",{class:Ce(["mt-2 block font-mono text-[11px]",Vt[W.tone]])},x(W.delta),3)]))),128))]),a("div",uk,[a("div",ck,[a("div",dk,[O[18]||(O[18]=a("div",null,[a("div",{class:"eyebrow"},"Airspace"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Live map")],-1)),a("div",fk,[Ie(ye).showAirTraffic&&Z.value?(p(),m("span",{key:0,class:Ce(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ft.accent]),title:"Live aircraft from OpenSky Network"},[A(ee,{name:"radio",size:12}),z(x(Z.value)+" aircraft ",1)],2)):$("",!0),Ue.value?(p(),m("span",{key:1,class:Ce(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ft.success])},[O[14]||(O[14]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(Ue.value)+" drones ",1)],2)):$("",!0),a("div",hk,[a("button",{type:"button",class:Ce(["grid h-7 w-7 place-items-center rounded-md text-ink-muted transition hover:bg-surface-2 hover:text-ink",U.value?"bg-surface-2 text-ink":""]),title:"Map settings","aria-label":"Map settings",onClick:O[3]||(O[3]=W=>U.value=!U.value)},[A(ee,{name:"settings",size:16})],2),U.value?(p(),m(re,{key:0},[a("div",{class:"fixed inset-0 z-[1190]",onClick:O[4]||(O[4]=W=>U.value=!1)}),a("div",pk,[O[17]||(O[17]=a("div",{class:"eyebrow mb-2.5"},"Map settings",-1)),a("label",mk,[O[15]||(O[15]=a("span",{class:"text-sm text-ink-secondary"},"Show live air traffic",-1)),A(nn,{modelValue:Ie(ye).showAirTraffic,"onUpdate:modelValue":O[5]||(O[5]=W=>Ie(ye).showAirTraffic=W)},null,8,["modelValue"])]),a("div",{class:Ce(["mt-3.5",Ie(ye).showAirTraffic?"":"pointer-events-none opacity-40"])},[a("div",gk,[O[16]||(O[16]=a("span",{class:"text-sm text-ink-secondary"},"Refresh interval",-1)),a("span",vk,"every "+x(R.value)+"s",1)]),oe(a("select",{"onUpdate:modelValue":O[6]||(O[6]=W=>Ie(ye).airTrafficInterval=W),class:"field"},[(p(),m(re,null,$e(I,W=>a("option",{key:W.value,value:W.value},x(W.label)+x(W.value==="auto"?` (plan: ${E.recommendedInterval}s)`:""),9,_k)),64))],512),[[Ot,Ie(ye).airTrafficInterval]]),E.plan?(p(),m("p",bk," OpenSky plan: "+x(E.plan),1)):$("",!0)],2)])],64)):$("",!0)])])]),A(Cu,{position:ce.value,trail:ue.value,aircraft:Ie(ye).showAirTraffic?T.value:[]},null,8,["position","trail","aircraft"]),Ie(ye).showAirTraffic?E.loaded&&E.unavailable?(p(),m("p",xk,x(E.detail||"Live air traffic is unavailable."),1)):(p(),m("p",wk," Live air traffic from OpenSky Network · updates every "+x(R.value)+"s ",1)):(p(),m("p",yk," Live air traffic hidden · enable it in Map settings "))]),a("div",kk,[a("div",Sk,[a("div",Tk,[O[19]||(O[19]=a("div",null,[a("div",{class:"eyebrow"},"Conditions"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Weather")],-1)),A(ee,{name:"sun",size:16,class:"text-ink-muted"})]),te.data?(p(),m(re,{key:0},[a("div",Pk,[a("div",Ck,x(pe.value),1),a("div",Lk,[a("div",Ak,[a("span",Mk,x(st(te.data.temp)),1),a("span",Ek,x(me.value),1)]),a("div",Ok,x(te.data.description||"—"),1)])]),a("div",zk,x(Be.value)+" · "+x(He.value),1),a("div",$k,[a("div",Ik,[O[20]||(O[20]=a("div",{class:"eyebrow"},"Feels like",-1)),a("div",Nk,x(st(te.data.feelsLike))+x(me.value),1)]),a("div",Fk,[O[21]||(O[21]=a("div",{class:"eyebrow"},"Wind",-1)),a("div",Dk,x(st(te.data.windSpeed,1))+" "+x(he.value),1)]),a("div",Rk,[O[22]||(O[22]=a("div",{class:"eyebrow"},"Humidity",-1)),a("div",Bk,[z(x(st(te.data.humidity)),1),te.data.humidity!=null?(p(),m("span",Uk,"%")):$("",!0)])]),a("div",Vk,[O[23]||(O[23]=a("div",{class:"eyebrow"},"Cloud cover",-1)),a("div",Zk,[z(x(st(te.data.clouds)),1),te.data.clouds!=null?(p(),m("span",Hk,"%")):$("",!0)])])]),xt.value?(p(),m("div",jk,"Updated "+x(xt.value)+" · OpenWeather",1)):$("",!0)],64)):te.loaded&&te.unavailable?(p(),m("div",Wk,[A(ee,{name:"sun",size:24,class:"text-ink-muted"}),O[24]||(O[24]=a("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"Weather unavailable",-1)),a("div",Kk,x(te.detail),1)])):(p(),m("div",Gk," Loading weather… "))]),a("div",qk,[a("div",Yk,[O[25]||(O[25]=a("div",null,[a("div",{class:"eyebrow"},"Today"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Schedule")],-1)),A(ee,{name:"clock",size:16,class:"text-ink-muted"})]),a("div",Jk,[A(ee,{name:"calendar",size:24,class:"text-ink-muted"}),O[26]||(O[26]=a("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"No missions scheduled",-1)),O[27]||(O[27]=a("div",{class:"mt-0.5 text-xs text-ink-muted"},"Scheduling is not wired to a backend yet.",-1))])])])]),a("div",Xk,[a("div",Qk,[O[30]||(O[30]=a("div",null,[a("div",{class:"eyebrow"},"Fleet"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft status")],-1)),a("div",eS,[a("span",{class:Ce(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ft.success])},[O[28]||(O[28]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(Ue.value)+" in flight ",1)],2),Ge.value?(p(),m("span",{key:0,class:Ce(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ft.warning])},[O[29]||(O[29]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(Ge.value)+" offline ",1)],2)):$("",!0)])]),le.value.length?(p(),m("div",nS,[a("table",iS,[a("thead",null,[a("tr",oS,[(p(),m(re,null,$e(["Aircraft","Mission","Status","Alt","Battery","Speed",""],W=>a("th",{key:W,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"},x(W),1)),64))])]),a("tbody",null,[(p(!0),m(re,null,$e(le.value,(W,vt)=>(p(),m("tr",{key:W.id,class:Ce(["cursor-pointer transition hover:bg-surface-2",vtjn(W.id)},[a("td",aS,x(W.id),1),a("td",rS,x(W.mission),1),a("td",lS,[a("span",{class:Ce(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ft[W.tone]])},[O[31]||(O[31]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(W.status),1)],2)]),a("td",uS,x(W.alt),1),a("td",cS,[W.battery!=null?(p(),m("div",dS,[a("div",fS,[a("div",{class:Ce(["h-full",W.battery<40?"bg-caution":"bg-ready"]),style:Eo({width:W.battery+"%"})},null,6)]),a("span",hS,x(W.battery)+"%",1)])):(p(),m("span",pS,"—"))]),a("td",mS,[z(x(W.speed==null?"—":W.speed.toFixed(1))+" ",1),O[32]||(O[32]=a("span",{class:"text-ink-muted"},"m/s",-1))]),a("td",gS,[a("button",{class:"btn-ghost inline-flex items-center gap-1.5 whitespace-nowrap",onClick:hl(_t=>jn(W.id),["stop"])},[A(ee,{name:"play",size:14}),O[33]||(O[33]=z(" Track ",-1))],8,vS)])],10,sS))),128))])])])):(p(),m("div",tS," No aircraft connected yet. Devices appear here as they come online. "))])])):Ee.value==="Live flights"?(p(),m("div",_S,[a("div",bS,[a("span",yS,x(h.value||"No device selected"),1),q.value&&!J.value?(p(),m("span",xS,"Offline")):$("",!0),S.value.length?(p(),m("div",wS,[(p(!0),m(re,null,$e(S.value,W=>(p(),m("button",{key:W,class:Ce(["flex items-center gap-2 rounded border px-3 py-1.5 font-mono text-xs font-bold transition",W===h.value?"border-accent bg-accent-soft text-accent-soft-fg":"border-line bg-surface-1 text-ink-secondary hover:border-line-strong"]),onClick:vt=>h.value=W},[a("span",{class:Ce(["h-2 w-2 rounded-full",u[W].online?"bg-ready":"bg-ink-muted"])},null,2),z(" "+x(W),1)],10,kS))),128))])):$("",!0)]),S.value.length?(p(),m(re,{key:1},[a("div",{class:Ce(["mb-4 grid gap-3",!J.value&&q.value?"opacity-60":""]),style:{"grid-template-columns":"repeat(auto-fit, minmax(150px, 1fr))"}},[a("div",TS,[O[36]||(O[36]=a("div",{class:"eyebrow"},"Registration",-1)),a("div",{class:Ce(["mt-1 text-sm font-semibold",J.value?((ze=q.value)==null?void 0:ze.registration)==="success"?"text-success-fg":"text-danger-fg":"text-ink"])},x(J.value&&((tt=q.value)!=null&&tt.registration)?q.value.registration:"—"),3)]),a("div",PS,[O[37]||(O[37]=a("div",{class:"eyebrow"},"Drone link",-1)),a("div",{class:Ce(["mt-1 text-sm font-semibold",J.value?(It=q.value)!=null&&It.connected?"text-success-fg":"text-danger-fg":"text-ink"])},x(q.value?J.value?q.value.connected?"connected":"no drone":"app offline":"—"),3)]),a("div",CS,[O[38]||(O[38]=a("div",{class:"eyebrow"},"Model",-1)),a("div",LS,x(((kt=q.value)==null?void 0:kt.model)||"—"),1)]),a("div",AS,[O[39]||(O[39]=a("div",{class:"eyebrow"},"Last update",-1)),a("div",MS,x((Et=q.value)!=null&&Et.lastSeenMs?Ie(ku)(q.value.lastSeenMs):"—"),1)])],2),a("div",ES,[a("div",OS,[O[41]||(O[41]=a("div",{class:"mb-3 eyebrow"},"Battery",-1)),a("div",zS,[a("div",$S,[a("div",{class:Ce(["h-full transition-all",typeof j.value.batteryPercent=="number"?j.value.batteryPercent<20?"bg-warning":j.value.batteryPercent<40?"bg-caution":"bg-ready":""]),style:Eo({width:(typeof j.value.batteryPercent=="number"?j.value.batteryPercent:0)+"%"})},null,6)]),a("div",IS,[z(x(typeof j.value.batteryPercent=="number"?j.value.batteryPercent:"—"),1),O[40]||(O[40]=a("span",{class:"text-sm text-ink-secondary"},"%",-1))])])]),a("div",NS,[O[43]||(O[43]=a("div",{class:"mb-3 eyebrow"},"Altitude",-1)),a("div",FS,[z(x(Gt(j.value.altitude,1)),1),O[42]||(O[42]=a("span",{class:"text-sm text-ink-secondary"}," m",-1))])]),a("div",DS,[O[48]||(O[48]=a("div",{class:"mb-3 eyebrow"},"Flight",-1)),a("div",RS,[a("div",BS,[O[44]||(O[44]=a("span",{class:"text-ink-secondary"},"Mode",-1)),a("b",US,x(j.value.flightMode||"—"),1)]),a("div",VS,[O[45]||(O[45]=a("span",{class:"text-ink-secondary"},"Flying",-1)),a("b",ZS,x(j.value.isFlying==null?"—":j.value.isFlying?"yes":"no"),1)]),a("div",HS,[O[46]||(O[46]=a("span",{class:"text-ink-secondary"},"GPS sats",-1)),a("b",jS,x(j.value.satelliteCount==null?"—":j.value.satelliteCount),1)]),a("div",WS,[O[47]||(O[47]=a("span",{class:"text-ink-secondary"},"Speed (H)",-1)),a("b",KS,x(ae.value==null?"—":Gt(ae.value,2," m/s")),1)])])]),a("div",GS,[O[52]||(O[52]=a("div",{class:"mb-3 eyebrow"},"Position",-1)),a("div",qS,[a("div",YS,[O[49]||(O[49]=a("span",{class:"text-ink-secondary"},"Latitude",-1)),a("b",JS,x(Gt(j.value.latitude,6)),1)]),a("div",XS,[O[50]||(O[50]=a("span",{class:"text-ink-secondary"},"Longitude",-1)),a("b",QS,x(Gt(j.value.longitude,6)),1)]),a("div",e5,[O[51]||(O[51]=a("span",{class:"text-ink-secondary"},"Vert. speed",-1)),a("b",t5,x(Gt(typeof j.value.velocityZ=="number"?-j.value.velocityZ:void 0,2," m/s")),1)])])]),a("div",n5,[O[53]||(O[53]=a("div",{class:"mb-3 eyebrow"},"Track",-1)),A(Cu,{position:ce.value,trail:ue.value},null,8,["position","trail"])]),a("div",i5,[O[54]||(O[54]=a("div",{class:"mb-3 eyebrow"},"Send command",-1)),a("div",o5,[oe(a("input",{"onUpdate:modelValue":O[7]||(O[7]=W=>At.value=W),class:"field flex-1",placeholder:"command (e.g. startConnection)"},null,512),[[ge,At.value]]),oe(a("input",{"onUpdate:modelValue":O[8]||(O[8]=W=>Ut.value=W),class:"field flex-1",placeholder:"payload JSON (optional)"},null,512),[[ge,Ut.value]]),a("button",{class:"btn-accent",onClick:Ii},"Send")]),a("div",s5,x(Pt.value),1)]),a("div",a5,[O[55]||(O[55]=a("div",{class:"mb-3 eyebrow"},"Event log",-1)),a("div",r5,[(p(!0),m(re,null,$e(b,(W,vt)=>(p(),m("div",{key:vt,class:"border-b border-line py-1"},[a("span",l5,x(W.t),1),a("span",u5,x(W.tag),1),a("span",c5,x(W.text),1)]))),128))])])])],64)):(p(),m("div",SS,[A(ee,{name:"radio",size:28,class:"text-ink-muted"}),O[34]||(O[34]=a("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No aircraft online",-1)),O[35]||(O[35]=a("div",{class:"mt-1 text-xs text-ink-muted"},"Live telemetry appears here once a drone connects.",-1))]))])):Ee.value==="Logbook"?(p(),nt(vx,{key:2,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):Ee.value==="Drones"?(p(),nt(h0,{key:3,ref_key:"dronesView",ref:kn,"connected-fc-serials":Te.value,onDeleted:at},null,8,["connected-fc-serials"])):Ee.value==="Routes"?(p(),nt(N2,{key:4})):Ee.value==="Documents"?(p(),nt(Xw,{key:5,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):Ee.value==="Settings"?(p(),nt(ty,{key:6,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName,onLogout:O[9]||(O[9]=W=>l("logout"))},null,8,["email","role","organization","organization-name"])):(p(),m("div",d5,[a("div",f5,[A(ee,{name:zt.value,size:28,class:"text-ink-muted"},null,8,["name"]),a("div",h5,x(Ee.value),1),Ee.value==="Drives"?(p(),m("div",p5,[O[56]||(O[56]=z(" Browse and transfer files here once a drive is connected. Configure drives in ",-1)),a("button",{class:"font-semibold text-accent hover:underline",onClick:O[10]||(O[10]=W=>Ee.value="Settings")},"Settings → Integrations"),O[57]||(O[57]=z(". ",-1))])):(p(),m("div",m5,"This section is part of the console shell and has no backend yet."))])]))])])}}},b5={key:0,class:"h-full"},y5={key:1,class:"grid h-full place-items-center text-ink-muted text-sm"},x5={__name:"App",setup(t){const i=Y(!1),s=Y(null),l=Y("user"),u=Y(""),f=Y(""),h=Y("");function _(T){l.value=T&&T.role||"user",u.value=T&&T.organization||"",f.value=T&&T.organizationName||""}ti(async()=>{h.value=(await Qh()).apiBase||"";const T=await _u();T&&(s.value=T.email,_(T),await Tu()),i.value=!0});async function b(T){s.value=T,_(await _u()),await Tu()}async function C(){jp(),await tp(),s.value=null,l.value="user",u.value="",f.value=""}return(T,E)=>i.value?(p(),m("div",b5,[s.value?(p(),nt(_5,{key:0,email:s.value,role:l.value,organization:u.value,"organization-name":f.value,onLogout:C},null,8,["email","role","organization","organization-name"])):(p(),nt(lm,{key:1,"default-api-base":h.value,onSignedIn:b},null,8,["default-api-base"]))])):(p(),m("div",y5,"Loading…"))}};qh(x5).mount("#app"); diff --git a/Web App/server/dist/assets/index-DwIAtafL.js b/Web App/server/dist/assets/index-DwIAtafL.js deleted file mode 100644 index 4224688..0000000 --- a/Web App/server/dist/assets/index-DwIAtafL.js +++ /dev/null @@ -1,20 +0,0 @@ -(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))l(u);new MutationObserver(u=>{for(const f of u)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&l(h)}).observe(document,{childList:!0,subtree:!0});function s(u){const f={};return u.integrity&&(f.integrity=u.integrity),u.referrerPolicy&&(f.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?f.credentials="include":u.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function l(u){if(u.ep)return;u.ep=!0;const f=s(u);fetch(u.href,f)}})();/** -* @vue/shared v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function Xr(t){const i=Object.create(null);for(const s of t.split(","))i[s]=1;return s=>s in i}const vt={},es=[],ci=()=>{},zu=()=>!1,ja=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Wa=t=>t.startsWith("onUpdate:"),Kt=Object.assign,Qr=(t,i)=>{const s=t.indexOf(i);s>-1&&t.splice(s,1)},pd=Object.prototype.hasOwnProperty,ct=(t,i)=>pd.call(t,i),Ne=Array.isArray,ts=t=>ea(t)==="[object Map]",ls=t=>ea(t)==="[object Set]",Al=t=>ea(t)==="[object Date]",je=t=>typeof t=="function",Tt=t=>typeof t=="string",Qn=t=>typeof t=="symbol",dt=t=>t!==null&&typeof t=="object",$u=t=>(dt(t)||je(t))&&je(t.then)&&je(t.catch),Iu=Object.prototype.toString,ea=t=>Iu.call(t),md=t=>ea(t).slice(8,-1),Nu=t=>ea(t)==="[object Object]",el=t=>Tt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Rs=Xr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ka=t=>{const i=Object.create(null);return(s=>i[s]||(i[s]=t(s)))},gd=/-\w/g,Jn=Ka(t=>t.replace(gd,i=>i.slice(1).toUpperCase())),vd=/\B([A-Z])/g,to=Ka(t=>t.replace(vd,"-$1").toLowerCase()),Fu=Ka(t=>t.charAt(0).toUpperCase()+t.slice(1)),xr=Ka(t=>t?`on${Fu(t)}`:""),ui=(t,i)=>!Object.is(t,i),Ea=(t,...i)=>{for(let s=0;s{Object.defineProperty(t,i,{configurable:!0,enumerable:!1,writable:l,value:s})},Ga=t=>{const i=parseFloat(t);return isNaN(i)?t:i},_d=t=>{const i=Tt(t)?Number(t):NaN;return isNaN(i)?t:i};let Ml;const qa=()=>Ml||(Ml=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Eo(t){if(Ne(t)){const i={};for(let s=0;s{if(s){const l=s.split(yd);l.length>1&&(i[l[0].trim()]=l[1].trim())}}),i}function Pe(t){let i="";if(Tt(t))i=t;else if(Ne(t))for(let s=0;sXi(s,i))}const Bu=t=>!!(t&&t.__v_isRef===!0),x=t=>Tt(t)?t:t==null?"":Ne(t)||dt(t)&&(t.toString===Iu||!je(t.toString))?Bu(t)?x(t.value):JSON.stringify(t,Uu,2):String(t),Uu=(t,i)=>Bu(i)?Uu(t,i.value):ts(i)?{[`Map(${i.size})`]:[...i.entries()].reduce((s,[l,u],f)=>(s[wr(l,f)+" =>"]=u,s),{})}:ls(i)?{[`Set(${i.size})`]:[...i.values()].map(s=>wr(s))}:Qn(i)?wr(i):dt(i)&&!Ne(i)&&!Nu(i)?String(i):i,wr=(t,i="")=>{var s;return Qn(t)?`Symbol(${(s=t.description)!=null?s:i})`:t};/** -* @vue/reactivity v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let Yt;class Pd{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&&Yt&&(Yt.active?(this.parent=Yt,this.index=(Yt.scopes||(Yt.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let i,s;if(this.scopes)for(i=0,s=this.scopes.length;i0&&--this._on===0){if(Yt===this)Yt=this.prevScope;else{let i=Yt;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 s,l;for(s=0,l=this.effects.length;s0)return;if(Us){let i=Us;for(Us=void 0;i;){const s=i.next;i.next=void 0,i.flags&=-9,i=s}}let t;for(;Bs;){let i=Bs;for(Bs=void 0;i;){const s=i.next;if(i.next=void 0,i.flags&=-9,i.flags&1)try{i.trigger()}catch(l){t||(t=l)}i=s}}if(t)throw t}function ju(t){for(let i=t.deps;i;i=i.nextDep)i.version=-1,i.prevActiveLink=i.dep.activeLink,i.dep.activeLink=i}function Wu(t){let i,s=t.depsTail,l=s;for(;l;){const u=l.prevDep;l.version===-1?(l===s&&(s=u),ol(l),Ld(l)):i=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=u}t.deps=i,t.depsTail=s}function Ir(t){for(let i=t.deps;i;i=i.nextDep)if(i.dep.version!==i.version||i.dep.computed&&(Ku(i.dep.computed)||i.dep.version!==i.version))return!0;return!!t._dirty}function Ku(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Ws)||(t.globalVersion=Ws,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Ir(t))))return;t.flags|=2;const i=t.dep,s=xt,l=Xn;xt=t,Xn=!0;try{ju(t);const u=t.fn(t._value);(i.version===0||ui(u,t._value))&&(t.flags|=128,t._value=u,i.version++)}catch(u){throw i.version++,u}finally{xt=s,Xn=l,Wu(t),t.flags&=-3}}function ol(t,i=!1){const{dep:s,prevSub:l,nextSub:u}=t;if(l&&(l.nextSub=u,t.prevSub=void 0),u&&(u.prevSub=l,t.nextSub=void 0),s.subs===t&&(s.subs=l,!l&&s.computed)){s.computed.flags&=-5;for(let f=s.computed.deps;f;f=f.nextDep)ol(f,!0)}!i&&!--s.sc&&s.map&&s.map.delete(s.key)}function Ld(t){const{prevDep:i,nextDep:s}=t;i&&(i.nextDep=s,t.prevDep=void 0),s&&(s.prevDep=i,t.nextDep=void 0)}let Xn=!0;const Gu=[];function di(){Gu.push(Xn),Xn=!1}function fi(){const t=Gu.pop();Xn=t===void 0?!0:t}function El(t){const{cleanup:i}=t;if(t.cleanup=void 0,i){const s=xt;xt=void 0;try{i()}finally{xt=s}}}let Ws=0;class Ad{constructor(i,s){this.sub=i,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class sl{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(!xt||!Xn||xt===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==xt)s=this.activeLink=new Ad(xt,this),xt.deps?(s.prevDep=xt.depsTail,xt.depsTail.nextDep=s,xt.depsTail=s):xt.deps=xt.depsTail=s,qu(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const l=s.nextDep;l.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=l),s.prevDep=xt.depsTail,s.nextDep=void 0,xt.depsTail.nextDep=s,xt.depsTail=s,xt.deps===s&&(xt.deps=l)}return s}trigger(i){this.version++,Ws++,this.notify(i)}notify(i){nl();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{il()}}}function qu(t){if(t.dep.sc++,t.sub.flags&4){const i=t.dep.computed;if(i&&!t.dep.subs){i.flags|=20;for(let l=i.deps;l;l=l.nextDep)qu(l)}const s=t.dep.subs;s!==t&&(t.prevSub=s,s&&(s.nextSub=t)),t.dep.subs=t}}const Nr=new WeakMap,Ao=Symbol(""),Fr=Symbol(""),Ks=Symbol("");function on(t,i,s){if(Xn&&xt){let l=Nr.get(t);l||Nr.set(t,l=new Map);let u=l.get(s);u||(l.set(s,u=new sl),u.map=l,u.key=s),u.track()}}function Li(t,i,s,l,u,f){const h=Nr.get(t);if(!h){Ws++;return}const _=b=>{b&&b.trigger()};if(nl(),i==="clear")h.forEach(_);else{const b=Ne(t),C=b&&el(s);if(b&&s==="length"){const T=Number(l);h.forEach((M,H)=>{(H==="length"||H===Ks||!Qn(H)&&H>=T)&&_(M)})}else switch((s!==void 0||h.has(void 0))&&_(h.get(s)),C&&_(h.get(Ks)),i){case"add":b?C&&_(h.get("length")):(_(h.get(Ao)),ts(t)&&_(h.get(Fr)));break;case"delete":b||(_(h.get(Ao)),ts(t)&&_(h.get(Fr)));break;case"set":ts(t)&&_(h.get(Ao));break}}il()}function Xo(t){const i=ut(t);return i===t?i:(on(i,"iterate",Ks),Vn(t)?i:i.map(ei))}function Ya(t){return on(t=ut(t),"iterate",Ks),t}function ri(t,i){return Ei(t)?as(Mo(t)?ei(i):i):ei(i)}const Md={__proto__:null,[Symbol.iterator](){return Sr(this,Symbol.iterator,t=>ri(this,t))},concat(...t){return Xo(this).concat(...t.map(i=>Ne(i)?Xo(i):i))},entries(){return Sr(this,"entries",t=>(t[1]=ri(this,t[1]),t))},every(t,i){return Si(this,"every",t,i,void 0,arguments)},filter(t,i){return Si(this,"filter",t,i,s=>s.map(l=>ri(this,l)),arguments)},find(t,i){return Si(this,"find",t,i,s=>ri(this,s),arguments)},findIndex(t,i){return Si(this,"findIndex",t,i,void 0,arguments)},findLast(t,i){return Si(this,"findLast",t,i,s=>ri(this,s),arguments)},findLastIndex(t,i){return Si(this,"findLastIndex",t,i,void 0,arguments)},forEach(t,i){return Si(this,"forEach",t,i,void 0,arguments)},includes(...t){return Tr(this,"includes",t)},indexOf(...t){return Tr(this,"indexOf",t)},join(t){return Xo(this).join(t)},lastIndexOf(...t){return Tr(this,"lastIndexOf",t)},map(t,i){return Si(this,"map",t,i,void 0,arguments)},pop(){return Es(this,"pop")},push(...t){return Es(this,"push",t)},reduce(t,...i){return Ol(this,"reduce",t,i)},reduceRight(t,...i){return Ol(this,"reduceRight",t,i)},shift(){return Es(this,"shift")},some(t,i){return Si(this,"some",t,i,void 0,arguments)},splice(...t){return Es(this,"splice",t)},toReversed(){return Xo(this).toReversed()},toSorted(t){return Xo(this).toSorted(t)},toSpliced(...t){return Xo(this).toSpliced(...t)},unshift(...t){return Es(this,"unshift",t)},values(){return Sr(this,"values",t=>ri(this,t))}};function Sr(t,i,s){const l=Ya(t),u=l[i]();return l!==t&&!Vn(t)&&(u._next=u.next,u.next=()=>{const f=u._next();return f.done||(f.value=s(f.value)),f}),u}const Ed=Array.prototype;function Si(t,i,s,l,u,f){const h=Ya(t),_=h!==t&&!Vn(t),b=h[i];if(b!==Ed[i]){const M=b.apply(t,f);return _?ei(M):M}let C=s;h!==t&&(_?C=function(M,H){return s.call(this,ri(t,M),H,t)}:s.length>2&&(C=function(M,H){return s.call(this,M,H,t)}));const T=b.call(h,C,l);return _&&u?u(T):T}function Ol(t,i,s,l){const u=Ya(t),f=u!==t&&!Vn(t);let h=s,_=!1;u!==t&&(f?(_=l.length===0,h=function(C,T,M){return _&&(_=!1,C=ri(t,C)),s.call(this,C,ri(t,T),M,t)}):s.length>3&&(h=function(C,T,M){return s.call(this,C,T,M,t)}));const b=u[i](h,...l);return _?ri(t,b):b}function Tr(t,i,s){const l=ut(t);on(l,"iterate",Ks);const u=l[i](...s);return(u===-1||u===!1)&&ll(s[0])?(s[0]=ut(s[0]),l[i](...s)):u}function Es(t,i,s=[]){di(),nl();const l=ut(t)[i].apply(t,s);return il(),fi(),l}const Od=Xr("__proto__,__v_isRef,__isVue"),Yu=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Qn));function zd(t){Qn(t)||(t=String(t));const i=ut(this);return on(i,"has",t),i.hasOwnProperty(t)}class Ju{constructor(i=!1,s=!1){this._isReadonly=i,this._isShallow=s}get(i,s,l){if(s==="__v_skip")return i.__v_skip;const u=this._isReadonly,f=this._isShallow;if(s==="__v_isReactive")return!u;if(s==="__v_isReadonly")return u;if(s==="__v_isShallow")return f;if(s==="__v_raw")return l===(u?f?Zd:tc:f?ec:Qu).get(i)||Object.getPrototypeOf(i)===Object.getPrototypeOf(l)?i:void 0;const h=Ne(i);if(!u){let b;if(h&&(b=Md[s]))return b;if(s==="hasOwnProperty")return zd}const _=Reflect.get(i,s,rn(i)?i:l);if((Qn(s)?Yu.has(s):Od(s))||(u||on(i,"get",s),f))return _;if(rn(_)){const b=h&&el(s)?_:_.value;return u&&dt(b)?Rr(b):b}return dt(_)?u?Rr(_):gt(_):_}}class Xu extends Ju{constructor(i=!1){super(!1,i)}set(i,s,l,u){let f=i[s];const h=Ne(i)&&el(s);if(!this._isShallow){const C=Ei(f);if(!Vn(l)&&!Ei(l)&&(f=ut(f),l=ut(l)),!h&&rn(f)&&!rn(l))return C||(f.value=l),!0}const _=h?Number(s)t,Ta=t=>Reflect.getPrototypeOf(t);function Dd(t,i,s){return function(...l){const u=this.__v_raw,f=ut(u),h=ts(f),_=t==="entries"||t===Symbol.iterator&&h,b=t==="keys"&&h,C=u[t](...l),T=s?Dr:i?as:ei;return!i&&on(f,"iterate",b?Fr:Ao),Kt(Object.create(C),{next(){const{value:M,done:H}=C.next();return H?{value:M,done:H}:{value:_?[T(M[0]),T(M[1])]:T(M),done:H}}})}}function Pa(t){return function(...i){return t==="delete"?!1:t==="clear"?void 0:this}}function Rd(t,i){const s={get(u){const f=this.__v_raw,h=ut(f),_=ut(u);t||(ui(u,_)&&on(h,"get",u),on(h,"get",_));const{has:b}=Ta(h),C=i?Dr:t?as:ei;if(b.call(h,u))return C(f.get(u));if(b.call(h,_))return C(f.get(_));f!==h&&f.get(u)},get size(){const u=this.__v_raw;return!t&&on(ut(u),"iterate",Ao),u.size},has(u){const f=this.__v_raw,h=ut(f),_=ut(u);return t||(ui(u,_)&&on(h,"has",u),on(h,"has",_)),u===_?f.has(u):f.has(u)||f.has(_)},forEach(u,f){const h=this,_=h.__v_raw,b=ut(_),C=i?Dr:t?as:ei;return!t&&on(b,"iterate",Ao),_.forEach((T,M)=>u.call(f,C(T),C(M),h))}};return Kt(s,t?{add:Pa("add"),set:Pa("set"),delete:Pa("delete"),clear:Pa("clear")}:{add(u){const f=ut(this),h=Ta(f),_=ut(u),b=!i&&!Vn(u)&&!Ei(u)?_:u;return h.has.call(f,b)||ui(u,b)&&h.has.call(f,u)||ui(_,b)&&h.has.call(f,_)||(f.add(b),Li(f,"add",b,b)),this},set(u,f){!i&&!Vn(f)&&!Ei(f)&&(f=ut(f));const h=ut(this),{has:_,get:b}=Ta(h);let C=_.call(h,u);C||(u=ut(u),C=_.call(h,u));const T=b.call(h,u);return h.set(u,f),C?ui(f,T)&&Li(h,"set",u,f):Li(h,"add",u,f),this},delete(u){const f=ut(this),{has:h,get:_}=Ta(f);let b=h.call(f,u);b||(u=ut(u),b=h.call(f,u)),_&&_.call(f,u);const C=f.delete(u);return b&&Li(f,"delete",u,void 0),C},clear(){const u=ut(this),f=u.size!==0,h=u.clear();return f&&Li(u,"clear",void 0,void 0),h}}),["keys","values","entries",Symbol.iterator].forEach(u=>{s[u]=Dd(u,t,i)}),s}function al(t,i){const s=Rd(t,i);return(l,u,f)=>u==="__v_isReactive"?!t:u==="__v_isReadonly"?t:u==="__v_raw"?l:Reflect.get(ct(s,u)&&u in l?s:l,u,f)}const Bd={get:al(!1,!1)},Ud={get:al(!1,!0)},Vd={get:al(!0,!1)};const Qu=new WeakMap,ec=new WeakMap,tc=new WeakMap,Zd=new WeakMap;function Hd(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function gt(t){return Ei(t)?t:rl(t,!1,Id,Bd,Qu)}function jd(t){return rl(t,!1,Fd,Ud,ec)}function Rr(t){return rl(t,!0,Nd,Vd,tc)}function rl(t,i,s,l,u){if(!dt(t)||t.__v_raw&&!(i&&t.__v_isReactive)||t.__v_skip||!Object.isExtensible(t))return t;const f=u.get(t);if(f)return f;const h=Hd(md(t));if(h===0)return t;const _=new Proxy(t,h===2?l:s);return u.set(t,_),_}function Mo(t){return Ei(t)?Mo(t.__v_raw):!!(t&&t.__v_isReactive)}function Ei(t){return!!(t&&t.__v_isReadonly)}function Vn(t){return!!(t&&t.__v_isShallow)}function ll(t){return t?!!t.__v_raw:!1}function ut(t){const i=t&&t.__v_raw;return i?ut(i):t}function Wd(t){return!ct(t,"__v_skip")&&Object.isExtensible(t)&&Du(t,"__v_skip",!0),t}const ei=t=>dt(t)?gt(t):t,as=t=>dt(t)?Rr(t):t;function rn(t){return t?t.__v_isRef===!0:!1}function Y(t){return Kd(t,!1)}function Kd(t,i){return rn(t)?t:new Gd(t,i)}class Gd{constructor(i,s){this.dep=new sl,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?i:ut(i),this._value=s?i:ei(i),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(i){const s=this._rawValue,l=this.__v_isShallow||Vn(i)||Ei(i);i=l?i:ut(i),ui(i,s)&&(this._rawValue=i,this._value=l?i:ei(i),this.dep.trigger())}}function $e(t){return rn(t)?t.value:t}const qd={get:(t,i,s)=>i==="__v_raw"?t:$e(Reflect.get(t,i,s)),set:(t,i,s,l)=>{const u=t[i];return rn(u)&&!rn(s)?(u.value=s,!0):Reflect.set(t,i,s,l)}};function nc(t){return Mo(t)?t:new Proxy(t,qd)}class Yd{constructor(i,s,l){this.fn=i,this.setter=s,this._value=void 0,this.dep=new sl(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ws-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=l}notify(){if(this.flags|=16,!(this.flags&8)&&xt!==this)return Hu(this,!0),!0}get value(){const i=this.dep.track();return Ku(this),i&&(i.version=this.dep.version),this._value}set value(i){this.setter&&this.setter(i)}}function Jd(t,i,s=!1){let l,u;return je(t)?l=t:(l=t.get,u=t.set),new Yd(l,u,s)}const Ca={},za=new WeakMap;let Po;function Xd(t,i=!1,s=Po){if(s){let l=za.get(s);l||za.set(s,l=[]),l.push(t)}}function Qd(t,i,s=vt){const{immediate:l,deep:u,once:f,scheduler:h,augmentJob:_,call:b}=s,C=ue=>u?ue:Vn(ue)||u===!1||u===0?Ai(ue,1):Ai(ue);let T,M,H,j,G=!1,N=!1;if(rn(t)?(M=()=>t.value,G=Vn(t)):Mo(t)?(M=()=>C(t),G=!0):Ne(t)?(N=!0,G=t.some(ue=>Mo(ue)||Vn(ue)),M=()=>t.map(ue=>{if(rn(ue))return ue.value;if(Mo(ue))return C(ue);if(je(ue))return b?b(ue,2):ue()})):je(t)?i?M=b?()=>b(t,2):t:M=()=>{if(H){di();try{H()}finally{fi()}}const ue=Po;Po=T;try{return b?b(t,3,[j]):t(j)}finally{Po=ue}}:M=ci,i&&u){const ue=M,ke=u===!0?1/0:u;M=()=>Ai(ue(),ke)}const U=Cd(),R=()=>{T.stop(),U&&U.active&&Qr(U.effects,T)};if(f&&i){const ue=i;i=(...ke)=>{const Ce=ue(...ke);return R(),Ce}}let oe=N?new Array(t.length).fill(Ca):Ca;const we=ue=>{if(!(!(T.flags&1)||!T.dirty&&!ue))if(i){const ke=T.run();if(ue||u||G||(N?ke.some((Ce,Le)=>ui(Ce,oe[Le])):ui(ke,oe))){H&&H();const Ce=Po;Po=T;try{const Le=[ke,oe===Ca?void 0:N&&oe[0]===Ca?[]:oe,j];oe=ke,b?b(i,3,Le):i(...Le)}finally{Po=Ce}}}else T.run()};return _&&_(we),T=new Vu(M),T.scheduler=h?()=>h(we,!1):we,j=ue=>Xd(ue,!1,T),H=T.onStop=()=>{const ue=za.get(T);if(ue){if(b)b(ue,4);else for(const ke of ue)ke();za.delete(T)}},i?l?we(!0):oe=T.run():h?h(we.bind(null,!0),!0):T.run(),R.pause=T.pause.bind(T),R.resume=T.resume.bind(T),R.stop=R,R}function Ai(t,i=1/0,s){if(i<=0||!dt(t)||t.__v_skip||(s=s||new Map,(s.get(t)||0)>=i))return t;if(s.set(t,i),i--,rn(t))Ai(t.value,i,s);else if(Ne(t))for(let l=0;l{Ai(l,i,s)});else if(Nu(t)){for(const l in t)Ai(t[l],i,s);for(const l of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,l)&&Ai(t[l],i,s)}return t}/** -* @vue/runtime-core v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function ta(t,i,s,l){try{return l?t(...l):t()}catch(u){Ja(u,i,s)}}function Hn(t,i,s,l){if(je(t)){const u=ta(t,i,s,l);return u&&$u(u)&&u.catch(f=>{Ja(f,i,s)}),u}if(Ne(t)){const u=[];for(let f=0;f>>1,u=fn[l],f=Gs(u);f=Gs(s)?fn.push(t):fn.splice(tf(i),0,t),t.flags|=1,sc()}}function sc(){$a||($a=ic.then(rc))}function nf(t){Ne(t)?ns.push(...t):Ji&&t.id===-1?Ji.splice(Qo+1,0,t):t.flags&1||(ns.push(t),t.flags|=1),sc()}function zl(t,i,s=ai+1){for(;sGs(s)-Gs(l));if(ns.length=0,Ji){Ji.push(...i);return}for(Ji=i,Qo=0;Qot.id==null?t.flags&2?-1:1/0:t.id;function rc(t){try{for(ai=0;ai{l._d&&Da(-1);const f=Ia(i);let h;try{h=t(...u)}finally{Ia(f),l._d&&Da(1)}return h};return l._n=!0,l._c=!0,l._d=!0,l}function ie(t,i){if(an===null)return t;const s=nr(an),l=t.dirs||(t.dirs=[]);for(let u=0;u1)return s&&je(i)?i.call(l&&l.proxy):i}}const of=Symbol.for("v-scx"),sf=()=>Vs(of);function Bt(t,i,s){return cc(t,i,s)}function cc(t,i,s=vt){const{immediate:l,deep:u,flush:f,once:h}=s,_=Kt({},s),b=i&&l||!i&&f!=="post";let C;if(Xs){if(f==="sync"){const j=sf();C=j.__watcherHandles||(j.__watcherHandles=[])}else if(!b){const j=()=>{};return j.stop=ci,j.resume=ci,j.pause=ci,j}}const T=hn;_.call=(j,G,N)=>Hn(j,T,G,N);let M=!1;f==="post"?_.scheduler=j=>{dn(j,T&&T.suspense)}:f!=="sync"&&(M=!0,_.scheduler=(j,G)=>{G?j():ul(j)}),_.augmentJob=j=>{i&&(j.flags|=4),M&&(j.flags|=2,T&&(j.id=T.uid,j.i=T))};const H=Qd(t,i,_);return Xs&&(C?C.push(H):b&&H()),H}function af(t,i,s){const l=this.proxy,u=Tt(t)?t.includes(".")?dc(l,t):()=>l[t]:t.bind(l,l);let f;je(i)?f=i:(f=i.handler,s=i);const h=na(this),_=cc(u,f.bind(l),s);return h(),_}function dc(t,i){const s=i.split(".");return()=>{let l=t;for(let u=0;ut.__isTeleport,Co=t=>t&&(t.disabled||t.disabled===""),rf=t=>t&&(t.defer||t.defer===""),$l=t=>typeof SVGElement<"u"&&t instanceof SVGElement,Il=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Br=(t,i)=>{const s=t&&t.to;return Tt(s)?i?i(s):null:s},lf={name:"Teleport",__isTeleport:!0,process(t,i,s,l,u,f,h,_,b,C){const{mc:T,pc:M,pbc:H,o:{insert:j,querySelector:G,createText:N,createComment:U,parentNode:R}}=C,oe=Co(i.props);let{dynamicChildren:we}=i;const ue=(Le,Ze,he)=>{Le.shapeFlag&16&&T(Le.children,Ze,he,u,f,h,_,b)},ke=(Le=i)=>{const Ze=Co(Le.props),he=Le.target=Br(Le.props,G),ee=Ur(he,Le,N,j);he&&(h!=="svg"&&$l(he)?h="svg":h!=="mathml"&&Il(he)&&(h="mathml"),u&&u.isCE&&(u.ce._teleportTargets||(u.ce._teleportTargets=new Set)).add(he),Ze||(ue(Le,he,ee),Is(Le,!1)))},Ce=Le=>{const Ze=()=>{if(Yi.get(Le)===Ze){if(Yi.delete(Le),Co(Le.props)){const he=R(Le.el)||s;ue(Le,he,Le.anchor),Is(Le,!0)}ke(Le)}};Yi.set(Le,Ze),dn(Ze,f)};if(t==null){const Le=i.el=N(""),Ze=i.anchor=N("");if(j(Le,s,l),j(Ze,s,l),rf(i.props)||f&&f.pendingBranch){Ce(i);return}oe&&(ue(i,s,Ze),Is(i,!0)),ke()}else{i.el=t.el;const Le=i.anchor=t.anchor,Ze=Yi.get(t);if(Ze){Ze.flags|=8,Yi.delete(t),Ce(i);return}i.targetStart=t.targetStart;const he=i.target=t.target,ee=i.targetAnchor=t.targetAnchor,V=Co(t.props),O=V?s:he,F=V?Le:ee;if(h==="svg"||$l(he)?h="svg":(h==="mathml"||Il(he))&&(h="mathml"),we?(H(t.dynamicChildren,we,O,u,f,h,_),fl(t,i,!0)):b||M(t,i,O,F,u,f,h,_,!1),oe)V?i.props&&t.props&&i.props.to!==t.props.to&&(i.props.to=t.props.to):La(i,s,Le,C,1);else if((i.props&&i.props.to)!==(t.props&&t.props.to)){const $=Br(i.props,G);$&&(i.target=$,La(i,$,null,C,0))}else V&&La(i,he,ee,C,1);Is(i,oe)}},remove(t,i,s,{um:l,o:{remove:u}},f){const{shapeFlag:h,children:_,anchor:b,targetStart:C,targetAnchor:T,target:M,props:H}=t,j=Co(H),G=f||!j,N=Yi.get(t);if(N&&(N.flags|=8,Yi.delete(t)),M&&(u(C),u(T)),f&&u(b),!N&&(j||M)&&h&16)for(let U=0;U<_.length;U++){const R=_[U];l(R,i,s,G,!!R.dynamicChildren)}},move:La,hydrate:uf};function La(t,i,s,{o:{insert:l},m:u},f=2){f===0&&l(t.targetAnchor,i,s);const{el:h,anchor:_,shapeFlag:b,children:C,props:T}=t,M=f===2;if(M&&l(h,i,s),!Yi.has(t)&&(!M||Co(T))&&b&16)for(let H=0;H{t.isMounted=!0}),us(()=>{t.isUnmounting=!0}),t}const Bn=[Function,Array],pc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Bn,onEnter:Bn,onAfterEnter:Bn,onEnterCancelled:Bn,onBeforeLeave:Bn,onLeave:Bn,onAfterLeave:Bn,onLeaveCancelled:Bn,onBeforeAppear:Bn,onAppear:Bn,onAfterAppear:Bn,onAppearCancelled:Bn},mc=t=>{const i=t.subTree;return i.component?mc(i.component):i},ff={name:"BaseTransition",props:pc,setup(t,{slots:i}){const s=Uc(),l=df();return()=>{const u=i.default&&_c(i.default(),!0),f=u&&u.length?gc(u):s.subTree?I():void 0;if(!f)return;const h=ut(t),{mode:_}=h;if(l.isLeaving)return Pr(f);const b=Nl(f);if(!b)return Pr(f);let C=Vr(b,h,l,s,M=>C=M);b.type!==sn&&qs(b,C);let T=s.subTree&&Nl(s.subTree);if(T&&T.type!==sn&&!Lo(T,b)&&mc(s).type!==sn){let M=Vr(T,h,l,s);if(qs(T,M),_==="out-in"&&b.type!==sn)return l.isLeaving=!0,M.afterLeave=()=>{l.isLeaving=!1,s.job.flags&8||s.update(),delete M.afterLeave,T=void 0},Pr(f);_==="in-out"&&b.type!==sn?M.delayLeave=(H,j,G)=>{const N=vc(l,T);N[String(T.key)]=T,H[Un]=()=>{j(),H[Un]=void 0,delete C.delayedLeave,T=void 0},C.delayedLeave=()=>{G(),delete C.delayedLeave,T=void 0}}:T=void 0}else T&&(T=void 0);return f}}};function gc(t){let i=t[0];if(t.length>1){for(const s of t)if(s.type!==sn){i=s;break}}return i}const hf=ff;function vc(t,i){const{leavingVNodes:s}=t;let l=s.get(i.type);return l||(l=Object.create(null),s.set(i.type,l)),l}function Vr(t,i,s,l,u){const{appear:f,mode:h,persisted:_=!1,onBeforeEnter:b,onEnter:C,onAfterEnter:T,onEnterCancelled:M,onBeforeLeave:H,onLeave:j,onAfterLeave:G,onLeaveCancelled:N,onBeforeAppear:U,onAppear:R,onAfterAppear:oe,onAppearCancelled:we}=i,ue=String(t.key),ke=vc(s,t),Ce=(he,ee)=>{he&&Hn(he,l,9,ee)},Le=(he,ee)=>{const V=ee[1];Ce(he,ee),Ne(he)?he.every(O=>O.length<=1)&&V():he.length<=1&&V()},Ze={mode:h,persisted:_,beforeEnter(he){let ee=b;if(!s.isMounted)if(f)ee=U||b;else return;he[Un]&&he[Un](!0);const V=ke[ue];V&&Lo(t,V)&&V.el[Un]&&V.el[Un](),Ce(ee,[he])},enter(he){if(ke[ue]===t)return;let ee=C,V=T,O=M;if(!s.isMounted)if(f)ee=R||C,V=oe||T,O=we||M;else return;let F=!1;he[Os]=Ye=>{F||(F=!0,Ye?Ce(O,[he]):Ce(V,[he]),Ze.delayedLeave&&Ze.delayedLeave(),he[Os]=void 0)};const $=he[Os].bind(null,!1);ee?Le(ee,[he,$]):$()},leave(he,ee){const V=String(t.key);if(he[Os]&&he[Os](!0),s.isUnmounting)return ee();Ce(H,[he]);let O=!1;he[Un]=$=>{O||(O=!0,ee(),$?Ce(N,[he]):Ce(G,[he]),he[Un]=void 0,ke[V]===t&&delete ke[V])};const F=he[Un].bind(null,!1);ke[V]=t,j?Le(j,[he,F]):F()},clone(he){const ee=Vr(he,i,s,l,u);return u&&u(ee),ee}};return Ze}function Pr(t){if(Xa(t))return t=Qi(t),t.children=null,t}function Nl(t){if(!Xa(t))return hc(t.type)&&t.children?gc(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:i,children:s}=t;if(s){if(i&16)return s[0];if(i&32&&je(s.default))return s.default()}}function qs(t,i){t.shapeFlag&6&&t.component?(t.transition=i,qs(t.component.subTree,i)):t.shapeFlag&128?(t.ssContent.transition=i.clone(t.ssContent),t.ssFallback.transition=i.clone(t.ssFallback)):t.transition=i}function _c(t,i=!1,s){let l=[],u=0;for(let f=0;f1)for(let f=0;fZs(N,i&&(Ne(i)?i[U]:i),s,l,u));return}if(is(l)&&!u){l.shapeFlag&512&&l.type.__asyncResolved&&l.component.subTree.component&&Zs(t,i,s,l.component.subTree);return}const f=l.shapeFlag&4?nr(l.component):l.el,h=u?null:f,{i:_,r:b}=t,C=i&&i.r,T=_.refs===vt?_.refs={}:_.refs,M=_.setupState,H=ut(M),j=M===vt?zu:N=>Fl(T,N)?!1:ct(H,N),G=(N,U)=>!(U&&Fl(T,U));if(C!=null&&C!==b){if(Dl(i),Tt(C))T[C]=null,j(C)&&(M[C]=null);else if(rn(C)){const N=i;G(C,N.k)&&(C.value=null),N.k&&(T[N.k]=null)}}if(je(b)){di();try{ta(b,_,12,[h,T])}finally{fi()}}else{const N=Tt(b),U=rn(b);if(N||U){const R=()=>{if(t.f){const oe=N?j(b)?M[b]:T[b]:G()||!t.k?b.value:T[t.k];if(u)Ne(oe)&&Qr(oe,f);else if(Ne(oe))oe.includes(f)||oe.push(f);else if(N)T[b]=[f],j(b)&&(M[b]=T[b]);else{const we=[f];G(b,t.k)&&(b.value=we),t.k&&(T[t.k]=we)}}else N?(T[b]=h,j(b)&&(M[b]=h)):U&&(G(b,t.k)&&(b.value=h),t.k&&(T[t.k]=h))};if(h){const oe=()=>{R(),Na.delete(t)};oe.id=-1,Na.set(t,oe),dn(oe,s)}else Dl(t),R()}}}function Dl(t){const i=Na.get(t);i&&(i.flags|=8,Na.delete(t))}qa().requestIdleCallback;qa().cancelIdleCallback;const is=t=>!!t.type.__asyncLoader,Xa=t=>t.type.__isKeepAlive;function pf(t,i){yc(t,"a",i)}function mf(t,i){yc(t,"da",i)}function yc(t,i,s=hn){const l=t.__wdc||(t.__wdc=()=>{let u=s;for(;u;){if(u.isDeactivated)return;u=u.parent}return t()});if(Qa(i,l,s),s){let u=s.parent;for(;u&&u.parent;)Xa(u.parent.vnode)&&gf(l,i,s,u),u=u.parent}}function gf(t,i,s,l){const u=Qa(i,t,l,!0);xc(()=>{Qr(l[i],u)},s)}function Qa(t,i,s=hn,l=!1){if(s){const u=s[t]||(s[t]=[]),f=i.__weh||(i.__weh=(...h)=>{di();const _=na(s),b=Hn(i,s,t,h);return _(),fi(),b});return l?u.unshift(f):u.push(f),f}}const Oi=t=>(i,s=hn)=>{(!Xs||t==="sp")&&Qa(t,(...l)=>i(...l),s)},vf=Oi("bm"),ti=Oi("m"),_f=Oi("bu"),bf=Oi("u"),us=Oi("bum"),xc=Oi("um"),yf=Oi("sp"),xf=Oi("rtg"),wf=Oi("rtc");function kf(t,i=hn){Qa("ec",t,i)}const Sf=Symbol.for("v-ndc");function ze(t,i,s,l){let u;const f=s,h=Ne(t);if(h||Tt(t)){const _=h&&Mo(t);let b=!1,C=!1;_&&(b=!Vn(t),C=Ei(t),t=Ya(t)),u=new Array(t.length);for(let T=0,M=t.length;Ti(_,b,void 0,f));else{const _=Object.keys(t);u=new Array(_.length);for(let b=0,C=_.length;b0;return p(),nt(ae,null,[A("slot",s,l)],C?-2:64)}let f=t[i];f&&f._c&&(f._d=!1),p();const h=f&&wc(f(s)),_=s.key||h&&h.key,b=nt(ae,{key:(_&&!Qn(_)?_:`_${i}`)+(!h&&l?"_fb":"")},h||[],h&&t._===1?64:-2);return b.scopeId&&(b.slotScopeIds=[b.scopeId+"-s"]),f&&f._c&&(f._d=!0),b}function wc(t){return t.some(i=>Js(i)?!(i.type===sn||i.type===ae&&!wc(i.children)):!0)?t:null}const Zr=t=>t?Vc(t)?nr(t):Zr(t.parent):null,Hs=Kt(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Zr(t.parent),$root:t=>Zr(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>Sc(t),$forceUpdate:t=>t.f||(t.f=()=>{ul(t.update)}),$nextTick:t=>t.n||(t.n=oc.bind(t.proxy)),$watch:t=>af.bind(t)}),Cr=(t,i)=>t!==vt&&!t.__isScriptSetup&&ct(t,i),Pf={get({_:t},i){if(i==="__v_skip")return!0;const{ctx:s,setupState:l,data:u,props:f,accessCache:h,type:_,appContext:b}=t;if(i[0]!=="$"){const H=h[i];if(H!==void 0)switch(H){case 1:return l[i];case 2:return u[i];case 4:return s[i];case 3:return f[i]}else{if(Cr(l,i))return h[i]=1,l[i];if(u!==vt&&ct(u,i))return h[i]=2,u[i];if(ct(f,i))return h[i]=3,f[i];if(s!==vt&&ct(s,i))return h[i]=4,s[i];Hr&&(h[i]=0)}}const C=Hs[i];let T,M;if(C)return i==="$attrs"&&on(t.attrs,"get",""),C(t);if((T=_.__cssModules)&&(T=T[i]))return T;if(s!==vt&&ct(s,i))return h[i]=4,s[i];if(M=b.config.globalProperties,ct(M,i))return M[i]},set({_:t},i,s){const{data:l,setupState:u,ctx:f}=t;return Cr(u,i)?(u[i]=s,!0):l!==vt&&ct(l,i)?(l[i]=s,!0):ct(t.props,i)||i[0]==="$"&&i.slice(1)in t?!1:(f[i]=s,!0)},has({_:{data:t,setupState:i,accessCache:s,ctx:l,appContext:u,props:f,type:h}},_){let b;return!!(s[_]||t!==vt&&_[0]!=="$"&&ct(t,_)||Cr(i,_)||ct(f,_)||ct(l,_)||ct(Hs,_)||ct(u.config.globalProperties,_)||(b=h.__cssModules)&&b[_])},defineProperty(t,i,s){return s.get!=null?t._.accessCache[i]=0:ct(s,"value")&&this.set(t,i,s.value,null),Reflect.defineProperty(t,i,s)}};function Rl(t){return Ne(t)?t.reduce((i,s)=>(i[s]=null,i),{}):t}let Hr=!0;function Cf(t){const i=Sc(t),s=t.proxy,l=t.ctx;Hr=!1,i.beforeCreate&&Bl(i.beforeCreate,t,"bc");const{data:u,computed:f,methods:h,watch:_,provide:b,inject:C,created:T,beforeMount:M,mounted:H,beforeUpdate:j,updated:G,activated:N,deactivated:U,beforeDestroy:R,beforeUnmount:oe,destroyed:we,unmounted:ue,render:ke,renderTracked:Ce,renderTriggered:Le,errorCaptured:Ze,serverPrefetch:he,expose:ee,inheritAttrs:V,components:O,directives:F,filters:$}=i;if(C&&Lf(C,l,null),h)for(const ge in h){const fe=h[ge];je(fe)&&(l[ge]=fe.bind(s))}if(u){const ge=u.call(s,s);dt(ge)&&(t.data=gt(ge))}if(Hr=!0,f)for(const ge in f){const fe=f[ge],ft=je(fe)?fe.bind(s,s):je(fe.get)?fe.get.bind(s,s):ci,pe=!je(fe)&&je(fe.set)?fe.set.bind(s):ci,Ue=de({get:ft,set:pe});Object.defineProperty(l,ge,{enumerable:!0,configurable:!0,get:()=>Ue.value,set:Ve=>Ue.value=Ve})}if(_)for(const ge in _)kc(_[ge],l,s,ge);if(b){const ge=je(b)?b.call(s):b;Reflect.ownKeys(ge).forEach(fe=>{uc(fe,ge[fe])})}T&&Bl(T,t,"c");function Se(ge,fe){Ne(fe)?fe.forEach(ft=>ge(ft.bind(s))):fe&&ge(fe.bind(s))}if(Se(vf,M),Se(ti,H),Se(_f,j),Se(bf,G),Se(pf,N),Se(mf,U),Se(kf,Ze),Se(wf,Ce),Se(xf,Le),Se(us,oe),Se(xc,ue),Se(yf,he),Ne(ee))if(ee.length){const ge=t.exposed||(t.exposed={});ee.forEach(fe=>{Object.defineProperty(ge,fe,{get:()=>s[fe],set:ft=>s[fe]=ft,enumerable:!0})})}else t.exposed||(t.exposed={});ke&&t.render===ci&&(t.render=ke),V!=null&&(t.inheritAttrs=V),O&&(t.components=O),F&&(t.directives=F),he&&bc(t)}function Lf(t,i,s=ci){Ne(t)&&(t=jr(t));for(const l in t){const u=t[l];let f;dt(u)?"default"in u?f=Vs(u.from||l,u.default,!0):f=Vs(u.from||l):f=Vs(u),rn(f)?Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>f.value,set:h=>f.value=h}):i[l]=f}}function Bl(t,i,s){Hn(Ne(t)?t.map(l=>l.bind(i.proxy)):t.bind(i.proxy),i,s)}function kc(t,i,s,l){let u=l.includes(".")?dc(s,l):()=>s[l];if(Tt(t)){const f=i[t];je(f)&&Bt(u,f)}else if(je(t))Bt(u,t.bind(s));else if(dt(t))if(Ne(t))t.forEach(f=>kc(f,i,s,l));else{const f=je(t.handler)?t.handler.bind(s):i[t.handler];je(f)&&Bt(u,f,t)}}function Sc(t){const i=t.type,{mixins:s,extends:l}=i,{mixins:u,optionsCache:f,config:{optionMergeStrategies:h}}=t.appContext,_=f.get(i);let b;return _?b=_:!u.length&&!s&&!l?b=i:(b={},u.length&&u.forEach(C=>Fa(b,C,h,!0)),Fa(b,i,h)),dt(i)&&f.set(i,b),b}function Fa(t,i,s,l=!1){const{mixins:u,extends:f}=i;f&&Fa(t,f,s,!0),u&&u.forEach(h=>Fa(t,h,s,!0));for(const h in i)if(!(l&&h==="expose")){const _=Af[h]||s&&s[h];t[h]=_?_(t[h],i[h]):i[h]}return t}const Af={data:Ul,props:Vl,emits:Vl,methods:Ns,computed:Ns,beforeCreate:cn,created:cn,beforeMount:cn,mounted:cn,beforeUpdate:cn,updated:cn,beforeDestroy:cn,beforeUnmount:cn,destroyed:cn,unmounted:cn,activated:cn,deactivated:cn,errorCaptured:cn,serverPrefetch:cn,components:Ns,directives:Ns,watch:Ef,provide:Ul,inject:Mf};function Ul(t,i){return i?t?function(){return Kt(je(t)?t.call(this,this):t,je(i)?i.call(this,this):i)}:i:t}function Mf(t,i){return Ns(jr(t),jr(i))}function jr(t){if(Ne(t)){const i={};for(let s=0;si==="modelValue"||i==="model-value"?t.modelModifiers:t[`${i}Modifiers`]||t[`${Jn(i)}Modifiers`]||t[`${to(i)}Modifiers`];function If(t,i,...s){if(t.isUnmounted)return;const l=t.vnode.props||vt;let u=s;const f=i.startsWith("update:"),h=f&&$f(l,i.slice(7));h&&(h.trim&&(u=s.map(T=>Tt(T)?T.trim():T)),h.number&&(u=s.map(Ga)));let _,b=l[_=xr(i)]||l[_=xr(Jn(i))];!b&&f&&(b=l[_=xr(to(i))]),b&&Hn(b,t,6,u);const C=l[_+"Once"];if(C){if(!t.emitted)t.emitted={};else if(t.emitted[_])return;t.emitted[_]=!0,Hn(C,t,6,u)}}const Nf=new WeakMap;function Pc(t,i,s=!1){const l=s?Nf:i.emitsCache,u=l.get(t);if(u!==void 0)return u;const f=t.emits;let h={},_=!1;if(!je(t)){const b=C=>{const T=Pc(C,i,!0);T&&(_=!0,Kt(h,T))};!s&&i.mixins.length&&i.mixins.forEach(b),t.extends&&b(t.extends),t.mixins&&t.mixins.forEach(b)}return!f&&!_?(dt(t)&&l.set(t,null),null):(Ne(f)?f.forEach(b=>h[b]=null):Kt(h,f),dt(t)&&l.set(t,h),h)}function er(t,i){return!t||!ja(i)?!1:(i=i.slice(2),i=i==="Once"?i:i.replace(/Once$/,""),ct(t,i[0].toLowerCase()+i.slice(1))||ct(t,to(i))||ct(t,i))}function Zl(t){const{type:i,vnode:s,proxy:l,withProxy:u,propsOptions:[f],slots:h,attrs:_,emit:b,render:C,renderCache:T,props:M,data:H,setupState:j,ctx:G,inheritAttrs:N}=t,U=Ia(t);let R,oe;try{if(s.shapeFlag&4){const ue=u||l,ke=ue;R=li(C.call(ke,ue,T,M,j,H,G)),oe=_}else{const ue=i;R=li(ue.length>1?ue(M,{attrs:_,slots:h,emit:b}):ue(M,null)),oe=i.props?_:Ff(_)}}catch(ue){js.length=0,Ja(ue,t,1),R=A(sn)}let we=R;if(oe&&N!==!1){const ue=Object.keys(oe),{shapeFlag:ke}=we;ue.length&&ke&7&&(f&&ue.some(Wa)&&(oe=Df(oe,f)),we=Qi(we,oe,!1,!0))}return s.dirs&&(we=Qi(we,null,!1,!0),we.dirs=we.dirs?we.dirs.concat(s.dirs):s.dirs),s.transition&&qs(we,s.transition),R=we,Ia(U),R}const Ff=t=>{let i;for(const s in t)(s==="class"||s==="style"||ja(s))&&((i||(i={}))[s]=t[s]);return i},Df=(t,i)=>{const s={};for(const l in t)(!Wa(l)||!(l.slice(9)in i))&&(s[l]=t[l]);return s};function Rf(t,i,s){const{props:l,children:u,component:f}=t,{props:h,children:_,patchFlag:b}=i,C=f.emitsOptions;if(i.dirs||i.transition)return!0;if(s&&b>=0){if(b&1024)return!0;if(b&16)return l?Hl(l,h,C):!!h;if(b&8){const T=i.dynamicProps;for(let M=0;MObject.create(Lc),Mc=t=>Object.getPrototypeOf(t)===Lc;function Uf(t,i,s,l=!1){const u={},f=Ac();t.propsDefaults=Object.create(null),Ec(t,i,u,f);for(const h in t.propsOptions[0])h in u||(u[h]=void 0);s?t.props=l?u:jd(u):t.type.props?t.props=u:t.props=f,t.attrs=f}function Vf(t,i,s,l){const{props:u,attrs:f,vnode:{patchFlag:h}}=t,_=ut(u),[b]=t.propsOptions;let C=!1;if((l||h>0)&&!(h&16)){if(h&8){const T=t.vnode.dynamicProps;for(let M=0;M{b=!0;const[H,j]=Oc(M,i,!0);Kt(h,H),j&&_.push(...j)};!s&&i.mixins.length&&i.mixins.forEach(T),t.extends&&T(t.extends),t.mixins&&t.mixins.forEach(T)}if(!f&&!b)return dt(t)&&l.set(t,es),es;if(Ne(f))for(let T=0;Tt==="_"||t==="_ctx"||t==="$stable",dl=t=>Ne(t)?t.map(li):[li(t)],Hf=(t,i,s)=>{if(i._n)return i;const l=ye((...u)=>dl(i(...u)),s);return l._c=!1,l},zc=(t,i,s)=>{const l=t._ctx;for(const u in t){if(cl(u))continue;const f=t[u];if(je(f))i[u]=Hf(u,f,l);else if(f!=null){const h=dl(f);i[u]=()=>h}}},$c=(t,i)=>{const s=dl(i);t.slots.default=()=>s},Ic=(t,i,s)=>{for(const l in i)(s||!cl(l))&&(t[l]=i[l])},jf=(t,i,s)=>{const l=t.slots=Ac();if(t.vnode.shapeFlag&32){const u=i._;u?(Ic(l,i,s),s&&Du(l,"_",u,!0)):zc(i,l)}else i&&$c(t,i)},Wf=(t,i,s)=>{const{vnode:l,slots:u}=t;let f=!0,h=vt;if(l.shapeFlag&32){const _=i._;_?s&&_===1?f=!1:Ic(u,i,s):(f=!i.$stable,zc(i,u)),h=i}else i&&($c(t,i),h={default:1});if(f)for(const _ in u)!cl(_)&&h[_]==null&&delete u[_]},dn=Jf;function Kf(t){return Gf(t)}function Gf(t,i){const s=qa();s.__VUE__=!0;const{insert:l,remove:u,patchProp:f,createElement:h,createText:_,createComment:b,setText:C,setElementText:T,parentNode:M,nextSibling:H,setScopeId:j=ci,insertStaticContent:G}=t,N=(w,y,S,q=null,W=null,J=null,ce=void 0,le=null,se=!!y.dynamicChildren)=>{if(w===y)return;w&&!Lo(w,y)&&(q=zt(w),Ve(w,W,J,!0),w=null),y.patchFlag===-2&&(se=!1,y.dynamicChildren=null);const{type:te,ref:ve,shapeFlag:re}=y;switch(te){case tr:U(w,y,S,q);break;case sn:R(w,y,S,q);break;case Ar:w==null&&oe(y,S,q,ce);break;case ae:O(w,y,S,q,W,J,ce,le,se);break;default:re&1?ke(w,y,S,q,W,J,ce,le,se):re&6?F(w,y,S,q,W,J,ce,le,se):(re&64||re&128)&&te.process(w,y,S,q,W,J,ce,le,se,Pt)}ve!=null&&W?Zs(ve,w&&w.ref,J,y||w,!y):ve==null&&w&&w.ref!=null&&Zs(w.ref,null,J,w,!0)},U=(w,y,S,q)=>{if(w==null)l(y.el=_(y.children),S,q);else{const W=y.el=w.el;y.children!==w.children&&C(W,y.children)}},R=(w,y,S,q)=>{w==null?l(y.el=b(y.children||""),S,q):y.el=w.el},oe=(w,y,S,q)=>{[w.el,w.anchor]=G(w.children,y,S,q,w.el,w.anchor)},we=({el:w,anchor:y},S,q)=>{let W;for(;w&&w!==y;)W=H(w),l(w,S,q),w=W;l(y,S,q)},ue=({el:w,anchor:y})=>{let S;for(;w&&w!==y;)S=H(w),u(w),w=S;u(y)},ke=(w,y,S,q,W,J,ce,le,se)=>{if(y.type==="svg"?ce="svg":y.type==="math"&&(ce="mathml"),w==null)Ce(y,S,q,W,J,ce,le,se);else{const te=w.el&&w.el._isVueCE?w.el:null;try{te&&te._beginPatch(),he(w,y,W,J,ce,le,se)}finally{te&&te._endPatch()}}},Ce=(w,y,S,q,W,J,ce,le)=>{let se,te;const{props:ve,shapeFlag:re,transition:Te,dirs:Ae}=w;if(se=w.el=h(w.type,J,ve&&ve.is,ve),re&8?T(se,w.children):re&16&&Ze(w.children,se,null,q,W,Lr(w,J),ce,le),Ae&&wo(w,null,q,"created"),Le(se,w,w.scopeId,ce,q),ve){for(const Ke in ve)Ke!=="value"&&!Rs(Ke)&&f(se,Ke,null,ve[Ke],J,q);"value"in ve&&f(se,"value",null,ve.value,J),(te=ve.onVnodeBeforeMount)&&si(te,q,w)}Ae&&wo(w,null,q,"beforeMount");const Re=qf(W,Te);Re&&Te.beforeEnter(se),l(se,y,S),((te=ve&&ve.onVnodeMounted)||Re||Ae)&&dn(()=>{try{te&&si(te,q,w),Re&&Te.enter(se),Ae&&wo(w,null,q,"mounted")}finally{}},W)},Le=(w,y,S,q,W)=>{if(S&&j(w,S),q)for(let J=0;J{for(let te=se;te{const le=y.el=w.el;let{patchFlag:se,dynamicChildren:te,dirs:ve}=y;se|=w.patchFlag&16;const re=w.props||vt,Te=y.props||vt;let Ae;if(S&&ko(S,!1),(Ae=Te.onVnodeBeforeUpdate)&&si(Ae,S,y,w),ve&&wo(y,w,S,"beforeUpdate"),S&&ko(S,!0),te&&(!w.dynamicChildren||w.dynamicChildren.length!==te.length)&&(se=0,ce=!1,te=null),(re.innerHTML&&Te.innerHTML==null||re.textContent&&Te.textContent==null)&&T(le,""),te?ee(w.dynamicChildren,te,le,S,q,Lr(y,W),J):ce||fe(w,y,le,null,S,q,Lr(y,W),J,!1),se>0){if(se&16)V(le,re,Te,S,W);else if(se&2&&re.class!==Te.class&&f(le,"class",null,Te.class,W),se&4&&f(le,"style",re.style,Te.style,W),se&8){const Re=y.dynamicProps;for(let Ke=0;Ke{Ae&&si(Ae,S,y,w),ve&&wo(y,w,S,"updated")},q)},ee=(w,y,S,q,W,J,ce)=>{for(let le=0;le{if(y!==S){if(y!==vt)for(const J in y)!Rs(J)&&!(J in S)&&f(w,J,y[J],null,W,q);for(const J in S){if(Rs(J))continue;const ce=S[J],le=y[J];ce!==le&&J!=="value"&&f(w,J,le,ce,W,q)}"value"in S&&f(w,"value",y.value,S.value,W)}},O=(w,y,S,q,W,J,ce,le,se)=>{const te=y.el=w?w.el:_(""),ve=y.anchor=w?w.anchor:_("");let{patchFlag:re,dynamicChildren:Te,slotScopeIds:Ae}=y;Ae&&(le=le?le.concat(Ae):Ae),w==null?(l(te,S,q),l(ve,S,q),Ze(y.children||[],S,ve,W,J,ce,le,se)):re>0&&re&64&&Te&&w.dynamicChildren&&w.dynamicChildren.length===Te.length?(ee(w.dynamicChildren,Te,S,W,J,ce,le),(y.key!=null||W&&y===W.subTree)&&fl(w,y,!0)):fe(w,y,S,ve,W,J,ce,le,se)},F=(w,y,S,q,W,J,ce,le,se)=>{y.slotScopeIds=le,w==null?y.shapeFlag&512?W.ctx.activate(y,S,q,ce,se):$(y,S,q,W,J,ce,se):Ye(w,y,se)},$=(w,y,S,q,W,J,ce)=>{const le=w.component=oh(w,q,W);if(Xa(w)&&(le.ctx.renderer=Pt),sh(le,!1,ce),le.asyncDep){if(W&&W.registerDep(le,Se,ce),!w.el){const se=le.subTree=A(sn);R(null,se,y,S),w.placeholder=se.el}}else Se(le,w,y,S,W,J,ce)},Ye=(w,y,S)=>{const q=y.component=w.component;if(Rf(w,y,S))if(q.asyncDep&&!q.asyncResolved){ge(q,y,S);return}else q.next=y,q.update();else y.el=w.el,q.vnode=y},Se=(w,y,S,q,W,J,ce)=>{const le=()=>{if(w.isMounted){let{next:re,bu:Te,u:Ae,parent:Re,vnode:Ke}=w;{const Jt=Nc(w);if(Jt){re&&(re.el=Ke.el,ge(w,re,ce)),Jt.asyncDep.then(()=>{dn(()=>{w.isUnmounted||te()},W)});return}}let Ge=re,pt;ko(w,!1),re?(re.el=Ke.el,ge(w,re,ce)):re=Ke,Te&&Ea(Te),(pt=re.props&&re.props.onVnodeBeforeUpdate)&&si(pt,Re,re,Ke),ko(w,!0);const ht=Zl(w),Vt=w.subTree;w.subTree=ht,N(Vt,ht,M(Vt.el),zt(Vt),w,W,J),re.el=ht.el,Ge===null&&Bf(w,ht.el),Ae&&dn(Ae,W),(pt=re.props&&re.props.onVnodeUpdated)&&dn(()=>si(pt,Re,re,Ke),W)}else{let re;const{el:Te,props:Ae}=y,{bm:Re,m:Ke,parent:Ge,root:pt,type:ht}=w,Vt=is(y);ko(w,!1),Re&&Ea(Re),!Vt&&(re=Ae&&Ae.onVnodeBeforeMount)&&si(re,Ge,y),ko(w,!0);{pt.ce&&pt.ce._hasShadowRoot()&&pt.ce._injectChildStyle(ht,w.parent?w.parent.type:void 0);const Jt=w.subTree=Zl(w);N(null,Jt,S,q,w,W,J),y.el=Jt.el}if(Ke&&dn(Ke,W),!Vt&&(re=Ae&&Ae.onVnodeMounted)){const Jt=y;dn(()=>si(re,Ge,Jt),W)}(y.shapeFlag&256||Ge&&is(Ge.vnode)&&Ge.vnode.shapeFlag&256)&&w.a&&dn(w.a,W),w.isMounted=!0,y=S=q=null}};w.scope.on();const se=w.effect=new Vu(le);w.scope.off();const te=w.update=se.run.bind(se),ve=w.job=se.runIfDirty.bind(se);ve.i=w,ve.id=w.uid,se.scheduler=()=>ul(ve),ko(w,!0),te()},ge=(w,y,S)=>{y.component=w;const q=w.vnode.props;w.vnode=y,w.next=null,Vf(w,y.props,q,S),Wf(w,y.children,S),di(),zl(w),fi()},fe=(w,y,S,q,W,J,ce,le,se=!1)=>{const te=w&&w.children,ve=w?w.shapeFlag:0,re=y.children,{patchFlag:Te,shapeFlag:Ae}=y;if(Te>0){if(Te&128){pe(te,re,S,q,W,J,ce,le,se);return}else if(Te&256){ft(te,re,S,q,W,J,ce,le,se);return}}Ae&8?(ve&16&&De(te,W,J),re!==te&&T(S,re)):ve&16?Ae&16?pe(te,re,S,q,W,J,ce,le,se):De(te,W,J,!0):(ve&8&&T(S,""),Ae&16&&Ze(re,S,q,W,J,ce,le,se))},ft=(w,y,S,q,W,J,ce,le,se)=>{w=w||es,y=y||es;const te=w.length,ve=y.length,re=Math.min(te,ve);let Te;for(Te=0;Teve?De(w,W,J,!0,!1,re):Ze(y,S,q,W,J,ce,le,se,re)},pe=(w,y,S,q,W,J,ce,le,se)=>{let te=0;const ve=y.length;let re=w.length-1,Te=ve-1;for(;te<=re&&te<=Te;){const Ae=w[te],Re=y[te]=se?Ci(y[te]):li(y[te]);if(Lo(Ae,Re))N(Ae,Re,S,null,W,J,ce,le,se);else break;te++}for(;te<=re&&te<=Te;){const Ae=w[re],Re=y[Te]=se?Ci(y[Te]):li(y[Te]);if(Lo(Ae,Re))N(Ae,Re,S,null,W,J,ce,le,se);else break;re--,Te--}if(te>re){if(te<=Te){const Ae=Te+1,Re=AeTe)for(;te<=re;)Ve(w[te],W,J,!0),te++;else{const Ae=te,Re=te,Ke=new Map;for(te=Re;te<=Te;te++){const Ct=y[te]=se?Ci(y[te]):li(y[te]);Ct.key!=null&&Ke.set(Ct.key,te)}let Ge,pt=0;const ht=Te-Re+1;let Vt=!1,Jt=0;const Zt=new Array(ht);for(te=0;te=ht){Ve(Ct,W,J,!0);continue}let $t;if(Ct.key!=null)$t=Ke.get(Ct.key);else for(Ge=Re;Ge<=Te;Ge++)if(Zt[Ge-Re]===0&&Lo(Ct,y[Ge])){$t=Ge;break}$t===void 0?Ve(Ct,W,J,!0):(Zt[$t-Re]=te+1,$t>=Jt?Jt=$t:Vt=!0,N(Ct,y[$t],S,null,W,J,ce,le,se),pt++)}const pn=Vt?Yf(Zt):es;for(Ge=pn.length-1,te=ht-1;te>=0;te--){const Ct=Re+te,$t=y[Ct],kn=y[Ct+1],zi=Ct+1{const{el:J,type:ce,transition:le,children:se,shapeFlag:te}=w;if(te&6){Ue(w.component.subTree,y,S,q);return}if(te&128){w.suspense.move(y,S,q);return}if(te&64){ce.move(w,y,S,Pt);return}if(ce===ae){l(J,y,S);for(let re=0;rele.enter(J),W));else{const{leave:re,delayLeave:Te,afterLeave:Ae}=le,Re=()=>{w.ctx.isUnmounted?u(J):l(J,y,S)},Ke=()=>{const Ge=J._isLeaving||!!J[Un];J._isLeaving&&J[Un](!0),le.persisted&&!Ge?Re():re(J,()=>{Re(),Ae&&Ae()})};Te?Te(J,Re,Ke):Ke()}else l(J,y,S)},Ve=(w,y,S,q=!1,W=!1)=>{const{type:J,props:ce,ref:le,children:se,dynamicChildren:te,shapeFlag:ve,patchFlag:re,dirs:Te,cacheIndex:Ae,memo:Re}=w;if(re===-2&&(W=!1),le!=null&&(di(),Zs(le,null,S,w,!0),fi()),Ae!=null&&(y.renderCache[Ae]=void 0),ve&256){y.ctx.deactivate(w);return}const Ke=ve&1&&Te,Ge=!is(w);let pt;if(Ge&&(pt=ce&&ce.onVnodeBeforeUnmount)&&si(pt,y,w),ve&6)Me(w.component,S,q);else{if(ve&128){w.suspense.unmount(S,q);return}Ke&&wo(w,null,y,"beforeUnmount"),ve&64?w.type.remove(w,y,S,Pt,q):te&&!te.hasOnce&&(J!==ae||re>0&&re&64)?De(te,y,S,!1,!0):(J===ae&&re&384||!W&&ve&16)&&De(se,y,S),q&&wt(w)}const ht=Re!=null&&Ae==null;(Ge&&(pt=ce&&ce.onVnodeUnmounted)||Ke||ht)&&dn(()=>{pt&&si(pt,y,w),Ke&&wo(w,null,y,"unmounted"),ht&&(w.el=null)},S)},wt=w=>{const{type:y,el:S,anchor:q,transition:W}=w;if(y===ae){st(S,q);return}if(y===Ar){ue(w);return}const J=()=>{u(S),W&&!W.persisted&&W.afterLeave&&W.afterLeave()};if(w.shapeFlag&1&&W&&!W.persisted){const{leave:ce,delayLeave:le}=W,se=()=>ce(S,J);le?le(w.el,J,se):se()}else J()},st=(w,y)=>{let S;for(;w!==y;)S=H(w),u(w),w=S;u(y)},Me=(w,y,S)=>{const{bum:q,scope:W,job:J,subTree:ce,um:le,m:se,a:te}=w;Wl(se),Wl(te),q&&Ea(q),W.stop(),J&&(J.flags|=8,Ve(ce,w,y,S)),le&&dn(le,y),dn(()=>{w.isUnmounted=!0},y)},De=(w,y,S,q=!1,W=!1,J=0)=>{for(let ce=J;ce{if(w.shapeFlag&6)return zt(w.component.subTree);if(w.shapeFlag&128)return w.suspense.next();const y=H(w.anchor||w.el),S=y&&y[fc];return S?H(S):y};let At=!1;const Ut=(w,y,S)=>{let q;w==null?y._vnode&&(Ve(y._vnode,null,null,!0),q=y._vnode.component):N(y._vnode||null,w,y,null,null,null,S),y._vnode=w,At||(At=!0,zl(q),ac(),At=!1)},Pt={p:N,um:Ve,m:Ue,r:wt,mt:$,mc:Ze,pc:fe,pbc:ee,n:zt,o:t};return{render:Ut,hydrate:void 0,createApp:zf(Ut)}}function Lr({type:t,props:i},s){return s==="svg"&&t==="foreignObject"||s==="mathml"&&t==="annotation-xml"&&i&&i.encoding&&i.encoding.includes("html")?void 0:s}function ko({effect:t,job:i},s){s?(t.flags|=32,i.flags|=4):(t.flags&=-33,i.flags&=-5)}function qf(t,i){return(!t||t&&!t.pendingBranch)&&i&&!i.persisted}function fl(t,i,s=!1){const l=t.children,u=i.children;if(Ne(l)&&Ne(u))for(let f=0;f>1,t[s[_]]0&&(i[l]=s[f-1]),s[f]=l)}}for(f=s.length,h=s[f-1];f-- >0;)s[f]=h,h=i[h];return s}function Nc(t){const i=t.subTree.component;if(i)return i.asyncDep&&!i.asyncResolved?i:Nc(i)}function Wl(t){if(t)for(let i=0;it.__isSuspense;function Jf(t,i){i&&i.pendingBranch?Ne(t)?i.effects.push(...t):i.effects.push(t):nf(t)}const ae=Symbol.for("v-fgt"),tr=Symbol.for("v-txt"),sn=Symbol.for("v-cmt"),Ar=Symbol.for("v-stc"),js=[];let zn=null;function p(t=!1){js.push(zn=t?null:[])}function Xf(){js.pop(),zn=js[js.length-1]||null}let Ys=1;function Da(t,i=!1){Ys+=t,t<0&&zn&&i&&(zn.hasOnce=!0)}function Rc(t){return t.dynamicChildren=Ys>0?zn||es:null,Xf(),Ys>0&&zn&&zn.push(t),t}function m(t,i,s,l,u,f){return Rc(a(t,i,s,l,u,f,!0))}function nt(t,i,s,l,u){return Rc(A(t,i,s,l,u,!0))}function Js(t){return t?t.__v_isVNode===!0:!1}function Lo(t,i){return t.type===i.type&&t.key===i.key}const Bc=({key:t})=>t??null,Oa=({ref:t,ref_key:i,ref_for:s})=>(typeof t=="number"&&(t=""+t),t!=null?Tt(t)||rn(t)||je(t)?{i:an,r:t,k:i,f:!!s}:t:null);function a(t,i=null,s=null,l=0,u=null,f=t===ae?0:1,h=!1,_=!1){const b={__v_isVNode:!0,__v_skip:!0,type:t,props:i,key:i&&Bc(i),ref:i&&Oa(i),scopeId:lc,slotScopeIds:null,children:s,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:f,patchFlag:l,dynamicProps:u,dynamicChildren:null,appContext:null,ctx:an};return _?(Ra(b,s),f&128&&t.normalize(b)):s&&(b.shapeFlag|=Tt(s)?8:16),Ys>0&&!h&&zn&&(b.patchFlag>0||f&6)&&b.patchFlag!==32&&zn.push(b),b}const A=Qf;function Qf(t,i=null,s=null,l=0,u=null,f=!1){if((!t||t===Sf)&&(t=sn),Js(t)){const _=Qi(t,i,!0);return s&&Ra(_,s),Ys>0&&!f&&zn&&(_.shapeFlag&6?zn[zn.indexOf(t)]=_:zn.push(_)),_.patchFlag=-2,_}if(uh(t)&&(t=t.__vccOpts),i){i=eh(i);let{class:_,style:b}=i;_&&!Tt(_)&&(i.class=Pe(_)),dt(b)&&(ll(b)&&!Ne(b)&&(b=Kt({},b)),i.style=Eo(b))}const h=Tt(t)?1:Dc(t)?128:hc(t)?64:dt(t)?4:je(t)?2:0;return a(t,i,s,l,u,h,f,!0)}function eh(t){return t?ll(t)||Mc(t)?Kt({},t):t:null}function Qi(t,i,s=!1,l=!1){const{props:u,ref:f,patchFlag:h,children:_,transition:b}=t,C=i?th(u||{},i):u,T={__v_isVNode:!0,__v_skip:!0,type:t.type,props:C,key:C&&Bc(C),ref:i&&i.ref?s&&f?Ne(f)?f.concat(Oa(i)):[f,Oa(i)]:Oa(i):f,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:_,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:i&&t.type!==ae?h===-1?16:h|16:h,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:b,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Qi(t.ssContent),ssFallback:t.ssFallback&&Qi(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return b&&l&&qs(T,b.clone(T)),T}function z(t=" ",i=0){return A(tr,null,t,i)}function I(t="",i=!1){return i?(p(),nt(sn,null,t)):A(sn,null,t)}function li(t){return t==null||typeof t=="boolean"?A(sn):Ne(t)?A(ae,null,t.slice()):Js(t)?Ci(t):A(tr,null,String(t))}function Ci(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Qi(t)}function Ra(t,i){let s=0;const{shapeFlag:l}=t;if(i==null)i=null;else if(Ne(i))s=16;else if(typeof i=="object")if(l&65){const u=i.default;u&&(u._c&&(u._d=!1),Ra(t,u()),u._c&&(u._d=!0));return}else{s=32;const u=i._;!u&&!Mc(i)?i._ctx=an:u===3&&an&&(an.slots._===1?i._=1:(i._=2,t.patchFlag|=1024))}else if(je(i)){if(l&65){Ra(t,{default:i});return}i={default:i,_ctx:an},s=32}else i=String(i),l&64?(s=16,i=[z(i)]):s=8;t.children=i,t.shapeFlag|=s}function th(...t){const i={};for(let s=0;shn||an;let Ba,Kr;{const t=qa(),i=(s,l)=>{let u;return(u=t[s])||(u=t[s]=[]),u.push(l),f=>{u.length>1?u.forEach(h=>h(f)):u[0](f)}};Ba=i("__VUE_INSTANCE_SETTERS__",s=>hn=s),Kr=i("__VUE_SSR_SETTERS__",s=>Xs=s)}const na=t=>{const i=hn;return Ba(t),t.scope.on(),()=>{t.scope.off(),Ba(i)}},Kl=()=>{hn&&hn.scope.off(),Ba(null)};function Vc(t){return t.vnode.shapeFlag&4}let Xs=!1;function sh(t,i=!1,s=!1){i&&Kr(i);const{props:l,children:u}=t.vnode,f=Vc(t);Uf(t,l,f,i),jf(t,u,s||i);const h=f?ah(t,i):void 0;return i&&Kr(!1),h}function ah(t,i){const s=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Pf);const{setup:l}=s;if(l){di();const u=t.setupContext=l.length>1?lh(t):null,f=na(t),h=ta(l,t,0,[t.props,u]),_=$u(h);if(fi(),f(),(_||t.sp)&&!is(t)&&bc(t),_){if(h.then(Kl,Kl),i)return h.then(b=>{Gl(t,b)}).catch(b=>{Ja(b,t,0)});t.asyncDep=h}else Gl(t,h)}else Zc(t)}function Gl(t,i,s){je(i)?t.type.__ssrInlineRender?t.ssrRender=i:t.render=i:dt(i)&&(t.setupState=nc(i)),Zc(t)}function Zc(t,i,s){const l=t.type;t.render||(t.render=l.render||ci);{const u=na(t);di();try{Cf(t)}finally{fi(),u()}}}const rh={get(t,i){return on(t,"get",""),t[i]}};function lh(t){const i=s=>{t.exposed=s||{}};return{attrs:new Proxy(t.attrs,rh),slots:t.slots,emit:t.emit,expose:i}}function nr(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(nc(Wd(t.exposed)),{get(i,s){if(s in i)return i[s];if(s in Hs)return Hs[s](t)},has(i,s){return s in i||s in Hs}})):t.proxy}function uh(t){return je(t)&&"__vccOpts"in t}const de=(t,i)=>Jd(t,i,Xs);function ch(t,i,s){try{Da(-1);const l=arguments.length;return l===2?dt(i)&&!Ne(i)?Js(i)?A(t,null,[i]):A(t,i):A(t,null,i):(l>3?s=Array.prototype.slice.call(arguments,2):l===3&&Js(s)&&(s=[s]),A(t,i,s))}finally{Da(1)}}const dh="3.5.39";/** -* @vue/runtime-dom v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let Gr;const ql=typeof window<"u"&&window.trustedTypes;if(ql)try{Gr=ql.createPolicy("vue",{createHTML:t=>t})}catch{}const Hc=Gr?t=>Gr.createHTML(t):t=>t,fh="http://www.w3.org/2000/svg",hh="http://www.w3.org/1998/Math/MathML",Pi=typeof document<"u"?document:null,Yl=Pi&&Pi.createElement("template"),ph={insert:(t,i,s)=>{i.insertBefore(t,s||null)},remove:t=>{const i=t.parentNode;i&&i.removeChild(t)},createElement:(t,i,s,l)=>{const u=i==="svg"?Pi.createElementNS(fh,t):i==="mathml"?Pi.createElementNS(hh,t):s?Pi.createElement(t,{is:s}):Pi.createElement(t);return t==="select"&&l&&l.multiple!=null&&u.setAttribute("multiple",l.multiple),u},createText:t=>Pi.createTextNode(t),createComment:t=>Pi.createComment(t),setText:(t,i)=>{t.nodeValue=i},setElementText:(t,i)=>{t.textContent=i},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>Pi.querySelector(t),setScopeId(t,i){t.setAttribute(i,"")},insertStaticContent(t,i,s,l,u,f){const h=s?s.previousSibling:i.lastChild;if(u&&(u===f||u.nextSibling))for(;i.insertBefore(u.cloneNode(!0),s),!(u===f||!(u=u.nextSibling)););else{Yl.innerHTML=Hc(l==="svg"?`${t}`:l==="mathml"?`${t}`:t);const _=Yl.content;if(l==="svg"||l==="mathml"){const b=_.firstChild;for(;b.firstChild;)_.appendChild(b.firstChild);_.removeChild(b)}i.insertBefore(_,s)}return[h?h.nextSibling:i.firstChild,s?s.previousSibling:i.lastChild]}},Gi="transition",zs="animation",Qs=Symbol("_vtc"),jc={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},mh=Kt({},pc,jc),gh=t=>(t.displayName="Transition",t.props=mh,t),vh=gh((t,{slots:i})=>ch(hf,_h(t),i)),So=(t,i=[])=>{Ne(t)?t.forEach(s=>s(...i)):t&&t(...i)},Jl=t=>t?Ne(t)?t.some(i=>i.length>1):t.length>1:!1;function _h(t){const i={};for(const O in t)O in jc||(i[O]=t[O]);if(t.css===!1)return i;const{name:s="v",type:l,duration:u,enterFromClass:f=`${s}-enter-from`,enterActiveClass:h=`${s}-enter-active`,enterToClass:_=`${s}-enter-to`,appearFromClass:b=f,appearActiveClass:C=h,appearToClass:T=_,leaveFromClass:M=`${s}-leave-from`,leaveActiveClass:H=`${s}-leave-active`,leaveToClass:j=`${s}-leave-to`}=t,G=bh(u),N=G&&G[0],U=G&&G[1],{onBeforeEnter:R,onEnter:oe,onEnterCancelled:we,onLeave:ue,onLeaveCancelled:ke,onBeforeAppear:Ce=R,onAppear:Le=oe,onAppearCancelled:Ze=we}=i,he=(O,F,$,Ye)=>{O._enterCancelled=Ye,To(O,F?T:_),To(O,F?C:h),$&&$()},ee=(O,F)=>{O._isLeaving=!1,To(O,M),To(O,j),To(O,H),F&&F()},V=O=>(F,$)=>{const Ye=O?Le:oe,Se=()=>he(F,O,$);So(Ye,[F,Se]),Xl(()=>{To(F,O?b:f),Ti(F,O?T:_),Jl(Ye)||Ql(F,l,N,Se)})};return Kt(i,{onBeforeEnter(O){So(R,[O]),Ti(O,f),Ti(O,h)},onBeforeAppear(O){So(Ce,[O]),Ti(O,b),Ti(O,C)},onEnter:V(!1),onAppear:V(!0),onLeave(O,F){O._isLeaving=!0;const $=()=>ee(O,F);Ti(O,M),O._enterCancelled?(Ti(O,H),nu(O)):(nu(O),Ti(O,H)),Xl(()=>{O._isLeaving&&(To(O,M),Ti(O,j),Jl(ue)||Ql(O,l,U,$))}),So(ue,[O,$])},onEnterCancelled(O){he(O,!1,void 0,!0),So(we,[O])},onAppearCancelled(O){he(O,!0,void 0,!0),So(Ze,[O])},onLeaveCancelled(O){ee(O),So(ke,[O])}})}function bh(t){if(t==null)return null;if(dt(t))return[Mr(t.enter),Mr(t.leave)];{const i=Mr(t);return[i,i]}}function Mr(t){return _d(t)}function Ti(t,i){i.split(/\s+/).forEach(s=>s&&t.classList.add(s)),(t[Qs]||(t[Qs]=new Set)).add(i)}function To(t,i){i.split(/\s+/).forEach(l=>l&&t.classList.remove(l));const s=t[Qs];s&&(s.delete(i),s.size||(t[Qs]=void 0))}function Xl(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let yh=0;function Ql(t,i,s,l){const u=t._endId=++yh,f=()=>{u===t._endId&&l()};if(s!=null)return setTimeout(f,s);const{type:h,timeout:_,propCount:b}=xh(t,i);if(!h)return l();const C=h+"end";let T=0;const M=()=>{t.removeEventListener(C,H),f()},H=j=>{j.target===t&&++T>=b&&M()};setTimeout(()=>{T(s[G]||"").split(", "),u=l(`${Gi}Delay`),f=l(`${Gi}Duration`),h=eu(u,f),_=l(`${zs}Delay`),b=l(`${zs}Duration`),C=eu(_,b);let T=null,M=0,H=0;i===Gi?h>0&&(T=Gi,M=h,H=f.length):i===zs?C>0&&(T=zs,M=C,H=b.length):(M=Math.max(h,C),T=M>0?h>C?Gi:zs:null,H=T?T===Gi?f.length:b.length:0);const j=T===Gi&&/\b(?:transform|all)(?:,|$)/.test(l(`${Gi}Property`).toString());return{type:T,timeout:M,propCount:H,hasTransform:j}}function eu(t,i){for(;t.lengthtu(s)+tu(t[l])))}function tu(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function nu(t){return(t?t.ownerDocument:document).body.offsetHeight}function wh(t,i,s){const l=t[Qs];l&&(i=(i?[i,...l]:[...l]).join(" ")),i==null?t.removeAttribute("class"):s?t.setAttribute("class",i):t.className=i}const Ua=Symbol("_vod"),Wc=Symbol("_vsh"),kh={name:"show",beforeMount(t,{value:i},{transition:s}){t[Ua]=t.style.display==="none"?"":t.style.display,s&&i?s.beforeEnter(t):$s(t,i)},mounted(t,{value:i},{transition:s}){s&&i&&s.enter(t)},updated(t,{value:i,oldValue:s},{transition:l}){!i!=!s&&(l?i?(l.beforeEnter(t),$s(t,!0),l.enter(t)):l.leave(t,()=>{$s(t,!1)}):$s(t,i))},beforeUnmount(t,{value:i}){$s(t,i)}};function $s(t,i){t.style.display=i?t[Ua]:"none",t[Wc]=!i}const Sh=Symbol(""),Th=/(?:^|;)\s*display\s*:/;function Ph(t,i,s){const l=t.style,u=Tt(s);let f=!1;if(s&&!u){if(i)if(Tt(i))for(const h of i.split(";")){const _=h.slice(0,h.indexOf(":")).trim();s[_]==null&&Fs(l,_,"")}else for(const h in i)s[h]==null&&Fs(l,h,"");for(const h in s){h==="display"&&(f=!0);const _=s[h];_!=null?Lh(t,h,!Tt(i)&&i?i[h]:void 0,_)||Fs(l,h,_):Fs(l,h,"")}}else if(u){if(i!==s){const h=l[Sh];h&&(s+=";"+h),l.cssText=s,f=Th.test(s)}}else i&&t.removeAttribute("style");Ua in t&&(t[Ua]=f?l.display:"",t[Wc]&&(l.display="none"))}const iu=/\s*!important$/;function Fs(t,i,s){if(Ne(s))s.forEach(l=>Fs(t,i,l));else if(s==null&&(s=""),i.startsWith("--"))t.setProperty(i,s);else{const l=Ch(t,i);iu.test(s)?t.setProperty(to(l),s.replace(iu,""),"important"):t[l]=s}}const ou=["Webkit","Moz","ms"],Er={};function Ch(t,i){const s=Er[i];if(s)return s;let l=Jn(i);if(l!=="filter"&&l in t)return Er[i]=l;l=Fu(l);for(let u=0;uOr||($h.then(()=>Or=0),Or=Date.now());function Nh(t,i){const s=l=>{if(!l._vts)l._vts=Date.now();else if(l._vts<=s.attached)return;const u=s.value;if(Ne(u)){const f=l.stopImmediatePropagation;l.stopImmediatePropagation=()=>{f.call(l),l._stopped=!0};const h=u.slice(),_=[l];for(let b=0;bt.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Fh=(t,i,s,l,u,f)=>{const h=u==="svg";i==="class"?wh(t,l,h):i==="style"?Ph(t,s,l):ja(i)?Wa(i)||Mh(t,i,s,l,f):(i[0]==="."?(i=i.slice(1),!0):i[0]==="^"?(i=i.slice(1),!1):Dh(t,i,l,h))?(ru(t,i,l),!t.tagName.includes("-")&&(i==="value"||i==="checked"||i==="selected")&&au(t,i,l,h,f,i!=="value")):t._isVueCE&&(Rh(t,i)||t._def.__asyncLoader&&(/[A-Z]/.test(i)||!Tt(l)))?ru(t,Jn(i),l,f,i):(i==="true-value"?t._trueValue=l:i==="false-value"&&(t._falseValue=l),au(t,i,l,h))};function Dh(t,i,s,l){if(l)return!!(i==="innerHTML"||i==="textContent"||i in t&&uu(i)&&je(s));if(i==="spellcheck"||i==="draggable"||i==="translate"||i==="autocorrect"||i==="sandbox"&&t.tagName==="IFRAME"||i==="form"||i==="list"&&t.tagName==="INPUT"||i==="type"&&t.tagName==="TEXTAREA")return!1;if(i==="width"||i==="height"){const u=t.tagName;if(u==="IMG"||u==="VIDEO"||u==="CANVAS"||u==="SOURCE")return!1}return uu(i)&&Tt(s)?!1:i in t}function Rh(t,i){const s=t._def.props;if(!s)return!1;const l=Jn(i);return Array.isArray(s)?s.some(u=>Jn(u)===l):Object.keys(s).some(u=>Jn(u)===l)}const eo=t=>{const i=t.props["onUpdate:modelValue"]||!1;return Ne(i)?s=>Ea(i,s):i};function Bh(t){t.target.composing=!0}function cu(t){const i=t.target;i.composing&&(i.composing=!1,i.dispatchEvent(new Event("input")))}const Zn=Symbol("_assign");function du(t,i,s){return i&&(t=t.trim()),s&&(t=Ga(t)),t}const me={created(t,{modifiers:{lazy:i,trim:s,number:l}},u){t[Zn]=eo(u);const f=l||u.props&&u.props.type==="number";Mi(t,i?"change":"input",h=>{h.target.composing||t[Zn](du(t.value,s,f))}),(s||f)&&Mi(t,"change",()=>{t.value=du(t.value,s,f)}),i||(Mi(t,"compositionstart",Bh),Mi(t,"compositionend",cu),Mi(t,"change",cu))},mounted(t,{value:i}){t.value=i??""},beforeUpdate(t,{value:i,oldValue:s,modifiers:{lazy:l,trim:u,number:f}},h){if(t[Zn]=eo(h),t.composing)return;const _=(f||t.type==="number")&&!/^0\d/.test(t.value)?Ga(t.value):t.value,b=i??"";if(_===b)return;const C=t.getRootNode();(C instanceof Document||C instanceof ShadowRoot)&&C.activeElement===t&&t.type!=="range"&&(l&&i===s||u&&t.value.trim()===b)||(t.value=b)}},Va={deep:!0,created(t,i,s){t[Zn]=eo(s),Mi(t,"change",()=>{const l=t._modelValue,u=rs(t),f=t.checked,h=t[Zn];if(Ne(l)){const _=tl(l,u),b=_!==-1;if(f&&!b)h(l.concat(u));else if(!f&&b){const C=[...l];C.splice(_,1),h(C)}}else if(ls(l)){const _=new Set(l);f?_.add(u):_.delete(u),h(_)}else h(Kc(t,f))})},mounted:fu,beforeUpdate(t,i,s){t[Zn]=eo(s),fu(t,i,s)}};function fu(t,{value:i,oldValue:s},l){t._modelValue=i;let u;if(Ne(i))u=tl(i,l.props.value)>-1;else if(ls(i))u=i.has(l.props.value);else{if(i===s)return;u=Xi(i,Kc(t,!0))}t.checked!==u&&(t.checked=u)}const Uh={created(t,{value:i},s){t.checked=Xi(i,s.props.value),t[Zn]=eo(s),Mi(t,"change",()=>{t[Zn](rs(t))})},beforeUpdate(t,{value:i,oldValue:s},l){t[Zn]=eo(l),i!==s&&(t.checked=Xi(i,l.props.value))}},Ot={deep:!0,created(t,{value:i,modifiers:{number:s}},l){const u=ls(i);Mi(t,"change",()=>{const f=Array.prototype.filter.call(t.options,h=>h.selected).map(h=>s?Ga(rs(h)):rs(h));t[Zn](t.multiple?u?new Set(f):f:f[0]),t._assigning=!0,oc(()=>{t._assigning=!1})}),t[Zn]=eo(l)},mounted(t,{value:i}){hu(t,i)},beforeUpdate(t,i,s){t[Zn]=eo(s)},updated(t,{value:i}){t._assigning||hu(t,i)}};function hu(t,i){const s=t.multiple,l=Ne(i);if(!(s&&!l&&!ls(i))){for(let u=0,f=t.options.length;uString(C)===String(_)):h.selected=tl(i,_)>-1}else h.selected=i.has(_);else if(Xi(rs(h),i)){t.selectedIndex!==u&&(t.selectedIndex=u);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function rs(t){return"_value"in t?t._value:t.value}function Kc(t,i){const s=i?"_trueValue":"_falseValue";return s in t?t[s]:i}const Vh={created(t,i,s){Aa(t,i,s,null,"created")},mounted(t,i,s){Aa(t,i,s,null,"mounted")},beforeUpdate(t,i,s,l){Aa(t,i,s,l,"beforeUpdate")},updated(t,i,s,l){Aa(t,i,s,l,"updated")}};function Zh(t,i){switch(t){case"SELECT":return Ot;case"TEXTAREA":return me;default:switch(i){case"checkbox":return Va;case"radio":return Uh;default:return me}}}function Aa(t,i,s,l,u){const h=Zh(t.tagName,s.props&&s.props.type)[u];h&&h(t,i,s,l)}const Hh=["ctrl","shift","alt","meta"],jh={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,i)=>Hh.some(s=>t[`${s}Key`]&&!i.includes(s))},hl=(t,i)=>{if(!t)return t;const s=t._withMods||(t._withMods={}),l=i.join(".");return s[l]||(s[l]=((u,...f)=>{for(let h=0;h{const s=t._withKeys||(t._withKeys={}),l=i.join(".");return s[l]||(s[l]=(u=>{if(!("key"in u))return;const f=to(u.key);if(i.some(h=>h===f||Wh[h]===f))return t(u)}))},Kh=Kt({patchProp:Fh},ph);let mu;function Gh(){return mu||(mu=Kf(Kh))}const qh=((...t)=>{const i=Gh().createApp(...t),{mount:s}=i;return i.mount=l=>{const u=Jh(l);if(!u)return;const f=i._component;!je(f)&&!f.render&&!f.template&&(f.template=u.innerHTML),u.nodeType===1&&(u.textContent="");const h=s(u,!1,Yh(u));return u instanceof Element&&(u.removeAttribute("v-cloak"),u.setAttribute("data-v-app","")),h},i});function Yh(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function Jh(t){return Tt(t)?document.querySelector(t):t}const Gc="pv_theme",gu={light:"#EEF0F3",dark:"#0B1730"},Za=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;function qc(){return Za&&Za.matches?"dark":"light"}function Xh(){try{return localStorage.getItem(Gc)||"light"}catch{return"light"}}function Yc(t){return t==="system"?qc():t}function Jc(t){const i=document.documentElement;i.setAttribute("data-theme",t),i.style.backgroundColor=gu[t]||gu.light}const Oo=Y(Xh()),ss=Y(Yc(Oo.value));function Ha(t){Oo.value=t;const i=Yc(t);ss.value=i,Jc(i);try{localStorage.setItem(Gc,t)}catch{}}function vu(){Ha(ss.value==="dark"?"light":"dark")}Za&&Za.addEventListener("change",()=>{if(Oo.value==="system"){const t=qc();ss.value=t,Jc(t)}});async function Qh(){try{const t=await fetch("/bff/config");return t.ok?await t.json():{apiBase:""}}catch{return{apiBase:""}}}async function _u(){try{const t=await fetch("/bff/me");return t.ok?await t.json():null}catch{return null}}async function ep(t,i,s){const l=await fetch("/bff/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,apiBase:s})});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function tp(){try{await fetch("/bff/logout",{method:"POST"})}catch{}}async function np(){try{const t=await fetch("/bff/devices");return t.ok?await t.json():[]}catch{return[]}}async function ip(){try{const t=await fetch("/bff/users");return t.ok?{ok:!0,status:200,users:(await t.json()).users||[]}:{ok:!1,status:t.status,users:[]}}catch{return{ok:!1,status:0,users:[]}}}async function op(t,i,s,l){const u=await fetch("/bff/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t,password:i,role:s,organization:l})});return{ok:u.ok,status:u.status,body:await u.json().catch(()=>({}))}}async function sp(t,i){const s=await fetch(`/bff/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function ap(t){const i=await fetch(`/bff/users/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function rp(){try{const t=await fetch("/bff/orgs");return t.ok?{ok:!0,status:200,organizations:(await t.json()).organizations||[]}:{ok:!1,status:t.status,organizations:[]}}catch{return{ok:!1,status:0,organizations:[]}}}async function lp(t){const i=await fetch("/bff/orgs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t})});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function up(t,i){const s=await fetch(`/bff/orgs/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function cp(t){const i=await fetch(`/bff/orgs/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function dp(){try{const t=await fetch("/bff/preferences");if(!t.ok)return null;const i=await t.json();return i&&typeof i.preferences=="object"?i.preferences:null}catch{return null}}async function fp(t){try{return(await fetch("/bff/preferences",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({preferences:t})})).ok}catch{return!1}}async function hp(){try{const t=await fetch("/bff/integrations/opensky");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function bu(t){const i=await fetch("/bff/integrations/opensky",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function pp(t){const i=t?`?bbox=${encodeURIComponent(t)}`:"",s=await fetch(`/bff/integrations/opensky/health${i}`,{method:"POST"});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function mp(t){try{const i=t?`?bbox=${encodeURIComponent(t)}`:"",s=await fetch(`/bff/integrations/opensky/states${i}`);if(!s.ok)return{states:[],unavailable:!0,detail:"OpenSky unavailable"};const l=await s.json();return{states:l.states||[],time:l.time,unavailable:!!l.unavailable,detail:l.detail||"",plan:l.plan||"",recommendedInterval:l.recommendedInterval||0}}catch{return{states:[],unavailable:!0,detail:"OpenSky unavailable"}}}async function gp(){try{const t=await fetch("/bff/integrations/filetransfer");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function yu(t){const i=await fetch("/bff/integrations/filetransfer",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function vp(){const t=await fetch("/bff/integrations/filetransfer/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function _p(){try{const t=await fetch("/bff/integrations/localstorage");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function Ma(t){const i=await fetch("/bff/integrations/localstorage",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function bp(){const t=await fetch("/bff/integrations/localstorage/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function yp(){try{const t=await fetch("/bff/integrations/webdav");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function xu(t){const i=await fetch("/bff/integrations/webdav",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function xp(){const t=await fetch("/bff/integrations/webdav/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function wp(){try{const t=await fetch("/bff/integrations/openweather");return t.ok?{ok:!0,status:200,body:await t.json()}:{ok:!1,status:t.status,body:await t.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function wu(t){const i=await fetch("/bff/integrations/openweather",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function kp(){const t=await fetch("/bff/integrations/openweather/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function Sp(t,i){try{const s=t!=null&&i!=null?`?lat=${encodeURIComponent(t)}&lon=${encodeURIComponent(i)}`:"",l=await fetch(`/bff/integrations/openweather/current${s}`);return l.ok?await l.json():{unavailable:!0,detail:"Weather unavailable"}}catch{return{unavailable:!0,detail:"Weather unavailable"}}}async function pl(){try{const t=await fetch("/bff/drones");return t.ok?{ok:!0,status:200,drones:(await t.json()).drones||[]}:{ok:!1,status:t.status,drones:[]}}catch{return{ok:!1,status:0,drones:[]}}}async function Tp(t){const i=await fetch("/bff/drones",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Pp(t){try{const i=await fetch("/bff/drones/auto",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}catch{return{ok:!1,status:0,body:{}}}}async function Cp(t,i){const s=await fetch(`/bff/drones/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function Lp(t){const i=await fetch(`/bff/drones/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Ap(){try{const t=await fetch("/bff/flights");return t.ok?{ok:!0,status:200,flights:(await t.json()).flights||[]}:{ok:!1,status:t.status,flights:[]}}catch{return{ok:!1,status:0,flights:[]}}}async function Mp(t){const i=await fetch("/bff/flights",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}async function Ep(t,i){const s=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function Op(t){const i=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function zp(){return"/bff/logbook/export"}async function $p(){try{const t=await fetch("/bff/routes");return t.ok?{ok:!0,status:200,routes:(await t.json()).routes||[]}:{ok:!1,status:t.status,routes:[]}}catch{return{ok:!1,status:0,routes:[]}}}async function Ip(t){try{const i=t!=null&&t!==""?`?expiring=${encodeURIComponent(t)}`:"",s=await fetch(`/bff/documents${i}`);return s.ok?{ok:!0,status:200,documents:(await s.json()).documents||[]}:{ok:!1,status:s.status,documents:[]}}catch{return{ok:!1,status:0,documents:[]}}}async function Np(t,i){const s=new FormData;Object.entries(t).forEach(([u,f])=>{f!=null&&f!==""&&s.append(u,f)}),i&&s.append("file",i);const l=await fetch("/bff/documents",{method:"POST",body:s});return{ok:l.ok,status:l.status,body:await l.json().catch(()=>({}))}}async function Fp(t,i){const s=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return{ok:s.ok,status:s.status,body:await s.json().catch(()=>({}))}}async function Dp(t){const i=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function zr(t){return`/bff/documents/${encodeURIComponent(t)}/file`}function Rp(t){return`/bff/documents/${encodeURIComponent(t)}/file?inline=1`}async function Bp(t,i,s){const l=await fetch(`/bff/devices/${encodeURIComponent(t)}/command`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({command:i,payload:s})});return{ok:l.ok,body:await l.json().catch(()=>({}))}}const Xc="pv_prefs",qr={name:"",username:"",displayName:"",bio:"",avatar:"",showEmail:!1,fontSize:"md",language:"en",region:"US",dateFormat:"MDY",timeFormat:"24",reduceMotion:!1,showAirTraffic:!0,autoBbox:!0,airTrafficInterval:"auto",twoFactor:!1};function Up(){try{return{...qr,...JSON.parse(localStorage.getItem(Xc)||"{}")||{}}}catch{return{...qr}}}const be=gt(Up());function Qc(){try{localStorage.setItem(Xc,JSON.stringify(be))}catch{}}function ed(t){if(!t||typeof t!="object")return!1;for(const i of Object.keys(qr))i in t&&(be[i]=t[i]);return!0}const Vp={sm:15,md:16,lg:18};function ml(t){document.documentElement.style.fontSize=(Vp[t]||16)+"px"}function gl(t){document.documentElement.classList.toggle("reduce-motion",!!t)}function td(t){const i=new Date(t),s=i.getFullYear(),l=String(i.getMonth()+1).padStart(2,"0"),u=String(i.getDate()).padStart(2,"0");let f;switch(be.dateFormat){case"DMY":f=`${u}/${l}/${s}`;break;case"YMD":f=`${s}/${l}/${u}`;break;case"ISO":f=`${s}-${l}-${u}`;break;default:f=`${l}/${u}/${s}`}let h;return be.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:f,time:h}}function ku(t){return td(t).time}function Su(t){const i=td(t);return`${i.date} ${i.time}`}let vl=!1,Yr=!1,Jr=null;function Zp(){return{...JSON.parse(JSON.stringify(be)),themeMode:Oo.value}}function _l(){!vl||Yr||(clearTimeout(Jr),Jr=setTimeout(()=>{fp(Zp())},600))}function Hp(t){Yr=!0;try{ed(t),t.themeMode&&Ha(t.themeMode),ml(be.fontSize),gl(be.reduceMotion),Qc()}finally{Yr=!1}}async function Tu(){vl=!0;const t=await dp();t&&Object.keys(t).length?Hp(t):_l()}function jp(){vl=!1,clearTimeout(Jr)}Bt(be,()=>{Qc(),_l()},{deep:!0});Bt(Oo,_l);Bt(()=>be.fontSize,ml,{immediate:!0});Bt(()=>be.reduceMotion,gl,{immediate:!0});const Wp=["width","height"],nd={__name:"BrandMark",props:{size:{type:[Number,String],default:28}},setup(t){return(i,s)=>(p(),m("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none","aria-hidden":"true"},[...s[0]||(s[0]=[a("g",{"stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"},[a("polyline",{points:"8,30 19,17 30,30",stroke:"var(--accent)"}),a("polyline",{points:"18,33 29,20 40,33",stroke:"currentColor"})],-1)])],8,Wp))}},Kp=["title","aria-label"],Gp={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},qp={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Yp={__name:"ThemeToggle",setup(t){return(i,s)=>(p(),m("button",{class:"btn-icon",type:"button",title:$e(ss)==="dark"?"Switch to light":"Switch to dark","aria-label":$e(ss)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:s[0]||(s[0]=(...l)=>$e(vu)&&$e(vu)(...l))},[$e(ss)==="dark"?(p(),m("svg",Gp,[...s[1]||(s[1]=[a("circle",{cx:"12",cy:"12",r:"4"},null,-1),a("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)])])):(p(),m("svg",qp,[...s[2]||(s[2]=[a("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z"},null,-1)])]))],8,Kp))}},Jp={class:"relative grid h-full place-items-center p-5"},Xp={class:"absolute right-5 top-5"},Qp={class:"mb-6 flex items-center gap-3 text-ink"},em={class:"relative mb-1"},tm=["type"],nm=["aria-label","title"],im={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]"},om={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]"},sm={key:0,class:"mt-4"},am={key:1,class:"mt-4 rounded border border-line bg-danger-soft px-3 py-2 text-sm text-danger-fg"},rm=["disabled"],lm={__name:"LoginView",props:{defaultApiBase:{type:String,default:""}},emits:["signed-in"],setup(t,{emit:i}){const s=t,l=i,u=Y(""),f=Y(""),h=Y(localStorage.getItem("api_url")||s.defaultApiBase||"http://localhost:8080"),_=Y(!1),b=Y(!1),C=Y(!1),T=Y("");async function M(){C.value=!0,T.value="",localStorage.setItem("api_url",h.value.trim());const{ok:H,status:j,body:G}=await ep(u.value.trim(),f.value,h.value.trim());if(C.value=!1,H){l("signed-in",G.email);return}T.value=j===400?"Invalid email or password.":j===502?"API server can't reach PocketBase.":G.message||G.error||"Cannot reach the API server."}return(H,j)=>(p(),m("div",Jp,[a("div",Xp,[A(Yp)]),a("form",{class:"panel w-[380px] p-8 shadow-md",onSubmit:hl(M,["prevent"])},[a("div",Qp,[A(nd,{size:34}),j[5]||(j[5]=a("div",{class:"leading-tight"},[a("div",{class:"text-mode"},"PilotVault"),a("div",{class:"eyebrow mt-0.5"},"Control panel")],-1))]),j[9]||(j[9]=a("label",{class:"eyebrow mb-1.5 block"},"Email",-1)),ie(a("input",{"onUpdate:modelValue":j[0]||(j[0]=G=>u.value=G),type:"email",autocomplete:"username",required:"",class:"field mb-4",placeholder:"you@example.com"},null,512),[[me,u.value]]),j[10]||(j[10]=a("label",{class:"eyebrow mb-1.5 block"},"Password",-1)),a("div",em,[ie(a("input",{"onUpdate:modelValue":j[1]||(j[1]=G=>f.value=G),type:b.value?"text":"password",autocomplete:"current-password",required:"",class:"field w-full pr-10",placeholder:"••••••••"},null,8,tm),[[Vh,f.value]]),a("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":b.value?"Hide password":"Show password",title:b.value?"Hide password":"Show password",onClick:j[2]||(j[2]=G=>b.value=!b.value)},[b.value?(p(),m("svg",im,[...j[6]||(j[6]=[a("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),a("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])])):(p(),m("svg",om,[...j[7]||(j[7]=[a("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),a("circle",{cx:"12",cy:"12",r:"3"},null,-1)])]))],8,nm)]),_.value?(p(),m("div",sm,[j[8]||(j[8]=a("label",{class:"eyebrow mb-1.5 block"},"API Server",-1)),ie(a("input",{"onUpdate:modelValue":j[3]||(j[3]=G=>h.value=G),type:"text",class:"field font-mono",placeholder:"10.2.1.101:8080"},null,512),[[me,h.value]])])):I("",!0),T.value?(p(),m("p",am,x(T.value),1)):I("",!0),a("button",{type:"submit",class:"btn-accent mt-6 w-full",disabled:C.value},x(C.value?"Signing in…":"Sign in"),9,rm),a("button",{type:"button",class:"mx-auto mt-3 block text-xs text-ink-muted transition hover:text-ink-secondary",onClick:j[4]||(j[4]=G=>_.value=!_.value)},x(_.value?"Hide server settings":"Server settings"),1)],32)]))}};function um(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ds={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 cm=Ds.exports,Pu;function dm(){return Pu||(Pu=1,(function(t,i){(function(s,l){l(i)})(cm,(function(s){var l="1.9.4";function u(e){var n,o,r,d;for(o=1,r=arguments.length;o"u"||!L||!L.Mixin)){e=we(e)?e:[e];for(var n=0;n0?Math.floor(e):Math.ceil(e)};fe.prototype={clone:function(){return new fe(this.x,this.y)},add:function(e){return this.clone()._add(pe(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(pe(e))},_subtract:function(e){return this.x-=e.x,this.y-=e.y,this},divideBy:function(e){return this.clone()._divideBy(e)},_divideBy:function(e){return this.x/=e,this.y/=e,this},multiplyBy:function(e){return this.clone()._multiplyBy(e)},_multiplyBy:function(e){return this.x*=e,this.y*=e,this},scaleBy:function(e){return new fe(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new fe(this.x/e.x,this.y/e.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=ft(this.x),this.y=ft(this.y),this},distanceTo:function(e){e=pe(e);var n=e.x-this.x,o=e.y-this.y;return Math.sqrt(n*n+o*o)},equals:function(e){return e=pe(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=pe(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+H(this.x)+", "+H(this.y)+")"}};function pe(e,n,o){return e instanceof fe?e:we(e)?new fe(e[0],e[1]):e==null?e:typeof e=="object"&&"x"in e&&"y"in e?new fe(e.x,e.y):new fe(e,n,o)}function Ue(e,n){if(e)for(var o=n?[e,n]:e,r=0,d=o.length;r=this.min.x&&o.x<=this.max.x&&n.y>=this.min.y&&o.y<=this.max.y},intersects:function(e){e=Ve(e);var n=this.min,o=this.max,r=e.min,d=e.max,v=d.x>=n.x&&r.x<=o.x,P=d.y>=n.y&&r.y<=o.y;return v&&P},overlaps:function(e){e=Ve(e);var n=this.min,o=this.max,r=e.min,d=e.max,v=d.x>n.x&&r.xn.y&&r.y=n.lat&&d.lat<=o.lat&&r.lng>=n.lng&&d.lng<=o.lng},intersects:function(e){e=st(e);var n=this._southWest,o=this._northEast,r=e.getSouthWest(),d=e.getNorthEast(),v=d.lat>=n.lat&&r.lat<=o.lat,P=d.lng>=n.lng&&r.lng<=o.lng;return v&&P},overlaps:function(e){e=st(e);var n=this._southWest,o=this._northEast,r=e.getSouthWest(),d=e.getNorthEast(),v=d.lat>n.lat&&r.latn.lng&&r.lng1,jn=(function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",M,n),window.removeEventListener("testPassiveEventSupport",M,n)}catch{}return e})(),Z=(function(){return!!document.createElement("canvas").getContext})(),E=!!(document.createElementNS&&q("svg").createSVGRect),Oe=!!E&&(function(){var e=document.createElement("div");return e.innerHTML="",(e.firstChild&&e.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),tt=!E&&(function(){try{var e=document.createElement("div");e.innerHTML='';var n=e.firstChild;return n.style.behavior="url(#default#VML)",n&&typeof n.adj=="object"}catch{return!1}})(),It=navigator.platform.indexOf("Mac")===0,St=navigator.platform.indexOf("Linux")===0;function Et(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var K={ie:ce,ielt9:le,edge:se,webkit:te,android:ve,android23:re,androidStock:Ae,opera:Re,chrome:Ke,gecko:Ge,safari:pt,phantom:ht,opera12:Vt,win:Jt,ie3d:Zt,webkit3d:pn,gecko3d:Ct,any3d:$t,mobile:kn,mobileWebkit:zi,mobileWebkit3d:at,msPointer:Sn,pointer:$i,touch:hi,touchNative:rt,mobileOpera:pi,mobileGecko:Ii,retina:Gt,passiveEvents:jn,canvas:Z,svg:E,vml:tt,inlineSvg:Oe,mac:It,linux:St},_t=K.msPointer?"MSPointerDown":"pointerdown",bt=K.msPointer?"MSPointerMove":"pointermove",oa=K.msPointer?"MSPointerUp":"pointerup",cs=K.msPointer?"MSPointerCancel":"pointercancel",no={touchstart:_t,touchmove:bt,touchend:oa,touchcancel:cs},sa={touchstart:ds,touchmove:Wn,touchend:Wn,touchcancel:Wn},Ni={},aa=!1;function ir(e,n,o){return n==="touchstart"&<(),sa[n]?(o=sa[n].bind(this,o),e.addEventListener(no[n],o,!1),o):(console.warn("wrong event specified:",n),M)}function ra(e,n,o){if(!no[n]){console.warn("wrong event specified:",n);return}e.removeEventListener(no[n],o,!1)}function or(e){Ni[e.pointerId]=e}function sr(e){Ni[e.pointerId]&&(Ni[e.pointerId]=e)}function la(e){delete Ni[e.pointerId]}function lt(){aa||(document.addEventListener(_t,or,!0),document.addEventListener(bt,sr,!0),document.addEventListener(oa,la,!0),document.addEventListener(cs,la,!0),aa=!0)}function Wn(e,n){if(n.pointerType!==(n.MSPOINTER_TYPE_MOUSE||"mouse")){n.touches=[];for(var o in Ni)n.touches.push(Ni[o]);n.changedTouches=[n],e(n)}}function ds(e,n){n.MSPOINTER_TYPE_TOUCH&&n.pointerType===n.MSPOINTER_TYPE_TOUCH&&Dt(n),Wn(e,n)}function Xt(e){var n={},o,r;for(r in e)o=e[r],n[r]=o&&o.bind?o.bind(e):o;return e=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var io=200;function zo(e,n){e.addEventListener("dblclick",n);var o=0,r;function d(v){if(v.detail!==1){r=v.detail;return}if(!(v.pointerType==="mouse"||v.sourceCapabilities&&!v.sourceCapabilities.firesTouchEvents)){var P=da(v);if(!(P.some(function(B){return B instanceof HTMLLabelElement&&B.attributes.for})&&!P.some(function(B){return B instanceof HTMLInputElement||B instanceof HTMLSelectElement}))){var D=Date.now();D-o<=io?(r++,r===2&&n(Xt(v))):r=1,o=D}}}return e.addEventListener("click",d),{dblclick:n,simDblclick:d}}function $o(e,n){e.removeEventListener("dblclick",n.dblclick),e.removeEventListener("click",n.simDblclick)}var Tn=Do(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),$n=Do(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ua=$n==="webkitTransition"||$n==="OTransition"?$n+"End":"transitionend";function Io(e){return typeof e=="string"?document.getElementById(e):e}function mi(e,n){var o=e.style[n]||e.currentStyle&&e.currentStyle[n];if((!o||o==="auto")&&document.defaultView){var r=document.defaultView.getComputedStyle(e,null);o=r?r[n]:null}return o==="auto"?null:o}function it(e,n,o){var r=document.createElement(e);return r.className=n||"",o&&o.appendChild(r),r}function ot(e){var n=e.parentNode;n&&n.removeChild(e)}function Pn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Cn(e){var n=e.parentNode;n&&n.lastChild!==e&&n.appendChild(e)}function qt(e){var n=e.parentNode;n&&n.firstChild!==e&&n.insertBefore(e,n.firstChild)}function No(e,n){if(e.classList!==void 0)return e.classList.contains(n);var o=Fo(e);return o.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(o)}function He(e,n){if(e.classList!==void 0)for(var o=G(n),r=0,d=o.length;r0?2*window.devicePixelRatio:1;function fa(e){return K.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/vs:e.deltaY&&e.deltaMode===1?-e.deltaY*20:e.deltaY&&e.deltaMode===2?-e.deltaY*60:e.deltaX||e.deltaZ?0:e.wheelDelta?(e.wheelDeltaY||e.wheelDelta)/2:e.detail&&Math.abs(e.detail)<32765?-e.detail*20:e.detail?e.detail/-32765*60:0}function Ee(e,n){var o=n.relatedTarget;if(!o)return!0;try{for(;o&&o!==e;)o=o.parentNode}catch{return!1}return o!==e}var Vi={__proto__:null,on:Ie,off:Je,stopPropagation:_i,disableScrollPropagation:gs,disableClickPropagation:Bi,preventDefault:Dt,stop:bi,getPropagationPath:da,getMousePosition:Ui,getWheelDelta:fa,isExternalTarget:Ee,addListener:Ie,removeListener:Je},so=ge.extend({run:function(e,n,o,r){this.stop(),this._el=e,this._inProgress=!0,this._duration=o||.25,this._easeOutPower=1/Math.max(r||.5,.2),this._startPos=Xe(e),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=V(this._animate,this),this._step()},_step:function(e){var n=+new Date-this._startTime,o=this._duration*1e3;nthis.options.maxZoom)?this.setZoom(e):this},panInsideBounds:function(e,n){this._enforcingBounds=!0;var o=this.getCenter(),r=this._limitCenter(o,this._zoom,st(e));return o.equals(r)||this.panTo(r,n),this._enforcingBounds=!1,this},panInside:function(e,n){n=n||{};var o=pe(n.paddingTopLeft||n.padding||[0,0]),r=pe(n.paddingBottomRight||n.padding||[0,0]),d=this.project(this.getCenter()),v=this.project(e),P=this.getPixelBounds(),D=Ve([P.min.add(o),P.max.subtract(r)]),B=D.getSize();if(!D.contains(v)){this._enforcingBounds=!0;var ne=v.subtract(D.getCenter()),_e=D.extend(v).getSize().subtract(B);d.x+=ne.x<0?-_e.x:_e.x,d.y+=ne.y<0?-_e.y:_e.y,this.panTo(this.unproject(d),n),this._enforcingBounds=!1}return this},invalidateSize:function(e){if(!this._loaded)return this;e=u({animate:!1,pan:!0},e===!0?{animate:!0}:e);var n=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var o=this.getSize(),r=n.divideBy(2).round(),d=o.divideBy(2).round(),v=r.subtract(d);return!v.x&&!v.y?this:(e.animate&&e.pan?this.panBy(v):(e.pan&&this._rawPanBy(v),this.fire("move"),e.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(h(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:n,newSize:o}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(e){if(e=this._locateOptions=u({timeout:1e4,watch:!1},e),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var n=h(this._handleGeolocationResponse,this),o=h(this._handleGeolocationError,this);return e.watch?this._locationWatchId=navigator.geolocation.watchPosition(n,o,e):navigator.geolocation.getCurrentPosition(n,o,e),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(e){if(this._container._leaflet_id){var n=e.code,o=e.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: "+o+"."})}},_handleGeolocationResponse:function(e){if(this._container._leaflet_id){var n=e.coords.latitude,o=e.coords.longitude,r=new Me(n,o),d=r.toBounds(e.coords.accuracy*2),v=this._locateOptions;if(v.setView){var P=this.getBoundsZoom(d);this.setView(r,v.maxZoom?Math.min(P,v.maxZoom):P)}var D={latlng:r,bounds:d,timestamp:e.timestamp};for(var B in e.coords)typeof e.coords[B]=="number"&&(D[B]=e.coords[B]);this.fire("locationfound",D)}},addHandler:function(e,n){if(!n)return this;var o=this[e]=new n(this);return this._handlers.push(o),this.options[e]&&o.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(),ot(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(O(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var e;for(e in this._layers)this._layers[e].remove();for(e in this._panes)ot(this._panes[e]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(e,n){var o="leaflet-pane"+(e?" leaflet-"+e.replace("Pane","")+"-pane":""),r=it("div",o,n||this._mapPane);return e&&(this._panes[e]=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 e=this.getPixelBounds(),n=this.unproject(e.getBottomLeft()),o=this.unproject(e.getTopRight());return new wt(n,o)},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(e,n,o){e=st(e),o=pe(o||[0,0]);var r=this.getZoom()||0,d=this.getMinZoom(),v=this.getMaxZoom(),P=e.getNorthWest(),D=e.getSouthEast(),B=this.getSize().subtract(o),ne=Ve(this.project(D,r),this.project(P,r)).getSize(),_e=K.any3d?this.options.zoomSnap:1,Fe=B.x/ne.x,et=B.y/ne.y,un=n?Math.max(Fe,et):Math.min(Fe,et);return r=this.getScaleZoom(un,r),_e&&(r=Math.round(r/(_e/100))*(_e/100),r=n?Math.ceil(r/_e)*_e:Math.floor(r/_e)*_e),Math.max(d,Math.min(v,r))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new fe(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(e,n){var o=this._getTopLeftPoint(e,n);return new Ue(o,o.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(e){return this.options.crs.getProjectedBounds(e===void 0?this.getZoom():e)},getPane:function(e){return typeof e=="string"?this._panes[e]:e},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(e,n){var o=this.options.crs;return n=n===void 0?this._zoom:n,o.scale(e)/o.scale(n)},getScaleZoom:function(e,n){var o=this.options.crs;n=n===void 0?this._zoom:n;var r=o.zoom(e*o.scale(n));return isNaN(r)?1/0:r},project:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.latLngToPoint(De(e),n)},unproject:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.pointToLatLng(pe(e),n)},layerPointToLatLng:function(e){var n=pe(e).add(this.getPixelOrigin());return this.unproject(n)},latLngToLayerPoint:function(e){var n=this.project(De(e))._round();return n._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(De(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(st(e))},distance:function(e,n){return this.options.crs.distance(De(e),De(n))},containerPointToLayerPoint:function(e){return pe(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return pe(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var n=this.containerPointToLayerPoint(pe(e));return this.layerPointToLatLng(n)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(De(e)))},mouseEventToContainerPoint:function(e){return Ui(e,this._container)},mouseEventToLayerPoint:function(e){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(e))},mouseEventToLatLng:function(e){return this.layerPointToLatLng(this.mouseEventToLayerPoint(e))},_initContainer:function(e){var n=this._container=Io(e);if(n){if(n._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Ie(n,"scroll",this._onScroll,this),this._containerId=b(n)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&K.any3d,He(e,"leaflet-container"+(K.touch?" leaflet-touch":"")+(K.retina?" leaflet-retina":"")+(K.ielt9?" leaflet-oldie":"")+(K.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var n=mi(e,"position");n!=="absolute"&&n!=="relative"&&n!=="fixed"&&n!=="sticky"&&(e.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var e=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Mt(this._mapPane,new fe(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(He(e.markerPane,"leaflet-zoom-hide"),He(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,n,o){Mt(this._mapPane,new fe(0,0));var r=!this._loaded;this._loaded=!0,n=this._limitZoom(n),this.fire("viewprereset");var d=this._zoom!==n;this._moveStart(d,o)._move(e,n)._moveEnd(d),this.fire("viewreset"),r&&this.fire("load")},_moveStart:function(e,n){return e&&this.fire("zoomstart"),n||this.fire("movestart"),this},_move:function(e,n,o,r){n===void 0&&(n=this._zoom);var d=this._zoom!==n;return this._zoom=n,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),r?o&&o.pinch&&this.fire("zoom",o):((d||o&&o.pinch)&&this.fire("zoom",o),this.fire("move",o)),this},_moveEnd:function(e){return e&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return O(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){Mt(this._mapPane,this._getMapPanePos().subtract(e))},_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(e){this._targets={},this._targets[b(this._container)]=this;var n=e?Je:Ie;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),K.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){O(this._resizeRequest),this._resizeRequest=V(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var e=this._getMapPanePos();Math.max(Math.abs(e.x),Math.abs(e.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(e,n){for(var o=[],r,d=n==="mouseout"||n==="mouseover",v=e.target||e.srcElement,P=!1;v;){if(r=this._targets[b(v)],r&&(n==="click"||n==="preclick")&&this._draggableMoved(r)){P=!0;break}if(r&&r.listens(n,!0)&&(d&&!Ee(v,e)||(o.push(r),d))||v===this._container)break;v=v.parentNode}return!o.length&&!P&&!d&&this.listens(n,!0)&&(o=[this]),o},_isClickDisabled:function(e){for(;e&&e!==this._container;){if(e._leaflet_disable_click)return!0;e=e.parentNode}},_handleDOMEvent:function(e){var n=e.target||e.srcElement;if(!(!this._loaded||n._leaflet_disable_events||e.type==="click"&&this._isClickDisabled(n))){var o=e.type;o==="mousedown"&&Ro(n),this._fireDOMEvent(e,o)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,n,o){if(e.type==="click"){var r=u({},e);r.type="preclick",this._fireDOMEvent(r,r.type,o)}var d=this._findEventTargets(e,n);if(o){for(var v=[],P=0;P0?Math.round(e-n)/2:Math.max(0,Math.ceil(e))-Math.max(0,Math.floor(n))},_limitZoom:function(e){var n=this.getMinZoom(),o=this.getMaxZoom(),r=K.any3d?this.options.zoomSnap:1;return r&&(e=Math.round(e/r)*r),Math.max(n,Math.min(o,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Lt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(e,n){var o=this._getCenterOffset(e)._trunc();return(n&&n.animate)!==!0&&!this.getSize().contains(o)?!1:(this.panBy(o,n),!0)},_createAnimProxy:function(){var e=this._proxy=it("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(n){var o=Tn,r=this._proxy.style[o];gi(this._proxy,this.project(n.center,n.zoom),this.getZoomScale(n.zoom,1)),r===this._proxy.style[o]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ot(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),n=this.getZoom();gi(this._proxy,this.project(e,n),this.getZoomScale(n,1))},_catchTransitionEnd:function(e){this._animatingZoom&&e.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(e,n,o){if(this._animatingZoom)return!0;if(o=o||{},!this._zoomAnimated||o.animate===!1||this._nothingToAnimate()||Math.abs(n-this._zoom)>this.options.zoomAnimationThreshold)return!1;var r=this.getZoomScale(n),d=this._getCenterOffset(e)._divideBy(1-1/r);return o.animate!==!0&&!this.getSize().contains(d)?!1:(V(function(){this._moveStart(!0,o.noMoveStart||!1)._animateZoom(e,n,!0)},this),!0)},_animateZoom:function(e,n,o,r){this._mapPane&&(o&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=n,He(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,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&&Lt(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 Vo(e,n){return new qe(e,n)}var en=$.extend({options:{position:"topright"},initialize:function(e){N(this,e)},getPosition:function(){return this.options.position},setPosition:function(e){var n=this._map;return n&&n.removeControl(this),this.options.position=e,n&&n.addControl(this),this},getContainer:function(){return this._container},addTo:function(e){this.remove(),this._map=e;var n=this._container=this.onAdd(e),o=this.getPosition(),r=e._controlCorners[o];return He(n,"leaflet-control"),o.indexOf("bottom")!==-1?r.insertBefore(n,r.firstChild):r.appendChild(n),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ot(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(e){this._map&&e&&e.screenX>0&&e.screenY>0&&this._map.getContainer().focus()}}),ln=function(e){return new en(e)};qe.include({addControl:function(e){return e.addTo(this),this},removeControl:function(e){return e.remove(),this},_initControlPos:function(){var e=this._controlCorners={},n="leaflet-",o=this._controlContainer=it("div",n+"control-container",this._container);function r(d,v){var P=n+d+" "+n+v;e[d+v]=it("div",P,o)}r("top","left"),r("top","right"),r("bottom","left"),r("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)ot(this._controlCorners[e]);ot(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var yi=en.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,n,o,r){return o1,this._baseLayersList.style.display=e?"":"none"),this._separator.style.display=n&&e?"":"none",this},_onLayerChange:function(e){this._handlingClick||this._update();var n=this._getLayer(b(e.target)),o=n.overlay?e.type==="add"?"overlayadd":"overlayremove":e.type==="add"?"baselayerchange":null;o&&this._map.fire(o,n)},_createRadioElement:function(e,n){var o='",r=document.createElement("div");return r.innerHTML=o,r.firstChild},_addItem:function(e){var n=document.createElement("label"),o=this._map.hasLayer(e.layer),r;e.overlay?(r=document.createElement("input"),r.type="checkbox",r.className="leaflet-control-layers-selector",r.defaultChecked=o):r=this._createRadioElement("leaflet-base-layers_"+b(this),o),this._layerControlInputs.push(r),r.layerId=b(e.layer),Ie(r,"click",this._onInputClick,this);var d=document.createElement("span");d.innerHTML=" "+e.name;var v=document.createElement("span");n.appendChild(v),v.appendChild(r),v.appendChild(d);var P=e.overlay?this._overlaysList:this._baseLayersList;return P.appendChild(n),this._checkDisabledLayers(),n},_onInputClick:function(){if(!this._preventClick){var e=this._layerControlInputs,n,o,r=[],d=[];this._handlingClick=!0;for(var v=e.length-1;v>=0;v--)n=e[v],o=this._getLayer(n.layerId).layer,n.checked?r.push(o):n.checked||d.push(o);for(v=0;v=0;d--)n=e[d],o=this._getLayer(n.layerId).layer,n.disabled=o.options.minZoom!==void 0&&ro.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,Ie(e,"click",Dt),this.expand();var n=this;setTimeout(function(){Je(e,"click",Dt),n._preventClick=!1})}}),ao=function(e,n,o){return new yi(e,n,o)},Zo=en.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(e){var n="leaflet-control-zoom",o=it("div",n+" leaflet-bar"),r=this.options;return this._zoomInButton=this._createButton(r.zoomInText,r.zoomInTitle,n+"-in",o,this._zoomIn),this._zoomOutButton=this._createButton(r.zoomOutText,r.zoomOutTitle,n+"-out",o,this._zoomOut),this._updateDisabled(),e.on("zoomend zoomlevelschange",this._updateDisabled,this),o},onRemove:function(e){e.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(e){!this._disabled&&this._map._zoomthis._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(e.shiftKey?3:1))},_createButton:function(e,n,o,r,d){var v=it("a",o,r);return v.innerHTML=e,v.href="#",v.title=n,v.setAttribute("role","button"),v.setAttribute("aria-label",n),Bi(v),Ie(v,"click",bi),Ie(v,"click",d,this),Ie(v,"click",this._refocusOnMap,this),v},_updateDisabled:function(){var e=this._map,n="leaflet-disabled";Lt(this._zoomInButton,n),Lt(this._zoomOutButton,n),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(He(this._zoomOutButton,n),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(He(this._zoomInButton,n),this._zoomInButton.setAttribute("aria-disabled","true"))}});qe.mergeOptions({zoomControl:!0}),qe.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new Zo,this.addControl(this.zoomControl))});var _s=function(e){return new Zo(e)},Ho=en.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var n="leaflet-control-scale",o=it("div",n),r=this.options;return this._addScales(r,n+"-line",o),e.on(r.updateWhenIdle?"moveend":"move",this._update,this),e.whenReady(this._update,this),o},onRemove:function(e){e.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(e,n,o){e.metric&&(this._mScale=it("div",n,o)),e.imperial&&(this._iScale=it("div",n,o))},_update:function(){var e=this._map,n=e.getSize().y/2,o=e.distance(e.containerPointToLatLng([0,n]),e.containerPointToLatLng([this.options.maxWidth,n]));this._updateScales(o)},_updateScales:function(e){this.options.metric&&e&&this._updateMetric(e),this.options.imperial&&e&&this._updateImperial(e)},_updateMetric:function(e){var n=this._getRoundNum(e),o=n<1e3?n+" m":n/1e3+" km";this._updateScale(this._mScale,o,n/e)},_updateImperial:function(e){var n=e*3.2808399,o,r,d;n>5280?(o=n/5280,r=this._getRoundNum(o),this._updateScale(this._iScale,r+" mi",r/o)):(d=this._getRoundNum(n),this._updateScale(this._iScale,d+" ft",d/n))},_updateScale:function(e,n,o){e.style.width=Math.round(this.options.maxWidth*o)+"px",e.innerHTML=n},_getRoundNum:function(e){var n=Math.pow(10,(Math.floor(e)+"").length-1),o=e/n;return o=o>=10?10:o>=5?5:o>=3?3:o>=2?2:1,n*o}}),ar=function(e){return new Ho(e)},gn='',Zi=en.extend({options:{position:"bottomright",prefix:''+(K.inlineSvg?gn+" ":"")+"Leaflet"},initialize:function(e){N(this,e),this._attributions={}},onAdd:function(e){e.attributionControl=this,this._container=it("div","leaflet-control-attribution"),Bi(this._container);for(var n in e._layers)e._layers[n].getAttribution&&this.addAttribution(e._layers[n].getAttribution());return this._update(),e.on("layeradd",this._addAttribution,this),this._container},onRemove:function(e){e.off("layeradd",this._addAttribution,this)},_addAttribution:function(e){e.layer.getAttribution&&(this.addAttribution(e.layer.getAttribution()),e.layer.once("remove",function(){this.removeAttribution(e.layer.getAttribution())},this))},setPrefix:function(e){return this.options.prefix=e,this._update(),this},addAttribution:function(e){return e?(this._attributions[e]||(this._attributions[e]=0),this._attributions[e]++,this._update(),this):this},removeAttribution:function(e){return e?(this._attributions[e]&&(this._attributions[e]--,this._update()),this):this},_update:function(){if(this._map){var e=[];for(var n in this._attributions)this._attributions[n]&&e.push(n);var o=[];this.options.prefix&&o.push(this.options.prefix),e.length&&o.push(e.join(", ")),this._container.innerHTML=o.join(' ')}}});qe.mergeOptions({attributionControl:!0}),qe.addInitHook(function(){this.options.attributionControl&&new Zi().addTo(this)});var ha=function(e){return new Zi(e)};en.Layers=yi,en.Zoom=Zo,en.Scale=Ho,en.Attribution=Zi,ln.layers=ao,ln.zoom=_s,ln.scale=ar,ln.attribution=ha;var An=$.extend({initialize:function(e){this._map=e},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}});An.addTo=function(e,n){return e.addHandler(n,this),this};var rr={Events:Se},bs=K.touch?"touchstart mousedown":"mousedown",vn=ge.extend({options:{clickTolerance:3},initialize:function(e,n,o,r){N(this,r),this._element=e,this._dragStartTarget=n||e,this._preventOutline=o},enable:function(){this._enabled||(Ie(this._dragStartTarget,bs,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(vn._dragging===this&&this.finishDrag(!0),Je(this._dragStartTarget,bs,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!No(this._element,"leaflet-zoom-anim"))){if(e.touches&&e.touches.length!==1){vn._dragging===this&&this.finishDrag();return}if(!(vn._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(vn._dragging=this,this._preventOutline&&Ro(this._element),Fi(),In(),!this._moving)){this.fire("down");var n=e.touches?e.touches[0]:e,o=Bo(this._element);this._startPoint=new fe(n.clientX,n.clientY),this._startPos=Xe(this._element),this._parentScale=hs(o);var r=e.type==="mousedown";Ie(document,r?"mousemove":"touchmove",this._onMove,this),Ie(document,r?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(e){if(this._enabled){if(e.touches&&e.touches.length>1){this._moved=!0;return}var n=e.touches&&e.touches.length===1?e.touches[0]:e,o=new fe(n.clientX,n.clientY)._subtract(this._startPoint);!o.x&&!o.y||Math.abs(o.x)+Math.abs(o.y)v&&(P=D,v=B);v>o&&(n[P]=1,ws(e,n,o,r,P),ws(e,n,o,P,d))}function va(e,n){for(var o=[e[0]],r=1,d=0,v=e.length;rn&&(o.push(e[r]),d=r);return dn.max.x&&(o|=2),e.yn.max.y&&(o|=8),o}function ks(e,n){var o=n.x-e.x,r=n.y-e.y;return o*o+r*r}function We(e,n,o,r){var d=n.x,v=n.y,P=o.x-d,D=o.y-v,B=P*P+D*D,ne;return B>0&&(ne=((e.x-d)*P+(e.y-v)*D)/B,ne>1?(d=o.x,v=o.y):ne>0&&(d+=P*ne,v+=D*ne)),P=e.x-d,D=e.y-v,r?P*P+D*D:new fe(d,v)}function yt(e){return!we(e[0])||typeof e[0][0]!="object"&&typeof e[0][0]<"u"}function xi(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),yt(e)}function Ss(e,n){var o,r,d,v,P,D,B,ne;if(!e||e.length===0)throw new Error("latlngs not passed");yt(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var _e=De([0,0]),Fe=st(e),et=Fe.getNorthWest().distanceTo(Fe.getSouthWest())*Fe.getNorthEast().distanceTo(Fe.getNorthWest());et<1700&&(_e=ys(e));var un=e.length,Wt=[];for(o=0;or){B=(v-r)/d,ne=[D.x-B*(D.x-P.x),D.y-B*(D.y-P.y)];break}var xn=n.unproject(pe(ne));return De([xn.lat+_e.lat,xn.lng+_e.lng])}var dr={__proto__:null,simplify:xs,pointToSegmentDistance:ga,closestPointOnSegment:ur,clipSegment:jo,_getEdgeIntersection:Hi,_getBitCode:Nn,_sqClosestPointOnSegment:We,isFlat:yt,_flat:xi,polylineCenter:Ss},ro={project:function(e){return new fe(e.lng,e.lat)},unproject:function(e){return new Me(e.y,e.x)},bounds:new Ue([-180,-90],[180,90])},Ts={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Ue([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(e){var n=Math.PI/180,o=this.R,r=e.lat*n,d=this.R_MINOR/o,v=Math.sqrt(1-d*d),P=v*Math.sin(r),D=Math.tan(Math.PI/4-r/2)/Math.pow((1-P)/(1+P),v/2);return r=-o*Math.log(Math.max(D,1e-10)),new fe(e.lng*n*o,r)},unproject:function(e){for(var n=180/Math.PI,o=this.R,r=this.R_MINOR/o,d=Math.sqrt(1-r*r),v=Math.exp(-e.y/o),P=Math.PI/2-2*Math.atan(v),D=0,B=.1,ne;D<15&&Math.abs(B)>1e-7;D++)ne=d*Math.sin(P),ne=Math.pow((1-ne)/(1+ne),d/2),B=Math.PI/2-2*Math.atan(v*ne)-P,P+=B;return new Me(P*n,e.x*n/o)}},fr={__proto__:null,LonLat:ro,Mercator:Ts,SphericalMercator:Pt},hr=u({},At,{code:"EPSG:3395",projection:Ts,transformation:(function(){var e=.5/(Math.PI*Ts.R);return w(e,.5,-e,.5)})()}),ba=u({},At,{code:"EPSG:4326",projection:ro,transformation:w(1/180,1,-1/180,.5)}),lo=u({},zt,{projection:ro,transformation:w(1,0,-1,0),scale:function(e){return Math.pow(2,e)},zoom:function(e){return Math.log(e)/Math.LN2},distance:function(e,n){var o=n.lng-e.lng,r=n.lat-e.lat;return Math.sqrt(o*o+r*r)},infinite:!0});zt.Earth=At,zt.EPSG3395=hr,zt.EPSG3857=y,zt.EPSG900913=S,zt.EPSG4326=ba,zt.Simple=lo;var _n=ge.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(e){return e.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(e){return e&&e.removeLayer(this),this},getPane:function(e){return this._map.getPane(e?this.options[e]||e:this.options.pane)},addInteractiveTarget:function(e){return this._map._targets[b(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[b(e)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(e){var n=e.target;if(n.hasLayer(this)){if(this._map=n,this._zoomAnimated=n._zoomAnimated,this.getEvents){var o=this.getEvents();n.on(o,this),this.once("remove",function(){n.off(o,this)},this)}this.onAdd(n),this.fire("add"),n.fire("layeradd",{layer:this})}}});qe.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var n=b(e);return this._layers[n]?this:(this._layers[n]=e,e._mapToAdd=this,e.beforeAdd&&e.beforeAdd(this),this.whenReady(e._layerAdd,e),this)},removeLayer:function(e){var n=b(e);return this._layers[n]?(this._loaded&&e.onRemove(this),delete this._layers[n],this._loaded&&(this.fire("layerremove",{layer:e}),e.fire("remove")),e._map=e._mapToAdd=null,this):this},hasLayer:function(e){return b(e)in this._layers},eachLayer:function(e,n){for(var o in this._layers)e.call(n,this._layers[o]);return this},_addLayers:function(e){e=e?we(e)?e:[e]:[];for(var n=0,o=e.length;nthis._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()=2&&n[0]instanceof Me&&n[0].equals(n[o-1])&&n.pop(),n},_setLatLngs:function(e){tn.prototype._setLatLngs.call(this,e),yt(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return yt(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,n=this.options.weight,o=new fe(n,n);if(e=new Ue(e.min.subtract(o),e.max.add(o)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(e))){if(this.options.noClip){this._parts=this._rings;return}for(var r=0,d=this._rings.length,v;re.y!=d.y>e.y&&e.x<(d.x-r.x)*(e.y-r.y)/(d.y-r.y)+r.x&&(n=!n);return n||tn.prototype._containsPoint.call(this,e,!0)}});function ya(e,n){return new Fn(e,n)}var yn=bn.extend({initialize:function(e,n){N(this,n),this._layers={},e&&this.addData(e)},addData:function(e){var n=we(e)?e:e.features,o,r,d;if(n){for(o=0,r=n.length;o0&&d.push(d[0].slice()),d}function Qe(e,n){return e.feature?u({},e.feature,{geometry:n}):En(n)}function En(e){return e.type==="Feature"||e.type==="FeatureCollection"?e:{type:"Feature",properties:{},geometry:e}}var Ki={toGeoJSON:function(e){return Qe(this,{type:"Point",coordinates:Ls(this.getLatLng(),e)})}};Wo.include(Ki),Wi.include(Ki),wi.include(Ki),tn.include({toGeoJSON:function(e){var n=!yt(this._latlngs),o=Go(this._latlngs,n?1:0,!1,e);return Qe(this,{type:(n?"Multi":"")+"LineString",coordinates:o})}}),Fn.include({toGeoJSON:function(e){var n=!yt(this._latlngs),o=n&&!yt(this._latlngs[0]),r=Go(this._latlngs,o?2:n?1:0,!0,e);return n||(r=[r]),Qe(this,{type:(o?"Multi":"")+"Polygon",coordinates:r})}}),qn.include({toMultiPoint:function(e){var n=[];return this.eachLayer(function(o){n.push(o.toGeoJSON(e).geometry.coordinates)}),Qe(this,{type:"MultiPoint",coordinates:n})},toGeoJSON:function(e){var n=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(n==="MultiPoint")return this.toMultiPoint(e);var o=n==="GeometryCollection",r=[];return this.eachLayer(function(d){if(d.toGeoJSON){var v=d.toGeoJSON(e);if(o)r.push(v.geometry);else{var P=En(v);P.type==="FeatureCollection"?r.push.apply(r,P.features):r.push(P)}}}),o?Qe(this,{geometries:r,type:"GeometryCollection"}):{type:"FeatureCollection",features:r}}});function qo(e,n){return new yn(e,n)}var gr=qo,ho=_n.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,n,o){this._url=e,this._bounds=st(n),N(this,o)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(He(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ot(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(e){return this.options.opacity=e,this._image&&this._updateOpacity(),this},setStyle:function(e){return e.opacity&&this.setOpacity(e.opacity),this},bringToFront:function(){return this._map&&Cn(this._image),this},bringToBack:function(){return this._map&&qt(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=st(e),this._map&&this._reset(),this},getEvents:function(){var e={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(e.zoomanim=this._animateZoom),e},setZIndex:function(e){return this.options.zIndex=e,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var e=this._url.tagName==="IMG",n=this._image=e?this._url:it("img");if(He(n,"leaflet-image-layer"),this._zoomAnimated&&He(n,"leaflet-zoom-animated"),this.options.className&&He(n,this.options.className),n.onselectstart=M,n.onmousemove=M,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(),e){this._url=n.src;return}n.src=this._url,n.alt=this.options.alt},_animateZoom:function(e){var n=this._map.getZoomScale(e.zoom),o=this._map._latLngBoundsToNewLayerBounds(this._bounds,e.zoom,e.center).min;gi(this._image,o,n)},_reset:function(){var e=this._image,n=new Ue(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),o=n.getSize();Mt(e,n.min),e.style.width=o.x+"px",e.style.height=o.y+"px"},_updateOpacity:function(){mn(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 e=this.options.errorOverlayUrl;e&&this._url!==e&&(this._url=e,this._image.src=e)},getCenter:function(){return this._bounds.getCenter()}}),vr=function(e,n,o){return new ho(e,n,o)},po=ho.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var e=this._url.tagName==="VIDEO",n=this._image=e?this._url:it("video");if(He(n,"leaflet-image-layer"),this._zoomAnimated&&He(n,"leaflet-zoom-animated"),this.options.className&&He(n,this.options.className),n.onselectstart=M,n.onmousemove=M,n.onloadeddata=h(this.fire,this,"load"),e){for(var o=n.getElementsByTagName("source"),r=[],d=0;d0?r:[n.src];return}we(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 v=0;vd?(n.height=d+"px",He(e,v)):Lt(e,v),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var n=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),o=this._getAnchor();Mt(this._container,n.add(o))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var e=this._map,n=parseInt(mi(this._container,"marginBottom"),10)||0,o=this._container.offsetHeight+n,r=this._containerWidth,d=new fe(this._containerLeft,-o-this._containerBottom);d._add(Xe(this._container));var v=e.layerPointToContainerPoint(d),P=pe(this.options.autoPanPadding),D=pe(this.options.autoPanPaddingTopLeft||P),B=pe(this.options.autoPanPaddingBottomRight||P),ne=e.getSize(),_e=0,Fe=0;v.x+r+B.x>ne.x&&(_e=v.x+r-ne.x+B.x),v.x-_e-D.x<0&&(_e=v.x-D.x),v.y+o+B.y>ne.y&&(Fe=v.y+o-ne.y+B.y),v.y-Fe-D.y<0&&(Fe=v.y-D.y),(_e||Fe)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([_e,Fe]))}},_getAnchor:function(){return pe(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),As=function(e,n){return new Dn(e,n)};qe.mergeOptions({closePopupOnClick:!0}),qe.include({openPopup:function(e,n,o){return this._initOverlay(Dn,e,n,o).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),_n.include({bindPopup:function(e,n){return this._popup=this._initOverlay(Dn,this._popup,e,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(e){return this._popup&&(this instanceof bn||(this._popup._source=this),this._popup._prepareOpen(e||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(e){return this._popup&&this._popup.setContent(e),this},getPopup:function(){return this._popup},_openPopup:function(e){if(!(!this._popup||!this._map)){bi(e);var n=e.layer||e.target;if(this._popup._source===n&&!(n instanceof ni)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(e.latlng);return}this._popup._source=n,this.openPopup(e.latlng)}},_movePopup:function(e){this._popup.setLatLng(e.latlng)},_onKeyPress:function(e){e.originalEvent.keyCode===13&&this._openPopup(e)}});var _o=Nt.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){Nt.prototype.onAdd.call(this,e),this.setOpacity(this.options.opacity),e.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(e){Nt.prototype.onRemove.call(this,e),e.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var e=Nt.prototype.getEvents.call(this);return this.options.permanent||(e.preclick=this.close),e},_initLayout:function(){var e="leaflet-tooltip",n=e+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=it("div",n),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+b(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var n,o,r=this._map,d=this._container,v=r.latLngToContainerPoint(r.getCenter()),P=r.layerPointToContainerPoint(e),D=this.options.direction,B=d.offsetWidth,ne=d.offsetHeight,_e=pe(this.options.offset),Fe=this._getAnchor();D==="top"?(n=B/2,o=ne):D==="bottom"?(n=B/2,o=0):D==="center"?(n=B/2,o=ne/2):D==="right"?(n=0,o=ne/2):D==="left"?(n=B,o=ne/2):P.xthis.options.maxZoom||or?this._retainParent(d,v,P,r):!1)},_retainChildren:function(e,n,o,r){for(var d=2*e;d<2*e+2;d++)for(var v=2*n;v<2*n+2;v++){var P=new fe(d,v);P.z=o+1;var D=this._tileCoordsToKey(P),B=this._tiles[D];if(B&&B.active){B.retain=!0;continue}else B&&B.loaded&&(B.retain=!0);o+1this.options.maxZoom||this.options.minZoom!==void 0&&d1){this._setView(e,o);return}for(var Fe=d.min.y;Fe<=d.max.y;Fe++)for(var et=d.min.x;et<=d.max.x;et++){var un=new fe(et,Fe);if(un.z=this._tileZoom,!!this._isValidTile(un)){var Wt=this._tiles[this._tileCoordsToKey(un)];Wt?Wt.current=!0:P.push(un)}}if(P.sort(function(xn,Jo){return xn.distanceTo(v)-Jo.distanceTo(v)}),P.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Rn=document.createDocumentFragment();for(et=0;eto.max.x)||!n.wrapLat&&(e.yo.max.y))return!1}if(!this.options.bounds)return!0;var r=this._tileCoordsToBounds(e);return st(this.options.bounds).overlaps(r)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var n=this._map,o=this.getTileSize(),r=e.scaleBy(o),d=r.add(o),v=n.unproject(r,e.z),P=n.unproject(d,e.z);return[v,P]},_tileCoordsToBounds:function(e){var n=this._tileCoordsToNwSe(e),o=new wt(n[0],n[1]);return this.options.noWrap||(o=this._map.wrapLatLngBounds(o)),o},_tileCoordsToKey:function(e){return e.x+":"+e.y+":"+e.z},_keyToTileCoords:function(e){var n=e.split(":"),o=new fe(+n[0],+n[1]);return o.z=+n[2],o},_removeTile:function(e){var n=this._tiles[e];n&&(ot(n.el),delete this._tiles[e],this.fire("tileunload",{tile:n.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){He(e,"leaflet-tile");var n=this.getTileSize();e.style.width=n.x+"px",e.style.height=n.y+"px",e.onselectstart=M,e.onmousemove=M,K.ielt9&&this.options.opacity<1&&mn(e,this.options.opacity)},_addTile:function(e,n){var o=this._getTilePos(e),r=this._tileCoordsToKey(e),d=this.createTile(this._wrapCoords(e),h(this._tileReady,this,e));this._initTile(d),this.createTile.length<2&&V(h(this._tileReady,this,e,null,d)),Mt(d,o),this._tiles[r]={el:d,coords:e,current:!0},n.appendChild(d),this.fire("tileloadstart",{tile:d,coords:e})},_tileReady:function(e,n,o){n&&this.fire("tileerror",{error:n,tile:o,coords:e});var r=this._tileCoordsToKey(e);o=this._tiles[r],o&&(o.loaded=+new Date,this._map._fadeAnimated?(mn(o.el,0),O(this._fadeFrame),this._fadeFrame=V(this._updateOpacity,this)):(o.active=!0,this._pruneTiles()),n||(He(o.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:o.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),K.ielt9||!this._map._fadeAnimated?V(this._pruneTiles,this):setTimeout(h(this._pruneTiles,this),250)))},_getTilePos:function(e){return e.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(e){var n=new fe(this._wrapX?T(e.x,this._wrapX):e.x,this._wrapY?T(e.y,this._wrapY):e.y);return n.z=e.z,n},_pxBoundsToTileRange:function(e){var n=this.getTileSize();return new Ue(e.min.unscaleBy(n).floor(),e.max.unscaleBy(n).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var e in this._tiles)if(!this._tiles[e].loaded)return!1;return!0}});function br(e){return new bo(e)}var Yn=bo.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(e,n){this._url=e,n=N(this,n),n.detectRetina&&K.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(e,n){return this._url===e&&n===void 0&&(n=!0),this._url=e,n||this.redraw(),this},createTile:function(e,n){var o=document.createElement("img");return Ie(o,"load",h(this._tileOnLoad,this,n,o)),Ie(o,"error",h(this._tileOnError,this,n,o)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(o.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(o.referrerPolicy=this.options.referrerPolicy),o.alt="",o.src=this.getTileUrl(e),o},getTileUrl:function(e){var n={r:K.retina?"@2x":"",s:this._getSubdomain(e),x:e.x,y:e.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var o=this._globalTileRange.max.y-e.y;this.options.tms&&(n.y=o),n["-y"]=o}return oe(this._url,u(n,this.options))},_tileOnLoad:function(e,n){K.ielt9?setTimeout(h(e,this,null,n),0):e(null,n)},_tileOnError:function(e,n,o){var r=this.options.errorTileUrl;r&&n.getAttribute("src")!==r&&(n.src=r),e(o,n)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,n=this.options.maxZoom,o=this.options.zoomReverse,r=this.options.zoomOffset;return o&&(e=n-e),e+r},_getSubdomain:function(e){var n=Math.abs(e.x+e.y)%this.options.subdomains.length;return this.options.subdomains[n]},_abortLoading:function(){var e,n;for(e in this._tiles)if(this._tiles[e].coords.z!==this._tileZoom&&(n=this._tiles[e].el,n.onload=M,n.onerror=M,!n.complete)){n.src=ke;var o=this._tiles[e].coords;ot(n),delete this._tiles[e],this.fire("tileabort",{tile:n,coords:o})}},_removeTile:function(e){var n=this._tiles[e];if(n)return n.el.setAttribute("src",ke),bo.prototype._removeTile.call(this,e)},_tileReady:function(e,n,o){if(!(!this._map||o&&o.getAttribute("src")===ke))return bo.prototype._tileReady.call(this,e,n,o)}});function wa(e,n){return new Yn(e,n)}var mt=Yn.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(e,n){this._url=e;var o=u({},this.defaultWmsParams);for(var r in n)r in this.options||(o[r]=n[r]);n=N(this,n);var d=n.detectRetina&&K.retina?2:1,v=this.getTileSize();o.width=v.x*d,o.height=v.y*d,this.wmsParams=o},onAdd:function(e){this._crs=this.options.crs||e.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var n=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[n]=this._crs.code,Yn.prototype.onAdd.call(this,e)},getTileUrl:function(e){var n=this._tileCoordsToNwSe(e),o=this._crs,r=Ve(o.project(n[0]),o.project(n[1])),d=r.min,v=r.max,P=(this._wmsVersion>=1.3&&this._crs===ba?[d.y,d.x,v.y,v.x]:[d.x,d.y,v.x,v.y]).join(","),D=Yn.prototype.getTileUrl.call(this,e);return D+U(this.wmsParams,D,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+P},setParams:function(e,n){return u(this.wmsParams,e),n||this.redraw(),this}});function yo(e,n){return new mt(e,n)}Yn.WMS=mt,wa.wms=yo;var On=_n.extend({options:{padding:.1},initialize:function(e){N(this,e),b(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),He(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 e={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(e.zoomanim=this._onAnimZoom),e},_onAnimZoom:function(e){this._updateTransform(e.center,e.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(e,n){var o=this._map.getZoomScale(n,this._zoom),r=this._map.getSize().multiplyBy(.5+this.options.padding),d=this._map.project(this._center,n),v=r.multiplyBy(-o).add(d).subtract(this._map._getNewPixelOrigin(e,n));K.any3d?gi(this._container,v,o):Mt(this._container,v)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var e in this._layers)this._layers[e]._reset()},_onZoomEnd:function(){for(var e in this._layers)this._layers[e]._project()},_updatePaths:function(){for(var e in this._layers)this._layers[e]._update()},_update:function(){var e=this.options.padding,n=this._map.getSize(),o=this._map.containerPointToLayerPoint(n.multiplyBy(-e)).round();this._bounds=new Ue(o,o.add(n.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Yo=On.extend({options:{tolerance:0},getEvents:function(){var e=On.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){On.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");Ie(e,"mousemove",this._onMouseMove,this),Ie(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ie(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){O(this._redrawRequest),delete this._ctx,ot(this._container),Je(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var e;this._redrawBounds=null;for(var n in this._layers)e=this._layers[n],e._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){On.prototype._update.call(this);var e=this._bounds,n=this._container,o=e.getSize(),r=K.retina?2:1;Mt(n,e.min),n.width=r*o.x,n.height=r*o.y,n.style.width=o.x+"px",n.style.height=o.y+"px",K.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){On.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[b(e)]=e;var n=e._order={layer:e,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=n),this._drawLast=n,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(e){this._requestRedraw(e)},_removePath:function(e){var n=e._order,o=n.next,r=n.prev;o?o.prev=r:this._drawLast=r,r?r.next=o:this._drawFirst=o,delete e._order,delete this._layers[b(e)],this._requestRedraw(e)},_updatePath:function(e){this._extendRedrawBounds(e),e._project(),e._update(),this._requestRedraw(e)},_updateStyle:function(e){this._updateDashArray(e),this._requestRedraw(e)},_updateDashArray:function(e){if(typeof e.options.dashArray=="string"){var n=e.options.dashArray.split(/[, ]+/),o=[],r,d;for(d=0;d')}}catch{}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),g={_initContainer:function(){this._container=it("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(On.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var n=e._container=xo("shape");He(n,"leaflet-vml-shape "+(this.options.className||"")),n.coordsize="1 1",e._path=xo("path"),n.appendChild(e._path),this._updateStyle(e),this._layers[b(e)]=e},_addPath:function(e){var n=e._container;this._container.appendChild(n),e.options.interactive&&e.addInteractiveTarget(n)},_removePath:function(e){var n=e._container;ot(n),e.removeInteractiveTarget(n),delete this._layers[b(e)]},_updateStyle:function(e){var n=e._stroke,o=e._fill,r=e.options,d=e._container;d.stroked=!!r.stroke,d.filled=!!r.fill,r.stroke?(n||(n=e._stroke=xo("stroke")),d.appendChild(n),n.weight=r.weight+"px",n.color=r.color,n.opacity=r.opacity,r.dashArray?n.dashStyle=we(r.dashArray)?r.dashArray.join(" "):r.dashArray.replace(/( *, *)/g," "):n.dashStyle="",n.endcap=r.lineCap.replace("butt","flat"),n.joinstyle=r.lineJoin):n&&(d.removeChild(n),e._stroke=null),r.fill?(o||(o=e._fill=xo("fill")),d.appendChild(o),o.color=r.fillColor||r.color,o.opacity=r.fillOpacity):o&&(d.removeChild(o),e._fill=null)},_updateCircle:function(e){var n=e._point.round(),o=Math.round(e._radius),r=Math.round(e._radiusY||o);this._setPath(e,e._empty()?"M0 0":"AL "+n.x+","+n.y+" "+o+","+r+" 0,"+65535*360)},_setPath:function(e,n){e._path.v=n},_bringToFront:function(e){Cn(e._container)},_bringToBack:function(e){qt(e._container)}},c=K.vml?xo:q,X=On.extend({_initContainer:function(){this._container=c("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=c("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ot(this._container),Je(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){On.prototype._update.call(this);var e=this._bounds,n=e.getSize(),o=this._container;(!this._svgSize||!this._svgSize.equals(n))&&(this._svgSize=n,o.setAttribute("width",n.x),o.setAttribute("height",n.y)),Mt(o,e.min),o.setAttribute("viewBox",[e.min.x,e.min.y,n.x,n.y].join(" ")),this.fire("update")}},_initPath:function(e){var n=e._path=c("path");e.options.className&&He(n,e.options.className),e.options.interactive&&He(n,"leaflet-interactive"),this._updateStyle(e),this._layers[b(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){ot(e._path),e.removeInteractiveTarget(e._path),delete this._layers[b(e)]},_updatePath:function(e){e._project(),e._update()},_updateStyle:function(e){var n=e._path,o=e.options;n&&(o.stroke?(n.setAttribute("stroke",o.color),n.setAttribute("stroke-opacity",o.opacity),n.setAttribute("stroke-width",o.weight),n.setAttribute("stroke-linecap",o.lineCap),n.setAttribute("stroke-linejoin",o.lineJoin),o.dashArray?n.setAttribute("stroke-dasharray",o.dashArray):n.removeAttribute("stroke-dasharray"),o.dashOffset?n.setAttribute("stroke-dashoffset",o.dashOffset):n.removeAttribute("stroke-dashoffset")):n.setAttribute("stroke","none"),o.fill?(n.setAttribute("fill",o.fillColor||o.color),n.setAttribute("fill-opacity",o.fillOpacity),n.setAttribute("fill-rule",o.fillRule||"evenodd")):n.setAttribute("fill","none"))},_updatePoly:function(e,n){this._setPath(e,W(e._parts,n))},_updateCircle:function(e){var n=e._point,o=Math.max(Math.round(e._radius),1),r=Math.max(Math.round(e._radiusY),1)||o,d="a"+o+","+r+" 0 1,0 ",v=e._empty()?"M0 0":"M"+(n.x-o)+","+n.y+d+o*2+",0 "+d+-o*2+",0 ";this._setPath(e,v)},_setPath:function(e,n){e._path.setAttribute("d",n)},_bringToFront:function(e){Cn(e._path)},_bringToBack:function(e){qt(e._path)}});K.vml&&X.include(g);function k(e){return K.svg||K.vml?new X(e):null}qe.include({getRenderer:function(e){var n=e.options.renderer||this._getPaneRenderer(e.options.pane)||this.options.renderer||this._renderer;return n||(n=this._renderer=this._createRenderer()),this.hasLayer(n)||this.addLayer(n),n},_getPaneRenderer:function(e){if(e==="overlayPane"||e===void 0)return!1;var n=this._paneRenderers[e];return n===void 0&&(n=this._createRenderer({pane:e}),this._paneRenderers[e]=n),n},_createRenderer:function(e){return this.options.preferCanvas&&ka(e)||k(e)}});var Be=Fn.extend({initialize:function(e,n){Fn.prototype.initialize.call(this,this._boundsToLatLngs(e),n)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=st(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function id(e,n){return new Be(e,n)}X.create=c,X.pointsToPath=W,yn.geometryToLayer=ii,yn.coordsToLatLng=oi,yn.coordsToLatLngs=ki,yn.latLngToCoords=Ls,yn.latLngsToCoords=Go,yn.getFeature=Qe,yn.asFeature=En,qe.mergeOptions({boxZoom:!0});var bl=An.extend({initialize:function(e){this._map=e,this._container=e._container,this._pane=e._panes.overlayPane,this._resetStateTimeout=0,e.on("unload",this._destroy,this)},addHooks:function(){Ie(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){Je(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ot(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(e){if(!e.shiftKey||e.which!==1&&e.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),In(),Fi(),this._startPoint=this._map.mouseEventToContainerPoint(e),Ie(document,{contextmenu:bi,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=it("div","leaflet-zoom-box",this._container),He(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var n=new Ue(this._point,this._startPoint),o=n.getSize();Mt(this._box,n.min),this._box.style.width=o.x+"px",this._box.style.height=o.y+"px"},_finish:function(){this._moved&&(ot(this._box),Lt(this._container,"leaflet-crosshair")),vi(),Di(),Je(document,{contextmenu:bi,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(e){if(!(e.which!==1&&e.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(h(this._resetState,this),0);var n=new wt(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(n).fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(e){e.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});qe.addInitHook("addHandler","boxZoom",bl),qe.mergeOptions({doubleClickZoom:!0});var yl=An.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(e){var n=this._map,o=n.getZoom(),r=n.options.zoomDelta,d=e.originalEvent.shiftKey?o-r:o+r;n.options.doubleClickZoom==="center"?n.setZoom(d):n.setZoomAround(e.containerPoint,d)}});qe.addInitHook("addHandler","doubleClickZoom",yl),qe.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var xl=An.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new vn(e._mapPane,e._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),e.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),e.on("zoomend",this._onZoomEnd,this),e.whenReady(this._onZoomEnd,this))}He(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Lt(this._map._container,"leaflet-grab"),Lt(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 e=this._map;if(e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var n=st(this._map.options.maxBounds);this._offsetLimit=Ve(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;e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(e){if(this._map.options.inertia){var n=this._lastTime=+new Date,o=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(o),this._times.push(n),this._prunePositions(n)}this._map.fire("move",e).fire("drag",e)},_prunePositions:function(e){for(;this._positions.length>1&&e-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var e=this._map.getSize().divideBy(2),n=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=n.subtract(e).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(e,n){return e-(e-n)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var e=this._draggable._newPos.subtract(this._draggable._startPos),n=this._offsetLimit;e.xn.max.x&&(e.x=this._viscousLimit(e.x,n.max.x)),e.y>n.max.y&&(e.y=this._viscousLimit(e.y,n.max.y)),this._draggable._newPos=this._draggable._startPos.add(e)}},_onPreDragWrap:function(){var e=this._worldWidth,n=Math.round(e/2),o=this._initialWorldOffset,r=this._draggable._newPos.x,d=(r-n+o)%e+n-o,v=(r+n+o)%e-n-o,P=Math.abs(d+o)0?v:-v))-n;this._delta=0,this._startTime=null,P&&(e.options.scrollWheelZoom==="center"?e.setZoom(n+P):e.setZoomAround(this._lastMousePos,n+P))}});qe.addInitHook("addHandler","scrollWheelZoom",kl);var od=600;qe.mergeOptions({tapHold:K.touchNative&&K.safari&&K.mobile,tapTolerance:15});var Sl=An.extend({addHooks:function(){Ie(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){Je(this._map._container,"touchstart",this._onDown,this)},_onDown:function(e){if(clearTimeout(this._holdTimeout),e.touches.length===1){var n=e.touches[0];this._startPos=this._newPos=new fe(n.clientX,n.clientY),this._holdTimeout=setTimeout(h(function(){this._cancel(),this._isTapValid()&&(Ie(document,"touchend",Dt),Ie(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",n))},this),od),Ie(document,"touchend touchcancel contextmenu",this._cancel,this),Ie(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){Je(document,"touchend",Dt),Je(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),Je(document,"touchend touchcancel contextmenu",this._cancel,this),Je(document,"touchmove",this._onMove,this)},_onMove:function(e){var n=e.touches[0];this._newPos=new fe(n.clientX,n.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(e,n){var o=new MouseEvent(e,{bubbles:!0,cancelable:!0,view:window,screenX:n.screenX,screenY:n.screenY,clientX:n.clientX,clientY:n.clientY});o._simulated=!0,n.target.dispatchEvent(o)}});qe.addInitHook("addHandler","tapHold",Sl),qe.mergeOptions({touchZoom:K.touch,bounceAtZoomLimits:!0});var Tl=An.extend({addHooks:function(){He(this._map._container,"leaflet-touch-zoom"),Ie(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Lt(this._map._container,"leaflet-touch-zoom"),Je(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(e){var n=this._map;if(!(!e.touches||e.touches.length!==2||n._animatingZoom||this._zooming)){var o=n.mouseEventToContainerPoint(e.touches[0]),r=n.mouseEventToContainerPoint(e.touches[1]);this._centerPoint=n.getSize()._divideBy(2),this._startLatLng=n.containerPointToLatLng(this._centerPoint),n.options.touchZoom!=="center"&&(this._pinchStartLatLng=n.containerPointToLatLng(o.add(r)._divideBy(2))),this._startDist=o.distanceTo(r),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),Ie(document,"touchmove",this._onTouchMove,this),Ie(document,"touchend touchcancel",this._onTouchEnd,this),Dt(e)}},_onTouchMove:function(e){if(!(!e.touches||e.touches.length!==2||!this._zooming)){var n=this._map,o=n.mouseEventToContainerPoint(e.touches[0]),r=n.mouseEventToContainerPoint(e.touches[1]),d=o.distanceTo(r)/this._startDist;if(this._zoom=n.getScaleZoom(d,this._startZoom),!n.options.bounceAtZoomLimits&&(this._zoomn.getMaxZoom()&&d>1)&&(this._zoom=n._limitZoom(this._zoom)),n.options.touchZoom==="center"){if(this._center=this._startLatLng,d===1)return}else{var v=o._add(r)._divideBy(2)._subtract(this._centerPoint);if(d===1&&v.x===0&&v.y===0)return;this._center=n.unproject(n.project(this._pinchStartLatLng,this._zoom).subtract(v),this._zoom)}this._moved||(n._moveStart(!0,!1),this._moved=!0),O(this._animRequest);var P=h(n._move,n,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=V(P,this,!0),Dt(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,O(this._animRequest),Je(document,"touchmove",this._onTouchMove,this),Je(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});qe.addInitHook("addHandler","touchZoom",Tl),qe.BoxZoom=bl,qe.DoubleClickZoom=yl,qe.Drag=xl,qe.Keyboard=wl,qe.ScrollWheelZoom=kl,qe.TapHold=Sl,qe.TouchZoom=Tl,s.Bounds=Ue,s.Browser=K,s.CRS=zt,s.Canvas=Yo,s.Circle=Wi,s.CircleMarker=wi,s.Class=$,s.Control=en,s.DivIcon=Ms,s.DivOverlay=Nt,s.DomEvent=Vi,s.DomUtil=Ln,s.Draggable=vn,s.Evented=ge,s.FeatureGroup=bn,s.GeoJSON=yn,s.GridLayer=bo,s.Handler=An,s.Icon=ji,s.ImageOverlay=ho,s.LatLng=Me,s.LatLngBounds=wt,s.Layer=_n,s.LayerGroup=qn,s.LineUtil=dr,s.Map=qe,s.Marker=Wo,s.Mixin=rr,s.Path=ni,s.Point=fe,s.PolyUtil=lr,s.Polygon=Fn,s.Polyline=tn,s.Popup=Dn,s.PosAnimation=so,s.Projection=fr,s.Rectangle=Be,s.Renderer=On,s.SVG=X,s.SVGOverlay=go,s.TileLayer=Yn,s.Tooltip=_o,s.Transformation=kt,s.Util=F,s.VideoOverlay=po,s.bind=h,s.bounds=Ve,s.canvas=ka,s.circle=Rt,s.circleMarker=fo,s.control=ln,s.divIcon=xa,s.extend=u,s.featureGroup=Ps,s.geoJSON=qo,s.geoJson=gr,s.gridLayer=br,s.icon=pr,s.imageOverlay=vr,s.latLng=De,s.latLngBounds=st,s.layerGroup=uo,s.map=Vo,s.marker=mr,s.point=pe,s.polygon=ya,s.polyline=Ko,s.popup=As,s.rectangle=id,s.setOptions=N,s.stamp=b,s.svg=k,s.svgOverlay=vo,s.tileLayer=wa,s.tooltip=_r,s.transformation=w,s.version=l,s.videoOverlay=mo;var sd=window.L;s.noConflict=function(){return window.L=sd,this},window.L=s}))})(Ds,Ds.exports)),Ds.exports}var fm=dm();const qi=um(fm),Cu={__name:"DeviceMap",props:{position:{type:Object,default:null},trail:{type:Array,default:()=>[]},aircraft:{type:Array,default:()=>[]}},setup(t){const i=t,s=Y(null);let l,u,f,h;const _=new Map;function b(G,N){const U=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0",R=N?"#8a94a6":U,oe=typeof G=="number"?G:0;return qi.divIcon({className:"plane-marker",iconSize:[22,22],iconAnchor:[11,11],html:``})}function C(G){const U=[`${G.callsign||G.icao24||"aircraft"}`];return G.country&&U.push(G.country),typeof G.altitude=="number"&&U.push(`${Math.round(G.altitude)} m`),typeof G.velocity=="number"&&U.push(`${Math.round(G.velocity*3.6)} km/h`),G.onGround&&U.push("on ground"),U.join(" · ")}function T(){if(!l)return;h||(h=qi.layerGroup().addTo(l));const G=new Set;for(const N of i.aircraft){if(typeof N.lat!="number"||typeof N.lng!="number")continue;G.add(N.icao24);const U=[N.lat,N.lng];let R=_.get(N.icao24);R?(R.setLatLng(U),R.setIcon(b(N.heading,N.onGround)),R.setTooltipContent(C(N))):(R=qi.marker(U,{icon:b(N.heading,N.onGround)}).bindTooltip(C(N)),R.addTo(h),_.set(N.icao24,R))}for(const[N,U]of _)G.has(N)||(h.removeLayer(U),_.delete(N))}function M(){if(!l)return;const G=i.position;if(G&&(G.lat||G.lng)){const N=[G.lat,G.lng];u?u.setLatLng(N):(u=qi.marker(N).addTo(l),l.setView(N,17))}if(f&&f.remove(),i.trail.length){const N=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0";f=qi.polyline(i.trail,{color:N,weight:3}).addTo(l)}}ti(()=>{l=qi.map(s.value,{zoomControl:!0}).setView([20,0],2),qi.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",maxZoom:19}).addTo(l),setTimeout(()=>l.invalidateSize(),60),M(),T(),(!i.position||!i.position.lat&&!i.position.lng)&&i.aircraft.length&&j()});let H=!1;function j(){if(H||!l||!i.aircraft.length)return;const G=i.aircraft.filter(N=>typeof N.lat=="number"&&typeof N.lng=="number").map(N=>[N.lat,N.lng]);G.length&&(l.fitBounds(qi.latLngBounds(G).pad(.2)),H=!0)}return us(()=>{l&&l.remove(),l=null}),Bt(()=>i.position,M,{deep:!0}),Bt(()=>i.trail,M,{deep:!0}),Bt(()=>i.aircraft,()=>{T(),(!i.position||!i.position.lat&&!i.position.lng)&&j()},{deep:!0}),(G,N)=>(p(),m("div",{ref_key:"el",ref:s,class:"h-[320px] w-full rounded-lg"},null,512))}},hm=["width","height","stroke-width"],pm=["d"],Q={__name:"Icon",props:{name:{type:String,required:!0},size:{type:[Number,String],default:18},stroke:{type:[Number,String],default:2}},setup(t){const l=({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",eye:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7z M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",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"}[t.name]||"").split(" M").map((u,f)=>f?"M"+u:u);return(u,f)=>(p(),m("svg",{width:t.size,height:t.size,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":t.stroke,"stroke-linecap":"round","stroke-linejoin":"round",style:{flex:"none"},"aria-hidden":"true"},[(p(!0),m(ae,null,ze($e(l),(h,_)=>(p(),m("path",{key:_,d:h},null,8,pm))),128))],8,hm))}},mm=["aria-checked","disabled"],nn={__name:"Toggle",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:i}){const s=i;return(l,u)=>(p(),m("button",{type:"button",role:"switch","aria-checked":t.modelValue,disabled:t.disabled,class:Pe(["relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition disabled:opacity-40",t.modelValue?"bg-accent":"bg-surface-2 border border-line-strong"]),onClick:u[0]||(u[0]=f=>s("update:modelValue",!t.modelValue))},[a("span",{class:Pe(["inline-block h-4 w-4 transform rounded-full bg-white shadow-sm transition",t.modelValue?"translate-x-6":"translate-x-1"])},null,2)],10,mm))}},gm={class:"inline-flex rounded-[10px] border border-line bg-surface-2 p-0.5"},vm=["onClick"],wn={__name:"Segmented",props:{modelValue:{type:[String,Number],default:""},options:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(t,{emit:i}){const s=i;return(l,u)=>(p(),m("div",gm,[(p(!0),m(ae,null,ze(t.options,f=>(p(),m("button",{key:f.value,type:"button",class:Pe(["inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] font-semibold transition",t.modelValue===f.value?"bg-surface-1 text-ink shadow-xs":"text-ink-secondary hover:text-ink"]),onClick:h=>s("update:modelValue",f.value)},[f.icon?(p(),nt(Q,{key:0,name:f.icon,size:15},null,8,["name"])):I("",!0),z(" "+x(f.label),1)],10,vm))),128))]))}},_m={class:"text-sm font-semibold text-ink"},bm={key:0,class:"mt-0.5 text-xs text-ink-muted"},xe={__name:"Row",props:{title:{type:String,default:""},desc:{type:String,default:""},keywords:{type:String,default:""},block:{type:Boolean,default:!1}},setup(t){const i=t,s=Vs("settingsSearch",{value:""}),l=de(()=>{const u=(s.value||"").trim().toLowerCase();return u?`${i.title} ${i.desc} ${i.keywords}`.toLowerCase().includes(u):!0});return(u,f)=>l.value?(p(),m("div",{key:0,class:Pe(["border-b border-line py-4 last:border-0",t.block?"":"flex items-center justify-between gap-6"])},[a("div",{class:Pe(t.block?"mb-3":"min-w-0")},[a("div",_m,x(t.title),1),t.desc?(p(),m("div",bm,x(t.desc),1)):I("",!0)],2),a("div",{class:Pe(t.block?"":"shrink-0")},[Tf(u.$slots,"default")],2)],2)):I("",!0)}},ia=[{code:"AL",name:"Albania",continent:"EU",bbox:"39.6,19.3,42.7,21.1"},{code:"AD",name:"Andorra",continent:"EU",bbox:"42.4,1.4,42.7,1.8"},{code:"AT",name:"Austria",continent:"EU",bbox:"46.4,9.5,49.0,17.2"},{code:"BY",name:"Belarus",continent:"EU",bbox:"51.2,23.2,56.2,32.8"},{code:"BE",name:"Belgium",continent:"EU",bbox:"49.5,2.5,51.5,6.4"},{code:"BA",name:"Bosnia and Herzegovina",continent:"EU",bbox:"42.6,15.7,45.3,19.6"},{code:"BG",name:"Bulgaria",continent:"EU",bbox:"41.2,22.4,44.2,28.6"},{code:"HR",name:"Croatia",continent:"EU",bbox:"42.4,13.5,46.6,19.4"},{code:"CY",name:"Cyprus",continent:"EU",bbox:"34.6,32.3,35.7,34.6"},{code:"CZ",name:"Czechia",continent:"EU",bbox:"48.6,12.1,51.1,18.9"},{code:"DK",name:"Denmark",continent:"EU",bbox:"54.6,8.1,57.8,12.7"},{code:"EE",name:"Estonia",continent:"EU",bbox:"57.5,21.8,59.7,28.2"},{code:"FI",name:"Finland",continent:"EU",bbox:"59.8,20.6,70.1,31.6"},{code:"FR",name:"France",continent:"EU",bbox:"41.3,-5.2,51.1,9.6"},{code:"DE",name:"Germany",continent:"EU",bbox:"47.2,5.8,55.1,15.1"},{code:"GR",name:"Greece",continent:"EU",bbox:"34.8,19.4,41.8,28.3"},{code:"HU",name:"Hungary",continent:"EU",bbox:"45.7,16.1,48.6,22.9"},{code:"IS",name:"Iceland",continent:"EU",bbox:"63.3,-24.6,66.6,-13.5"},{code:"IE",name:"Ireland",continent:"EU",bbox:"51.4,-10.6,55.4,-6.0"},{code:"IT",name:"Italy",continent:"EU",bbox:"36.6,6.6,47.1,18.6"},{code:"XK",name:"Kosovo",continent:"EU",bbox:"41.8,20.0,43.3,21.8"},{code:"LV",name:"Latvia",continent:"EU",bbox:"55.7,20.9,58.1,28.2"},{code:"LI",name:"Liechtenstein",continent:"EU",bbox:"47.0,9.4,47.3,9.6"},{code:"LT",name:"Lithuania",continent:"EU",bbox:"53.9,20.9,56.5,26.9"},{code:"LU",name:"Luxembourg",continent:"EU",bbox:"49.4,5.7,50.2,6.5"},{code:"MT",name:"Malta",continent:"EU",bbox:"35.8,14.1,36.1,14.6"},{code:"MD",name:"Moldova",continent:"EU",bbox:"45.4,26.6,48.5,30.2"},{code:"MC",name:"Monaco",continent:"EU",bbox:"43.72,7.40,43.75,7.44"},{code:"ME",name:"Montenegro",continent:"EU",bbox:"41.8,18.4,43.6,20.4"},{code:"NL",name:"Netherlands",continent:"EU",bbox:"50.7,3.3,53.7,7.2"},{code:"MK",name:"North Macedonia",continent:"EU",bbox:"40.8,20.4,42.4,23.0"},{code:"NO",name:"Norway",continent:"EU",bbox:"57.9,4.6,71.2,31.1"},{code:"PL",name:"Poland",continent:"EU",bbox:"49.0,14.1,54.9,24.2"},{code:"PT",name:"Portugal",continent:"EU",bbox:"36.9,-9.5,42.2,-6.2"},{code:"RO",name:"Romania",continent:"EU",bbox:"43.6,20.2,48.3,29.7"},{code:"SM",name:"San Marino",continent:"EU",bbox:"43.89,12.40,43.99,12.52"},{code:"RS",name:"Serbia",continent:"EU",bbox:"42.2,18.8,46.2,23.0"},{code:"SK",name:"Slovakia",continent:"EU",bbox:"47.7,16.8,49.6,22.6"},{code:"SI",name:"Slovenia",continent:"EU",bbox:"45.4,13.4,46.9,16.6"},{code:"ES",name:"Spain",continent:"EU",bbox:"35.9,-9.4,43.8,3.4"},{code:"SE",name:"Sweden",continent:"EU",bbox:"55.3,11.1,69.1,24.2"},{code:"CH",name:"Switzerland",continent:"EU",bbox:"45.8,5.9,47.8,10.5"},{code:"UA",name:"Ukraine",continent:"EU",bbox:"44.4,22.1,52.4,40.2"},{code:"GB",name:"United Kingdom",continent:"EU",bbox:"49.9,-8.7,60.9,1.8"},{code:"VA",name:"Vatican City",continent:"EU",bbox:"41.900,12.445,41.908,12.458"},{code:"RU",name:"Russia",continent:"EU",bbox:"41.2,19.6,81.9,180"},{code:"TR",name:"Turkey",continent:"EU",bbox:"35.8,25.7,42.3,44.8"},{code:"AF",name:"Afghanistan",continent:"AS",bbox:"29.4,60.5,38.5,74.9"},{code:"AM",name:"Armenia",continent:"AS",bbox:"38.8,43.4,41.3,46.6"},{code:"AZ",name:"Azerbaijan",continent:"AS",bbox:"38.4,44.8,41.9,50.4"},{code:"BH",name:"Bahrain",continent:"AS",bbox:"25.8,50.4,26.3,50.7"},{code:"BD",name:"Bangladesh",continent:"AS",bbox:"20.7,88.0,26.6,92.7"},{code:"BT",name:"Bhutan",continent:"AS",bbox:"26.7,88.7,28.3,92.1"},{code:"BN",name:"Brunei",continent:"AS",bbox:"4.0,114.0,5.1,115.4"},{code:"KH",name:"Cambodia",continent:"AS",bbox:"10.4,102.3,14.7,107.6"},{code:"CN",name:"China",continent:"AS",bbox:"18.2,73.5,53.6,134.8"},{code:"GE",name:"Georgia",continent:"AS",bbox:"41.0,40.0,43.6,46.7"},{code:"IN",name:"India",continent:"AS",bbox:"6.7,68.1,35.5,97.4"},{code:"ID",name:"Indonesia",continent:"AS",bbox:"-11.0,95.0,6.1,141.0"},{code:"IR",name:"Iran",continent:"AS",bbox:"25.0,44.0,39.8,63.3"},{code:"IQ",name:"Iraq",continent:"AS",bbox:"29.1,38.8,37.4,48.6"},{code:"IL",name:"Israel",continent:"AS",bbox:"29.5,34.2,33.3,35.9"},{code:"JP",name:"Japan",continent:"AS",bbox:"24.0,122.9,45.5,145.8"},{code:"JO",name:"Jordan",continent:"AS",bbox:"29.2,34.9,33.4,39.3"},{code:"KZ",name:"Kazakhstan",continent:"AS",bbox:"40.6,46.5,55.4,87.3"},{code:"KW",name:"Kuwait",continent:"AS",bbox:"28.5,46.5,30.1,48.4"},{code:"KG",name:"Kyrgyzstan",continent:"AS",bbox:"39.2,69.3,43.3,80.3"},{code:"LA",name:"Laos",continent:"AS",bbox:"13.9,100.1,22.5,107.7"},{code:"LB",name:"Lebanon",continent:"AS",bbox:"33.0,35.1,34.7,36.6"},{code:"MY",name:"Malaysia",continent:"AS",bbox:"0.9,99.6,7.4,119.3"},{code:"MV",name:"Maldives",continent:"AS",bbox:"-0.7,72.7,7.1,73.7"},{code:"MN",name:"Mongolia",continent:"AS",bbox:"41.6,87.7,52.1,119.9"},{code:"MM",name:"Myanmar",continent:"AS",bbox:"9.8,92.2,28.5,101.2"},{code:"NP",name:"Nepal",continent:"AS",bbox:"26.3,80.1,30.4,88.2"},{code:"KP",name:"North Korea",continent:"AS",bbox:"37.7,124.2,43.0,130.7"},{code:"OM",name:"Oman",continent:"AS",bbox:"16.6,52.0,26.4,59.8"},{code:"PK",name:"Pakistan",continent:"AS",bbox:"23.7,60.9,37.1,77.8"},{code:"PH",name:"Philippines",continent:"AS",bbox:"4.6,116.9,21.1,126.6"},{code:"QA",name:"Qatar",continent:"AS",bbox:"24.5,50.7,26.2,51.6"},{code:"SA",name:"Saudi Arabia",continent:"AS",bbox:"16.4,34.6,32.2,55.7"},{code:"SG",name:"Singapore",continent:"AS",bbox:"1.2,103.6,1.5,104.1"},{code:"KR",name:"South Korea",continent:"AS",bbox:"33.1,125.9,38.6,129.6"},{code:"LK",name:"Sri Lanka",continent:"AS",bbox:"5.9,79.7,9.8,81.9"},{code:"SY",name:"Syria",continent:"AS",bbox:"32.3,35.7,37.3,42.4"},{code:"TW",name:"Taiwan",continent:"AS",bbox:"21.9,120.0,25.3,122.0"},{code:"TJ",name:"Tajikistan",continent:"AS",bbox:"36.7,67.4,41.0,75.2"},{code:"TH",name:"Thailand",continent:"AS",bbox:"5.6,97.3,20.5,105.6"},{code:"TL",name:"Timor-Leste",continent:"AS",bbox:"-9.5,124.0,-8.1,127.3"},{code:"TM",name:"Turkmenistan",continent:"AS",bbox:"35.1,52.4,42.8,66.7"},{code:"AE",name:"United Arab Emirates",continent:"AS",bbox:"22.6,51.5,26.1,56.4"},{code:"UZ",name:"Uzbekistan",continent:"AS",bbox:"37.2,55.9,45.6,73.1"},{code:"VN",name:"Vietnam",continent:"AS",bbox:"8.2,102.1,23.4,109.5"},{code:"YE",name:"Yemen",continent:"AS",bbox:"12.1,42.5,19.0,54.5"},{code:"DZ",name:"Algeria",continent:"AF",bbox:"18.9,-8.7,37.1,12.0"},{code:"AO",name:"Angola",continent:"AF",bbox:"-18.0,11.6,-4.4,24.1"},{code:"BJ",name:"Benin",continent:"AF",bbox:"6.2,0.8,12.4,3.9"},{code:"BW",name:"Botswana",continent:"AF",bbox:"-26.9,20.0,-17.8,29.4"},{code:"BF",name:"Burkina Faso",continent:"AF",bbox:"9.4,-5.5,15.1,2.4"},{code:"BI",name:"Burundi",continent:"AF",bbox:"-4.5,29.0,-2.3,30.8"},{code:"CV",name:"Cabo Verde",continent:"AF",bbox:"14.8,-25.4,17.2,-22.7"},{code:"CM",name:"Cameroon",continent:"AF",bbox:"1.7,8.5,13.1,16.2"},{code:"CF",name:"Central African Republic",continent:"AF",bbox:"2.2,14.4,11.0,27.5"},{code:"TD",name:"Chad",continent:"AF",bbox:"7.4,13.5,23.4,24.0"},{code:"KM",name:"Comoros",continent:"AF",bbox:"-12.4,43.2,-11.4,44.5"},{code:"CG",name:"Congo",continent:"AF",bbox:"-5.0,11.1,3.7,18.6"},{code:"CD",name:"DR Congo",continent:"AF",bbox:"-13.5,12.2,5.4,31.3"},{code:"DJ",name:"Djibouti",continent:"AF",bbox:"10.9,41.7,12.7,43.4"},{code:"EG",name:"Egypt",continent:"AF",bbox:"22.0,25.0,31.7,36.9"},{code:"GQ",name:"Equatorial Guinea",continent:"AF",bbox:"0.9,9.3,3.8,11.4"},{code:"ER",name:"Eritrea",continent:"AF",bbox:"12.4,36.4,18.0,43.1"},{code:"SZ",name:"Eswatini",continent:"AF",bbox:"-27.3,30.8,-25.7,32.1"},{code:"ET",name:"Ethiopia",continent:"AF",bbox:"3.4,33.0,14.9,48.0"},{code:"GA",name:"Gabon",continent:"AF",bbox:"-4.0,8.7,2.3,14.5"},{code:"GM",name:"Gambia",continent:"AF",bbox:"13.1,-16.8,13.8,-13.8"},{code:"GH",name:"Ghana",continent:"AF",bbox:"4.7,-3.3,11.2,1.2"},{code:"GN",name:"Guinea",continent:"AF",bbox:"7.2,-15.1,12.7,-7.6"},{code:"GW",name:"Guinea-Bissau",continent:"AF",bbox:"10.9,-16.7,12.7,-13.6"},{code:"CI",name:"Ivory Coast",continent:"AF",bbox:"4.4,-8.6,10.7,-2.5"},{code:"KE",name:"Kenya",continent:"AF",bbox:"-4.7,33.9,5.5,41.9"},{code:"LS",name:"Lesotho",continent:"AF",bbox:"-30.7,27.0,-28.6,29.5"},{code:"LR",name:"Liberia",continent:"AF",bbox:"4.3,-11.5,8.6,-7.4"},{code:"LY",name:"Libya",continent:"AF",bbox:"19.5,9.3,33.2,25.2"},{code:"MG",name:"Madagascar",continent:"AF",bbox:"-25.6,43.2,-11.9,50.5"},{code:"MW",name:"Malawi",continent:"AF",bbox:"-17.1,32.7,-9.4,35.9"},{code:"ML",name:"Mali",continent:"AF",bbox:"10.1,-12.3,25.0,4.3"},{code:"MR",name:"Mauritania",continent:"AF",bbox:"14.7,-17.1,27.3,-4.8"},{code:"MU",name:"Mauritius",continent:"AF",bbox:"-20.5,57.3,-19.9,57.8"},{code:"MA",name:"Morocco",continent:"AF",bbox:"27.7,-13.2,35.9,-1.0"},{code:"MZ",name:"Mozambique",continent:"AF",bbox:"-26.9,30.2,-10.5,40.8"},{code:"NA",name:"Namibia",continent:"AF",bbox:"-28.9,11.7,-16.9,25.3"},{code:"NE",name:"Niger",continent:"AF",bbox:"11.7,0.2,23.5,16.0"},{code:"NG",name:"Nigeria",continent:"AF",bbox:"4.3,2.7,13.9,14.7"},{code:"RW",name:"Rwanda",continent:"AF",bbox:"-2.8,28.9,-1.1,30.9"},{code:"SN",name:"Senegal",continent:"AF",bbox:"12.3,-17.5,16.7,-11.4"},{code:"SL",name:"Sierra Leone",continent:"AF",bbox:"6.9,-13.3,10.0,-10.3"},{code:"SO",name:"Somalia",continent:"AF",bbox:"-1.7,40.9,12.0,51.4"},{code:"ZA",name:"South Africa",continent:"AF",bbox:"-34.8,16.5,-22.1,32.9"},{code:"SS",name:"South Sudan",continent:"AF",bbox:"3.5,24.1,12.2,35.9"},{code:"SD",name:"Sudan",continent:"AF",bbox:"8.7,21.8,22.2,38.6"},{code:"TZ",name:"Tanzania",continent:"AF",bbox:"-11.7,29.3,-1.0,40.4"},{code:"TG",name:"Togo",continent:"AF",bbox:"6.1,-0.1,11.1,1.8"},{code:"TN",name:"Tunisia",continent:"AF",bbox:"30.2,7.5,37.5,11.6"},{code:"UG",name:"Uganda",continent:"AF",bbox:"-1.5,29.6,4.2,35.0"},{code:"ZM",name:"Zambia",continent:"AF",bbox:"-18.1,21.9,-8.2,33.7"},{code:"ZW",name:"Zimbabwe",continent:"AF",bbox:"-22.4,25.2,-15.6,33.1"},{code:"CA",name:"Canada",continent:"NA",bbox:"41.7,-141.0,83.1,-52.6"},{code:"US",name:"United States",continent:"NA",bbox:"24.4,-125.0,49.4,-66.9"},{code:"MX",name:"Mexico",continent:"NA",bbox:"14.5,-118.4,32.7,-86.7"},{code:"GT",name:"Guatemala",continent:"NA",bbox:"13.7,-92.2,17.8,-88.2"},{code:"BZ",name:"Belize",continent:"NA",bbox:"15.9,-89.2,18.5,-87.8"},{code:"SV",name:"El Salvador",continent:"NA",bbox:"13.1,-90.1,14.4,-87.7"},{code:"HN",name:"Honduras",continent:"NA",bbox:"12.9,-89.4,16.5,-83.1"},{code:"NI",name:"Nicaragua",continent:"NA",bbox:"10.7,-87.7,15.0,-83.1"},{code:"CR",name:"Costa Rica",continent:"NA",bbox:"8.0,-85.9,11.2,-82.5"},{code:"PA",name:"Panama",continent:"NA",bbox:"7.2,-83.1,9.6,-77.2"},{code:"CU",name:"Cuba",continent:"NA",bbox:"19.8,-85.0,23.3,-74.1"},{code:"DO",name:"Dominican Republic",continent:"NA",bbox:"17.5,-72.0,19.9,-68.3"},{code:"HT",name:"Haiti",continent:"NA",bbox:"18.0,-74.5,20.1,-71.6"},{code:"JM",name:"Jamaica",continent:"NA",bbox:"17.7,-78.4,18.5,-76.2"},{code:"BS",name:"Bahamas",continent:"NA",bbox:"20.9,-79.0,27.3,-72.7"},{code:"TT",name:"Trinidad and Tobago",continent:"NA",bbox:"10.0,-61.9,11.4,-60.5"},{code:"AR",name:"Argentina",continent:"SA",bbox:"-55.1,-73.6,-21.8,-53.6"},{code:"BO",name:"Bolivia",continent:"SA",bbox:"-22.9,-69.6,-9.7,-57.5"},{code:"BR",name:"Brazil",continent:"SA",bbox:"-33.8,-74.0,5.3,-34.8"},{code:"CL",name:"Chile",continent:"SA",bbox:"-55.9,-75.6,-17.5,-66.4"},{code:"CO",name:"Colombia",continent:"SA",bbox:"-4.2,-79.0,12.5,-66.9"},{code:"EC",name:"Ecuador",continent:"SA",bbox:"-5.0,-81.1,1.4,-75.2"},{code:"GY",name:"Guyana",continent:"SA",bbox:"1.2,-61.4,8.6,-56.5"},{code:"PY",name:"Paraguay",continent:"SA",bbox:"-27.6,-62.6,-19.3,-54.3"},{code:"PE",name:"Peru",continent:"SA",bbox:"-18.4,-81.3,0.0,-68.7"},{code:"SR",name:"Suriname",continent:"SA",bbox:"1.8,-58.1,6.0,-54.0"},{code:"UY",name:"Uruguay",continent:"SA",bbox:"-35.0,-58.4,-30.1,-53.1"},{code:"VE",name:"Venezuela",continent:"SA",bbox:"0.6,-73.4,12.2,-59.8"},{code:"AU",name:"Australia",continent:"OC",bbox:"-43.6,113.3,-10.7,153.6"},{code:"NZ",name:"New Zealand",continent:"OC",bbox:"-47.3,166.4,-34.4,178.6"},{code:"PG",name:"Papua New Guinea",continent:"OC",bbox:"-11.7,140.8,-1.3,155.9"},{code:"FJ",name:"Fiji",continent:"OC",bbox:"-19.2,177.0,-16.0,180.0"}],ym=new Map(ia.map(t=>[t.code,t]));function xm(t){const i=String(t||"").split(",").map(s=>Number(s.trim()));return i.length!==4||i.some(s=>Number.isNaN(s))?null:i}function wm(t){const i=ym.get(t);return i?i.bbox:""}function $r(t,i){if(typeof t!="number"||typeof i!="number"||Number.isNaN(t)||Number.isNaN(i))return null;let s=null,l=1/0;for(const u of ia){const f=xm(u.bbox);if(!f)continue;const[h,_,b,C]=f;if(tb||i<_||i>C)continue;const T=Math.abs(b-h)*Math.abs(C-_);Tt.continent==="EU").slice().sort((t,i)=>t.name.localeCompare(i.name)).map(t=>({value:t.bbox,label:t.name}))}function Sm(){return ia.slice().sort((t,i)=>t.name.localeCompare(i.name)).map(t=>[t.code,t.name])}const Tm=[["EU","European countries"],["AS","Asian countries"],["AF","African countries"],["NA","North American countries"],["SA","South American countries"],["OC","Oceanian countries"]];function Pm(){return Tm.map(([t,i])=>({label:i,options:ia.filter(s=>s.continent===t).slice().sort((s,l)=>s.name.localeCompare(l.name)).map(s=>({value:s.bbox,label:s.name}))}))}const Cm=(t,i)=>{const s=t.__vccOpts||t;for(const[l,u]of i)s[l]=u;return s},Lm={class:"mx-auto max-w-[1280px] p-7"},Am={class:"mb-5 flex flex-wrap items-end justify-between gap-4"},Mm={class:"flex h-10 w-full max-w-[280px] items-center gap-2 rounded border border-line-strong bg-surface-1 px-3"},Em={class:"grid grid-cols-[210px_1fr] gap-6 max-[760px]:grid-cols-1"},Om={class:"flex flex-col gap-0.5 max-[760px]:flex-row max-[760px]:overflow-x-auto"},zm=["onClick"],$m={class:"whitespace-nowrap"},Im={class:"min-w-0"},Nm={key:0,class:"panel p-10 text-center text-sm text-ink-muted"},Fm={key:0,class:"eyebrow mb-2 mt-5 first:mt-0 flex items-center gap-2"},Dm={key:1,class:"panel mb-5 p-5"},Rm={class:"flex items-center gap-1"},Bm={class:"flex items-center gap-2"},Um={class:"font-mono text-sm text-ink"},Vm={class:"inline-flex items-center gap-1 rounded-full bg-amber-soft px-2 py-0.5 text-[11px] font-semibold text-amber-fg"},Zm={key:0,class:"mt-2 text-xs text-ink-muted"},Hm={class:"grid max-w-[420px] gap-2"},jm={class:"flex items-center gap-3"},Wm={key:2,class:"panel mb-5 p-5"},Km=["value"],Gm=["value"],qm=["value"],Ym={class:"font-mono text-sm text-ink"},Jm={key:3},Xm={key:0,class:"mb-5 flex items-center gap-1 overflow-x-auto border-b border-line"},Qm=["onClick"],eg={class:"panel mb-5 p-5"},tg={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},ng={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},ig={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"},sg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},ag={key:0},rg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},lg={class:"font-semibold text-ink-secondary"},ug={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},cg={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"},dg={class:"flex items-center justify-between gap-3"},fg={class:"flex items-center gap-2 text-sm font-semibold text-ink"},hg={key:0,class:"text-[11px] text-ink-muted"},pg={class:"mt-2 flex items-baseline gap-1.5"},mg={class:"font-mono text-2xl font-semibold text-ink"},gg={class:"text-sm text-ink-muted"},vg={class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},_g={class:"mt-2 text-xs text-ink-muted"},bg={class:"mt-2 text-sm text-ink"},yg={class:"font-semibold"},xg={class:"mt-1 text-xs text-ink-muted"},wg={key:1,class:"mt-2 text-xs text-ink-muted"},kg={key:0,class:"inline-flex items-center gap-2 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"},Tg={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"},Cg={key:1,class:"flex flex-col items-end gap-2"},Lg={key:0,value:"__auto__"},Ag=["label"],Mg=["value"],Eg={key:0,class:"w-64 text-right text-[11px] leading-snug text-ink-muted"},Og={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},zg={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"},Ig={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"},Ng={key:8,class:"border-b border-line py-3 text-xs text-amber-fg"},Fg={class:"mt-4 flex flex-wrap items-center gap-3"},Dg=["disabled"],Rg={key:1,class:"flex items-center gap-2",title:"Bounding box used for Test connection — smaller areas cost fewer OpenSky credits"},Bg=["label"],Ug=["value"],Vg=["disabled"],Zg={key:3,class:"text-xs text-danger-fg"},Hg={class:"panel mb-5 p-5"},jg={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Wg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Kg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Gg={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"},qg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Yg={key:0},Jg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Xg={class:"font-semibold text-ink-secondary"},Qg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},ev={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},tv={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"},nv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},iv={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"},ov={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},sv={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"},av={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},rv={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"},lv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},uv={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"},cv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},dv={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"},fv={key:7,class:"my-4 rounded-lg border border-line bg-surface-2 p-4","data-keywords":"usage quota rate limit calls per minute remaining left api"},hv={class:"flex items-center justify-between gap-3"},pv={class:"flex items-center gap-2 text-sm font-semibold text-ink"},mv={key:0,class:"text-[11px] text-ink-muted"},gv={class:"mt-2 flex items-baseline gap-1.5"},vv={class:"font-mono text-2xl font-semibold text-ink"},_v={class:"text-sm text-ink-muted"},bv={key:0,class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},yv={class:"mt-2 text-xs text-ink-muted"},xv={key:1,class:"mt-2 text-xs text-ink-muted"},wv={class:"mt-4 flex flex-wrap items-center gap-3"},kv=["disabled"],Sv=["disabled"],Tv={key:2,class:"text-xs text-danger-fg"},Pv={key:3,class:"text-[11px] text-ink-muted"},Cv={class:"panel mb-5 p-5"},Lv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Av={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Mv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Ev={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"},Ov={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},zv={key:0},$v={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Iv={class:"font-semibold text-ink-secondary"},Nv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Fv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Dv={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"},Rv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Bv={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"},Uv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Vv={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"},Zv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Hv={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"},jv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Wv={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"},Kv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Gv={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"},qv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Yv={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"},Jv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Xv={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"},Qv={key:0,class:"inline-flex items-center gap-2 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"},t_={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},n_={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"},i_={class:"mt-4 flex flex-wrap items-center gap-3"},o_=["disabled"],s_=["disabled"],a_={key:2,class:"text-xs text-danger-fg"},r_={key:3,class:"text-[11px] text-ink-muted"},l_={class:"panel mb-5 p-5"},u_={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},c_={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},d_={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},f_={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"},h_={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},p_={key:0},m_={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},g_={class:"font-semibold text-ink-secondary"},v_={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},__={key:0,class:"inline-flex items-center gap-2 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"},y_={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},x_={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"},w_={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},k_={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"},S_={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},T_={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"},P_={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},C_={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"},L_={class:"mt-4 flex flex-wrap items-center gap-3"},A_=["disabled"],M_=["disabled"],E_={key:2,class:"text-xs text-danger-fg"},O_={key:3,class:"text-[11px] text-ink-muted"},z_={key:3,class:"panel mb-5 p-5"},$_={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},I_={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},N_={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},F_={key:1,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},D_={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"},R_={key:5,class:"border-b border-line py-3 text-xs text-amber-fg"},B_={key:0},U_={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},V_={class:"font-semibold text-ink-secondary"},Z_={key:7,class:"border-b border-line py-3 text-xs text-ink-muted"},H_={class:"flex w-full flex-col gap-2"},j_={class:"break-all font-mono text-sm text-ink"},W_={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"},K_={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"},G_={key:0,class:"text-xs text-ink-muted"},q_={key:1,class:"border-b border-line py-3 text-xs text-ink-muted"},Y_={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},J_={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_={class:"mt-4 flex flex-wrap items-center gap-3"},Q_=["disabled"],e1=["disabled"],t1={key:2,class:"text-xs text-danger-fg"},n1={key:3,class:"text-[11px] text-ink-muted"},i1={key:4,class:"panel mb-5 p-5"},o1={class:"flex items-center gap-4"},s1=["src"],a1={key:1,class:"grid h-16 w-16 place-items-center rounded-full bg-[var(--navy-800)] text-lg font-bold text-white"},r1={class:"flex gap-2"},l1={class:"btn-ghost cursor-pointer"},u1={class:"mt-1 text-right text-[11px] text-ink-muted"},c1={key:5,class:"panel mb-5 p-5"},d1={class:"flex items-center gap-3"},f1={key:0,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},h1={class:"flex flex-wrap items-center gap-4"},p1={class:"min-w-0"},m1={class:"mt-1 select-all font-mono text-sm font-bold text-ink"},g1={class:"mt-3 flex items-center gap-2"},v1={key:0,class:"mt-2 text-xs text-danger-fg"},_1={key:1,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},b1={class:"mt-2 grid grid-cols-2 gap-1 font-mono text-xs text-ink-secondary sm:grid-cols-4"},y1={class:"rounded-lg border border-line bg-surface-2 p-3"},x1={class:"flex items-center gap-3"},w1={class:"grid h-9 w-9 place-items-center rounded-full bg-accent-soft text-accent-soft-fg"},k1={class:"min-w-0 flex-1"},S1={class:"text-sm font-semibold text-ink"},T1={class:"font-mono text-[11px] text-ink-muted"},P1={key:6,class:"mb-5"},C1={key:0,class:"panel mb-5 p-5"},L1={class:"grid max-w-[520px] gap-2"},A1={class:"flex flex-wrap gap-2"},M1=["disabled","title"],E1=["value"],O1=["value"],z1={class:"flex items-center gap-2 py-1 text-sm text-ink-secondary"},$1={class:"flex items-center gap-3"},I1=["disabled"],N1={key:0,class:"text-xs text-danger-fg"},F1={key:1,class:"text-xs text-ink-muted"},D1={key:1,class:"panel mb-5 p-5"},R1={class:"grid max-w-[520px] gap-2"},B1={class:"flex flex-wrap gap-2"},U1=["value"],V1=["value"],Z1={key:1,class:"text-xs text-ink-muted"},H1={class:"font-semibold text-ink-secondary"},j1={class:"flex items-center gap-3"},W1=["disabled"],K1={key:0,class:"text-xs text-danger-fg"},G1={class:"panel overflow-hidden p-0"},q1={class:"flex items-center justify-between px-5 py-4"},Y1=["disabled"],J1={key:0,class:"px-5 pb-5 text-sm text-danger-fg"},X1={key:1,class:"px-5 pb-8 text-sm text-ink-muted"},Q1={key:2,class:"overflow-x-auto"},eb={class:"w-full border-collapse text-sm"},tb={class:"text-left"},nb={class:"px-5 py-3"},ib={class:"text-ink"},ob={key:0,class:"ml-1.5 text-[11px] text-ink-muted"},sb={class:"px-5 py-3"},ab={class:"px-5 py-3"},rb={class:"px-5 py-3"},lb={class:"px-5 py-3 text-right"},ub=["onClick"],cb={key:1,class:"inline-flex items-center gap-1.5"},db=["onClick"],fb=["onClick"],hb={key:7,class:"mb-5"},pb={key:0,class:"panel mb-5 p-5"},mb={class:"grid max-w-[520px] gap-2"},gb={class:"flex items-center gap-3"},vb={key:0,class:"text-xs text-danger-fg"},_b={key:1,class:"panel mb-5 p-5"},bb={class:"grid max-w-[520px] gap-2"},yb={class:"flex items-center gap-3"},xb=["disabled"],wb={key:0,class:"text-xs text-danger-fg"},kb={class:"panel overflow-hidden p-0"},Sb={key:0,class:"px-5 pb-8 text-sm text-ink-muted"},Tb={key:1,class:"overflow-x-auto"},Pb={class:"w-full border-collapse text-sm"},Cb={class:"text-left"},Lb={class:"px-5 py-3"},Ab={class:"inline-flex items-center gap-2 text-ink"},Mb={class:"px-5 py-3 text-ink-secondary"},Eb={class:"px-5 py-3 text-right"},Ob=["onClick"],zb={key:1,class:"inline-flex items-center gap-1.5"},$b=["onClick"],Ib=["disabled","title","onClick"],Nb={key:8,class:"mb-5"},Fb={class:"panel mb-5 p-5"},Db={class:"btn-ghost cursor-pointer"},Rb={key:0,class:"mt-2 text-xs text-ink-muted"},Bb={class:"rounded-lg border p-5",style:{"border-color":"color-mix(in srgb, var(--danger) 35%, transparent)",background:"var(--danger-soft)"}},Ub={class:"flex items-center gap-2 text-danger-fg"},Vb={class:"mt-4 rounded-lg border border-line bg-surface-1 p-4"},Zb={class:"mt-3 flex items-start gap-2 text-sm text-ink-secondary"},Hb={class:"mt-3"},jb={class:"eyebrow mb-1 block"},Wb={class:"text-ink"},Kb=["placeholder"],Gb={class:"mt-4 flex flex-wrap items-center gap-3"},qb=["disabled"],Yb=["disabled"],Jb={key:2,class:"text-xs text-ink-muted"},Xb={key:0,class:"mt-3 rounded border border-line bg-surface-2 px-3 py-2 text-xs text-ink-secondary"},Qb={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"},Lu="pv.opensky.health",Au="pv.filetransfer.health",Mu="pv.webdav.health",Eu="pv.openweather.health",Ou="pv.localstorage.health",ey={__name:"Settings",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(t,{emit:i}){const s=t,l=i,u=de(()=>s.role==="superadmin"),f=de(()=>s.role==="admin"||s.role==="superadmin");function h(g){return g==="superadmin"?"Superadmin":g==="admin"?"Admin":"User"}function _(g){return g==="superadmin"||g==="admin"?"shield":"user"}function b(g){return g==="superadmin"||g==="admin"?C.accent:C.neutral}const C={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"},T=de(()=>{const g=[{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 openweather weather forecast temperature api key units calls per minute usage limit quota"},{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 f.value&&g.push({id:"team",label:"User management",icon:"users",kw:"users team members add remove create delete role admin permissions rights organization"}),u.value&&g.push({id:"organizations",label:"Organizations",icon:"grid",kw:"organization org tenant company create rename delete members"}),g.push({id:"advanced",label:"Advanced",icon:"alertTriangle",kw:"export import data delete account danger zone",danger:!0}),g}),M=Y("account"),H=Y("");uc("settingsSearch",H);const j=de(()=>H.value.trim().length>0),G=de(()=>H.value.trim().toLowerCase());function N(g){return G.value?(g.label+" "+g.kw).toLowerCase().includes(G.value)||R(g.id):!0}const U={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","openweather weather forecast","api key units metric imperial","default latitude longitude language","calls per minute limit usage quota","api call usage today rate limit"],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 R(g){return G.value?(U[g]||[]).some(c=>c.includes(G.value)):!0}const oe=de(()=>j.value?T.value.filter(N):T.value.filter(g=>g.id===M.value)),we=de({get:()=>Oo.value,set:g=>Ha(g)}),ue=[{value:"light",label:"Light",icon:"sun"},{value:"dark",label:"Dark",icon:"moon"},{value:"system",label:"System",icon:"monitor"}],ke=[{value:"sm",label:"Small"},{value:"md",label:"Default"},{value:"lg",label:"Large"}],Ce=[{value:"12",label:"12-hour"},{value:"24",label:"24-hour"}],Le=[["en","English"],["es","Español"],["de","Deutsch"],["fr","Français"],["pl","Polski"],["ja","日本語"]],Ze=Sm(),he=de(()=>(Ze.find(([g])=>g===be.region)||[null,be.region])[1]),ee=[["MDY","MM/DD/YYYY"],["DMY","DD/MM/YYYY"],["YMD","YYYY/MM/DD"],["ISO","YYYY-MM-DD"]],V=Y(Date.now());let O=null;const F=de(()=>Su(V.value)),$=gt({loaded:!1,available:!1,orgEnabled:!0,allowAnonymous:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Ye=Y("user"),Se=gt({clientId:"",clientSecret:"",plan:"",bbox:""}),ge=Y(""),fe=Y(!1),ft=Y(!1),pe=Y(null),Ue=Y(null),Ve=de(()=>pe.value&&pe.value.credits||null),wt=de(()=>{const g=Ve.value;return!g||!g.daily||g.remaining==null?null:Math.max(0,Math.min(100,Math.round(g.remaining/g.daily*100)))}),st=de(()=>{const g=wt.value;return g==null?"bg-accent":g<=10?"bg-danger":g<=30?"bg-amber":"bg-success"});function Me(g){return typeof g=="number"?g.toLocaleString():g}function De(){if(!Ue.value)return"";const g=Math.max(0,Math.round((Date.now()-Ue.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const X=Math.round(c/60);return X<24?`${X} h ago`:`${Math.round(X/24)} d ago`}function zt(){try{pe.value&&localStorage.setItem(Lu,JSON.stringify({health:pe.value,ts:Ue.value}))}catch{}}function At(){try{const g=localStorage.getItem(Lu);if(!g)return;const c=JSON.parse(g);c&&c.health&&(pe.value=c.health,Ue.value=c.ts||null)}catch{}}const Ut=[{value:"",label:"Not set"},{value:"anonymous",label:"Anonymous"},{value:"standard",label:"Standard"},{value:"contributor",label:"Contributor"}],Pt=[{value:"user",label:"My settings",icon:"user"},{value:"org",label:"Organization",icon:"users"}],kt=[{label:"World",options:[{value:"-90,-180,90,180",label:"World"}]},{label:"Continents",options:[{value:"34,-25,72,45",label:"Europe"},{value:"-35,-18,38,52",label:"Africa"},{value:"5,25,82,180",label:"Asia"},{value:"7,-168,72,-52",label:"North America"},{value:"-56,-82,13,-34",label:"South America"},{value:"-48,110,-10,180",label:"Oceania"}]},{label:"European countries",options:km()},{label:"Other countries",options:[{value:"24,-125,49.5,-66.5",label:"United States"},{value:"41.7,-141,83.1,-52.6",label:"Canada"},{value:"-43.6,113.3,-10.7,153.6",label:"Australia"},{value:"24,122.9,45.5,145.8",label:"Japan"}]}],w=kt.flatMap(g=>g.options);function y(g){const c=String(g||"").split(",").map(k=>k.trim());if(c.length!==4)return"";const X=c.map(Number);return X.some(k=>Number.isNaN(k))?"":X.join(",")}function S(g){const c=y(g),X=c&&w.find(k=>y(k.value)===c);return X?X.label:""}const q=Y(!1),W=de({get(){if(!ve.value&&be.autoBbox)return"__auto__";if(q.value)return"__custom__";const g=y(Se.bbox),c=g&&w.find(X=>y(X.value)===g);return c?c.value:"__custom__"},set(g){if(g==="__auto__"){ve.value||(be.autoBbox=!0),q.value=!1;return}if(ve.value||(be.autoBbox=!1),g==="__custom__"){q.value=!0;return}q.value=!1,Se.bbox=g}}),J=de(()=>W.value==="__custom__"),ce=de(()=>W.value==="__auto__"),le=de(()=>$.isSuperadmin),se=de(()=>$.isSuperadmin?"user":Ye.value),te=de(()=>$.scopes[se.value]||{editableLayer:"user",fields:{}}),ve=de(()=>se.value==="org");function re(g){return te.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function Te(g){return le.value||re(g).locked}function Ae(g){const c=re(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function Re(){Se.clientId=re("clientId").own||"",Se.clientSecret=re("clientSecret").own||"",Se.plan=re("plan").own||"",Se.bbox=re("bbox").own||"",q.value=!1}function Ke(g){$.available=!!g.available,$.orgEnabled=g.orgEnabled!==!1,$.allowAnonymous=!!g.allowAnonymous,$.enabled=!!g.enabled,$.canEditOrg=!!g.canEditOrg,$.isSuperadmin=!!g.isSuperadmin,$.scopes=g.scopes||{},Ye.value==="org"&&!$.canEditOrg&&(Ye.value="user"),Re(),$.loaded=!0}Bt(Ye,()=>{ge.value="",Re()});async function Ge(){At();const{ok:g,body:c}=await hp();g&&Ke(c)}async function pt(g){const c=ve.value;c?$.orgEnabled=g:$.enabled=g;const{ok:X,body:k}=await bu(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});X?(Ke(k),We(c?g?"OpenSky enabled for your organization.":"OpenSky disabled for your organization.":g?"OpenSky enabled.":"OpenSky disabled.")):(c?$.orgEnabled=!g:$.enabled=!g,We(k.error||"Could not update."))}async function ht(){ge.value="",fe.value=!0;const g={};for(const Be of["clientId","clientSecret","plan","bbox"])Te(Be)||(g[Be]=Se[Be]);const c={scope:se.value,config:g};ve.value||(c.enabled=$.enabled);const{ok:X,body:k}=await bu(c);if(fe.value=!1,!X){ge.value=k.error||"Could not save settings.";return}Ke(k),We(ve.value?"Organization OpenSky settings saved.":"OpenSky settings saved.")}const Vt=[{label:"World",options:[{value:"-90,-180,90,180",label:"World"}]},{label:"Continents",options:[{value:"34,-25,72,45",label:"Europe"},{value:"-35,-18,38,52",label:"Africa"},{value:"5,25,82,180",label:"Asia"},{value:"7,-168,72,-52",label:"North America"},{value:"-56,-82,13,-34",label:"South America"},{value:"-48,110,-10,180",label:"Oceania"}]},...Pm()],Jt=Vt.flatMap(g=>g.options),Zt=Y(""),pn=Y(!1),Ct=de({get(){if(pn.value)return"__custom__";if(!Zt.value)return"__default__";const g=y(Zt.value),c=g&&Jt.find(X=>y(X.value)===g);return c?c.value:"__custom__"},set(g){if(g==="__default__"){pn.value=!1,Zt.value="";return}if(g==="__custom__"){pn.value=!0;return}pn.value=!1,Zt.value=g}}),$t=de(()=>Ct.value==="__custom__");async function kn(){ft.value=!0,pe.value=null;const{ok:g,body:c}=await pp((Zt.value||"").trim()||void 0);ft.value=!1,pe.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."},Ue.value=Date.now(),zt()}function zi(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const at=gt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Sn=Y("user"),$i=["protocol","host","port","username","password","privateKey","keyPassphrase","hostKeyFingerprint","insecureSkipVerify","basePath"],rt=gt(Object.fromEntries($i.map(g=>[g,""]))),hi=Y(""),pi=Y(!1),Ii=Y(!1),Gt=Y(null),jn=Y(null),Z=[{value:"sftp",label:"SFTP"},{value:"ftps",label:"FTPS"},{value:"ftp",label:"FTP"}],E=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],Oe=de(()=>at.isSuperadmin),tt=de(()=>at.isSuperadmin?"user":Sn.value),It=de(()=>at.scopes[tt.value]||{editableLayer:"user",fields:{}}),St=de(()=>tt.value==="org"),Et=de(()=>(_t("protocol")?K("protocol").effective:rt.protocol)||"sftp");function K(g){return It.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function _t(g){return Oe.value||K(g).locked}function bt(g){const c=K(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function oa(g){return(Z.find(c=>c.value===g)||{}).label||g||"—"}function cs(){for(const g of $i)rt[g]=K(g).own||"";rt.protocol||(rt.protocol="sftp"),rt.insecureSkipVerify||(rt.insecureSkipVerify="false")}function no(g){at.available=!!g.available,at.orgEnabled=g.orgEnabled!==!1,at.enabled=!!g.enabled,at.canEditOrg=!!g.canEditOrg,at.isSuperadmin=!!g.isSuperadmin,at.scopes=g.scopes||{},Sn.value==="org"&&!at.canEditOrg&&(Sn.value="user"),cs(),at.loaded=!0}Bt(Sn,()=>{hi.value="",cs()});function sa(){if(!jn.value)return"";const g=Math.max(0,Math.round((Date.now()-jn.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const X=Math.round(c/60);return X<24?`${X} h ago`:`${Math.round(X/24)} d ago`}function Ni(){try{Gt.value&&localStorage.setItem(Au,JSON.stringify({health:Gt.value,ts:jn.value}))}catch{}}function aa(){try{const g=localStorage.getItem(Au);if(!g)return;const c=JSON.parse(g);c&&c.health&&(Gt.value=c.health,jn.value=c.ts||null)}catch{}}async function ir(){aa();const{ok:g,body:c}=await gp();g&&no(c)}async function ra(g){const c=St.value;c?at.orgEnabled=g:at.enabled=g;const{ok:X,body:k}=await yu(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});X?(no(k),We(c?g?"File transfer enabled for your organization.":"File transfer disabled for your organization.":g?"File transfer enabled.":"File transfer disabled.")):(c?at.orgEnabled=!g:at.enabled=!g,We(k.error||"Could not update."))}async function or(){hi.value="",pi.value=!0;const g={};for(const Be of $i)_t(Be)||(g[Be]=rt[Be]);const c={scope:tt.value,config:g};St.value||(c.enabled=at.enabled);const{ok:X,body:k}=await yu(c);if(pi.value=!1,!X){hi.value=k.error||"Could not save settings.";return}no(k),We(St.value?"Organization file-transfer settings saved.":"File-transfer settings saved.")}async function sr(){Ii.value=!0,Gt.value=null;const{ok:g,body:c}=await vp();Ii.value=!1,Gt.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."},jn.value=Date.now(),Ni()}function la(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const lt=gt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Wn=Y("user"),ds=["baseURL","username","password","insecureSkipVerify","basePath"],Xt=gt(Object.fromEntries(ds.map(g=>[g,""]))),io=Y(""),zo=Y(!1),$o=Y(!1),Tn=Y(null),$n=Y(null),ua=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],Io=de(()=>lt.isSuperadmin),mi=de(()=>lt.isSuperadmin?"user":Wn.value),it=de(()=>lt.scopes[mi.value]||{editableLayer:"user",fields:{}}),ot=de(()=>mi.value==="org");function Pn(g){return it.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function Cn(g){return Io.value||Pn(g).locked}function qt(g){const c=Pn(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function No(){for(const g of ds)Xt[g]=Pn(g).own||"";Xt.insecureSkipVerify||(Xt.insecureSkipVerify="false")}function He(g){lt.available=!!g.available,lt.orgEnabled=g.orgEnabled!==!1,lt.enabled=!!g.enabled,lt.canEditOrg=!!g.canEditOrg,lt.isSuperadmin=!!g.isSuperadmin,lt.scopes=g.scopes||{},Wn.value==="org"&&!lt.canEditOrg&&(Wn.value="user"),No(),lt.loaded=!0}Bt(Wn,()=>{io.value="",No()});function Lt(){if(!$n.value)return"";const g=Math.max(0,Math.round((Date.now()-$n.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const X=Math.round(c/60);return X<24?`${X} h ago`:`${Math.round(X/24)} d ago`}function fs(){try{Tn.value&&localStorage.setItem(Mu,JSON.stringify({health:Tn.value,ts:$n.value}))}catch{}}function Fo(){try{const g=localStorage.getItem(Mu);if(!g)return;const c=JSON.parse(g);c&&c.health&&(Tn.value=c.health,$n.value=c.ts||null)}catch{}}async function mn(){Fo();const{ok:g,body:c}=await yp();g&&He(c)}async function ca(g){const c=ot.value;c?lt.orgEnabled=g:lt.enabled=g;const{ok:X,body:k}=await xu(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});X?(He(k),We(c?g?"WebDAV enabled for your organization.":"WebDAV disabled for your organization.":g?"WebDAV enabled.":"WebDAV disabled.")):(c?lt.orgEnabled=!g:lt.enabled=!g,We(k.error||"Could not update."))}async function Do(){io.value="",zo.value=!0;const g={};for(const Be of ds)Cn(Be)||(g[Be]=Xt[Be]);const c={scope:mi.value,config:g};ot.value||(c.enabled=lt.enabled);const{ok:X,body:k}=await xu(c);if(zo.value=!1,!X){io.value=k.error||"Could not save settings.";return}He(k),We(ot.value?"Organization WebDAV settings saved.":"WebDAV settings saved.")}async function gi(){$o.value=!0,Tn.value=null;const{ok:g,body:c}=await xp();$o.value=!1,Tn.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."},$n.value=Date.now(),fs()}function Mt(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const Xe=gt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),In=Y("user"),vi=["apiKey","units","lat","lon","lang","callsPerMinute"],Ht=gt(Object.fromEntries(vi.map(g=>[g,""]))),Kn=Y(""),Fi=Y(!1),Di=Y(!1),Qt=Y(null),Gn=Y(null),Ro=[{value:"",label:"Not set"},{value:"metric",label:"Metric (°C)"},{value:"imperial",label:"Imperial (°F)"},{value:"standard",label:"Standard (K)"}],Ri=de(()=>Xe.isSuperadmin),Bo=de(()=>Xe.isSuperadmin?"user":In.value),hs=de(()=>Xe.scopes[Bo.value]||{editableLayer:"user",fields:{}}),Ln=de(()=>Bo.value==="org");function Ie(g){return hs.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function jt(g){return Ri.value||Ie(g).locked}function Je(g){const c=Ie(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function ps(){for(const g of vi)Ht[g]=Ie(g).own||""}function oo(g){Xe.available=!!g.available,Xe.orgEnabled=g.orgEnabled!==!1,Xe.enabled=!!g.enabled,Xe.canEditOrg=!!g.canEditOrg,Xe.isSuperadmin=!!g.isSuperadmin,Xe.scopes=g.scopes||{},In.value==="org"&&!Xe.canEditOrg&&(In.value="user"),ps(),Xe.loaded=!0}Bt(In,()=>{Kn.value="",ps()});function Uo(){if(!Gn.value)return"";const g=Math.max(0,Math.round((Date.now()-Gn.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const X=Math.round(c/60);return X<24?`${X} h ago`:`${Math.round(X/24)} d ago`}function ms(){try{Qt.value&&localStorage.setItem(Eu,JSON.stringify({health:Qt.value,ts:Gn.value}))}catch{}}function _i(){try{const g=localStorage.getItem(Eu);if(!g)return;const c=JSON.parse(g);c&&c.health&&(Qt.value=c.health,Gn.value=c.ts||null)}catch{}}async function gs(){_i();const{ok:g,body:c}=await wp();g&&oo(c)}async function Bi(g){const c=Ln.value;c?Xe.orgEnabled=g:Xe.enabled=g;const{ok:X,body:k}=await wu(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});X?(oo(k),We(c?g?"OpenWeather enabled for your organization.":"OpenWeather disabled for your organization.":g?"OpenWeather enabled.":"OpenWeather disabled.")):(c?Xe.orgEnabled=!g:Xe.enabled=!g,We(k.error||"Could not update."))}async function Dt(){Kn.value="",Fi.value=!0;const g={};for(const Be of vi)jt(Be)||(g[Be]=Ht[Be]);const c={scope:Bo.value,config:g};Ln.value||(c.enabled=Xe.enabled);const{ok:X,body:k}=await wu(c);if(Fi.value=!1,!X){Kn.value=k.error||"Could not save settings.";return}oo(k),We(Ln.value?"Organization OpenWeather settings saved.":"OpenWeather settings saved.")}async function bi(){Di.value=!0,Qt.value=null;const{ok:g,body:c}=await kp();Di.value=!1,Qt.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."},Gn.value=Date.now(),ms()}function da(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const Ui=de(()=>Qt.value&&Qt.value.usage||null),vs=de(()=>{const g=Ui.value;return!g||!g.minuteLimit?null:Math.max(0,Math.min(100,Math.round(g.minuteUsed/g.minuteLimit*100)))}),fa=de(()=>{const g=vs.value;return g==null?"bg-accent":g>=90?"bg-danger":g>=70?"bg-amber":"bg-success"}),Ee=gt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,isOrgUser:!1,mounts:[],privateFolder:!1,privateEnabled:!1,allowPrivate:!0,rootConfigured:!1,scopes:{}}),Vi=Y("user"),so=Y(""),qe=Y(""),Vo=Y(!1),en=Y(!1),ln=Y(null),yi=Y(null),ao=Y({}),Zo=[{value:"",label:"Inherit"},{value:"false",label:"Read-write"},{value:"true",label:"Read-only"}],_s=de(()=>Ee.isSuperadmin),Ho=de(()=>Ee.isSuperadmin?"user":Vi.value),ar=de(()=>Ee.scopes[Ho.value]||{editableLayer:"user",fields:{}}),gn=de(()=>Ho.value==="org");function Zi(g){return ar.value.fields[g]||{effective:"",own:"",source:"unset",locked:!1}}function ha(g){return _s.value||Zi(g).locked}function An(g){const c=Zi(g).source;return c==="global"?"Set by administrator":c==="org"?"Set by your organization":""}function rr(g){return(Zo.find(c=>c.value===g)||{}).label||"Inherit"}function bs(){so.value=Zi("readOnly").own||""}function vn(g){Ee.available=!!g.available,Ee.orgEnabled=g.orgEnabled!==!1,Ee.enabled=!!g.enabled,Ee.canEditOrg=!!g.canEditOrg,Ee.isSuperadmin=!!g.isSuperadmin,Ee.isOrgUser=!!g.isOrgUser,Ee.mounts=Array.isArray(g.mounts)?g.mounts:[],Ee.privateFolder=!!g.privateFolder,Ee.privateEnabled=!!g.privateEnabled,Ee.allowPrivate=g.allowPrivate!==!1,Ee.rootConfigured=!!g.rootConfigured,Ee.scopes=g.scopes||{},Vi.value==="org"&&!Ee.canEditOrg&&(Vi.value="user"),bs(),Ee.loaded=!0}Bt(Vi,()=>{qe.value="",bs()});function pa(){if(!yi.value)return"";const g=Math.max(0,Math.round((Date.now()-yi.value)/1e3));if(g<60)return"just now";const c=Math.round(g/60);if(c<60)return`${c} min ago`;const X=Math.round(c/60);return X<24?`${X} h ago`:`${Math.round(X/24)} d ago`}function ma(){try{ln.value&&localStorage.setItem(Ou,JSON.stringify({health:ln.value,ts:yi.value}))}catch{}}function ys(){try{const g=localStorage.getItem(Ou);if(!g)return;const c=JSON.parse(g);c&&c.health&&(ln.value=c.health,yi.value=c.ts||null)}catch{}}async function lr(){ys();const{ok:g,body:c}=await _p();g&&vn(c)}async function xs(g){const c=gn.value;c?Ee.orgEnabled=g:Ee.enabled=g;const{ok:X,body:k}=await Ma(c?{scope:"org",enabled:g}:{scope:"user",enabled:g});X?(vn(k),We(c?g?"Local storage enabled for your organization.":"Local storage disabled for your organization.":g?"Local storage enabled.":"Local storage disabled.")):(c?Ee.orgEnabled=!g:Ee.enabled=!g,We(k.error||"Could not update."))}async function ga(g){Ee.privateFolder=g;const{ok:c,body:X}=await Ma({scope:"user",privateFolder:g});c?(vn(X),We(g?"Private folder enabled.":"Private folder disabled.")):(Ee.privateFolder=!g,We(X.error||"Could not update."))}async function ur(g){Ee.allowPrivate=g;const{ok:c,body:X}=await Ma({scope:"org",allowPrivate:g});c?(vn(X),We(g?"Members may now create private folders.":"Private folders disabled for your organization.")):(Ee.allowPrivate=!g,We(X.error||"Could not update."))}async function cr(){qe.value="",Vo.value=!0;const g={};ha("readOnly")||(g.readOnly=so.value);const c={scope:Ho.value,config:g};gn.value||(c.enabled=Ee.enabled);const{ok:X,body:k}=await Ma(c);if(Vo.value=!1,!X){qe.value=k.error||"Could not save settings.";return}vn(k),We(gn.value?"Organization local-storage settings saved.":"Local-storage settings saved.")}async function ws(){en.value=!0,ln.value=null,ao.value={};const{ok:g,body:c}=await bp();en.value=!1,ln.value=g&&c.health?c.health:{status:"down",detail:c.error||"Probe failed."};const X={};if(Array.isArray(c.mounts))for(const k of c.mounts)X[k.id]={status:k.status,detail:k.detail};ao.value=X,yi.value=Date.now(),ma()}function va(g){return g==="ok"?C.success:g==="degraded"?C.warning:C.danger}const _a=[{id:"apis-external",label:"APIs — External",icon:"globe"},{id:"drives-external",label:"Drives — External",icon:"server"},{id:"drives-local",label:"Drives — Local",icon:"monitor"}],jo=Y("apis-external");function Hi(g){return j.value||jo.value===g}const Nn=Y("");let ks=null;function We(g){Nn.value=g,clearTimeout(ks),ks=setTimeout(()=>Nn.value="",2200)}const yt=gt({current:"",next:"",confirm:""}),xi=Y(""),Ss=Y(!1);function dr(){if(Ss.value=!1,!yt.current)return xi.value="Enter your current password.";if(yt.next.length<8)return xi.value="New password must be at least 8 characters.";if(yt.next!==yt.confirm)return xi.value="New passwords do not match.";xi.value="Validated. Connecting to the account service is pending — no password endpoint yet.",yt.current=yt.next=yt.confirm=""}const ro=Y("");function Ts(){ro.value="Verification link would be sent once the account service is wired up."}function fr(g){const c=g.target.files&&g.target.files[0];if(!c)return;if(c.size>1.5*1024*1024){We("Image too large (max ~1.5 MB).");return}const X=new FileReader;X.onload=()=>{be.avatar=String(X.result),We("Photo updated.")},X.readAsDataURL(c)}function hr(){be.avatar="",We("Photo removed.")}const ba=de(()=>{var X,k,Be;const c=(be.displayName||be.name||s.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((X=c[0])==null?void 0:X[0])||"P")+(((k=c[1])==null?void 0:k[0])||((Be=c[0])==null?void 0:Be[1])||"V")).toUpperCase()}),lo=Y(!1),_n=Y(""),qn=Y(""),uo=Y(""),bn=Y([]);function Ps(g){const c="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let X="";for(let k=0;kPs(4).toLowerCase()+"-"+Ps(4).toLowerCase()),uo.value=""}function co(){be.twoFactor=!1,bn.value=[],lo.value=!1}const Mn=navigator.userAgent;function Wo(){return/Edg\//.test(Mn)?"Edge":/OPR\//.test(Mn)?"Opera":/Chrome\//.test(Mn)?"Chrome":/Firefox\//.test(Mn)?"Firefox":/Safari\//.test(Mn)?"Safari":"Browser"}function mr(){return/Windows/.test(Mn)?"Windows":/Mac OS X/.test(Mn)?"macOS":/Android/.test(Mn)?"Android":/iPhone|iPad/.test(Mn)?"iOS":/Linux/.test(Mn)?"Linux":"Unknown OS"}const ni=Date.now(),wi=Y([]),fo=Y(!1),Wi=Y(""),Rt=gt({email:"",password:"",role:"user",organization:""}),tn=Y(""),Ko=Y(!1),Fn=Y(""),ya=de(()=>{const g=[{value:"user",label:"User"},{value:"admin",label:"Admin"}];return u.value&&g.push({value:"superadmin",label:"Superadmin"}),g}),yn=Y([]);async function ii(){if(!f.value)return;const g=await rp();g.ok&&(yn.value=g.organizations.slice().sort((c,X)=>c.name.localeCompare(X.name)))}const Cs=de(()=>{const g=yn.value.map(c=>({value:c.id,label:c.name}));return u.value&&g.unshift({value:"",label:"No organization"}),g});async function oi(){if(!f.value)return;fo.value=!0,Wi.value="";const g=await ip();if(fo.value=!1,!g.ok){Wi.value=g.status===403?"Manager role required.":"Could not load users.";return}wi.value=g.users.slice().sort((c,X)=>c.email.localeCompare(X.email))}function ki(g){try{const c=g.data||{},X=Object.keys(c)[0];return X&&c[X]&&c[X].message||g.message||g.error||"Invalid input."}catch{return g.error||"Could not create user."}}async function Ls(){tn.value="";const g=Rt.email.trim().toLowerCase();if(!g.includes("@"))return tn.value="Enter a valid email.";if(Rt.password.length<8)return tn.value="Password must be at least 8 characters.";Ko.value=!0;const c=u.value?Rt.organization:s.organization,{ok:X,body:k}=await op(g,Rt.password,Rt.role,c);if(Ko.value=!1,!X)return tn.value=ki(k);Rt.email="",Rt.password="",Rt.role="user",Rt.organization="",We("User created."),oi()}async function Go(g){const{ok:c,body:X}=await ap(g.id);if(Fn.value="",!c)return We(X.error||"Could not remove user.");We("User removed."),oi()}const Qe=gt({id:"",email:"",role:"user",verified:!1,password:"",organization:""}),En=Y(""),Ki=Y(!1),qo=de(()=>!!Qe.id&&Qe.email===s.email);function gr(g){Fn.value="",Qe.id=g.id,Qe.email=g.email,Qe.role=g.role||"user",Qe.verified=!!g.verified,Qe.password="",Qe.organization=g.organization||"",En.value=""}function ho(){Qe.id="",En.value=""}async function vr(){En.value="";const g=Qe.email.trim().toLowerCase();if(!g.includes("@"))return En.value="Enter a valid email.";if(Qe.password&&Qe.password.length<8)return En.value="New password must be at least 8 characters (or leave blank).";const c={email:g,role:Qe.role,verified:Qe.verified};u.value&&(c.organization=Qe.organization),Qe.password&&(c.password=Qe.password),Ki.value=!0;const{ok:X,body:k}=await sp(Qe.id,c);if(Ki.value=!1,!X)return En.value=ki(k);We("User updated."),ho(),oi()}const po=gt({name:""}),mo=Y(""),go=Y(!1),vo=Y(""),Nt=gt({id:"",name:""}),Dn=Y(""),As=de(()=>{const g={};for(const c of wi.value)c.organization&&(g[c.organization]=(g[c.organization]||0)+1);return g});async function _o(){mo.value="";const g=po.name.trim();if(!g)return mo.value="Enter an organization name.";go.value=!0;const{ok:c,body:X}=await lp(g);if(go.value=!1,!c)return mo.value=ki(X);po.name="",We("Organization created."),ii()}function _r(g){vo.value="",Nt.id=g.id,Nt.name=g.name,Dn.value=""}function Ms(){Nt.id="",Dn.value=""}async function xa(){Dn.value="";const g=Nt.name.trim();if(!g)return Dn.value="Enter an organization name.";const{ok:c,body:X}=await up(Nt.id,g);if(!c)return Dn.value=ki(X);We("Organization renamed."),Ms(),ii(),oi()}async function bo(g){const{ok:c,body:X}=await cp(g.id);if(vo.value="",!c)return We(X.error||"Could not delete organization.");We("Organization deleted."),ii()}function br(){const g={_app:"PilotVault",_kind:"settings-export",exportedAt:new Date().toISOString(),email:s.email,prefs:{...be},themeMode:Oo.value},c=new Blob([JSON.stringify(g,null,2)],{type:"application/json"}),X=URL.createObjectURL(c),k=document.createElement("a");k.href=X,k.download=`pilotvault-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(k),k.click(),k.remove(),URL.revokeObjectURL(X),We("Settings exported.")}const Yn=Y("");function wa(g){const c=g.target.files&&g.target.files[0];if(!c)return;const X=new FileReader;X.onload=()=>{try{const k=JSON.parse(String(X.result)),Be=k.prefs||k;if(!ed(Be))throw new Error("bad shape");k.themeMode&&Ha(k.themeMode),ml(be.fontSize),gl(be.reduceMotion),Yn.value="Settings imported and applied."}catch{Yn.value="That file is not a valid PilotVault settings export."}},X.readAsText(c),g.target.value=""}const mt=gt({understand:!1,typed:"",cooldown:0,armed:!1,msg:""});let yo=null;const On=de(()=>s.email||"DELETE MY ACCOUNT"),Yo=de(()=>mt.understand&&mt.typed===On.value);function ka(){Yo.value&&(mt.armed=!0,mt.cooldown=5,clearInterval(yo),yo=setInterval(()=>{mt.cooldown--,mt.cooldown<=0&&clearInterval(yo)},1e3))}Bt(Yo,g=>{!g&&mt.armed&&(mt.armed=!1,mt.cooldown=0,clearInterval(yo))});function xo(){if(!(!mt.armed||mt.cooldown>0)){try{localStorage.removeItem("pv_prefs")}catch{}mt.msg="Account deletion requires the account service. Local data was cleared and you were signed out.",setTimeout(()=>l("logout"),900)}}return ti(()=>{O=setInterval(()=>V.value=Date.now(),1e3),ii(),oi(),Ge(),ir(),mn(),gs(),lr()}),us(()=>{clearInterval(O),clearInterval(yo),clearTimeout(ks)}),(g,c)=>(p(),m("div",Lm,[a("div",Am,[c[72]||(c[72]=a("div",null,[a("div",{class:"eyebrow"},"Preferences"),a("h2",{class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},"Settings")],-1)),a("div",Mm,[A(Q,{name:"search",size:16,class:"text-ink-muted"}),ie(a("input",{"onUpdate:modelValue":c[0]||(c[0]=X=>H.value=X),placeholder:"Search settings…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[me,H.value]]),H.value?(p(),m("button",{key:0,class:"text-ink-muted hover:text-ink","aria-label":"Clear search",onClick:c[1]||(c[1]=X=>H.value="")},[A(Q,{name:"x",size:15})])):I("",!0)])]),a("div",Em,[ie(a("nav",Om,[(p(!0),m(ae,null,ze(T.value,X=>(p(),m("button",{key:X.id,class:Pe(["flex items-center gap-2.5 rounded px-3 py-2.5 text-left text-sm transition",[M.value===X.id?X.danger?"bg-danger-soft font-semibold text-danger-fg":"bg-accent-soft font-semibold text-accent-soft-fg":X.danger?"font-medium text-danger-fg hover:bg-danger-soft":"font-medium text-ink-secondary hover:bg-surface-2"]]),onClick:k=>M.value=X.id},[A(Q,{name:X.icon,size:17},null,8,["name"]),a("span",$m,x(X.label),1)],10,zm))),128))],512),[[kh,!j.value]]),a("div",Im,[j.value&&!oe.value.length?(p(),m("div",Nm," No settings match “"+x(H.value)+"”. ",1)):I("",!0),(p(!0),m(ae,null,ze(oe.value,X=>(p(),m(ae,{key:X.id},[j.value?(p(),m("div",Fm,[A(Q,{name:X.icon,size:14},null,8,["name"]),z(" "+x(X.label),1)])):I("",!0),X.id==="account"?(p(),m("div",Dm,[A(xe,{title:"Full name",desc:"Shown to your team on flights and audit logs.",keywords:"full name account"},{default:ye(()=>[ie(a("input",{"onUpdate:modelValue":c[2]||(c[2]=k=>$e(be).name=k),class:"field w-56",placeholder:"Jane Operator",onBlur:c[3]||(c[3]=k=>We("Saved."))},null,544),[[me,$e(be).name]])]),_:1}),A(xe,{title:"Username",desc:"Your unique handle within PilotVault.",keywords:"username handle"},{default:ye(()=>[a("div",Rm,[c[73]||(c[73]=a("span",{class:"text-sm text-ink-muted"},"@",-1)),ie(a("input",{"onUpdate:modelValue":c[4]||(c[4]=k=>$e(be).username=k),class:"field w-48",placeholder:"jane",onBlur:c[5]||(c[5]=k=>We("Saved."))},null,544),[[me,$e(be).username]])])]),_:1}),A(xe,{title:"Email address",desc:"Used for sign-in and notifications.",keywords:"email verification verify"},{default:ye(()=>[a("div",Bm,[a("span",Um,x(t.email||"—"),1),a("span",Vm,[A(Q,{name:"mail",size:12}),c[74]||(c[74]=z(" Unverified ",-1))])])]),_:1}),A(xe,{title:"Role",desc:"Your access level in PilotVault.",keywords:"role admin user superadmin access rights permissions"},{default:ye(()=>[a("span",{class:Pe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",b(t.role)])},[A(Q,{name:_(t.role),size:12},null,8,["name"]),z(x(h(t.role)),1)],2)]),_:1}),A(xe,{title:"Organization",desc:"The organization your account belongs to.",keywords:"organization org tenant company"},{default:ye(()=>[a("span",{class:Pe(["text-sm",t.organizationName?"text-ink":"text-ink-muted"])},x(t.organizationName||(u.value?"All organizations":"None")),3)]),_:1}),A(xe,{block:"",title:"Verify email",desc:"Confirm ownership to enable password resets and alerts.",keywords:"verify email resend"},{default:ye(()=>[a("button",{class:"btn-ghost",onClick:Ts},"Send verification link"),ro.value?(p(),m("p",Zm,x(ro.value),1)):I("",!0)]),_:1}),A(xe,{block:"",title:"Change password",desc:"Use at least 8 characters.",keywords:"password change current new"},{default:ye(()=>[a("div",Hm,[ie(a("input",{"onUpdate:modelValue":c[6]||(c[6]=k=>yt.current=k),type:"password",class:"field",placeholder:"Current password"},null,512),[[me,yt.current]]),ie(a("input",{"onUpdate:modelValue":c[7]||(c[7]=k=>yt.next=k),type:"password",class:"field",placeholder:"New password"},null,512),[[me,yt.next]]),ie(a("input",{"onUpdate:modelValue":c[8]||(c[8]=k=>yt.confirm=k),type:"password",class:"field",placeholder:"Confirm new password"},null,512),[[me,yt.confirm]]),a("div",jm,[a("button",{class:"btn-accent",onClick:dr},"Update password"),xi.value?(p(),m("span",{key:0,class:Pe(["text-xs",Ss.value?"text-success-fg":"text-ink-muted"])},x(xi.value),3)):I("",!0)])])]),_:1})])):X.id==="appearance"?(p(),m("div",Wm,[A(xe,{title:"Theme",desc:"Light, dark, or follow your system.",keywords:"theme light dark system appearance"},{default:ye(()=>[A(wn,{modelValue:we.value,"onUpdate:modelValue":c[9]||(c[9]=k=>we.value=k),options:ue},null,8,["modelValue"])]),_:1}),A(xe,{title:"Font size",desc:"Scales the entire interface for readability.",keywords:"font size accessibility text"},{default:ye(()=>[A(wn,{modelValue:$e(be).fontSize,"onUpdate:modelValue":c[10]||(c[10]=k=>$e(be).fontSize=k),options:ke},null,8,["modelValue"])]),_:1}),A(xe,{title:"Reduce motion",desc:"Minimise animations and transitions.",keywords:"reduce motion accessibility animation"},{default:ye(()=>[A(nn,{modelValue:$e(be).reduceMotion,"onUpdate:modelValue":c[11]||(c[11]=k=>$e(be).reduceMotion=k)},null,8,["modelValue"])]),_:1}),A(xe,{title:"Language",desc:"Interface language.",keywords:"language locale"},{default:ye(()=>[ie(a("select",{"onUpdate:modelValue":c[12]||(c[12]=k=>$e(be).language=k),class:"field w-48"},[(p(),m(ae,null,ze(Le,([k,Be])=>a("option",{key:k,value:k},x(Be),9,Km)),64))],512),[[Ot,$e(be).language]])]),_:1}),A(xe,{title:"Region",desc:"Affects number, unit and date defaults.",keywords:"region country locale"},{default:ye(()=>[ie(a("select",{"onUpdate:modelValue":c[13]||(c[13]=k=>$e(be).region=k),class:"field w-48"},[(p(!0),m(ae,null,ze($e(Ze),([k,Be])=>(p(),m("option",{key:k,value:k},x(Be),9,Gm))),128))],512),[[Ot,$e(be).region]])]),_:1}),A(xe,{title:"Date format",desc:"How calendar dates are displayed.",keywords:"date format"},{default:ye(()=>[ie(a("select",{"onUpdate:modelValue":c[14]||(c[14]=k=>$e(be).dateFormat=k),class:"field w-48"},[(p(),m(ae,null,ze(ee,([k,Be])=>a("option",{key:k,value:k},x(Be),9,qm)),64))],512),[[Ot,$e(be).dateFormat]])]),_:1}),A(xe,{title:"Time format",desc:"12- or 24-hour clock.",keywords:"time format clock 12 24 hour"},{default:ye(()=>[A(wn,{modelValue:$e(be).timeFormat,"onUpdate:modelValue":c[15]||(c[15]=k=>$e(be).timeFormat=k),options:Ce},null,8,["modelValue"])]),_:1}),A(xe,{title:"Preview",desc:"How timestamps appear across the app.",keywords:"preview date time"},{default:ye(()=>[a("span",Ym,x(F.value),1)]),_:1}),c[75]||(c[75]=a("p",{class:"mt-3 text-xs text-ink-muted"}," Language & region are stored now; full localisation ships with the account service. ",-1))])):X.id==="integrations"?(p(),m("div",Jm,[j.value?I("",!0):(p(),m("div",Xm,[(p(),m(ae,null,ze(_a,k=>a("button",{key:k.id,type:"button",class:Pe(["-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",jo.value===k.id?"border-accent text-ink":"border-transparent text-ink-secondary hover:text-ink"]),onClick:Be=>jo.value=k.id},[A(Q,{name:k.icon,size:16},null,8,["name"]),z(x(k.label),1)],10,Qm)),64))])),Hi("apis-external")?(p(),m(ae,{key:1},[a("div",eg,[a("div",tg,[a("div",ng,[A(Q,{name:"radio",size:20})]),c[76]||(c[76]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"OpenSky Network"),a("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))]),$.loaded&&!$.available?(p(),m("div",ig,[A(Q,{name:"lock",size:14,class:"mr-1 inline"}),c[77]||(c[77]=z(" OpenSky is currently disabled by your administrator. Contact them to enable it. ",-1))])):I("",!0),$.canEditOrg?(p(),m("div",og,[c[78]||(c[78]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(wn,{modelValue:Ye.value,"onUpdate:modelValue":c[16]||(c[16]=k=>Ye.value=k),options:Pt},null,8,["modelValue"])])):I("",!0),ve.value?(p(),nt(xe,{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:ye(()=>[A(nn,{"model-value":$.orgEnabled,disabled:!$.available,"onUpdate:modelValue":pt},null,8,["model-value","disabled"])]),_:1})):(p(),nt(xe,{key:3,title:"Enable OpenSky",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin opensky"},{default:ye(()=>[A(nn,{"model-value":$.enabled,disabled:!$.available||!$.orgEnabled,"onUpdate:modelValue":pt},null,8,["model-value","disabled"])]),_:1})),!ve.value&&$.available&&!$.orgEnabled?(p(),m("div",sg,[A(Q,{name:"lock",size:13,class:"mr-1 inline"}),c[80]||(c[80]=z("OpenSky is turned off for your organization",-1)),$.canEditOrg?(p(),m("span",ag,[...c[79]||(c[79]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):I("",!0),c[81]||(c[81]=z(". ",-1))])):I("",!0),ve.value?(p(),m("div",rg,[A(Q,{name:"users",size:13,class:"mr-1 inline"}),c[82]||(c[82]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",lg,x(t.organizationName||"your organization"),1),c[83]||(c[83]=z(". Leave a field blank to let each user choose their own; a value set here overrides the user's. ",-1))])):le.value?(p(),m("div",ug," As a superadmin you manage the global OpenSky configuration in the API Server panel. The effective configuration is shown below. ")):I("",!0),$.available&&!ve.value?(p(),m("div",cg,[a("div",dg,[a("div",fg,[A(Q,{name:"signal",size:15}),c[84]||(c[84]=z("Credit usage ",-1))]),Ue.value?(p(),m("span",hg,"Checked "+x(De()),1)):I("",!0)]),Ve.value?(p(),m(ae,{key:0},[Ve.value.remaining!=null?(p(),m(ae,{key:0},[a("div",pg,[a("span",mg,x(Me(Ve.value.remaining)),1),a("span",gg,"/ "+x(Me(Ve.value.daily))+" credits left today",1)]),a("div",vg,[a("div",{class:Pe(["h-full rounded-full transition-all",st.value]),style:Eo({width:wt.value+"%"})},null,6)]),a("div",_g," Used "+x(Me(Ve.value.daily-Ve.value.remaining))+" today · "+x(Ve.value.probeCost)+" credit"+x(Ve.value.probeCost===1?"":"s")+" per query · "+x(Ve.value.mode),1)],64)):(p(),m(ae,{key:1},[a("div",bg,[c[85]||(c[85]=z("Daily allowance: ",-1)),a("span",yg,x(Me(Ve.value.daily)),1),c[86]||(c[86]=z(" credits",-1))]),a("div",xg,x(Ve.value.probeCost)+" credit"+x(Ve.value.probeCost===1?"":"s")+" per query · "+x(Ve.value.mode)+". OpenSky only reports live remaining credits for authenticated requests — add OAuth2 credentials below to track usage. ",1)],64))],64)):(p(),m("div",wg,[...c[87]||(c[87]=[z(" Run ",-1),a("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),z(" below to fetch your live OpenSky credit balance. ",-1)])]))])):I("",!0),A(xe,{title:"OpenSky plan",desc:"Your account tier — sets the daily credit allowance.",keywords:"plan tier credits"},{default:ye(()=>[Te("plan")?(p(),m("span",kg,[z(x((Ut.find(k=>k.value===re("plan").effective)||{}).label||re("plan").effective||"—")+" ",1),Ae("plan")?(p(),m("span",Sg,[A(Q,{name:"lock",size:10}),z(x(Ae("plan")),1)])):I("",!0)])):(p(),nt(wn,{key:1,modelValue:Se.plan,"onUpdate:modelValue":c[17]||(c[17]=k=>Se.plan=k),options:Ut},null,8,["modelValue"]))]),_:1}),A(xe,{title:"Default bounding box",desc:"Automatic follows your location; or pick a region, or enter lamin,lomin,lamax,lomax by hand.",keywords:"bounding box bbox area region country continent world europe custom coordinates automatic location drone"},{default:ye(()=>[Te("bbox")?(p(),m("span",Tg,[z(x(S(re("bbox").effective)||re("bbox").effective||"—")+" ",1),Ae("bbox")?(p(),m("span",Pg,[A(Q,{name:"lock",size:10}),z(x(Ae("bbox")),1)])):I("",!0)])):(p(),m("div",Cg,[ie(a("select",{"onUpdate:modelValue":c[18]||(c[18]=k=>W.value=k),class:"field w-64"},[ve.value?I("",!0):(p(),m("option",Lg,"Automatic (by location)")),(p(),m(ae,null,ze(kt,k=>a("optgroup",{key:k.label,label:k.label},[(p(!0),m(ae,null,ze(k.options,Be=>(p(),m("option",{key:Be.value,value:Be.value},x(Be.label),9,Mg))),128))],8,Ag)),64)),c[88]||(c[88]=a("option",{value:"__custom__"},"Custom…",-1))],512),[[Ot,W.value]]),ce.value?(p(),m("p",Eg," Live map follows drone location → your device location → your Region ("+x(he.value)+"). ",1)):I("",!0),J.value?ie((p(),m("input",{key:1,"onUpdate:modelValue":c[19]||(c[19]=k=>Se.bbox=k),class:"field w-64 font-mono",placeholder:"50.5,3.2,53.7,7.3"},null,512)),[[me,Se.bbox]]):I("",!0)]))]),_:1}),A(xe,{title:"OAuth2 client ID",desc:"Optional — leave blank for anonymous access (lower limits).",keywords:"oauth client id credentials"},{default:ye(()=>[Te("clientId")?(p(),m("span",Og,[z(x(re("clientId").effective||"—")+" ",1),Ae("clientId")?(p(),m("span",zg,[A(Q,{name:"lock",size:10}),z(x(Ae("clientId")),1)])):I("",!0)])):ie((p(),m("input",{key:1,"onUpdate:modelValue":c[20]||(c[20]=k=>Se.clientId=k),class:"field w-64",placeholder:"your-api-client"},null,512)),[[me,Se.clientId]])]),_:1}),A(xe,{title:"OAuth2 client secret",desc:"Paired with the client ID for authenticated access.",keywords:"oauth client secret credentials password"},{default:ye(()=>[Te("clientSecret")?(p(),m("span",$g,[z(x(re("clientSecret").effective||"—")+" ",1),Ae("clientSecret")?(p(),m("span",Ig,[A(Q,{name:"lock",size:10}),z(x(Ae("clientSecret")),1)])):I("",!0)])):ie((p(),m("input",{key:1,"onUpdate:modelValue":c[21]||(c[21]=k=>Se.clientSecret=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[me,Se.clientSecret]])]),_:1}),$.available&&!$.allowAnonymous?(p(),m("div",Ng," Anonymous access is disabled by the administrator — OpenSky needs OAuth2 credentials from some layer to work. ")):I("",!0),a("div",Fg,[le.value?I("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:fe.value||!$.available,onClick:ht},x(fe.value?"Saving…":ve.value?"Save organization settings":"Save settings"),9,Dg)),ve.value?I("",!0):(p(),m("div",Rg,[c[91]||(c[91]=a("label",{class:"text-xs text-ink-muted"},"Test area",-1)),ie(a("select",{"onUpdate:modelValue":c[22]||(c[22]=k=>Ct.value=k),class:"field w-44"},[c[89]||(c[89]=a("option",{value:"__default__"},"Default bounding box",-1)),(p(),m(ae,null,ze(Vt,k=>a("optgroup",{key:k.label,label:k.label},[(p(!0),m(ae,null,ze(k.options,Be=>(p(),m("option",{key:Be.value,value:Be.value},x(Be.label),9,Ug))),128))],8,Bg)),64)),c[90]||(c[90]=a("option",{value:"__custom__"},"Custom…",-1))],512),[[Ot,Ct.value]]),$t.value?ie((p(),m("input",{key:0,"onUpdate:modelValue":c[23]||(c[23]=k=>Zt.value=k),class:"field w-44 font-mono",placeholder:"lamin,lomin,lamax,lomax"},null,512)),[[me,Zt.value]]):I("",!0)])),ve.value?I("",!0):(p(),m("button",{key:2,class:"btn-ghost",disabled:ft.value||!$.available,onClick:kn},x(ft.value?"Testing…":"Test connection"),9,Vg)),ge.value?(p(),m("span",Zg,x(ge.value),1)):I("",!0),pe.value&&!ve.value?(p(),m("span",{key:4,class:Pe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",zi(pe.value.status)])},[c[92]||(c[92]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(pe.value.detail||pe.value.status),1)],2)):I("",!0)])]),a("div",Hg,[a("div",jg,[a("div",Wg,[A(Q,{name:"sun",size:20})]),c[93]||(c[93]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"OpenWeather"),a("div",{class:"mt-0.5 text-xs text-ink-muted"}," Current conditions and forecast from the OpenWeather API. Configure the API key and default location your account uses. ")],-1))]),Xe.loaded&&!Xe.available?(p(),m("div",Kg,[A(Q,{name:"lock",size:14,class:"mr-1 inline"}),c[94]||(c[94]=z(" OpenWeather is currently disabled by your administrator. Contact them to enable it. ",-1))])):I("",!0),Xe.canEditOrg?(p(),m("div",Gg,[c[95]||(c[95]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(wn,{modelValue:In.value,"onUpdate:modelValue":c[24]||(c[24]=k=>In.value=k),options:Pt},null,8,["modelValue"])])):I("",!0),Ln.value?(p(),nt(xe,{key:2,title:"Enable OpenWeather (organization-wide)",desc:"Turn it on or off for everyone in your organization.",keywords:"enable disable plugin openweather weather organization"},{default:ye(()=>[A(nn,{"model-value":Xe.orgEnabled,disabled:!Xe.available,"onUpdate:modelValue":Bi},null,8,["model-value","disabled"])]),_:1})):(p(),nt(xe,{key:3,title:"Enable OpenWeather",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin openweather weather"},{default:ye(()=>[A(nn,{"model-value":Xe.enabled,disabled:!Xe.available||!Xe.orgEnabled,"onUpdate:modelValue":Bi},null,8,["model-value","disabled"])]),_:1})),!Ln.value&&Xe.available&&!Xe.orgEnabled?(p(),m("div",qg,[A(Q,{name:"lock",size:13,class:"mr-1 inline"}),c[97]||(c[97]=z("OpenWeather is turned off for your organization",-1)),Xe.canEditOrg?(p(),m("span",Yg,[...c[96]||(c[96]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):I("",!0),c[98]||(c[98]=z(". ",-1))])):I("",!0),Ln.value?(p(),m("div",Jg,[A(Q,{name:"users",size:13,class:"mr-1 inline"}),c[99]||(c[99]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",Xg,x(t.organizationName||"your organization"),1),c[100]||(c[100]=z(". Leave the API key blank to let each user configure their own; a key set here overrides the user's. ",-1))])):Ri.value?(p(),m("div",Qg," As a superadmin you manage the global OpenWeather configuration in the API Server panel. The effective configuration is shown below. ")):I("",!0),A(xe,{title:"API key",desc:"Your OpenWeather API key (the appid parameter). Required — OpenWeather has no anonymous tier.",keywords:"api key appid secret credentials token openweather"},{default:ye(()=>[jt("apiKey")?(p(),m("span",ev,[z(x(Ie("apiKey").effective||"—")+" ",1),Je("apiKey")?(p(),m("span",tv,[A(Q,{name:"lock",size:10}),z(x(Je("apiKey")),1)])):I("",!0)])):ie((p(),m("input",{key:1,"onUpdate:modelValue":c[25]||(c[25]=k=>Ht.apiKey=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[me,Ht.apiKey]])]),_:1}),A(xe,{title:"Units",desc:"Measurement system for temperatures and wind speed.",keywords:"units metric imperial standard celsius fahrenheit kelvin"},{default:ye(()=>[jt("units")?(p(),m("span",nv,[z(x((Ro.find(k=>k.value===Ie("units").effective)||{}).label||Ie("units").effective||"—")+" ",1),Je("units")?(p(),m("span",iv,[A(Q,{name:"lock",size:10}),z(x(Je("units")),1)])):I("",!0)])):(p(),nt(wn,{key:1,modelValue:Ht.units,"onUpdate:modelValue":c[26]||(c[26]=k=>Ht.units=k),options:Ro},null,8,["modelValue"]))]),_:1}),A(xe,{title:"Default latitude",desc:"Latitude used by the health probe and calls with no location (−90…90).",keywords:"latitude location coordinates default"},{default:ye(()=>[jt("lat")?(p(),m("span",ov,[z(x(Ie("lat").effective||"—")+" ",1),Je("lat")?(p(),m("span",sv,[A(Q,{name:"lock",size:10}),z(x(Je("lat")),1)])):I("",!0)])):ie((p(),m("input",{key:1,"onUpdate:modelValue":c[27]||(c[27]=k=>Ht.lat=k),inputmode:"decimal",class:"field w-40 font-mono",placeholder:"52.2297"},null,512)),[[me,Ht.lat]])]),_:1}),A(xe,{title:"Default longitude",desc:"Longitude used by the health probe and calls with no location (−180…180).",keywords:"longitude location coordinates default"},{default:ye(()=>[jt("lon")?(p(),m("span",av,[z(x(Ie("lon").effective||"—")+" ",1),Je("lon")?(p(),m("span",rv,[A(Q,{name:"lock",size:10}),z(x(Je("lon")),1)])):I("",!0)])):ie((p(),m("input",{key:1,"onUpdate:modelValue":c[28]||(c[28]=k=>Ht.lon=k),inputmode:"decimal",class:"field w-40 font-mono",placeholder:"21.0122"},null,512)),[[me,Ht.lon]])]),_:1}),A(xe,{title:"Language",desc:"Optional ISO code for human-readable weather descriptions, e.g. en, pl, de.",keywords:"language locale description"},{default:ye(()=>[jt("lang")?(p(),m("span",lv,[z(x(Ie("lang").effective||"—")+" ",1),Je("lang")?(p(),m("span",uv,[A(Q,{name:"lock",size:10}),z(x(Je("lang")),1)])):I("",!0)])):ie((p(),m("input",{key:1,"onUpdate:modelValue":c[29]||(c[29]=k=>Ht.lang=k),class:"field w-24 font-mono",placeholder:"en"},null,512)),[[me,Ht.lang]])]),_:1}),A(xe,{title:"Calls per minute limit",desc:"Your plan's per-minute limit (free tier is 60). Only used to gauge app usage below. Leave blank to inherit; the app falls back to 60.",keywords:"calls per minute limit rate quota plan usage"},{default:ye(()=>[jt("callsPerMinute")?(p(),m("span",cv,[z(x(Ie("callsPerMinute").effective||"60")+" ",1),Je("callsPerMinute")?(p(),m("span",dv,[A(Q,{name:"lock",size:10}),z(x(Je("callsPerMinute")),1)])):I("",!0)])):ie((p(),m("input",{key:1,"onUpdate:modelValue":c[30]||(c[30]=k=>Ht.callsPerMinute=k),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"60"},null,512)),[[me,Ht.callsPerMinute]])]),_:1}),Xe.available&&!Ln.value?(p(),m("div",fv,[a("div",hv,[a("div",pv,[A(Q,{name:"signal",size:15}),c[101]||(c[101]=z("API call usage ",-1))]),Gn.value?(p(),m("span",mv,"Checked "+x(Uo()),1)):I("",!0)]),Ui.value?(p(),m(ae,{key:0},[a("div",gv,[a("span",vv,x(Ui.value.minuteUsed),1),a("span",_v,"/ "+x(Ui.value.minuteLimit||"—")+" calls this minute",1)]),vs.value!=null?(p(),m("div",bv,[a("div",{class:Pe(["h-full rounded-full transition-all",fa.value]),style:Eo({width:vs.value+"%"})},null,6)])):I("",!0),a("div",yv,x(Ui.value.dayUsed)+" calls today · counts only requests PilotVault makes with this key, since server start. OpenWeather does not report remaining quota — check your account dashboard for the authoritative total. ",1)],64)):(p(),m("div",xv,[...c[102]||(c[102]=[z(" Run ",-1),a("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),z(" below to record and show call usage. ",-1)])]))])):I("",!0),a("div",wv,[Ri.value?I("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:Fi.value||!Xe.available,onClick:Dt},x(Fi.value?"Saving…":Ln.value?"Save organization settings":"Save settings"),9,kv)),Ln.value?I("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:Di.value||!Xe.available,onClick:bi},x(Di.value?"Testing…":"Test connection"),9,Sv)),Kn.value?(p(),m("span",Tv,x(Kn.value),1)):I("",!0),Gn.value&&!Ln.value?(p(),m("span",Pv,"Checked "+x(Uo()),1)):I("",!0),Qt.value&&!Ln.value?(p(),m("span",{key:4,class:Pe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",da(Qt.value.status)])},[c[103]||(c[103]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(Qt.value.detail||Qt.value.status),1)],2)):I("",!0)])])],64)):I("",!0),Hi("drives-external")?(p(),m(ae,{key:2},[a("div",Cv,[a("div",Lv,[a("div",Av,[A(Q,{name:"server",size:20})]),c[104]||(c[104]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"File Transfer (FTP / SFTP)"),a("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))]),at.loaded&&!at.available?(p(),m("div",Mv,[A(Q,{name:"lock",size:14,class:"mr-1 inline"}),c[105]||(c[105]=z(" File transfer is currently disabled by your administrator. Contact them to enable it. ",-1))])):I("",!0),at.canEditOrg?(p(),m("div",Ev,[c[106]||(c[106]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(wn,{modelValue:Sn.value,"onUpdate:modelValue":c[31]||(c[31]=k=>Sn.value=k),options:Pt},null,8,["modelValue"])])):I("",!0),St.value?(p(),nt(xe,{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:ye(()=>[A(nn,{"model-value":at.orgEnabled,disabled:!at.available,"onUpdate:modelValue":ra},null,8,["model-value","disabled"])]),_:1})):(p(),nt(xe,{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:ye(()=>[A(nn,{"model-value":at.enabled,disabled:!at.available||!at.orgEnabled,"onUpdate:modelValue":ra},null,8,["model-value","disabled"])]),_:1})),!St.value&&at.available&&!at.orgEnabled?(p(),m("div",Ov,[A(Q,{name:"lock",size:13,class:"mr-1 inline"}),c[108]||(c[108]=z("File transfer is turned off for your organization",-1)),at.canEditOrg?(p(),m("span",zv,[...c[107]||(c[107]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):I("",!0),c[109]||(c[109]=z(". ",-1))])):I("",!0),St.value?(p(),m("div",$v,[A(Q,{name:"users",size:13,class:"mr-1 inline"}),c[110]||(c[110]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",Iv,x(t.organizationName||"your organization"),1),c[111]||(c[111]=z(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):Oe.value?(p(),m("div",Nv," As a superadmin you manage the global file-transfer configuration in the API Server panel. The effective configuration is shown below. ")):I("",!0),A(xe,{title:"Protocol",desc:"SFTP (over SSH), FTPS (FTP over TLS), or plain FTP.",keywords:"protocol sftp ftps ftp"},{default:ye(()=>[_t("protocol")?(p(),m("span",Fv,[z(x(oa(K("protocol").effective))+" ",1),bt("protocol")?(p(),m("span",Dv,[A(Q,{name:"lock",size:10}),z(x(bt("protocol")),1)])):I("",!0)])):(p(),nt(wn,{key:1,modelValue:rt.protocol,"onUpdate:modelValue":c[32]||(c[32]=k=>rt.protocol=k),options:Z},null,8,["modelValue"]))]),_:1}),A(xe,{title:"Host",desc:"Server hostname or IP address.",keywords:"host server address"},{default:ye(()=>[_t("host")?(p(),m("span",Rv,[z(x(K("host").effective||"—")+" ",1),bt("host")?(p(),m("span",Bv,[A(Q,{name:"lock",size:10}),z(x(bt("host")),1)])):I("",!0)])):ie((p(),m("input",{key:1,"onUpdate:modelValue":c[33]||(c[33]=k=>rt.host=k),class:"field w-64",placeholder:"files.example.com"},null,512)),[[me,rt.host]])]),_:1}),A(xe,{title:"Port",desc:"Leave blank for the protocol default (22 for SFTP, 21 for FTP/FTPS).",keywords:"port"},{default:ye(()=>[_t("port")?(p(),m("span",Uv,[z(x(K("port").effective||"default")+" ",1),bt("port")?(p(),m("span",Vv,[A(Q,{name:"lock",size:10}),z(x(bt("port")),1)])):I("",!0)])):ie((p(),m("input",{key:1,"onUpdate:modelValue":c[34]||(c[34]=k=>rt.port=k),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"22"},null,512)),[[me,rt.port]])]),_:1}),A(xe,{title:"Username",desc:"Account used to authenticate.",keywords:"username login account"},{default:ye(()=>[_t("username")?(p(),m("span",Zv,[z(x(K("username").effective||"—")+" ",1),bt("username")?(p(),m("span",Hv,[A(Q,{name:"lock",size:10}),z(x(bt("username")),1)])):I("",!0)])):ie((p(),m("input",{key:1,"onUpdate:modelValue":c[35]||(c[35]=k=>rt.username=k),class:"field w-64",placeholder:"user"},null,512)),[[me,rt.username]])]),_:1}),A(xe,{title:"Password",desc:"Password auth for FTP/FTPS, or SFTP password login. Leave blank to use a key.",keywords:"password secret credentials"},{default:ye(()=>[_t("password")?(p(),m("span",jv,[z(x(K("password").effective||"—")+" ",1),bt("password")?(p(),m("span",Wv,[A(Q,{name:"lock",size:10}),z(x(bt("password")),1)])):I("",!0)])):ie((p(),m("input",{key:1,"onUpdate:modelValue":c[36]||(c[36]=k=>rt.password=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[me,rt.password]])]),_:1}),Et.value==="sftp"?(p(),nt(xe,{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:ye(()=>[_t("privateKey")?(p(),m("span",Kv,[z(x(K("privateKey").effective||"—")+" ",1),bt("privateKey")?(p(),m("span",Gv,[A(Q,{name:"lock",size:10}),z(x(bt("privateKey")),1)])):I("",!0)])):ie((p(),m("textarea",{key:1,"onUpdate:modelValue":c[37]||(c[37]=k=>rt.privateKey=k),rows:"3",class:"field w-full font-mono text-xs",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512)),[[me,rt.privateKey]])]),_:1})):I("",!0),Et.value==="sftp"?(p(),nt(xe,{key:8,title:"Private key passphrase",desc:"Passphrase protecting the SSH private key, if any.",keywords:"passphrase key secret"},{default:ye(()=>[_t("keyPassphrase")?(p(),m("span",qv,[z(x(K("keyPassphrase").effective||"—")+" ",1),bt("keyPassphrase")?(p(),m("span",Yv,[A(Q,{name:"lock",size:10}),z(x(bt("keyPassphrase")),1)])):I("",!0)])):ie((p(),m("input",{key:1,"onUpdate:modelValue":c[38]||(c[38]=k=>rt.keyPassphrase=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[me,rt.keyPassphrase]])]),_:1})):I("",!0),Et.value==="sftp"?(p(),nt(xe,{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:ye(()=>[_t("hostKeyFingerprint")?(p(),m("span",Jv,[z(x(K("hostKeyFingerprint").effective||"—")+" ",1),bt("hostKeyFingerprint")?(p(),m("span",Xv,[A(Q,{name:"lock",size:10}),z(x(bt("hostKeyFingerprint")),1)])):I("",!0)])):ie((p(),m("input",{key:1,"onUpdate:modelValue":c[39]||(c[39]=k=>rt.hostKeyFingerprint=k),class:"field w-full font-mono text-xs",placeholder:"SHA256:…"},null,512)),[[me,rt.hostKeyFingerprint]])]),_:1})):I("",!0),Et.value==="ftps"?(p(),nt(xe,{key:10,title:"TLS verification",desc:"Skip only for self-signed test servers.",keywords:"tls certificate verify insecure ftps"},{default:ye(()=>[_t("insecureSkipVerify")?(p(),m("span",Qv,[z(x(K("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),bt("insecureSkipVerify")?(p(),m("span",e_,[A(Q,{name:"lock",size:10}),z(x(bt("insecureSkipVerify")),1)])):I("",!0)])):(p(),nt(wn,{key:1,modelValue:rt.insecureSkipVerify,"onUpdate:modelValue":c[40]||(c[40]=k=>rt.insecureSkipVerify=k),options:E},null,8,["modelValue"]))]),_:1})):I("",!0),A(xe,{title:"Base path",desc:"Working directory and health-check target, e.g. /uploads.",keywords:"base path directory folder root"},{default:ye(()=>[_t("basePath")?(p(),m("span",t_,[z(x(K("basePath").effective||"—")+" ",1),bt("basePath")?(p(),m("span",n_,[A(Q,{name:"lock",size:10}),z(x(bt("basePath")),1)])):I("",!0)])):ie((p(),m("input",{key:1,"onUpdate:modelValue":c[41]||(c[41]=k=>rt.basePath=k),class:"field w-64 font-mono",placeholder:"/uploads"},null,512)),[[me,rt.basePath]])]),_:1}),a("div",i_,[Oe.value?I("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:pi.value||!at.available,onClick:or},x(pi.value?"Saving…":St.value?"Save organization settings":"Save settings"),9,o_)),St.value?I("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:Ii.value||!at.available,onClick:sr},x(Ii.value?"Testing…":"Test connection"),9,s_)),hi.value?(p(),m("span",a_,x(hi.value),1)):I("",!0),jn.value&&!St.value?(p(),m("span",r_,"Checked "+x(sa()),1)):I("",!0),Gt.value&&!St.value?(p(),m("span",{key:4,class:Pe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",la(Gt.value.status)])},[c[112]||(c[112]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(Gt.value.detail||Gt.value.status),1)],2)):I("",!0)])]),a("div",l_,[a("div",u_,[a("div",c_,[A(Q,{name:"cloud",size:20})]),c[113]||(c[113]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"WebDAV"),a("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))]),lt.loaded&&!lt.available?(p(),m("div",d_,[A(Q,{name:"lock",size:14,class:"mr-1 inline"}),c[114]||(c[114]=z(" WebDAV is currently disabled by your administrator. Contact them to enable it. ",-1))])):I("",!0),lt.canEditOrg?(p(),m("div",f_,[c[115]||(c[115]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(wn,{modelValue:Wn.value,"onUpdate:modelValue":c[42]||(c[42]=k=>Wn.value=k),options:Pt},null,8,["modelValue"])])):I("",!0),ot.value?(p(),nt(xe,{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:ye(()=>[A(nn,{"model-value":lt.orgEnabled,disabled:!lt.available,"onUpdate:modelValue":ca},null,8,["model-value","disabled"])]),_:1})):(p(),nt(xe,{key:3,title:"Enable WebDAV",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin webdav"},{default:ye(()=>[A(nn,{"model-value":lt.enabled,disabled:!lt.available||!lt.orgEnabled,"onUpdate:modelValue":ca},null,8,["model-value","disabled"])]),_:1})),!ot.value&<.available&&!lt.orgEnabled?(p(),m("div",h_,[A(Q,{name:"lock",size:13,class:"mr-1 inline"}),c[117]||(c[117]=z("WebDAV is turned off for your organization",-1)),lt.canEditOrg?(p(),m("span",p_,[...c[116]||(c[116]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):I("",!0),c[118]||(c[118]=z(". ",-1))])):I("",!0),ot.value?(p(),m("div",m_,[A(Q,{name:"users",size:13,class:"mr-1 inline"}),c[119]||(c[119]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",g_,x(t.organizationName||"your organization"),1),c[120]||(c[120]=z(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):Io.value?(p(),m("div",v_," As a superadmin you manage the global WebDAV configuration in the API Server panel. The effective configuration is shown below. ")):I("",!0),A(xe,{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:ye(()=>[Cn("baseURL")?(p(),m("span",__,[z(x(Pn("baseURL").effective||"—")+" ",1),qt("baseURL")?(p(),m("span",b_,[A(Q,{name:"lock",size:10}),z(x(qt("baseURL")),1)])):I("",!0)])):ie((p(),m("input",{key:1,"onUpdate:modelValue":c[43]||(c[43]=k=>Xt.baseURL=k),class:"field w-full font-mono text-xs",placeholder:"https://cloud.example.com/remote.php/dav/files/alice/"},null,512)),[[me,Xt.baseURL]])]),_:1}),A(xe,{title:"Username",desc:"Account used to authenticate (leave blank for a public share).",keywords:"username login account"},{default:ye(()=>[Cn("username")?(p(),m("span",y_,[z(x(Pn("username").effective||"—")+" ",1),qt("username")?(p(),m("span",x_,[A(Q,{name:"lock",size:10}),z(x(qt("username")),1)])):I("",!0)])):ie((p(),m("input",{key:1,"onUpdate:modelValue":c[44]||(c[44]=k=>Xt.username=k),class:"field w-64",placeholder:"user"},null,512)),[[me,Xt.username]])]),_:1}),A(xe,{title:"Password",desc:"Password or app-specific token for HTTP Basic auth.",keywords:"password secret credentials token"},{default:ye(()=>[Cn("password")?(p(),m("span",w_,[z(x(Pn("password").effective||"—")+" ",1),qt("password")?(p(),m("span",k_,[A(Q,{name:"lock",size:10}),z(x(qt("password")),1)])):I("",!0)])):ie((p(),m("input",{key:1,"onUpdate:modelValue":c[45]||(c[45]=k=>Xt.password=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[me,Xt.password]])]),_:1}),A(xe,{title:"TLS verification",desc:"Only affects HTTPS. Skip only for self-signed test servers.",keywords:"tls certificate verify insecure https"},{default:ye(()=>[Cn("insecureSkipVerify")?(p(),m("span",S_,[z(x(Pn("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),qt("insecureSkipVerify")?(p(),m("span",T_,[A(Q,{name:"lock",size:10}),z(x(qt("insecureSkipVerify")),1)])):I("",!0)])):(p(),nt(wn,{key:1,modelValue:Xt.insecureSkipVerify,"onUpdate:modelValue":c[46]||(c[46]=k=>Xt.insecureSkipVerify=k),options:ua},null,8,["modelValue"]))]),_:1}),A(xe,{title:"Base path",desc:"Working directory under the server URL and health-check target, e.g. /Documents.",keywords:"base path directory folder root"},{default:ye(()=>[Cn("basePath")?(p(),m("span",P_,[z(x(Pn("basePath").effective||"—")+" ",1),qt("basePath")?(p(),m("span",C_,[A(Q,{name:"lock",size:10}),z(x(qt("basePath")),1)])):I("",!0)])):ie((p(),m("input",{key:1,"onUpdate:modelValue":c[47]||(c[47]=k=>Xt.basePath=k),class:"field w-64 font-mono",placeholder:"/Documents"},null,512)),[[me,Xt.basePath]])]),_:1}),a("div",L_,[Io.value?I("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:zo.value||!lt.available,onClick:Do},x(zo.value?"Saving…":ot.value?"Save organization settings":"Save settings"),9,A_)),ot.value?I("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:$o.value||!lt.available,onClick:gi},x($o.value?"Testing…":"Test connection"),9,M_)),io.value?(p(),m("span",E_,x(io.value),1)):I("",!0),$n.value&&!ot.value?(p(),m("span",O_,"Checked "+x(Lt()),1)):I("",!0),Tn.value&&!ot.value?(p(),m("span",{key:4,class:Pe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Mt(Tn.value.status)])},[c[121]||(c[121]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(Tn.value.detail||Tn.value.status),1)],2)):I("",!0)])])],64)):I("",!0),Hi("drives-local")?(p(),m("div",z_,[a("div",$_,[a("div",I_,[A(Q,{name:"monitor",size:20})]),c[122]||(c[122]=a("div",{class:"min-w-0"},[a("div",{class:"text-sm font-semibold text-ink"},"Local Storage"),a("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))]),Ee.loaded&&!Ee.available?(p(),m("div",N_,[A(Q,{name:"lock",size:14,class:"mr-1 inline"}),c[123]||(c[123]=z(" Local storage is currently disabled by your administrator. Contact them to enable it. ",-1))])):Ee.loaded&&!Ee.rootConfigured?(p(),m("div",F_,[A(Q,{name:"alertTriangle",size:14,class:"mr-1 inline"}),c[124]||(c[124]=z(" No storage root has been configured by your administrator yet. ",-1))])):I("",!0),Ee.canEditOrg?(p(),m("div",D_,[c[125]||(c[125]=a("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(wn,{modelValue:Vi.value,"onUpdate:modelValue":c[48]||(c[48]=k=>Vi.value=k),options:Pt},null,8,["modelValue"])])):I("",!0),gn.value?(p(),nt(xe,{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:ye(()=>[A(nn,{"model-value":Ee.orgEnabled,disabled:!Ee.available,"onUpdate:modelValue":xs},null,8,["model-value","disabled"])]),_:1})):(p(),nt(xe,{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:ye(()=>[A(nn,{"model-value":Ee.enabled,disabled:!Ee.available||!Ee.orgEnabled,"onUpdate:modelValue":xs},null,8,["model-value","disabled"])]),_:1})),!gn.value&&Ee.available&&!Ee.orgEnabled?(p(),m("div",R_,[A(Q,{name:"lock",size:13,class:"mr-1 inline"}),c[127]||(c[127]=z("Local storage is turned off for your organization",-1)),Ee.canEditOrg?(p(),m("span",B_,[...c[126]||(c[126]=[z(" — switch to ",-1),a("span",{class:"font-semibold"},"Organization",-1),z(" to turn it back on",-1)])])):I("",!0),c[128]||(c[128]=z(". ",-1))])):I("",!0),gn.value?(p(),m("div",U_,[A(Q,{name:"users",size:13,class:"mr-1 inline"}),c[129]||(c[129]=z("These are organization-wide settings — they apply to everyone in ",-1)),a("span",V_,x(t.organizationName||"your organization"),1),c[130]||(c[130]=z(", who all share the organization folder. Members can additionally enable a private folder inside it. ",-1))])):_s.value?(p(),m("div",Z_," As a superadmin you manage the global storage root in the API Server panel. The effective configuration is shown below. ")):I("",!0),gn.value?(p(),nt(xe,{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:ye(()=>[A(nn,{"model-value":Ee.allowPrivate,disabled:!Ee.available,"onUpdate:modelValue":ur},null,8,["model-value","disabled"])]),_:1})):I("",!0),gn.value?I("",!0):(p(),m(ae,{key:9},[A(xe,{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:ye(()=>[a("div",H_,[(p(!0),m(ae,null,ze(Ee.mounts,k=>(p(),m("div",{key:k.id,class:"flex flex-wrap items-center gap-2"},[a("span",j_,x(k.path),1),k.kind==="shared"?(p(),m("span",W_,[A(Q,{name:"users",size:10}),c[131]||(c[131]=z("Shared with your organization",-1))])):(p(),m("span",K_,[A(Q,{name:"lock",size:10}),c[132]||(c[132]=z("Private to you",-1))])),ao.value[k.id]?(p(),m("span",{key:2,class:Pe(["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold",va(ao.value[k.id].status)])},[c[133]||(c[133]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(ao.value[k.id].status),1)],2)):I("",!0)]))),128)),Ee.mounts.length?I("",!0):(p(),m("div",G_,x(Ee.rootConfigured?"No folder assigned yet.":"Waiting for the administrator to configure a storage root."),1))])]),_:1}),Ee.isOrgUser&&Ee.allowPrivate?(p(),nt(xe,{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:ye(()=>[A(nn,{"model-value":Ee.privateFolder,disabled:!Ee.available||!Ee.orgEnabled,"onUpdate:modelValue":ga},null,8,["model-value","disabled"])]),_:1})):Ee.isOrgUser&&!Ee.allowPrivate?(p(),m("div",q_,[A(Q,{name:"lock",size:13,class:"mr-1 inline"}),c[134]||(c[134]=z("Private folders are turned off by your organization. ",-1))])):I("",!0)],64)),A(xe,{title:"Access mode",desc:"Read-only prevents uploads, deletes and folder creation.",keywords:"read only write access mode permission"},{default:ye(()=>[ha("readOnly")?(p(),m("span",Y_,[z(x(rr(Zi("readOnly").effective))+" ",1),An("readOnly")?(p(),m("span",J_,[A(Q,{name:"lock",size:10}),z(x(An("readOnly")),1)])):I("",!0)])):(p(),nt(wn,{key:1,modelValue:so.value,"onUpdate:modelValue":c[49]||(c[49]=k=>so.value=k),options:Zo},null,8,["modelValue"]))]),_:1}),a("div",X_,[_s.value?I("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:Vo.value||!Ee.available,onClick:cr},x(Vo.value?"Saving…":gn.value?"Save organization settings":"Save settings"),9,Q_)),gn.value?I("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:en.value||!Ee.available,onClick:ws},x(en.value?"Testing…":"Test folder"),9,e1)),qe.value?(p(),m("span",t1,x(qe.value),1)):I("",!0),yi.value&&!gn.value?(p(),m("span",n1,"Checked "+x(pa()),1)):I("",!0),ln.value&&!gn.value?(p(),m("span",{key:4,class:Pe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",va(ln.value.status)])},[c[135]||(c[135]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(ln.value.detail||ln.value.status),1)],2)):I("",!0)])])):I("",!0)])):X.id==="profile"?(p(),m("div",i1,[A(xe,{block:"",title:"Profile photo",desc:"PNG or JPG, up to ~1.5 MB. Stored on this device.",keywords:"avatar photo picture"},{default:ye(()=>[a("div",o1,[$e(be).avatar?(p(),m("img",{key:0,src:$e(be).avatar,alt:"Avatar",class:"h-16 w-16 rounded-full object-cover"},null,8,s1)):(p(),m("div",a1,x(ba.value),1)),a("div",r1,[a("label",l1,[A(Q,{name:"upload",size:15,class:"mr-1.5 inline"}),c[136]||(c[136]=z("Upload ",-1)),a("input",{type:"file",accept:"image/*",class:"hidden",onChange:fr},null,32)]),$e(be).avatar?(p(),m("button",{key:0,class:"btn-ghost",onClick:hr},"Remove")):I("",!0)])])]),_:1}),A(xe,{title:"Display name",desc:"The name shown on your public profile.",keywords:"display name profile"},{default:ye(()=>[ie(a("input",{"onUpdate:modelValue":c[50]||(c[50]=k=>$e(be).displayName=k),class:"field w-56",placeholder:"Jane O.",onBlur:c[51]||(c[51]=k=>We("Saved."))},null,544),[[me,$e(be).displayName]])]),_:1}),A(xe,{block:"",title:"Bio",desc:"A short description others can see.",keywords:"bio about description"},{default:ye(()=>[ie(a("textarea",{"onUpdate:modelValue":c[52]||(c[52]=k=>$e(be).bio=k),rows:"3",maxlength:"240",class:"field w-full resize-none",placeholder:"Flight director, North yard operations…",onBlur:c[53]||(c[53]=k=>We("Saved."))},null,544),[[me,$e(be).bio]]),a("div",u1,x(($e(be).bio||"").length)+"/240",1)]),_:1}),A(xe,{title:"Show email on profile",desc:"Let teammates see your email address.",keywords:"show email public visibility"},{default:ye(()=>[A(nn,{modelValue:$e(be).showEmail,"onUpdate:modelValue":c[54]||(c[54]=k=>$e(be).showEmail=k)},null,8,["modelValue"])]),_:1})])):X.id==="security"?(p(),m("div",c1,[A(xe,{block:"",title:"Two-factor authentication",desc:"Require a one-time code at sign-in.",keywords:"two factor 2fa authentication security"},{default:ye(()=>[a("div",d1,[a("span",{class:Pe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",$e(be).twoFactor?"bg-success-soft text-success-fg":"bg-surface-2 text-ink-secondary"])},[c[137]||(c[137]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x($e(be).twoFactor?"Enabled":"Disabled"),1)],2),!$e(be).twoFactor&&!lo.value?(p(),m("button",{key:0,class:"btn-accent",onClick:ji},"Enable 2FA")):$e(be).twoFactor?(p(),m("button",{key:1,class:"btn-ghost",onClick:co},"Disable")):I("",!0)]),lo.value?(p(),m("div",f1,[a("div",h1,[c[139]||(c[139]=a("div",{class:"grid h-28 w-28 place-items-center rounded bg-white p-2"},[a("svg",{viewBox:"0 0 100 100",class:"h-full w-full"},[a("rect",{width:"100",height:"100",fill:"#fff"}),a("g",{fill:"#0F1E3D"},[a("rect",{x:"6",y:"6",width:"24",height:"24"}),a("rect",{x:"70",y:"6",width:"24",height:"24"}),a("rect",{x:"6",y:"70",width:"24",height:"24"}),a("rect",{x:"12",y:"12",width:"12",height:"12",fill:"#fff"}),a("rect",{x:"76",y:"12",width:"12",height:"12",fill:"#fff"}),a("rect",{x:"12",y:"76",width:"12",height:"12",fill:"#fff"}),a("rect",{x:"40",y:"10",width:"8",height:"8"}),a("rect",{x:"52",y:"20",width:"8",height:"8"}),a("rect",{x:"40",y:"40",width:"8",height:"8"}),a("rect",{x:"60",y:"44",width:"8",height:"8"}),a("rect",{x:"44",y:"60",width:"8",height:"8"}),a("rect",{x:"70",y:"60",width:"8",height:"8"}),a("rect",{x:"80",y:"72",width:"8",height:"8"}),a("rect",{x:"60",y:"80",width:"8",height:"8"})])])],-1)),a("div",p1,[c[138]||(c[138]=a("div",{class:"text-xs text-ink-secondary"},"Scan with an authenticator app, or enter this secret:",-1)),a("div",m1,x(_n.value),1),a("div",g1,[ie(a("input",{"onUpdate:modelValue":c[55]||(c[55]=k=>qn.value=k),inputmode:"numeric",maxlength:"6",class:"field w-28 font-mono tracking-[0.3em]",placeholder:"000000"},null,512),[[me,qn.value]]),a("button",{class:"btn-accent",onClick:pr},"Verify & enable")]),uo.value?(p(),m("p",v1,x(uo.value),1)):I("",!0)])])])):I("",!0),$e(be).twoFactor&&bn.value.length?(p(),m("div",_1,[c[140]||(c[140]=a("div",{class:"text-xs font-semibold text-ink"},"Recovery codes",-1)),c[141]||(c[141]=a("div",{class:"mt-0.5 text-xs text-ink-muted"},"Store these somewhere safe — each works once.",-1)),a("div",b1,[(p(!0),m(ae,null,ze(bn.value,k=>(p(),m("span",{key:k,class:"select-all"},x(k),1))),128))])])):I("",!0),c[142]||(c[142]=a("p",{class:"mt-2 text-xs text-ink-muted"},"Prototype — codes are generated locally until the account service verifies them.",-1))]),_:1}),A(xe,{block:"",title:"Active sessions",desc:"Devices currently signed in to your account.",keywords:"sessions devices logout sign out remote"},{default:ye(()=>[a("div",y1,[a("div",x1,[a("div",w1,[A(Q,{name:"monitor",size:18})]),a("div",k1,[a("div",S1,[z(x(Wo())+" on "+x(mr())+" ",1),c[143]||(c[143]=a("span",{class:"ml-1 rounded-full bg-success-soft px-2 py-0.5 text-[10px] font-semibold text-success-fg"},"This device",-1))]),a("div",T1,"Signed in "+x($e(Su)($e(ni))),1)]),a("button",{class:"btn-ghost",onClick:c[56]||(c[56]=k=>l("logout"))},"Log out")])]),c[144]||(c[144]=a("button",{class:"btn-ghost mt-2 opacity-60",disabled:"",title:"Requires the account service"}," Log out all other devices ",-1)),c[145]||(c[145]=a("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})])):X.id==="team"?(p(),m("div",P1,[Qe.id?(p(),m("div",C1,[A(xe,{block:"",title:`Edit user — ${Qe.email}`,desc:"Update details, change role, reset password, or set verified.",keywords:"edit user update role password verified organization"},{default:ye(()=>[a("div",L1,[a("div",A1,[ie(a("input",{"onUpdate:modelValue":c[57]||(c[57]=k=>Qe.email=k),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[me,Qe.email]]),ie(a("select",{"onUpdate:modelValue":c[58]||(c[58]=k=>Qe.role=k),class:"field w-32",disabled:qo.value,title:qo.value?"You cannot change your own role":""},[(p(!0),m(ae,null,ze(ya.value,k=>(p(),m("option",{key:k.value,value:k.value},x(k.label),9,E1))),128))],8,M1),[[Ot,Qe.role]])]),u.value?ie((p(),m("select",{key:0,"onUpdate:modelValue":c[59]||(c[59]=k=>Qe.organization=k),class:"field",title:"Organization"},[(p(!0),m(ae,null,ze(Cs.value,k=>(p(),m("option",{key:k.value,value:k.value},x(k.label),9,O1))),128))],512)),[[Ot,Qe.organization]]):I("",!0),ie(a("input",{"onUpdate:modelValue":c[60]||(c[60]=k=>Qe.password=k),type:"password",class:"field",placeholder:"New password (leave blank to keep current)"},null,512),[[me,Qe.password]]),a("label",z1,[A(nn,{modelValue:Qe.verified,"onUpdate:modelValue":c[61]||(c[61]=k=>Qe.verified=k)},null,8,["modelValue"]),c[146]||(c[146]=z(" Email verified ",-1))]),a("div",$1,[a("button",{class:"btn-accent",disabled:Ki.value,onClick:vr},x(Ki.value?"Saving…":"Save changes"),9,I1),a("button",{class:"btn-ghost",onClick:ho},"Cancel"),En.value?(p(),m("span",N1,x(En.value),1)):I("",!0),qo.value?(p(),m("span",F1,"Editing your own account — role locked.")):I("",!0)])])]),_:1},8,["title"])])):(p(),m("div",D1,[A(xe,{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:ye(()=>[a("div",R1,[a("div",B1,[ie(a("input",{"onUpdate:modelValue":c[62]||(c[62]=k=>Rt.email=k),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[me,Rt.email]]),ie(a("select",{"onUpdate:modelValue":c[63]||(c[63]=k=>Rt.role=k),class:"field w-32"},[(p(!0),m(ae,null,ze(ya.value,k=>(p(),m("option",{key:k.value,value:k.value},x(k.label),9,U1))),128))],512),[[Ot,Rt.role]])]),u.value?ie((p(),m("select",{key:0,"onUpdate:modelValue":c[64]||(c[64]=k=>Rt.organization=k),class:"field",title:"Organization"},[(p(!0),m(ae,null,ze(Cs.value,k=>(p(),m("option",{key:k.value,value:k.value},x(k.label),9,V1))),128))],512)),[[Ot,Rt.organization]]):(p(),m("div",Z1,[c[147]||(c[147]=z(" New users join your organization: ",-1)),a("span",H1,x(t.organizationName||"—"),1)])),ie(a("input",{"onUpdate:modelValue":c[65]||(c[65]=k=>Rt.password=k),type:"password",class:"field",placeholder:"Temporary password (min 8 chars)"},null,512),[[me,Rt.password]]),a("div",j1,[a("button",{class:"btn-accent",disabled:Ko.value,onClick:Ls},x(Ko.value?"Creating…":"Create user"),9,W1),tn.value?(p(),m("span",K1,x(tn.value),1)):I("",!0)])])]),_:1})])),a("div",G1,[a("div",q1,[c[148]||(c[148]=a("div",null,[a("div",{class:"eyebrow"},"Team"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All users")],-1)),a("button",{class:"btn-ghost",disabled:fo.value,onClick:oi},x(fo.value?"Loading…":"Refresh"),9,Y1)]),Wi.value?(p(),m("div",J1,x(Wi.value),1)):!wi.value.length&&!fo.value?(p(),m("div",X1,"No users yet.")):(p(),m("div",Q1,[a("table",eb,[a("thead",null,[a("tr",tb,[(p(),m(ae,null,ze(["User","Role","Organization","Status",""],k=>a("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"},x(k),1)),64))])]),a("tbody",null,[(p(!0),m(ae,null,ze(wi.value,k=>(p(),m("tr",{key:k.id,class:Pe(["border-b border-line last:border-0",Qe.id===k.id?"bg-accent-soft":""])},[a("td",nb,[a("span",ib,x(k.email),1),k.email===t.email?(p(),m("span",ob,"(you)")):I("",!0)]),a("td",sb,[a("span",{class:Pe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",b(k.role||"user")])},[A(Q,{name:_(k.role||"user"),size:12},null,8,["name"]),z(x(h(k.role||"user")),1)],2)]),a("td",ab,[a("span",{class:Pe(["text-sm",k.organizationName?"text-ink-secondary":"text-ink-muted"])},x(k.organizationName||"—"),3)]),a("td",rb,[a("span",{class:Pe(["text-xs",k.verified?"text-success-fg":"text-ink-muted"])},x(k.verified?"Verified":"Unverified"),3)]),a("td",lb,[Fn.value===k.id?(p(),m(ae,{key:0},[c[149]||(c[149]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Remove?",-1)),a("button",{class:"btn-ghost mr-1",onClick:c[66]||(c[66]=Be=>Fn.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Be=>Go(k)}," Remove ",8,ub)],64)):(p(),m("div",cb,[a("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Be=>gr(k)},[A(Q,{name:"settings",size:14}),c[150]||(c[150]=z(" Edit ",-1))],8,db),k.email!==t.email?(p(),m("button",{key:0,class:"btn-ghost inline-flex items-center gap-1.5",onClick:Be=>Fn.value=k.id},[A(Q,{name:"trash",size:14}),c[151]||(c[151]=z(" Remove ",-1))],8,fb)):I("",!0)]))])],2))),128))])])]))])])):X.id==="organizations"?(p(),m("div",hb,[Nt.id?(p(),m("div",pb,[A(xe,{block:"",title:"Rename organization",desc:"Update the organization's display name.",keywords:"rename organization edit"},{default:ye(()=>[a("div",mb,[ie(a("input",{"onUpdate:modelValue":c[67]||(c[67]=k=>Nt.name=k),class:"field",placeholder:"Organization name",onKeyup:pu(xa,["enter"])},null,544),[[me,Nt.name]]),a("div",gb,[a("button",{class:"btn-accent",onClick:xa},"Save changes"),a("button",{class:"btn-ghost",onClick:Ms},"Cancel"),Dn.value?(p(),m("span",vb,x(Dn.value),1)):I("",!0)])])]),_:1})])):(p(),m("div",_b,[A(xe,{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:ye(()=>[a("div",bb,[ie(a("input",{"onUpdate:modelValue":c[68]||(c[68]=k=>po.name=k),class:"field",placeholder:"e.g. Northwind Aerial",onKeyup:pu(_o,["enter"])},null,544),[[me,po.name]]),a("div",yb,[a("button",{class:"btn-accent",disabled:go.value,onClick:_o},x(go.value?"Creating…":"Create organization"),9,xb),mo.value?(p(),m("span",wb,x(mo.value),1)):I("",!0)])])]),_:1})])),a("div",kb,[a("div",{class:"flex items-center justify-between px-5 py-4"},[c[152]||(c[152]=a("div",null,[a("div",{class:"eyebrow"},"Tenancy"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All organizations")],-1)),a("button",{class:"btn-ghost",onClick:ii},"Refresh")]),yn.value.length?(p(),m("div",Tb,[a("table",Pb,[a("thead",null,[a("tr",Cb,[(p(),m(ae,null,ze(["Organization","Members",""],k=>a("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"},x(k),1)),64))])]),a("tbody",null,[(p(!0),m(ae,null,ze(yn.value,k=>(p(),m("tr",{key:k.id,class:Pe(["border-b border-line last:border-0",Nt.id===k.id?"bg-accent-soft":""])},[a("td",Lb,[a("span",Ab,[A(Q,{name:"grid",size:14,class:"text-ink-muted"}),z(x(k.name),1)])]),a("td",Mb,x(As.value[k.id]||0),1),a("td",Eb,[vo.value===k.id?(p(),m(ae,{key:0},[c[153]||(c[153]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),a("button",{class:"btn-ghost mr-1",onClick:c[69]||(c[69]=Be=>vo.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Be=>bo(k)}," Delete ",8,Ob)],64)):(p(),m("div",zb,[a("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Be=>_r(k)},[A(Q,{name:"settings",size:14}),c[154]||(c[154]=z(" Rename ",-1))],8,$b),a("button",{class:"btn-ghost inline-flex items-center gap-1.5",disabled:(As.value[k.id]||0)>0,title:(As.value[k.id]||0)>0?"Reassign or remove members first":"",onClick:Be=>vo.value=k.id},[A(Q,{name:"trash",size:14}),c[155]||(c[155]=z(" Delete ",-1))],8,Ib)]))])],2))),128))])])])):(p(),m("div",Sb,"No organizations yet."))])])):X.id==="advanced"?(p(),m("div",Nb,[a("div",Fb,[A(xe,{title:"Export data",desc:"Download your settings and profile as JSON.",keywords:"export data download backup"},{default:ye(()=>[a("button",{class:"btn-ghost",onClick:br},[A(Q,{name:"download",size:15,class:"mr-1.5 inline"}),c[156]||(c[156]=z("Export",-1))])]),_:1}),A(xe,{block:"",title:"Import data",desc:"Restore settings from a previous export.",keywords:"import data upload restore"},{default:ye(()=>[a("label",Db,[A(Q,{name:"upload",size:15,class:"mr-1.5 inline"}),c[157]||(c[157]=z("Choose file… ",-1)),a("input",{type:"file",accept:"application/json,.json",class:"hidden",onChange:wa},null,32)]),Yn.value?(p(),m("p",Rb,x(Yn.value),1)):I("",!0)]),_:1})]),a("div",Bb,[a("div",Ub,[A(Q,{name:"alertTriangle",size:18}),c[158]||(c[158]=a("h3",{class:"text-sm font-bold uppercase tracking-caps"},"Danger zone",-1))]),c[163]||(c[163]=a("p",{class:"mt-1 text-xs text-ink-secondary"},"Deleting your account is permanent and cannot be undone.",-1)),a("div",Vb,[c[162]||(c[162]=a("div",{class:"text-sm font-semibold text-ink"},"Delete account",-1)),a("label",Zb,[ie(a("input",{"onUpdate:modelValue":c[70]||(c[70]=k=>mt.understand=k),type:"checkbox",class:"mt-0.5 h-4 w-4 accent-[var(--danger)]"},null,512),[[Va,mt.understand]]),c[159]||(c[159]=z(" I understand this permanently deletes my account and all associated data. ",-1))]),a("div",Hb,[a("label",jb,[c[160]||(c[160]=z("Type ",-1)),a("span",Wb,x(On.value),1),c[161]||(c[161]=z(" to confirm",-1))]),ie(a("input",{"onUpdate:modelValue":c[71]||(c[71]=k=>mt.typed=k),class:"field w-full max-w-[360px] font-mono",placeholder:On.value},null,8,Kb),[[me,mt.typed]])]),a("div",Gb,[mt.armed?(p(),m("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:mt.cooldown>0,onClick:xo},x(mt.cooldown>0?`Confirm in ${mt.cooldown}s…`:"Permanently delete account"),9,Yb)):(p(),m("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:!Yo.value,onClick:ka}," Delete account… ",8,qb)),mt.armed&&mt.cooldown>0?(p(),m("span",Jb,"Cooling-off period — read once more.")):I("",!0)]),mt.msg?(p(),m("p",Xb,x(mt.msg),1)):I("",!0)])])])):I("",!0)],64))),128))])]),A(vh,{name:"fade"},{default:ye(()=>[Nn.value?(p(),m("div",Qb,[A(Q,{name:"check",size:16,class:"text-success-fg"}),z(x(Nn.value),1)])):I("",!0)]),_:1})]))}},ty=Cm(ey,[["__scopeId","data-v-7522b856"]]),ny={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},iy={class:"flex flex-wrap items-center gap-3"},oy={class:"ml-auto flex items-center gap-2"},sy=["href"],ay={class:"grid grid-cols-3 gap-4 max-[900px]:grid-cols-1"},ry={class:"eyebrow"},ly={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},uy={key:1,class:"panel p-5"},cy={class:"mb-4 flex items-center justify-between"},dy={class:"eyebrow"},fy={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},hy={class:"block"},py={class:"block"},my={class:"block"},gy={class:"block"},vy={key:0,value:""},_y=["value"],by={class:"block"},yy={class:"block"},xy={class:"block"},wy={class:"block"},ky={class:"block"},Sy=["value"],Ty={class:"block"},Py=["value"],Cy={class:"block"},Ly=["value"],Ay={class:"block"},My={class:"mt-3 block"},Ey={key:0,class:"mt-3 grid grid-cols-2 gap-3 max-[760px]:grid-cols-1"},Oy={class:"block"},zy={class:"block"},$y={class:"block"},Iy={class:"block"},Ny={class:"col-span-2 block max-[760px]:col-span-1"},Fy={class:"mt-4 flex items-center gap-3"},Dy=["disabled"],Ry={key:0,class:"text-sm text-danger-fg"},By={class:"panel overflow-hidden p-0"},Uy={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Vy={key:1,class:"grid place-items-center px-5 py-16 text-center"},Zy={key:2,class:"overflow-x-auto"},Hy={class:"w-full border-collapse text-sm"},jy={class:"text-left"},Wy={class:"whitespace-nowrap px-5 py-3 font-mono text-ink"},Ky={key:0,class:"text-ink-muted"},Gy={class:"px-5 py-3 text-ink-secondary"},qy=["title"],Yy={class:"px-5 py-3 font-mono text-ink-secondary"},Jy={class:"px-5 py-3 text-ink-secondary"},Xy={class:"px-5 py-3"},Qy=["onClick"],ex={class:"whitespace-nowrap px-5 py-3 text-right"},tx=["onClick"],nx=["onClick"],ix=["onClick"],ox={key:0,class:"border-b border-line bg-surface-2"},sx={colspan:"7",class:"px-5 py-3"},ax={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},rx={class:"text-ink-secondary"},lx={class:"text-ink"},ux={class:"text-ink-secondary"},cx={class:"text-ink"},dx={class:"text-ink-secondary"},fx={class:"font-mono text-ink"},hx={key:0,class:"text-ink-secondary"},px={class:"text-ink"},mx={key:0,class:"mt-2 space-y-1"},gx={key:1,class:"mt-2 text-xs text-success-fg"},vx={__name:"Logbook",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},setup(t){const i=t,s={success:"bg-success-soft text-success-fg",danger:"bg-danger-soft text-danger-fg",neutral:"bg-surface-2 text-ink-secondary"},l=Y([]),u=Y([]),f=Y(!1),h=Y("");async function _(){f.value=!0,h.value="";const[O,F]=await Promise.all([pl(),Ap()]);(!O.ok||!F.ok)&&(h.value=O.status===503||F.status===503?"Logbook storage is not configured on the API Server (service account missing).":"Could not load the logbook."),l.value=O.drones,u.value=F.flights,f.value=!1}ti(_);function b(O){const F=O.compliance||{};return F.exempt?{tone:"neutral",label:"Exempt"}:(F.redFlags||[]).length?{tone:"danger",label:`${F.redFlags.length} issue${F.redFlags.length>1?"s":""}`}:{tone:"success",label:"Compliant"}}const C=Y("");function T(O){C.value=C.value===O?"":O}const M=[{value:"open",label:"Open"},{value:"specific",label:"Specific"},{value:"certified",label:"Certified"}],H=[{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"}],j=[{value:"",label:"Auto (from drone)"},{value:"manual",label:"Manual"},{value:"automatic",label:"Automatic (FDR)"}];function G(){var O;return{operationDate:new Date().toISOString().slice(0,10),startTime:"",endTime:"",drone:((O=l.value[0])==null?void 0:O.id)||"",areaRoute:"",maxAltitudeAgl:"",pilotName:i.email,certificateRef:"",category:"open",purpose:"commercial",loggingPath:"",rawFdrLogUrl:"",authorisationRef:"",weather:"",airspaceRef:"",observer:"",incidents:"",notes:""}}const N=Y(!1),U=Y(""),R=gt(G()),oe=Y(""),we=Y(!1),ue=Y(!1);function ke(){Object.assign(R,G()),U.value="",oe.value="",ue.value=!1,N.value=!0}function Ce(O){Object.assign(R,{operationDate:(O.operationDate||"").slice(0,10),startTime:O.startTime||"",endTime:O.endTime||"",drone:O.drone||"",areaRoute:O.areaRoute||"",maxAltitudeAgl:O.maxAltitudeAgl||"",pilotName:O.pilotName||"",certificateRef:O.certificateRef||"",category:O.category||"open",purpose:O.purpose||"commercial",loggingPath:O.loggingPath||"",rawFdrLogUrl:O.rawFdrLogUrl||"",authorisationRef:O.authorisationRef||"",weather:O.weather||"",airspaceRef:O.airspaceRef||"",observer:O.observer||"",incidents:O.incidents||"",notes:O.notes||""}),U.value=O.id,oe.value="",ue.value=!!(O.weather||O.airspaceRef||O.observer||O.incidents||O.notes),N.value=!0}function Le(){N.value=!1,U.value=""}async function Ze(){var $;if(oe.value="",!R.drone){oe.value="Select a drone first (add one in the Drones section).";return}we.value=!0;const O={...R,maxAltitudeAgl:Number(R.maxAltitudeAgl)||0},F=U.value?await Ep(U.value,O):await Mp(O);if(we.value=!1,!F.ok){oe.value=(($=F.body)==null?void 0:$.error)||"Could not save the flight.";return}N.value=!1,await _()}const he=Y("");async function ee(O){const F=await Op(O.id);he.value="",F.ok&&await _()}const V=de(()=>{const O=u.value.length,F=u.value.filter(Ye=>{var Se;return(((Se=Ye.compliance)==null?void 0:Se.redFlags)||[]).length}).length,$=u.value.filter(Ye=>{var Se;return(Se=Ye.compliance)==null?void 0:Se.required}).length;return{total:O,flagged:F,required:$}});return(O,F)=>(p(),m("div",ny,[a("div",iy,[F[22]||(F[22]=a("div",null,[a("div",{class:"eyebrow"},"Logbook"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Flights (BEK 1649 §5)")],-1)),a("div",oy,[a("a",{href:$e(zp)(),class:"btn-ghost inline-flex items-center gap-2",title:"Download a compliance CSV (Trafikstyrelsen / police disclosure)"},[A(Q,{name:"download",size:15}),F[20]||(F[20]=z(" Export CSV ",-1))],8,sy),a("button",{class:"btn-accent inline-flex items-center gap-2",onClick:ke},[A(Q,{name:"plus",size:15}),F[21]||(F[21]=z(" Log flight ",-1))])])]),a("div",ay,[(p(!0),m(ae,null,ze([{label:"Flights logged",value:V.value.total,tone:"neutral"},{label:"Require logbook",value:V.value.required,tone:"neutral"},{label:"Compliance flags",value:V.value.flagged,tone:V.value.flagged?"danger":"success"}],$=>(p(),m("div",{key:$.label,class:"panel p-5"},[a("div",ry,x($.label),1),a("div",{class:Pe(["mt-2 text-[30px] font-bold leading-none tracking-tightest",$.tone==="danger"?"text-danger-fg":$.tone==="success"?"text-success-fg":"text-ink"])},x($.value),3)]))),128))]),h.value?(p(),m("div",ly,x(h.value),1)):I("",!0),N.value?(p(),m("div",uy,[a("div",cy,[a("div",null,[a("div",dy,x(U.value?"Edit entry":"New entry"),1),F[23]||(F[23]=a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Logbook flight (BEK 1649 §5)",-1))]),a("button",{class:"btn-icon",onClick:Le},[A(Q,{name:"x",size:16})])]),a("div",fy,[a("label",hy,[F[24]||(F[24]=a("span",{class:"eyebrow mb-1 block"},"Date",-1)),ie(a("input",{"onUpdate:modelValue":F[0]||(F[0]=$=>R.operationDate=$),type:"date",class:"field"},null,512),[[me,R.operationDate]])]),a("label",py,[F[25]||(F[25]=a("span",{class:"eyebrow mb-1 block"},"Start",-1)),ie(a("input",{"onUpdate:modelValue":F[1]||(F[1]=$=>R.startTime=$),type:"time",class:"field"},null,512),[[me,R.startTime]])]),a("label",my,[F[26]||(F[26]=a("span",{class:"eyebrow mb-1 block"},"End",-1)),ie(a("input",{"onUpdate:modelValue":F[2]||(F[2]=$=>R.endTime=$),type:"time",class:"field"},null,512),[[me,R.endTime]])]),a("label",gy,[F[27]||(F[27]=a("span",{class:"eyebrow mb-1 block"},"Drone",-1)),ie(a("select",{"onUpdate:modelValue":F[3]||(F[3]=$=>R.drone=$),class:"field"},[l.value.length?I("",!0):(p(),m("option",vy,"— add a drone first —")),(p(!0),m(ae,null,ze(l.value,$=>(p(),m("option",{key:$.id,value:$.id},x($.displayName),9,_y))),128))],512),[[Ot,R.drone]])]),a("label",by,[F[28]||(F[28]=a("span",{class:"eyebrow mb-1 block"},"Max altitude (m AGL)",-1)),ie(a("input",{"onUpdate:modelValue":F[4]||(F[4]=$=>R.maxAltitudeAgl=$),type:"number",min:"0",class:"field",placeholder:"120"},null,512),[[me,R.maxAltitudeAgl]])]),a("label",yy,[F[29]||(F[29]=a("span",{class:"eyebrow mb-1 block"},"Area / route",-1)),ie(a("input",{"onUpdate:modelValue":F[5]||(F[5]=$=>R.areaRoute=$),class:"field",placeholder:"Field N of Roskilde, grid survey"},null,512),[[me,R.areaRoute]])]),a("label",xy,[F[30]||(F[30]=a("span",{class:"eyebrow mb-1 block"},"Remote pilot name",-1)),ie(a("input",{"onUpdate:modelValue":F[6]||(F[6]=$=>R.pilotName=$),class:"field",placeholder:"Full name"},null,512),[[me,R.pilotName]])]),a("label",wy,[F[31]||(F[31]=a("span",{class:"eyebrow mb-1 block"},"Certificate ref",-1)),ie(a("input",{"onUpdate:modelValue":F[7]||(F[7]=$=>R.certificateRef=$),class:"field",placeholder:"A2 / STS cert no."},null,512),[[me,R.certificateRef]])]),a("label",ky,[F[32]||(F[32]=a("span",{class:"eyebrow mb-1 block"},"Logging path",-1)),ie(a("select",{"onUpdate:modelValue":F[8]||(F[8]=$=>R.loggingPath=$),class:"field"},[(p(),m(ae,null,ze(j,$=>a("option",{key:$.value,value:$.value},x($.label),9,Sy)),64))],512),[[Ot,R.loggingPath]])]),a("label",Ty,[F[33]||(F[33]=a("span",{class:"eyebrow mb-1 block"},"Category",-1)),ie(a("select",{"onUpdate:modelValue":F[9]||(F[9]=$=>R.category=$),class:"field"},[(p(),m(ae,null,ze(M,$=>a("option",{key:$.value,value:$.value},x($.label),9,Py)),64))],512),[[Ot,R.category]])]),a("label",Cy,[F[34]||(F[34]=a("span",{class:"eyebrow mb-1 block"},"Purpose",-1)),ie(a("select",{"onUpdate:modelValue":F[10]||(F[10]=$=>R.purpose=$),class:"field"},[(p(),m(ae,null,ze(H,$=>a("option",{key:$.value,value:$.value},x($.label),9,Ly)),64))],512),[[Ot,R.purpose]])]),a("label",Ay,[F[35]||(F[35]=a("span",{class:"eyebrow mb-1 block"},"Authorisation ref",-1)),ie(a("input",{"onUpdate:modelValue":F[11]||(F[11]=$=>R.authorisationRef=$),class:"field",placeholder:"Specific-category ref"},null,512),[[me,R.authorisationRef]])])]),a("label",My,[F[36]||(F[36]=a("span",{class:"eyebrow mb-1 block"},"FDR log URL (automatic path)",-1)),ie(a("input",{"onUpdate:modelValue":F[12]||(F[12]=$=>R.rawFdrLogUrl=$),class:"field",placeholder:"Link to the stored flight-data-recorder export"},null,512),[[me,R.rawFdrLogUrl]])]),a("button",{class:"mt-4 flex items-center gap-1.5 text-sm font-semibold text-accent",onClick:F[13]||(F[13]=$=>ue.value=!ue.value)},[A(Q,{name:ue.value?"x":"plus",size:14},null,8,["name"]),F[37]||(F[37]=z(" Operational details (weather, airspace, incidents) ",-1))]),ue.value?(p(),m("div",Ey,[a("label",Oy,[F[38]||(F[38]=a("span",{class:"eyebrow mb-1 block"},"Weather / wind",-1)),ie(a("input",{"onUpdate:modelValue":F[14]||(F[14]=$=>R.weather=$),class:"field",placeholder:"6 m/s NW, CAVOK"},null,512),[[me,R.weather]])]),a("label",zy,[F[39]||(F[39]=a("span",{class:"eyebrow mb-1 block"},"Airspace / NOTAM ref",-1)),ie(a("input",{"onUpdate:modelValue":F[15]||(F[15]=$=>R.airspaceRef=$),class:"field"},null,512),[[me,R.airspaceRef]])]),a("label",$y,[F[40]||(F[40]=a("span",{class:"eyebrow mb-1 block"},"Observer",-1)),ie(a("input",{"onUpdate:modelValue":F[16]||(F[16]=$=>R.observer=$),class:"field"},null,512),[[me,R.observer]])]),a("label",Iy,[F[41]||(F[41]=a("span",{class:"eyebrow mb-1 block"},"Incidents / anomalies",-1)),ie(a("input",{"onUpdate:modelValue":F[17]||(F[17]=$=>R.incidents=$),class:"field",placeholder:"RTH trigger, GPS dropout…"},null,512),[[me,R.incidents]])]),a("label",Ny,[F[42]||(F[42]=a("span",{class:"eyebrow mb-1 block"},"Notes",-1)),ie(a("textarea",{"onUpdate:modelValue":F[18]||(F[18]=$=>R.notes=$),rows:"2",class:"field"},null,512),[[me,R.notes]])])])):I("",!0),a("div",Fy,[a("button",{class:"btn-accent",disabled:we.value,onClick:Ze},x(we.value?"Saving…":U.value?"Save changes":"Log flight"),9,Dy),a("button",{class:"btn-ghost",onClick:Le},"Cancel"),oe.value?(p(),m("span",Ry,x(oe.value),1)):I("",!0)])])):I("",!0),a("div",By,[f.value?(p(),m("div",Uy,"Loading…")):u.value.length?(p(),m("div",Zy,[a("table",Hy,[a("thead",null,[a("tr",jy,[(p(),m(ae,null,ze(["Date","Drone","Area / route","Alt","Pilot","Compliance",""],$=>a("th",{key:$,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"},x($),1)),64))])]),a("tbody",null,[(p(!0),m(ae,null,ze(u.value,$=>{var Ye,Se,ge,fe;return p(),m(ae,{key:$.id},[a("tr",{class:Pe(["border-b border-line last:border-0",U.value===$.id?"bg-accent-soft":""])},[a("td",Wy,[z(x(($.operationDate||"").slice(0,10))+" ",1),$.startTime?(p(),m("span",Ky,x($.startTime),1)):I("",!0)]),a("td",Gy,x($.droneName||"—"),1),a("td",{class:"max-w-[220px] truncate px-5 py-3 text-ink-secondary",title:$.areaRoute},x($.areaRoute||"—"),9,qy),a("td",Yy,x($.maxAltitudeAgl?$.maxAltitudeAgl+" m":"—"),1),a("td",Jy,x($.pilotName||"—"),1),a("td",Xy,[a("button",{class:Pe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",s[b($).tone]]),onClick:ft=>T($.id)},[b($).tone==="danger"?(p(),nt(Q,{key:0,name:"alertTriangle",size:12})):b($).tone==="success"?(p(),nt(Q,{key:1,name:"check",size:12})):I("",!0),z(" "+x(b($).label),1)],10,Qy)]),a("td",ex,[he.value===$.id?(p(),m(ae,{key:0},[F[45]||(F[45]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),a("button",{class:"btn-ghost mr-1",onClick:F[19]||(F[19]=ft=>he.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:ft=>ee($)},"Delete",8,tx)],64)):(p(),m(ae,{key:1},[a("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:ft=>Ce($)},[A(Q,{name:"sliders",size:13}),F[46]||(F[46]=z(" Edit",-1))],8,nx),a("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:ft=>he.value=$.id},[A(Q,{name:"trash",size:13})],8,ix)],64))])],2),C.value===$.id?(p(),m("tr",ox,[a("td",sx,[a("div",ax,[a("span",rx,[F[47]||(F[47]=z("Logging path: ",-1)),a("b",lx,x(((Ye=$.compliance)==null?void 0:Ye.loggingPath)||"—"),1)]),a("span",ux,[F[48]||(F[48]=z("Category: ",-1)),a("b",cx,x($.category||"—"),1)]),a("span",dx,[F[49]||(F[49]=z("Retain until: ",-1)),a("b",fx,x(($.retentionUntil||"").slice(0,10)||"—"),1)]),(Se=$.compliance)!=null&&Se.exempt?(p(),m("span",hx,[F[50]||(F[50]=z("Exempt: ",-1)),a("b",px,x($.compliance.exemptReason),1)])):I("",!0)]),(((ge=$.compliance)==null?void 0:ge.redFlags)||[]).length?(p(),m("ul",mx,[(p(!0),m(ae,null,ze($.compliance.redFlags,(ft,pe)=>(p(),m("li",{key:pe,class:"flex items-start gap-2 text-xs text-danger-fg"},[A(Q,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),z(" "+x(ft),1)]))),128))])):(fe=$.compliance)!=null&&fe.exempt?I("",!0):(p(),m("div",gx,"No compliance gaps detected."))])])):I("",!0)],64)}),128))])])])):(p(),m("div",Vy,[A(Q,{name:"book",size:26,class:"text-ink-muted"}),F[43]||(F[43]=a("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No flights logged yet",-1)),F[44]||(F[44]=a("div",{class:"mt-1 text-xs text-ink-muted"},"Log your first operation to start the 5-year retention record.",-1))]))])]))}},_x={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},bx={class:"flex flex-wrap items-center gap-3"},yx={class:"ml-auto flex items-center gap-2"},xx={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},wx={class:"eyebrow"},kx={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},Sx={key:1,class:"panel p-5"},Tx={class:"mb-4 flex items-center justify-between"},Px={class:"eyebrow"},Cx={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},Lx={class:"block"},Ax={class:"block"},Mx={class:"block"},Ex={class:"block"},Ox={class:"block"},zx={class:"block"},$x={class:"block"},Ix={class:"block"},Nx={class:"block"},Fx={class:"block"},Dx=["value"],Rx={class:"mt-3 flex flex-wrap gap-6"},Bx={class:"flex items-center gap-2 text-sm text-ink-secondary"},Ux={class:"flex items-center gap-2 text-sm text-ink-secondary"},Vx={class:"mt-4 flex items-center gap-3"},Zx=["disabled"],Hx={key:0,class:"text-sm text-danger-fg"},jx={class:"panel overflow-hidden p-0"},Wx={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Kx={key:1,class:"grid place-items-center px-5 py-16 text-center"},Gx={key:2,class:"overflow-x-auto"},qx={class:"w-full border-collapse text-sm"},Yx={class:"text-left"},Jx={class:"px-5 py-3"},Xx={class:"flex items-center gap-2"},Qx={class:"font-semibold text-ink"},e0={key:0,class:"text-xs text-ink-muted"},t0={key:1,class:"text-xs text-ink-muted"},n0={class:"px-5 py-3 font-mono text-xs text-ink-secondary"},i0={key:0,class:"text-[11px] text-ink-muted",title:"Flight controller SN — reported by the aircraft, not its registered serial"},o0={class:"px-5 py-3 font-mono text-xs text-ink-secondary"},s0={class:"px-5 py-3 font-mono text-xs text-ink-secondary"},a0={class:"px-5 py-3 font-mono text-xs text-ink-secondary"},r0={class:"px-5 py-3"},l0={key:1,class:"text-ink-muted"},u0={class:"whitespace-nowrap px-5 py-3 text-right"},c0=["onClick"],d0=["onClick"],f0=["onClick"],h0={__name:"Drones",props:{connectedFcSerials:{type:Array,default:()=>[]}},emits:["deleted"],setup(t,{expose:i,emit:s}){const l=t,u=s,f={success:"bg-success-soft text-success-fg",accent:"bg-accent-soft text-accent-soft-fg",neutral:"bg-surface-2 text-ink-secondary"},h=Y([]),_=Y(!1),b=Y("");async function C(){_.value=!0,b.value="";const ee=await pl();ee.ok||(b.value=ee.status===503?"Drone storage is not configured on the API Server (service account missing).":"Could not load your drones."),h.value=ee.drones,_.value=!1}ti(C),i({reload:C});const T=de(()=>new Set(l.connectedFcSerials.filter(Boolean)));function M(ee){return!!ee.flightControllerSerial&&T.value.has(ee.flightControllerSerial)}const H=["","C0","C1","C2","C3","C4","C5","C6"];function j(){return{name:"",model:"",serial:"",flightControllerSerial:"",firmware:"",controllerFirmware:"",registration:"",operatorNumber:"",mtomGrams:"",isToy:!1,autologsFlights:!1,cClass:""}}const G=Y(!1),N=Y(""),U=gt(j()),R=Y(""),oe=Y(!1);function we(){Object.assign(U,j()),N.value="",R.value="",G.value=!0}function ue(ee){Object.assign(U,{name:ee.name||"",model:ee.model||"",serial:ee.serial||"",flightControllerSerial:ee.flightControllerSerial||"",firmware:ee.firmware||"",controllerFirmware:ee.controllerFirmware||"",registration:ee.registration||"",operatorNumber:ee.operatorNumber||"",mtomGrams:ee.mtomGrams||"",isToy:!!ee.isToy,autologsFlights:!!ee.autologsFlights,cClass:ee.cClass||""}),N.value=ee.id,R.value="",G.value=!0}function ke(){G.value=!1,N.value=""}async function Ce(){var O;if(R.value="",!U.name.trim()&&!U.model.trim()&&!U.serial.trim()&&!U.flightControllerSerial.trim()){R.value="Give the drone a custom name, model or serial.";return}oe.value=!0;const ee={...U,mtomGrams:Number(U.mtomGrams)||0},V=N.value?await Cp(N.value,ee):await Tp(ee);if(oe.value=!1,!V.ok){R.value=((O=V.body)==null?void 0:O.error)||"Could not save the drone.";return}G.value=!1,await C()}const Le=Y("");async function Ze(ee){var O;const V=await Lp(ee.id);Le.value="",V.ok?(u("deleted",ee.flightControllerSerial),await C()):R.value=((O=V.body)==null?void 0:O.error)||"Could not delete the drone."}const he=de(()=>({fleet:h.value.length,connected:h.value.filter(M).length,unnamed:h.value.filter(ee=>!(ee.name||"").trim()).length,unregistered:h.value.filter(ee=>!(ee.registration||"").trim()).length}));return(ee,V)=>(p(),m("div",_x,[a("div",bx,[V[14]||(V[14]=a("div",null,[a("div",{class:"eyebrow"},"Fleet"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Drones you fly")],-1)),a("div",yx,[a("button",{class:"btn-accent inline-flex items-center gap-2",onClick:we},[A(Q,{name:"plus",size:15}),V[13]||(V[13]=z(" Add drone ",-1))])])]),a("div",xx,[(p(!0),m(ae,null,ze([{label:"Drones in fleet",value:he.value.fleet,tone:"neutral"},{label:"Connected now",value:he.value.connected,tone:he.value.connected?"success":"neutral"},{label:"Awaiting a name",value:he.value.unnamed,tone:"neutral"},{label:"No registration",value:he.value.unregistered,tone:"neutral"}],O=>(p(),m("div",{key:O.label,class:"panel p-5"},[a("div",wx,x(O.label),1),a("div",{class:Pe(["mt-2 text-[30px] font-bold leading-none tracking-tightest",O.tone==="success"?"text-success-fg":"text-ink"])},x(O.value),3)]))),128))]),b.value?(p(),m("div",kx,x(b.value),1)):I("",!0),G.value?(p(),m("div",Sx,[a("div",Tx,[a("div",null,[a("div",Px,x(N.value?"Edit drone":"New drone"),1),V[15]||(V[15]=a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft registry",-1))]),a("button",{class:"btn-icon",onClick:ke},[A(Q,{name:"x",size:16})])]),a("div",Cx,[a("label",Lx,[V[16]||(V[16]=a("span",{class:"eyebrow mb-1 block"},"Custom name",-1)),ie(a("input",{"onUpdate:modelValue":V[0]||(V[0]=O=>U.name=O),class:"field",placeholder:"Mavic-01"},null,512),[[me,U.name]])]),a("label",Ax,[V[17]||(V[17]=a("span",{class:"eyebrow mb-1 block"},"Model",-1)),ie(a("input",{"onUpdate:modelValue":V[1]||(V[1]=O=>U.model=O),class:"field",placeholder:"DJI Mavic 3 Enterprise"},null,512),[[me,U.model]])]),a("label",Mx,[V[18]||(V[18]=a("span",{class:"eyebrow mb-1 block"},"Serial number",-1)),ie(a("input",{"onUpdate:modelValue":V[2]||(V[2]=O=>U.serial=O),class:"field",placeholder:"08QDE3H012032E"},null,512),[[me,U.serial]]),V[19]||(V[19]=a("span",{class:"mt-1 block text-xs text-ink-muted"},"From the sticker on the airframe.",-1))]),a("label",Ex,[V[20]||(V[20]=a("span",{class:"eyebrow mb-1 block"},"Flight controller SN",-1)),ie(a("input",{"onUpdate:modelValue":V[3]||(V[3]=O=>U.flightControllerSerial=O),class:"field",placeholder:"08RDE1J00103H1"},null,512),[[me,U.flightControllerSerial]]),V[21]||(V[21]=a("span",{class:"mt-1 block text-xs text-ink-muted"},"Auto-filled on connect.",-1))]),a("label",Ox,[V[22]||(V[22]=a("span",{class:"eyebrow mb-1 block"},"Drone firmware",-1)),ie(a("input",{"onUpdate:modelValue":V[4]||(V[4]=O=>U.firmware=O),class:"field",placeholder:"03.02.35.05"},null,512),[[me,U.firmware]])]),a("label",zx,[V[23]||(V[23]=a("span",{class:"eyebrow mb-1 block"},"Controller firmware",-1)),ie(a("input",{"onUpdate:modelValue":V[5]||(V[5]=O=>U.controllerFirmware=O),class:"field",placeholder:"01.03.0800"},null,512),[[me,U.controllerFirmware]])]),a("label",$x,[V[24]||(V[24]=a("span",{class:"eyebrow mb-1 block"},"Registration (FAA/CAA)",-1)),ie(a("input",{"onUpdate:modelValue":V[6]||(V[6]=O=>U.registration=O),class:"field",placeholder:"FA3X7K9PLM"},null,512),[[me,U.registration]])]),a("label",Ix,[V[25]||(V[25]=a("span",{class:"eyebrow mb-1 block"},"Operator no. (EU)",-1)),ie(a("input",{"onUpdate:modelValue":V[7]||(V[7]=O=>U.operatorNumber=O),class:"field",placeholder:"DNK…"},null,512),[[me,U.operatorNumber]])]),a("label",Nx,[V[26]||(V[26]=a("span",{class:"eyebrow mb-1 block"},"MTOM (grams)",-1)),ie(a("input",{"onUpdate:modelValue":V[8]||(V[8]=O=>U.mtomGrams=O),type:"number",min:"0",class:"field",placeholder:"920"},null,512),[[me,U.mtomGrams]])]),a("label",Fx,[V[27]||(V[27]=a("span",{class:"eyebrow mb-1 block"},"C-class",-1)),ie(a("select",{"onUpdate:modelValue":V[9]||(V[9]=O=>U.cClass=O),class:"field"},[(p(),m(ae,null,ze(H,O=>a("option",{key:O,value:O},x(O||"— none —"),9,Dx)),64))],512),[[Ot,U.cClass]])])]),V[30]||(V[30]=a("p",{class:"mt-3 text-xs text-ink-muted"}," Model, flight controller SN and both firmware versions fill themselves in when the drone connects — anything you type here is kept as-is. The serial number is the one you register the drone under, and only you can supply it: the SDK cannot read it off the aircraft. ",-1)),a("div",Rx,[a("label",Bx,[ie(a("input",{"onUpdate:modelValue":V[10]||(V[10]=O=>U.autologsFlights=O),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[Va,U.autologsFlights]]),V[28]||(V[28]=z(" Auto-logs flights (onboard FDR) ",-1))]),a("label",Ux,[ie(a("input",{"onUpdate:modelValue":V[11]||(V[11]=O=>U.isToy=O),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[Va,U.isToy]]),V[29]||(V[29]=z(" Toy drone (logbook-exempt) ",-1))])]),a("div",Vx,[a("button",{class:"btn-accent",disabled:oe.value,onClick:Ce},x(oe.value?"Saving…":N.value?"Save changes":"Add drone"),9,Zx),a("button",{class:"btn-ghost",onClick:ke},"Cancel"),R.value?(p(),m("span",Hx,x(R.value),1)):I("",!0)])])):I("",!0),a("div",jx,[_.value?(p(),m("div",Wx,"Loading…")):h.value.length?(p(),m("div",Gx,[a("table",qx,[a("thead",null,[a("tr",Yx,[(p(),m(ae,null,ze(["Drone","Serial","Firmware","Ctrl FW","Registration","Class",""],O=>a("th",{key:O,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"},x(O),1)),64))])]),a("tbody",null,[(p(!0),m(ae,null,ze(h.value,O=>(p(),m("tr",{key:O.id,class:Pe(["border-b border-line last:border-0",N.value===O.id?"bg-accent-soft":""])},[a("td",Jx,[a("div",Xx,[a("span",Qx,x(O.displayName),1),M(O)?(p(),m("span",{key:0,class:Pe(["inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] font-semibold",f.success])},[A(Q,{name:"signal",size:11}),V[33]||(V[33]=z(" connected ",-1))],2)):I("",!0)]),O.name&&O.model?(p(),m("div",e0,x(O.model),1)):O.name?I("",!0):(p(),m("div",t0,"no custom name yet"))]),a("td",n0,[z(x(O.serial||"—")+" ",1),O.flightControllerSerial?(p(),m("div",i0," FC "+x(O.flightControllerSerial),1)):I("",!0)]),a("td",o0,x(O.firmware||"—"),1),a("td",s0,x(O.controllerFirmware||"—"),1),a("td",a0,x(O.registration||"—"),1),a("td",r0,[O.cClass?(p(),m("span",{key:0,class:Pe(["inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",f.accent])},x(O.cClass),3)):(p(),m("span",l0,"—")),O.isToy?(p(),m("span",{key:2,class:Pe(["ml-1 inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",f.neutral])},"toy",2)):I("",!0)]),a("td",u0,[Le.value===O.id?(p(),m(ae,{key:0},[V[34]||(V[34]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),a("button",{class:"btn-ghost mr-1",onClick:V[12]||(V[12]=F=>Le.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:F=>Ze(O)},"Delete",8,c0)],64)):(p(),m(ae,{key:1},[a("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:F=>ue(O)},[A(Q,{name:"sliders",size:13}),V[35]||(V[35]=z(" Edit",-1))],8,d0),a("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:F=>Le.value=O.id},[A(Q,{name:"trash",size:13})],8,f0)],64))])],2))),128))])])])):(p(),m("div",Kx,[A(Q,{name:"drone",size:26,class:"text-ink-muted"}),V[31]||(V[31]=a("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No drones yet",-1)),V[32]||(V[32]=a("div",{class:"mt-1 text-xs text-ink-muted"}," Connect a drone in the Fly App and it lands here by itself — or add one by hand. ",-1))]))])]))}},p0={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},m0={class:"flex flex-wrap items-center gap-3"},g0={class:"inline-flex flex-wrap rounded-lg border border-line bg-surface-1 p-0.5"},v0=["onClick"],_0={class:"ml-auto"},b0={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},y0={class:"eyebrow"},x0={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},w0={key:1,class:"panel p-5"},k0={class:"mb-4 flex items-center justify-between"},S0={class:"eyebrow"},T0={class:"mt-0.5 text-base font-semibold text-ink"},P0={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},C0={class:"col-span-2 block max-[760px]:col-span-1"},L0={class:"block"},A0=["value"],M0={class:"block"},E0=["value"],O0={class:"block"},z0=["value"],$0={class:"block"},I0={class:"block"},N0={class:"block"},F0={class:"block"},D0=["value"],R0={class:"block"},B0={class:"block"},U0={class:"block"},V0=["value"],Z0={class:"mt-3 block"},H0={key:0,class:"mt-3"},j0={class:"eyebrow mb-1 block"},W0={key:1,class:"mt-3 text-xs text-ink-muted"},K0={class:"mt-4 flex items-center gap-3"},G0=["disabled"],q0={key:0,class:"text-sm text-danger-fg"},Y0={class:"panel overflow-hidden p-0"},J0={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},X0={key:1,class:"grid place-items-center px-5 py-16 text-center"},Q0={class:"mt-3 text-sm font-medium text-ink-secondary"},ew={class:"mt-1 text-xs text-ink-muted"},tw={key:2,class:"overflow-x-auto"},nw={class:"w-full border-collapse text-sm"},iw={class:"text-left"},ow={class:"px-5 py-3"},sw={class:"font-semibold text-ink"},aw={key:0,class:"font-mono text-[11px] text-ink-muted"},rw={class:"px-5 py-3 text-ink-secondary"},lw={class:"px-5 py-3 text-ink-secondary"},uw={class:"px-5 py-3"},cw=["onClick"],dw={key:0,class:"mt-0.5 font-mono text-[10.5px] text-ink-muted"},fw={class:"px-5 py-3 font-mono text-ink-secondary"},hw={class:"whitespace-nowrap px-5 py-3 text-right"},pw=["onClick"],mw=["onClick"],gw=["href"],vw=["onClick"],_w=["onClick"],bw=["onClick"],yw={key:0,class:"border-b border-line bg-surface-2"},xw={colspan:"6",class:"px-5 py-3"},ww={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},kw={class:"text-ink-secondary"},Sw={class:"text-ink"},Tw={class:"text-ink-secondary"},Pw={class:"text-ink"},Cw={key:0,class:"text-ink-secondary"},Lw={class:"text-ink"},Aw={key:1,class:"text-ink-secondary"},Mw={class:"font-mono text-ink"},Ew={key:2,class:"text-ink-secondary"},Ow={class:"font-mono text-ink"},zw={class:"text-ink-secondary"},$w={class:"text-ink"},Iw={key:0,class:"mt-2 space-y-1"},Nw={key:1,class:"mt-2 text-xs text-success-fg"},Fw={key:2,class:"mt-2 text-xs text-ink-secondary"},Dw={class:"flex max-h-[90vh] w-full max-w-[920px] flex-col overflow-hidden rounded-lg border border-line bg-surface-1 shadow-2xl"},Rw={class:"flex items-center gap-3 border-b border-line px-5 py-3"},Bw={class:"min-w-0"},Uw={class:"truncate text-sm font-semibold text-ink"},Vw={class:"truncate font-mono text-[11px] text-ink-muted"},Zw={class:"ml-auto flex items-center gap-2"},Hw=["href"],jw=["href"],Ww={class:"flex-1 overflow-auto bg-surface-2"},Kw=["src","alt"],Gw=["src","title"],qw={key:2,class:"grid place-items-center px-6 py-16 text-center"},Yw={class:"mt-1 text-xs text-ink-muted"},Jw=["href"],Xw={__name:"Documents",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},setup(t){const i={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"},s=[{value:"certificate",label:"Pilot certificate"},{value:"medical",label:"Medical / training"},{value:"insurance",label:"Insurance / liability"},{value:"background_check",label:"Background check / waiver"},{value:"registration",label:"Aircraft registration"},{value:"maintenance",label:"Maintenance log"},{value:"conformity",label:"Conformity / compliance"},{value:"firmware",label:"Firmware / software"},{value:"incident",label:"Incident / repair report"},{value:"flight_log",label:"Flight log"},{value:"checklist",label:"Pre-flight checklist"},{value:"airspace_auth",label:"Airspace authorisation"},{value:"mission_plan",label:"Mission plan / flight path"},{value:"risk_assessment",label:"Risk assessment / survey"},{value:"contract",label:"Contract / SOW"},{value:"client_insurance",label:"Client insurance cert"},{value:"delivery_report",label:"Delivery / media handoff"},{value:"other",label:"Other"}],l=Object.fromEntries(s.map(w=>[w.value,w.label])),u=[{value:"pilot",label:"Pilot"},{value:"aircraft",label:"Aircraft"},{value:"organization",label:"Organization"},{value:"client",label:"Client"},{value:"other",label:"Other"}],f=[{value:"active",label:"Active"},{value:"pending_review",label:"Pending review"},{value:"archived",label:"Archived"}],h=[{value:"pilot",label:"Pilot"},{value:"ops",label:"Ops manager"},{value:"admin",label:"Admin"},{value:"client",label:"Client-facing"}],_=Y([]),b=Y([]),C=Y(!1),T=Y("");async function M(){C.value=!0,T.value="";const[w,y]=await Promise.all([Ip(),pl()]);w.ok||(T.value=w.status===503?"Document storage is not configured on the API Server (service account missing).":"Could not load documents."),_.value=w.documents,b.value=y.drones||[],C.value=!1}ti(M);const H=Y("all"),j=[["all","All"],["expiring","Expiring soon"],["expired","Expired"],["pending","Pending review"],["archived","Archived"]],G=de(()=>{const w=_.value;switch(H.value){case"expiring":return w.filter(y=>{var S;return((S=y.expiry)==null?void 0:S.state)==="expiring_soon"&&y.status!=="archived"});case"expired":return w.filter(y=>{var S;return((S=y.expiry)==null?void 0:S.state)==="expired"&&y.status!=="archived"});case"pending":return w.filter(y=>y.status==="pending_review");case"archived":return w.filter(y=>y.status==="archived");default:return w.filter(y=>y.status!=="archived")}});function N(w){if(w.status==="archived")return{tone:"neutral",label:"Superseded",icon:""};const y=w.expiry||{};return y.state==="expired"?{tone:"danger",label:"Expired",icon:"alertTriangle"}:y.state==="expiring_soon"?{tone:"warning",label:`Expires in ${y.daysUntilExpiry}d`,icon:"clock"}:y.state==="valid"?{tone:"success",label:"Valid",icon:"check"}:{tone:"neutral",label:"No expiry",icon:""}}const U=Y("");function R(w){U.value=U.value===w?"":w}function oe(w){return w.ownerDrone?w.ownerDroneName||"Aircraft":w.ownerRef?w.ownerRef:w.ownerType==="pilot"?"Pilot":w.ownerType?w.ownerType.charAt(0).toUpperCase()+w.ownerType.slice(1):"—"}const we=["png","jpg","jpeg","gif","webp","svg","bmp","avif"],ue=["pdf","txt","csv","log","json","md","html","htm","xml"];function ke(w){const y=(w||"").split(".").pop().toLowerCase();return we.includes(y)?"image":ue.includes(y)?"frame":"none"}const Ce=Y(null),Le=de(()=>Ce.value?ke(Ce.value.fileName):"none"),Ze=de(()=>Ce.value?Rp(Ce.value.id):"");function he(w){Ce.value=w}function ee(){Ce.value=null}function V(w){w.key==="Escape"&&Ce.value&&ee()}ti(()=>window.addEventListener("keydown",V)),us(()=>window.removeEventListener("keydown",V));function O(){return{title:"",docType:"certificate",ownerType:"pilot",ownerDrone:"",ownerRef:"",reference:"",jurisdiction:"",issueDate:"",expiryDate:"",status:"active",accessTier:"ops",notes:""}}const F=Y(!1),$=Y(""),Ye=Y(""),Se=Y(""),ge=gt(O()),fe=Y(null),ft=Y(null),pe=Y(""),Ue=Y(!1);function Ve(){fe.value=null,ft.value&&(ft.value.value="")}function wt(){Object.assign(ge,O()),$.value="",Ye.value="",Se.value="",Ve(),pe.value="",F.value=!0}function st(w){Object.assign(ge,{title:w.title||"",docType:w.docType||"certificate",ownerType:w.ownerType||"pilot",ownerDrone:w.ownerDrone||"",ownerRef:w.ownerRef||"",reference:w.reference||"",jurisdiction:w.jurisdiction||"",issueDate:w.issueDate||"",expiryDate:w.expiryDate||"",status:w.status||"active",accessTier:w.accessTier||"ops",notes:w.notes||""}),$.value=w.id,Ye.value="",Se.value="",Ve(),pe.value="",F.value=!0}function Me(w){st(w),$.value="",Ye.value=w.id,Se.value=w.title,ge.status="active"}function De(){F.value=!1,$.value="",Ye.value=""}function zt(w){var y;fe.value=((y=w.target.files)==null?void 0:y[0])||null}async function At(){var y;if(pe.value="",!ge.title.trim()){pe.value="Give the document a title.";return}Ue.value=!0;let w;if($.value)w=await Fp($.value,{...ge});else{const S={...ge};Ye.value&&(S.replaces=Ye.value),w=await Np(S,fe.value)}if(Ue.value=!1,!w.ok){pe.value=((y=w.body)==null?void 0:y.error)||"Could not save the document.";return}F.value=!1,$.value="",Ye.value="",await M()}const Ut=Y("");async function Pt(w){var S;const y=await Dp(w.id);Ut.value="",y.ok?await M():pe.value=((S=y.body)==null?void 0:S.error)||"Could not delete the document."}const kt=de(()=>{const w=_.value.filter(y=>y.status!=="archived");return{total:w.length,expiring:w.filter(y=>{var S;return((S=y.expiry)==null?void 0:S.state)==="expiring_soon"}).length,expired:w.filter(y=>{var S;return((S=y.expiry)==null?void 0:S.state)==="expired"}).length,pending:_.value.filter(y=>y.status==="pending_review").length}});return(w,y)=>(p(),m("div",p0,[a("div",m0,[a("div",g0,[(p(),m(ae,null,ze(j,S=>a("button",{key:S[0],class:Pe(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",H.value===S[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:q=>H.value=S[0]},x(S[1]),11,v0)),64))]),a("div",_0,[a("button",{class:"btn-accent inline-flex items-center gap-2",onClick:wt},[A(Q,{name:"upload",size:15}),y[13]||(y[13]=z(" Add document ",-1))])])]),a("div",b0,[(p(!0),m(ae,null,ze([{label:"Documents on file",value:kt.value.total,tone:"neutral"},{label:"Expiring soon",value:kt.value.expiring,tone:kt.value.expiring?"warning":"neutral"},{label:"Expired",value:kt.value.expired,tone:kt.value.expired?"danger":"success"},{label:"Pending review",value:kt.value.pending,tone:kt.value.pending?"accent":"neutral"}],S=>(p(),m("div",{key:S.label,class:"panel p-5"},[a("div",y0,x(S.label),1),a("div",{class:Pe(["mt-2 text-[30px] font-bold leading-none tracking-tightest",S.tone==="danger"?"text-danger-fg":S.tone==="warning"?"text-amber-fg":S.tone==="success"?"text-success-fg":S.tone==="accent"?"text-accent-soft-fg":"text-ink"])},x(S.value),3)]))),128))]),T.value?(p(),m("div",x0,x(T.value),1)):I("",!0),F.value?(p(),m("div",w0,[a("div",k0,[a("div",null,[a("div",S0,x($.value?"Edit document":Ye.value?"New version":"New document"),1),a("div",T0,x(Ye.value?`Supersedes “${Se.value}”`:"Compliance & operational document"),1)]),a("button",{class:"btn-icon",onClick:De},[A(Q,{name:"x",size:16})])]),a("div",P0,[a("label",C0,[y[14]||(y[14]=a("span",{class:"eyebrow mb-1 block"},"Title",-1)),ie(a("input",{"onUpdate:modelValue":y[0]||(y[0]=S=>ge.title=S),class:"field",placeholder:"A2 Remote Pilot Certificate — J. Dariusz"},null,512),[[me,ge.title]])]),a("label",L0,[y[15]||(y[15]=a("span",{class:"eyebrow mb-1 block"},"Type",-1)),ie(a("select",{"onUpdate:modelValue":y[1]||(y[1]=S=>ge.docType=S),class:"field"},[(p(),m(ae,null,ze(s,S=>a("option",{key:S.value,value:S.value},x(S.label),9,A0)),64))],512),[[Ot,ge.docType]])]),a("label",M0,[y[16]||(y[16]=a("span",{class:"eyebrow mb-1 block"},"Owner type",-1)),ie(a("select",{"onUpdate:modelValue":y[2]||(y[2]=S=>ge.ownerType=S),class:"field"},[(p(),m(ae,null,ze(u,S=>a("option",{key:S.value,value:S.value},x(S.label),9,E0)),64))],512),[[Ot,ge.ownerType]])]),a("label",O0,[y[18]||(y[18]=a("span",{class:"eyebrow mb-1 block"},"Aircraft (if any)",-1)),ie(a("select",{"onUpdate:modelValue":y[3]||(y[3]=S=>ge.ownerDrone=S),class:"field"},[y[17]||(y[17]=a("option",{value:""},"— none —",-1)),(p(!0),m(ae,null,ze(b.value,S=>(p(),m("option",{key:S.id,value:S.id},x(S.name)+x(S.model?` · ${S.model}`:""),9,z0))),128))],512),[[Ot,ge.ownerDrone]])]),a("label",$0,[y[19]||(y[19]=a("span",{class:"eyebrow mb-1 block"},"Owner reference",-1)),ie(a("input",{"onUpdate:modelValue":y[4]||(y[4]=S=>ge.ownerRef=S),class:"field",placeholder:"Client name / serial / site"},null,512),[[me,ge.ownerRef]])]),a("label",I0,[y[20]||(y[20]=a("span",{class:"eyebrow mb-1 block"},"Reference / number",-1)),ie(a("input",{"onUpdate:modelValue":y[5]||(y[5]=S=>ge.reference=S),class:"field",placeholder:"Cert / registration / policy no."},null,512),[[me,ge.reference]])]),a("label",N0,[y[21]||(y[21]=a("span",{class:"eyebrow mb-1 block"},"Jurisdiction",-1)),ie(a("input",{"onUpdate:modelValue":y[6]||(y[6]=S=>ge.jurisdiction=S),class:"field",placeholder:"DK / EASA / FAA"},null,512),[[me,ge.jurisdiction]])]),a("label",F0,[y[22]||(y[22]=a("span",{class:"eyebrow mb-1 block"},"Access tier",-1)),ie(a("select",{"onUpdate:modelValue":y[7]||(y[7]=S=>ge.accessTier=S),class:"field"},[(p(),m(ae,null,ze(h,S=>a("option",{key:S.value,value:S.value},x(S.label),9,D0)),64))],512),[[Ot,ge.accessTier]])]),a("label",R0,[y[23]||(y[23]=a("span",{class:"eyebrow mb-1 block"},"Issue date",-1)),ie(a("input",{"onUpdate:modelValue":y[8]||(y[8]=S=>ge.issueDate=S),type:"date",class:"field"},null,512),[[me,ge.issueDate]])]),a("label",B0,[y[24]||(y[24]=a("span",{class:"eyebrow mb-1 block"},"Expiry date",-1)),ie(a("input",{"onUpdate:modelValue":y[9]||(y[9]=S=>ge.expiryDate=S),type:"date",class:"field"},null,512),[[me,ge.expiryDate]])]),a("label",U0,[y[25]||(y[25]=a("span",{class:"eyebrow mb-1 block"},"Status",-1)),ie(a("select",{"onUpdate:modelValue":y[10]||(y[10]=S=>ge.status=S),class:"field"},[(p(),m(ae,null,ze(f,S=>a("option",{key:S.value,value:S.value},x(S.label),9,V0)),64))],512),[[Ot,ge.status]])])]),a("label",Z0,[y[26]||(y[26]=a("span",{class:"eyebrow mb-1 block"},"Notes",-1)),ie(a("textarea",{"onUpdate:modelValue":y[11]||(y[11]=S=>ge.notes=S),rows:"2",class:"field",placeholder:"Conditions, renewal contacts, anything worth recording"},null,512),[[me,ge.notes]])]),$.value?(p(),m("div",W0,[...y[28]||(y[28]=[z(" Editing updates metadata only. To replace the file, close this and use ",-1),a("b",{class:"text-ink-secondary"},"New version",-1),z(" on the document — the old version is kept for audit. ",-1)])])):(p(),m("div",H0,[a("span",j0,"File "+x(Ye.value?"(new version)":"(optional)"),1),a("input",{ref_key:"fileInput",ref:ft,type:"file",class:"field",onChange:zt},null,544),y[27]||(y[27]=a("p",{class:"mt-1 text-xs text-ink-muted"}," Stored in PocketBase for now (object storage later). Max 50 MB. ",-1))])),a("div",K0,[a("button",{class:"btn-accent",disabled:Ue.value,onClick:At},x(Ue.value?"Saving…":$.value?"Save changes":Ye.value?"Upload new version":"Add document"),9,G0),a("button",{class:"btn-ghost",onClick:De},"Cancel"),pe.value?(p(),m("span",q0,x(pe.value),1)):I("",!0)])])):I("",!0),a("div",Y0,[C.value?(p(),m("div",J0,"Loading…")):G.value.length?(p(),m("div",tw,[a("table",nw,[a("thead",null,[a("tr",iw,[(p(),m(ae,null,ze(["Title","Type","Owner","Expiry","Ver",""],S=>a("th",{key:S,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"},x(S),1)),64))])]),a("tbody",null,[(p(!0),m(ae,null,ze(G.value,S=>{var q,W;return p(),m(ae,{key:S.id},[a("tr",{class:Pe(["border-b border-line last:border-0",$.value===S.id?"bg-accent-soft":""])},[a("td",ow,[a("div",sw,x(S.title),1),S.reference?(p(),m("div",aw,x(S.reference),1)):I("",!0)]),a("td",rw,x($e(l)[S.docType]||S.docType||"—"),1),a("td",lw,x(oe(S)),1),a("td",uw,[a("button",{class:Pe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",i[N(S).tone]]),onClick:J=>R(S.id)},[N(S).icon?(p(),nt(Q,{key:0,name:N(S).icon,size:12},null,8,["name"])):I("",!0),z(" "+x(N(S).label),1)],10,cw),S.expiryDate?(p(),m("div",dw,x(S.expiryDate),1)):I("",!0)]),a("td",fw,"v"+x(S.version||1),1),a("td",hw,[Ut.value===S.id?(p(),m(ae,{key:0},[y[29]||(y[29]=a("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),a("button",{class:"btn-ghost mr-1",onClick:y[12]||(y[12]=J=>Ut.value="")},"Cancel"),a("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:J=>Pt(S)},"Delete",8,pw)],64)):(p(),m(ae,{key:1},[S.hasFile?(p(),m("button",{key:0,class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Preview",onClick:J=>he(S)},[A(Q,{name:"eye",size:13})],8,mw)):I("",!0),S.hasFile?(p(),m("a",{key:1,href:$e(zr)(S.id),class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Download file"},[A(Q,{name:"download",size:13})],8,gw)):I("",!0),a("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Upload new version",onClick:J=>Me(S)},[A(Q,{name:"upload",size:13})],8,vw),a("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:J=>st(S)},[A(Q,{name:"sliders",size:13}),y[30]||(y[30]=z(" Edit",-1))],8,_w),a("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:J=>Ut.value=S.id},[A(Q,{name:"trash",size:13})],8,bw)],64))])],2),U.value===S.id?(p(),m("tr",yw,[a("td",xw,[a("div",ww,[a("span",kw,[y[31]||(y[31]=z("Status: ",-1)),a("b",Sw,x(S.status||"—"),1)]),a("span",Tw,[y[32]||(y[32]=z("Access: ",-1)),a("b",Pw,x(S.accessTier||"—"),1)]),S.jurisdiction?(p(),m("span",Cw,[y[33]||(y[33]=z("Jurisdiction: ",-1)),a("b",Lw,x(S.jurisdiction),1)])):I("",!0),S.issueDate?(p(),m("span",Aw,[y[34]||(y[34]=z("Issued: ",-1)),a("b",Mw,x(S.issueDate),1)])):I("",!0),S.expiryDate?(p(),m("span",Ew,[y[35]||(y[35]=z("Expires: ",-1)),a("b",Ow,x(S.expiryDate),1)])):I("",!0),a("span",zw,[y[36]||(y[36]=z("File: ",-1)),a("b",$w,x(S.hasFile?S.fileName:"none"),1)])]),(((q=S.expiry)==null?void 0:q.flags)||[]).length?(p(),m("ul",Iw,[(p(!0),m(ae,null,ze(S.expiry.flags,(J,ce)=>(p(),m("li",{key:ce,class:Pe(["flex items-start gap-2 text-xs",S.expiry.state==="expired"?"text-danger-fg":S.expiry.state==="expiring_soon"?"text-amber-fg":"text-ink-secondary"])},[A(Q,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),z(" "+x(J),1)],2))),128))])):((W=S.expiry)==null?void 0:W.state)==="valid"?(p(),m("div",Nw,"In force — no action needed.")):I("",!0),S.notes?(p(),m("div",Fw,[y[37]||(y[37]=a("span",{class:"text-ink-muted"},"Notes:",-1)),z(" "+x(S.notes),1)])):I("",!0)])])):I("",!0)],64)}),128))])])])):(p(),m("div",X0,[A(Q,{name:"fileText",size:26,class:"text-ink-muted"}),a("div",Q0,x(H.value==="all"?"No documents on file yet":"Nothing in this view"),1),a("div",ew,x(H.value==="all"?"Add certificates, registrations, insurance and authorisations to track their expiry.":"Try a different filter."),1)]))]),(p(),nt(cf,{to:"body"},[Ce.value?(p(),m("div",{key:0,class:"fixed inset-0 z-50 grid place-items-center p-4",style:{background:"color-mix(in srgb, black 60%, transparent)"},onClick:hl(ee,["self"])},[a("div",Dw,[a("div",Rw,[a("div",Bw,[a("div",Uw,x(Ce.value.title),1),a("div",Vw,x(Ce.value.fileName),1)]),a("div",Zw,[a("a",{href:Ze.value,target:"_blank",rel:"noopener",class:"btn-ghost inline-flex items-center gap-1.5",title:"Open in new tab"},[A(Q,{name:"globe",size:14}),y[38]||(y[38]=z(" New tab ",-1))],8,Hw),a("a",{href:$e(zr)(Ce.value.id),class:"btn-ghost inline-flex items-center gap-1.5",title:"Download"},[A(Q,{name:"download",size:14}),y[39]||(y[39]=z(" Download ",-1))],8,jw),a("button",{class:"btn-icon",title:"Close",onClick:ee},[A(Q,{name:"x",size:16})])])]),a("div",Ww,[Le.value==="image"?(p(),m("img",{key:0,src:Ze.value,alt:Ce.value.title,class:"mx-auto block max-w-full"},null,8,Kw)):Le.value==="frame"?(p(),m("iframe",{key:1,src:Ze.value,class:"h-[74vh] w-full border-0 bg-white",title:Ce.value.title},null,8,Gw)):(p(),m("div",qw,[A(Q,{name:"fileText",size:28,class:"text-ink-muted"}),y[41]||(y[41]=a("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"Preview isn't available for this file type",-1)),a("div",Yw,x(Ce.value.fileName),1),a("a",{href:$e(zr)(Ce.value.id),class:"btn-accent mt-4 inline-flex items-center gap-2"},[A(Q,{name:"download",size:15}),y[40]||(y[40]=z(" Download instead ",-1))],8,Jw)]))])])])):I("",!0)]))]))}},Qw={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},e2={class:"flex flex-wrap items-center gap-3"},t2={class:"ml-auto flex items-center gap-2"},n2=["disabled"],i2={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},o2={class:"eyebrow"},s2={class:"mt-2 text-[30px] font-bold leading-none tracking-tightest text-ink"},a2={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},r2={class:"panel overflow-hidden p-0"},l2={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},u2={key:1,class:"grid place-items-center px-5 py-16 text-center"},c2={key:2,class:"overflow-x-auto"},d2={class:"w-full border-collapse text-sm"},f2={class:"text-left"},h2=["onClick"],p2={class:"px-5 py-3"},m2={class:"flex items-center gap-2"},g2={class:"font-semibold text-ink"},v2={key:0,class:"inline-flex rounded-full bg-surface-2 px-2 py-0.5 text-[11px] font-semibold text-ink-secondary"},_2={class:"px-5 py-3 font-mono text-xs text-ink-secondary"},b2={class:"px-5 py-3 font-mono text-xs text-ink-secondary"},y2={class:"px-5 py-3 font-mono text-xs text-ink-secondary"},x2={class:"px-5 py-3 font-mono text-xs text-ink-secondary"},w2={class:"px-5 py-3 text-xs text-ink-secondary"},k2={class:"whitespace-nowrap px-5 py-3 text-xs text-ink-muted"},S2={key:0,class:"border-b border-line bg-surface-2"},T2={colspan:"7",class:"px-5 py-3"},P2={class:"w-full text-xs"},C2={class:"text-left text-ink-muted"},L2={class:"font-mono text-ink-secondary"},A2={class:"py-1 pr-4"},M2={class:"py-1 pr-4"},E2={class:"py-1 pr-4"},O2={class:"py-1 pr-4"},z2={class:"py-1 pr-4"},$2={class:"py-1 pr-4"},I2={class:"py-1 pr-4"},N2={__name:"Routes",setup(t){const i=Y([]),s=Y(!1),l=Y(""),u=Y("");async function f(){s.value=!0,l.value="";const N=await $p();N.ok||(l.value=N.status===503?"Route storage is not configured on the API Server (service account missing).":"Could not load your routes."),i.value=N.routes,s.value=!1}ti(f);function h(N,U){const oe=Ce=>Ce*Math.PI/180,we=oe(U.lat-N.lat),ue=oe(U.lon-N.lon),ke=Math.sin(we/2)**2+Math.cos(oe(N.lat))*Math.cos(oe(U.lat))*Math.sin(ue/2)**2;return 2*6371e3*Math.asin(Math.sqrt(ke))}function _(N){var U;return Array.isArray((U=N.spec)==null?void 0:U.points)?N.spec.points:[]}function b(N){const U=_(N);let R=0;for(let oe=1;oe=1e3?`${(N/1e3).toFixed(2)} km`:`${Math.round(N)} m`}function T(N){var oe;const U=Number((oe=N.spec)==null?void 0:oe.cruiseSpeed)||0;if(!U)return"—";const R=Math.round(b(N)/U);return R>=60?`${Math.floor(R/60)} min ${R%60} s`:`${R} s`}function M(N){const U=new Date(N);return Number.isNaN(U.getTime())?"—":U.toLocaleString()}const H={goHome:"Return to home",hover:"Hover",land:"Land",firstWaypoint:"Back to first WP"},j={none:"—",photo:"Photo",startRecord:"Start recording",stopRecord:"Stop recording"},G=de(()=>{const N=i.value;return{count:N.length,mine:N.filter(U=>U.mine).length,waypoints:N.reduce((U,R)=>U+_(R).length,0),distance:N.reduce((U,R)=>U+b(R),0)}});return(N,U)=>(p(),m("div",Qw,[a("div",e2,[U[1]||(U[1]=a("div",null,[a("div",{class:"eyebrow"},"Mission library"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Waypoint routes")],-1)),a("div",t2,[a("button",{class:"btn-ghost inline-flex items-center gap-2",disabled:s.value,onClick:f},[A(Q,{name:"download",size:14}),U[0]||(U[0]=z(" Refresh ",-1))],8,n2)])]),a("div",i2,[(p(!0),m(ae,null,ze([{label:"Routes",value:G.value.count},{label:"Yours",value:G.value.mine},{label:"Waypoints",value:G.value.waypoints},{label:"Total distance",value:C(G.value.distance)}],R=>(p(),m("div",{key:R.label,class:"panel p-5"},[a("div",o2,x(R.label),1),a("div",s2,x(R.value),1)]))),128))]),l.value?(p(),m("div",a2,x(l.value),1)):I("",!0),a("div",r2,[s.value&&!i.value.length?(p(),m("div",l2,"Loading…")):i.value.length?(p(),m("div",c2,[a("table",d2,[a("thead",null,[a("tr",f2,[(p(),m(ae,null,ze(["Route","Waypoints","Length","Est. time","Speed","On finish","Updated"],R=>a("th",{key:R,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"},x(R),1)),64))])]),a("tbody",null,[(p(!0),m(ae,null,ze(i.value,R=>{var oe,we,ue;return p(),m(ae,{key:R.id},[a("tr",{class:Pe(["cursor-pointer border-b border-line last:border-0 hover:bg-surface-2",u.value===R.id?"bg-accent-soft":""]),onClick:ke=>u.value=u.value===R.id?"":R.id},[a("td",p2,[a("div",m2,[A(Q,{name:"chevronRight",size:13,class:Pe(["text-ink-muted transition",u.value===R.id?"rotate-90":""])},null,8,["class"]),a("span",g2,x(R.name||"Route"),1),R.mine?I("",!0):(p(),m("span",v2," another pilot "))])]),a("td",_2,x(_(R).length),1),a("td",b2,x(C(b(R))),1),a("td",y2,x(T(R)),1),a("td",x2,x(((oe=R.spec)==null?void 0:oe.cruiseSpeed)??"—")+" m/s",1),a("td",w2,x(H[(we=R.spec)==null?void 0:we.finishAction]||((ue=R.spec)==null?void 0:ue.finishAction)||"—"),1),a("td",k2,x(M(R.updatedAt)),1)],10,h2),u.value===R.id?(p(),m("tr",S2,[a("td",T2,[a("table",P2,[a("thead",null,[a("tr",C2,[(p(),m(ae,null,ze(["#","Latitude","Longitude","Altitude","Speed","Gimbal","Action"],ke=>a("th",{key:ke,class:"py-1 pr-4 font-mono text-[10.5px] font-normal uppercase tracking-caps"},x(ke),1)),64))])]),a("tbody",L2,[(p(!0),m(ae,null,ze(_(R),(ke,Ce)=>(p(),m("tr",{key:Ce},[a("td",A2,x(Ce+1),1),a("td",M2,x(Number(ke.lat).toFixed(6)),1),a("td",E2,x(Number(ke.lon).toFixed(6)),1),a("td",O2,x(ke.altitude)+" m",1),a("td",z2,x(ke.speed!=null?`${ke.speed} m/s`:"cruise"),1),a("td",$2,x(ke.gimbalPitch!=null?`${ke.gimbalPitch}°`:"—"),1),a("td",I2,x(j[ke.action]||ke.action||"—")+x(ke.hoverSeconds?` · hover ${ke.hoverSeconds} s`:""),1)]))),128))])]),U[4]||(U[4]=a("div",{class:"mt-2 text-xs text-ink-muted"},"Edit this route in the Fly App; changes sync here.",-1))])])):I("",!0)],64)}),128))])])])):(p(),m("div",u2,[A(Q,{name:"route",size:26,class:"text-ink-muted"}),U[2]||(U[2]=a("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No routes yet",-1)),U[3]||(U[3]=a("div",{class:"mt-1 text-xs text-ink-muted"}," Save a route in the Fly App's Waypoints mission library while signed in and it shows up here. ",-1))]))])]))}},F2={class:"grid h-full grid-cols-[248px_1fr] max-[900px]:grid-cols-1"},D2={class:"flex flex-col border-r border-line bg-surface-1 px-4 py-5 max-[900px]:hidden"},R2={class:"flex items-center gap-2.5 px-2 pb-5"},B2={class:"flex flex-col gap-0.5"},U2=["onClick"],V2={class:"mt-auto flex flex-col gap-2.5"},Z2={class:"rounded-lg bg-surface-2 p-3"},H2={class:"flex items-center gap-2"},j2={class:"text-xs font-semibold text-ink"},W2={class:"mt-1.5 block font-mono text-[10.5px] text-ink-muted"},K2={class:"flex items-center gap-2.5 px-2 py-1"},G2={class:"grid h-8 w-8 place-items-center rounded-full bg-[var(--navy-800)] text-xs font-bold text-white"},q2={class:"min-w-0 flex-1"},Y2={class:"truncate text-[13px] font-semibold text-ink"},J2={class:"flex items-center gap-1.5 text-[11px] text-ink-muted"},X2=["title"],Q2={class:"overflow-y-auto"},ek={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)"}},tk={class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},nk={class:"ml-auto flex items-center gap-3"},ik={class:"flex h-10 w-60 items-center gap-2 rounded border border-line-strong bg-surface-1 px-3 max-[1100px]:hidden"},ok={key:0,class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},sk={class:"grid grid-cols-4 gap-4 max-[1100px]:grid-cols-2 max-[560px]:grid-cols-1"},ak={class:"flex items-center justify-between"},rk={class:"eyebrow"},lk={class:"mt-2.5 text-[34px] font-bold leading-none tracking-tightest text-ink"},uk={class:"grid grid-cols-[1.6fr_1fr] gap-5 max-[1100px]:grid-cols-1"},ck={class:"panel p-5"},dk={class:"mb-3.5 flex items-center justify-between"},fk={class:"flex items-center gap-2"},hk={class:"relative z-[1200]"},pk={class:"panel absolute right-0 z-[1200] mt-1.5 w-72 p-3.5 shadow-lg"},mk={class:"flex items-center justify-between gap-3"},gk={class:"mb-1.5 flex items-center justify-between"},vk={class:"font-mono text-[11px] text-ink-muted"},_k=["value"],bk={key:0,class:"mt-1.5 text-[11px] text-ink-muted"},yk={key:0,class:"mt-2.5 text-xs text-ink-muted"},xk={key:1,class:"mt-2.5 text-xs text-ink-muted"},wk={key:2,class:"mt-2.5 text-xs text-ink-muted"},kk={class:"flex flex-col gap-5"},Sk={class:"panel p-5"},Tk={class:"mb-3.5 flex items-center justify-between"},Pk={class:"flex items-center gap-3"},Ck={class:"text-5xl leading-none"},Lk={class:"min-w-0"},Ak={class:"flex items-baseline gap-1"},Mk={class:"text-[34px] font-bold leading-none tracking-tightest text-ink"},Ek={class:"text-lg font-semibold text-ink-secondary"},Ok={class:"mt-1 truncate text-sm capitalize text-ink-secondary"},zk={class:"mt-1.5 truncate text-xs text-ink-muted"},$k={class:"mt-4 grid grid-cols-2 gap-2.5"},Ik={class:"rounded-lg bg-surface-2 px-3 py-2"},Nk={class:"mt-0.5 font-mono text-sm text-ink"},Fk={class:"rounded-lg bg-surface-2 px-3 py-2"},Dk={class:"mt-0.5 font-mono text-sm text-ink"},Rk={class:"rounded-lg bg-surface-2 px-3 py-2"},Bk={class:"mt-0.5 font-mono text-sm text-ink"},Uk={key:0},Vk={class:"rounded-lg bg-surface-2 px-3 py-2"},Zk={class:"mt-0.5 font-mono text-sm text-ink"},Hk={key:0},jk={key:0,class:"mt-3 text-[11px] text-ink-muted"},Wk={key:1,class:"grid place-items-center py-8 text-center"},Kk={class:"mt-0.5 text-xs text-ink-muted"},Gk={key:2,class:"grid place-items-center py-8 text-center text-sm text-ink-muted"},qk={class:"panel p-5"},Yk={class:"mb-3.5 flex items-center justify-between"},Jk={class:"grid place-items-center py-10 text-center"},Xk={class:"panel overflow-hidden p-0"},Qk={class:"flex items-center justify-between px-5 py-4"},eS={class:"flex gap-2"},tS={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},nS={key:1,class:"overflow-x-auto"},iS={class:"w-full border-collapse text-sm"},oS={class:"text-left"},sS=["onClick"],aS={class:"px-5 py-3 font-mono font-bold text-ink"},rS={class:"px-5 py-3 text-ink-secondary"},lS={class:"px-5 py-3"},uS={class:"px-5 py-3 font-mono text-ink-secondary"},cS={class:"px-5 py-3"},dS={key:0,class:"flex items-center gap-2"},fS={class:"h-1.5 w-12 overflow-hidden rounded bg-surface-2"},hS={class:"font-mono text-xs text-ink-secondary"},pS={key:1,class:"font-mono text-xs text-ink-muted"},mS={class:"px-5 py-3 font-mono text-ink-secondary"},gS={class:"px-5 py-3 text-right"},vS=["onClick"],_S={key:1,class:"p-7"},bS={class:"mb-4 flex flex-wrap items-center gap-3"},yS={class:"font-mono text-mode font-bold text-ink"},xS={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"},wS={key:1,class:"ml-auto flex flex-wrap gap-1.5"},kS=["onClick"],SS={key:0,class:"panel grid place-items-center p-16 text-center"},TS={class:"pill"},PS={class:"pill"},CS={class:"pill"},LS={class:"mt-1 text-sm font-semibold text-ink"},AS={class:"pill"},MS={class:"mt-1 font-mono text-sm font-bold tabular text-ink"},ES={class:"grid grid-cols-2 gap-4 max-[820px]:grid-cols-1"},OS={class:"panel p-4"},zS={class:"flex items-center gap-4"},$S={class:"h-9 flex-1 overflow-hidden rounded border border-line bg-surface-2"},IS={class:"readout"},NS={class:"panel p-4"},FS={class:"readout"},DS={class:"panel p-4"},RS={class:"space-y-1.5 text-sm"},BS={class:"flex justify-between"},US={class:"text-ink"},VS={class:"flex justify-between"},ZS={class:"text-ink"},HS={class:"flex justify-between"},jS={class:"font-mono tabular text-ink"},WS={class:"flex justify-between"},KS={class:"font-mono tabular text-ink"},GS={class:"panel p-4"},qS={class:"space-y-1.5 text-sm"},YS={class:"flex justify-between"},JS={class:"font-mono tabular text-ink"},XS={class:"flex justify-between"},QS={class:"font-mono tabular text-ink"},e5={class:"flex justify-between"},t5={class:"font-mono tabular text-ink"},n5={class:"panel col-span-2 p-4 max-[820px]:col-span-1"},i5={class:"panel p-4"},o5={class:"flex flex-wrap gap-2"},s5={class:"mt-2 min-h-[16px] text-xs text-ink-muted"},a5={class:"panel p-4"},r5={class:"h-[180px] overflow-y-auto font-mono text-xs"},l5={class:"text-ink-muted"},u5={class:"font-semibold text-accent"},c5={class:"break-all text-ink"},d5={key:7,class:"p-7"},f5={class:"panel grid place-items-center p-16 text-center"},h5={class:"mt-3 text-sm font-medium text-ink-secondary"},p5={key:0,class:"mt-1 text-xs text-ink-muted"},m5={key:1,class:"mt-1 text-xs text-ink-muted"},g5="34,-25,72,45",v5=600*1e3,_5={__name:"Dashboard",props:{email:{type:String,default:""},role:{type:String,default:"user"},organization:{type:String,default:""},organizationName:{type:String,default:""}},emits:["logout"],setup(t,{emit:i}){const s=t,l=i,u=gt({}),f=gt({}),h=Y(null),_=Y(!1),b=gt([]),C=Y(""),T=Y([]),M=gt({unavailable:!1,detail:"",loaded:!1,plan:"",recommendedInterval:30}),H=de(()=>T.value.filter(Z=>!Z.onGround).length),j=Y(!1);let G=null;const N=[{value:"auto",label:"Auto"},{value:5,label:"5s"},{value:10,label:"10s"},{value:15,label:"15s"},{value:30,label:"30s"},{value:60,label:"60s"},{value:120,label:"120s"}],U=de(()=>{if(be.airTrafficInterval==="auto")return M.recommendedInterval||30;const Z=Number(be.airTrafficInterval);return Number.isFinite(Z)&&Z>0?Z:30}),R=Y(null);let oe=!1;function we(){if(!(oe||R.value!==null)){if(typeof navigator>"u"||!navigator.geolocation){R.value=!1;return}oe=!0,navigator.geolocation.getCurrentPosition(Z=>{R.value={lat:Z.coords.latitude,lng:Z.coords.longitude},oe=!1},()=>{R.value=!1,oe=!1},{timeout:8e3,maximumAge:6e5})}}function ue(Z,E,Oe){const tt=Z&&Z.telemetry||{},It=tt[E],St=tt[Oe];return typeof It=="number"&&typeof St=="number"&&(It||St)?{lat:It,lng:St}:null}function ke(){const Z=ue(q.value,"latitude","longitude")||S.value.map(tt=>ue(u[tt],"latitude","longitude")).find(Boolean);if(Z){const tt=$r(Z.lat,Z.lng);if(tt)return tt.bbox}const E=ue(q.value,"phoneLatitude","phoneLongitude")||S.value.map(tt=>ue(u[tt],"phoneLatitude","phoneLongitude")).find(Boolean);if(E){const tt=$r(E.lat,E.lng);if(tt)return tt.bbox}if(we(),R.value){const tt=$r(R.value.lat,R.value.lng);if(tt)return tt.bbox}const Oe=wm(be.region);return Oe||g5}async function Ce(){if(!be.showAirTraffic)return;const Z=be.autoBbox?ke():void 0,{states:E,unavailable:Oe,detail:tt,plan:It,recommendedInterval:St}=await mp(Z);T.value=E,M.unavailable=Oe,M.detail=tt,M.plan=It||"",St&&(M.recommendedInterval=St),M.loaded=!0}function Le(){G&&clearInterval(G),G=setInterval(()=>{Me.value==="Overview"&&be.showAirTraffic&&Ce()},U.value*1e3)}function Ze(){Ce(),Le()}function he(){G&&clearInterval(G),G=null}const ee=gt({loaded:!1,unavailable:!1,detail:"",data:null,units:"metric",source:"",updatedAt:0});let V=null;function O(){const Z=ue(q.value,"latitude","longitude")||S.value.map(Oe=>ue(u[Oe],"latitude","longitude")).find(Boolean);if(Z)return{lat:Z.lat,lng:Z.lng,source:"drone"};const E=ue(q.value,"phoneLatitude","phoneLongitude")||S.value.map(Oe=>ue(u[Oe],"phoneLatitude","phoneLongitude")).find(Boolean);return E?{lat:E.lat,lng:E.lng,source:"phone"}:R.value?{lat:R.value.lat,lng:R.value.lng,source:"browser"}:null}async function F(){const Z=O(),E=await Sp(Z?Z.lat:void 0,Z?Z.lng:void 0);if(ee.loaded=!0,ee.units=E.units||"metric",E.unavailable||!E.weather){ee.unavailable=!0,ee.detail=E.detail||"Weather is unavailable.",ee.data=null;return}ee.unavailable=!1,ee.detail="",ee.data=E.weather,ee.source=Z?Z.source:"default",ee.updatedAt=Date.now()}function $(){V&&clearInterval(V),V=setInterval(()=>{Me.value==="Overview"&&F()},v5)}function Ye(){F(),$()}function Se(){V&&clearInterval(V),V=null}const ge=de(()=>ee.units==="imperial"?"°F":ee.units==="standard"?"K":"°C"),fe=de(()=>ee.units==="imperial"?"mph":"m/s");function ft(Z){const E=(Z||"").slice(0,2);return E==="01"?(Z||"").endsWith("n")?"🌙":"☀️":{"02":"🌤️","03":"⛅","04":"☁️","09":"🌧️",10:"🌦️",11:"⛈️",13:"❄️",50:"🌫️"}[E]||"🌡️"}const pe=de(()=>ft(ee.data&&ee.data.icon)),Ue=de(()=>{const Z=ee.data;return Z?Z.country?`${Z.location}, ${Z.country}`:Z.location||"Unknown location":""}),Ve=de(()=>ee.source==="drone"?"at aircraft location":ee.source==="phone"||ee.source==="browser"?"at your location":"default location"),wt=de(()=>ee.updatedAt?new Date(ee.updatedAt).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"");function st(Z,E=0){return typeof Z=="number"?Z.toFixed(E):"—"}const Me=Y("Overview"),De=[["grid","Overview"],["radio","Live flights"],["route","Routes"],["calendar","Schedule"],["drone","Drones"],["book","Logbook"],["fileText","Documents"],["server","Drives"],["settings","Settings"]],zt=de(()=>(De.find(([,Z])=>Z===Me.value)||["grid"])[0]),At=Y(""),Ut=Y(""),Pt=Y("");let kt=null,w=null,y=!1;const S=de(()=>Object.keys(u).sort((Z,E)=>(u[E].online?1:0)-(u[Z].online?1:0)||Z.localeCompare(E))),q=de(()=>h.value?u[h.value]:null),W=de(()=>q.value&&q.value.telemetry||{}),J=de(()=>!!(q.value&&q.value.online)),ce=de(()=>{const Z=W.value;return typeof Z.latitude=="number"&&typeof Z.longitude=="number"&&(Z.latitude||Z.longitude)?{lat:Z.latitude,lng:Z.longitude}:null}),le=de(()=>h.value&&f[h.value]||[]),se=de(()=>{const Z=W.value;return typeof Z.velocityX=="number"&&typeof Z.velocityY=="number"?Math.hypot(Z.velocityX,Z.velocityY):null});function te(Z){return Z.online?Z.connected?["In flight","success"]:["Standby","accent"]:["Offline","neutral"]}function ve(Z){const E=Z&&Z.telemetry||{};return typeof E.velocityX=="number"&&typeof E.velocityY=="number"?Math.hypot(E.velocityX,E.velocityY):null}const re=de(()=>S.value.map(Z=>{const E=u[Z],Oe=E.telemetry||{},[tt,It]=te(E);return{id:Z,mission:E.model||(E.connected?"Drone linked":E.online?"App online":"No signal"),status:tt,tone:It,alt:typeof Oe.altitude=="number"?Oe.altitude.toFixed(0)+" m":"—",battery:typeof Oe.batteryPercent=="number"?Oe.batteryPercent:null,speed:ve(E)}})),Te=de(()=>S.value.map(Z=>u[Z].connected?u[Z].flightControllerSerial:"").filter(Boolean)),Ae=de(()=>S.value.filter(Z=>u[Z].online).length),Re=de(()=>S.value.filter(Z=>u[Z].online&&u[Z].connected).length),Ke=de(()=>S.value.filter(Z=>!u[Z].online).length),Ge=de(()=>{const Z=S.value.map(E=>{var Oe;return(Oe=u[E].telemetry)==null?void 0:Oe.batteryPercent}).filter(E=>typeof E=="number");return Z.length?Math.round(Z.reduce((E,Oe)=>E+Oe,0)/Z.length):null}),pt=de(()=>[{label:"Active flights",value:String(Re.value),delta:`${Ae.value} online`,tone:"success",icon:"radio"},{label:"Avg battery",value:Ge.value==null?"—":Ge.value+"%",delta:Ge.value==null?"no telemetry":Ge.value<40?"low — watch":"nominal",tone:Ge.value!=null&&Ge.value<40?"danger":"neutral",icon:"battery"},{label:"Fleet size",value:String(S.value.length),delta:`${Re.value} in flight`,tone:"neutral",icon:"grid"},{label:"Offline",value:String(Ke.value),delta:Ke.value?"needs attention":"all reachable",tone:Ke.value?"warning":"success",icon:"signal"}]),ht={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"},Vt={success:"text-success-fg",danger:"text-danger-fg",warning:"text-amber-fg",neutral:"text-ink-muted",accent:"text-accent-soft-fg"},Jt=de(()=>{var Oe,tt,It;const E=(s.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((Oe=E[0])==null?void 0:Oe[0])||"P")+(((tt=E[1])==null?void 0:tt[0])||((It=E[0])==null?void 0:It[1])||"V")).toUpperCase()}),Zt={superadmin:"Superadmin",admin:"Admin",user:"Operator"},pn=de(()=>Zt[s.role]||"Operator"),Ct=de(()=>s.organizationName||(s.role==="superadmin"?"All organizations":"No organization")),$t=new Set,kn=Y(null);async function zi(Z){var It,St,Et;if(!Z.connected||!Z.flightControllerSerial)return;const E={flightControllerSerial:Z.flightControllerSerial,model:Z.model||"",firmware:Z.firmware||"",controllerFirmware:Z.controllerFirmware||""},Oe=[E.flightControllerSerial,E.model,E.firmware,E.controllerFirmware].join("|");if($t.has(Oe))return;$t.add(Oe);const tt=await Pp(E);if(!tt.ok){(tt.status===0||tt.status>=500)&&$t.delete(Oe);return}((It=tt.body)!=null&&It.created||(St=tt.body)!=null&&St.updated)&&((Et=kn.value)==null||Et.reload())}function at(Z){if(Z)for(const E of $t)E.startsWith(`${Z}|`)&&$t.delete(E)}function Sn(Z){var Oe;u[Z.deviceId]=Z,zi(Z);const E=Z.telemetry||{};typeof E.latitude=="number"&&typeof E.longitude=="number"&&(E.latitude||E.longitude)&&(f[Z.deviceId]||(f[Z.deviceId]=[]),f[Z.deviceId].push([E.latitude,E.longitude]),f[Z.deviceId].length>1e3&&f[Z.deviceId].shift()),(!h.value||Z.online&&!((Oe=u[h.value])!=null&&Oe.online))&&(h.value=Z.deviceId)}function $i(Z){delete u[Z],delete f[Z],h.value===Z&&(h.value=S.value[0]||null)}function rt(Z){b.unshift({t:ku(Date.now()),tag:Z.type||"?",text:JSON.stringify(hi(Z))}),b.length>200&&b.pop()}function hi(Z){const E={...Z};return delete E.type,E}function pi(){const Z=location.protocol==="https:"?"wss":"ws";kt=new WebSocket(`${Z}://${location.host}/bff/ws`),kt.onopen=()=>_.value=!0,kt.onclose=()=>{_.value=!1,y||(w=setTimeout(pi,1500))},kt.onerror=()=>kt&&kt.close(),kt.onmessage=E=>{let Oe;try{Oe=JSON.parse(E.data)}catch{return}Oe.type==="snapshot"?(Oe.devices||[]).forEach(Sn):Oe.type==="update"&&Oe.device?(Sn(Oe.device),Oe.event&&Oe.device.deviceId===h.value&&rt(Oe.event)):Oe.type==="removed"&&Oe.deviceId&&$i(Oe.deviceId)}}async function Ii(){if(!h.value)return Pt.value="No device selected.";if(!At.value.trim())return Pt.value="Enter a command name.";let Z;if(Ut.value.trim())try{Z=JSON.parse(Ut.value)}catch{return Pt.value="Payload is not valid JSON."}const{ok:E,body:Oe}=await Bp(h.value,At.value.trim(),Z);Pt.value=E?`Sent "${At.value.trim()}".`:`Error: ${Oe.error||"failed"}`}function Gt(Z,E,Oe=""){return typeof Z=="number"?Z.toFixed(E)+Oe:"—"}function jn(Z){h.value=Z,Me.value="Live flights"}return Bt(Me,Z=>{Z==="Overview"&&(Ce(),F())}),Bt(()=>be.showAirTraffic,Z=>{Z?Ce():T.value=[]}),Bt(U,Le),ti(async()=>{(await np()).forEach(Sn),pi(),Ze(),Ye()}),us(()=>{y=!0,w&&clearTimeout(w),kt&&kt.close(),he(),Se()}),(Z,E)=>{var Oe,tt,It,St,Et;return p(),m("div",F2,[a("aside",D2,[a("div",R2,[A(nd,{size:26}),E[11]||(E[11]=a("span",{class:"text-[19px] tracking-tightest"},[a("span",{class:"font-medium text-ink-secondary"},"Pilot"),a("span",{class:"font-bold text-ink"},"Vault")],-1))]),a("nav",B2,[(p(),m(ae,null,ze(De,([K,_t])=>a("button",{key:_t,class:Pe(["flex items-center gap-3 rounded px-3 py-2.5 text-left text-sm transition",Me.value===_t?"bg-accent-soft font-semibold text-accent-soft-fg":"font-medium text-ink-secondary hover:bg-surface-2"]),onClick:bt=>Me.value=_t},[A(Q,{name:K,size:18,stroke:Me.value===_t?2.2:1.8},null,8,["name","stroke"]),z(" "+x(_t),1)],10,U2)),64))]),a("div",V2,[a("div",Z2,[a("div",H2,[a("span",{class:Pe(["h-2 w-2 rounded-full",_.value?"bg-ready":"bg-caution"])},null,2),a("span",j2,x(_.value?"Link healthy":"Reconnecting…"),1)]),a("span",W2,"API gateway · "+x(_.value?"streaming":"retrying"),1)]),a("div",K2,[a("div",G2,x(Jt.value),1),a("div",q2,[a("div",Y2,x(t.email||"Operator"),1),a("div",J2,[A(Q,{name:"grid",size:11,class:"shrink-0"}),a("span",{class:"truncate",title:`${pn.value} · ${Ct.value}`},x(pn.value)+" · "+x(Ct.value),9,X2)])]),a("button",{class:"text-ink-muted transition hover:text-ink",title:"Log out","aria-label":"Log out",onClick:E[0]||(E[0]=K=>l("logout"))},[A(Q,{name:"logout",size:16})])])])]),a("main",Q2,[a("header",ek,[a("div",null,[E[12]||(E[12]=a("div",{class:"eyebrow"},"Live operations",-1)),a("h1",tk,x(Me.value),1)]),a("div",nk,[a("div",ik,[A(Q,{name:"search",size:16,class:"text-ink-muted"}),ie(a("input",{"onUpdate:modelValue":E[1]||(E[1]=K=>C.value=K),placeholder:"Search drones, routes…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[me,C.value]])]),a("button",{class:"btn-accent flex items-center gap-2",onClick:E[2]||(E[2]=K=>Me.value="Live flights")},[A(Q,{name:"radio",size:16}),E[13]||(E[13]=z(" Live flights ",-1))])])]),Me.value==="Overview"?(p(),m("div",ok,[a("div",sk,[(p(!0),m(ae,null,ze(pt.value,K=>(p(),m("div",{key:K.label,class:"panel p-5"},[a("div",ak,[a("span",rk,x(K.label),1),A(Q,{name:K.icon,size:16,class:"text-ink-muted"},null,8,["name"])]),a("div",lk,x(K.value),1),a("span",{class:Pe(["mt-2 block font-mono text-[11px]",Vt[K.tone]])},x(K.delta),3)]))),128))]),a("div",uk,[a("div",ck,[a("div",dk,[E[18]||(E[18]=a("div",null,[a("div",{class:"eyebrow"},"Airspace"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Live map")],-1)),a("div",fk,[$e(be).showAirTraffic&&H.value?(p(),m("span",{key:0,class:Pe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ht.accent]),title:"Live aircraft from OpenSky Network"},[A(Q,{name:"radio",size:12}),z(x(H.value)+" aircraft ",1)],2)):I("",!0),Re.value?(p(),m("span",{key:1,class:Pe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ht.success])},[E[14]||(E[14]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(Re.value)+" drones ",1)],2)):I("",!0),a("div",hk,[a("button",{type:"button",class:Pe(["grid h-7 w-7 place-items-center rounded-md text-ink-muted transition hover:bg-surface-2 hover:text-ink",j.value?"bg-surface-2 text-ink":""]),title:"Map settings","aria-label":"Map settings",onClick:E[3]||(E[3]=K=>j.value=!j.value)},[A(Q,{name:"settings",size:16})],2),j.value?(p(),m(ae,{key:0},[a("div",{class:"fixed inset-0 z-[1190]",onClick:E[4]||(E[4]=K=>j.value=!1)}),a("div",pk,[E[17]||(E[17]=a("div",{class:"eyebrow mb-2.5"},"Map settings",-1)),a("label",mk,[E[15]||(E[15]=a("span",{class:"text-sm text-ink-secondary"},"Show live air traffic",-1)),A(nn,{modelValue:$e(be).showAirTraffic,"onUpdate:modelValue":E[5]||(E[5]=K=>$e(be).showAirTraffic=K)},null,8,["modelValue"])]),a("div",{class:Pe(["mt-3.5",$e(be).showAirTraffic?"":"pointer-events-none opacity-40"])},[a("div",gk,[E[16]||(E[16]=a("span",{class:"text-sm text-ink-secondary"},"Refresh interval",-1)),a("span",vk,"every "+x(U.value)+"s",1)]),ie(a("select",{"onUpdate:modelValue":E[6]||(E[6]=K=>$e(be).airTrafficInterval=K),class:"field"},[(p(),m(ae,null,ze(N,K=>a("option",{key:K.value,value:K.value},x(K.label)+x(K.value==="auto"?` (plan: ${M.recommendedInterval}s)`:""),9,_k)),64))],512),[[Ot,$e(be).airTrafficInterval]]),M.plan?(p(),m("p",bk," OpenSky plan: "+x(M.plan),1)):I("",!0)],2)])],64)):I("",!0)])])]),A(Cu,{position:ce.value,trail:le.value,aircraft:$e(be).showAirTraffic?T.value:[]},null,8,["position","trail","aircraft"]),$e(be).showAirTraffic?M.loaded&&M.unavailable?(p(),m("p",xk,x(M.detail||"Live air traffic is unavailable."),1)):(p(),m("p",wk," Live air traffic from OpenSky Network · updates every "+x(U.value)+"s ",1)):(p(),m("p",yk," Live air traffic hidden · enable it in Map settings "))]),a("div",kk,[a("div",Sk,[a("div",Tk,[E[19]||(E[19]=a("div",null,[a("div",{class:"eyebrow"},"Conditions"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Weather")],-1)),A(Q,{name:"sun",size:16,class:"text-ink-muted"})]),ee.data?(p(),m(ae,{key:0},[a("div",Pk,[a("div",Ck,x(pe.value),1),a("div",Lk,[a("div",Ak,[a("span",Mk,x(st(ee.data.temp)),1),a("span",Ek,x(ge.value),1)]),a("div",Ok,x(ee.data.description||"—"),1)])]),a("div",zk,x(Ue.value)+" · "+x(Ve.value),1),a("div",$k,[a("div",Ik,[E[20]||(E[20]=a("div",{class:"eyebrow"},"Feels like",-1)),a("div",Nk,x(st(ee.data.feelsLike))+x(ge.value),1)]),a("div",Fk,[E[21]||(E[21]=a("div",{class:"eyebrow"},"Wind",-1)),a("div",Dk,x(st(ee.data.windSpeed,1))+" "+x(fe.value),1)]),a("div",Rk,[E[22]||(E[22]=a("div",{class:"eyebrow"},"Humidity",-1)),a("div",Bk,[z(x(st(ee.data.humidity)),1),ee.data.humidity!=null?(p(),m("span",Uk,"%")):I("",!0)])]),a("div",Vk,[E[23]||(E[23]=a("div",{class:"eyebrow"},"Cloud cover",-1)),a("div",Zk,[z(x(st(ee.data.clouds)),1),ee.data.clouds!=null?(p(),m("span",Hk,"%")):I("",!0)])])]),wt.value?(p(),m("div",jk,"Updated "+x(wt.value)+" · OpenWeather",1)):I("",!0)],64)):ee.loaded&&ee.unavailable?(p(),m("div",Wk,[A(Q,{name:"sun",size:24,class:"text-ink-muted"}),E[24]||(E[24]=a("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"Weather unavailable",-1)),a("div",Kk,x(ee.detail),1)])):(p(),m("div",Gk," Loading weather… "))]),a("div",qk,[a("div",Yk,[E[25]||(E[25]=a("div",null,[a("div",{class:"eyebrow"},"Today"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Schedule")],-1)),A(Q,{name:"clock",size:16,class:"text-ink-muted"})]),a("div",Jk,[A(Q,{name:"calendar",size:24,class:"text-ink-muted"}),E[26]||(E[26]=a("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"No missions scheduled",-1)),E[27]||(E[27]=a("div",{class:"mt-0.5 text-xs text-ink-muted"},"Scheduling is not wired to a backend yet.",-1))])])])]),a("div",Xk,[a("div",Qk,[E[30]||(E[30]=a("div",null,[a("div",{class:"eyebrow"},"Fleet"),a("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft status")],-1)),a("div",eS,[a("span",{class:Pe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ht.success])},[E[28]||(E[28]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(Re.value)+" in flight ",1)],2),Ke.value?(p(),m("span",{key:0,class:Pe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ht.warning])},[E[29]||(E[29]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(Ke.value)+" offline ",1)],2)):I("",!0)])]),re.value.length?(p(),m("div",nS,[a("table",iS,[a("thead",null,[a("tr",oS,[(p(),m(ae,null,ze(["Aircraft","Mission","Status","Alt","Battery","Speed",""],K=>a("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"},x(K),1)),64))])]),a("tbody",null,[(p(!0),m(ae,null,ze(re.value,(K,_t)=>(p(),m("tr",{key:K.id,class:Pe(["cursor-pointer transition hover:bg-surface-2",_tjn(K.id)},[a("td",aS,x(K.id),1),a("td",rS,x(K.mission),1),a("td",lS,[a("span",{class:Pe(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ht[K.tone]])},[E[31]||(E[31]=a("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),z(x(K.status),1)],2)]),a("td",uS,x(K.alt),1),a("td",cS,[K.battery!=null?(p(),m("div",dS,[a("div",fS,[a("div",{class:Pe(["h-full",K.battery<40?"bg-caution":"bg-ready"]),style:Eo({width:K.battery+"%"})},null,6)]),a("span",hS,x(K.battery)+"%",1)])):(p(),m("span",pS,"—"))]),a("td",mS,[z(x(K.speed==null?"—":K.speed.toFixed(1))+" ",1),E[32]||(E[32]=a("span",{class:"text-ink-muted"},"m/s",-1))]),a("td",gS,[a("button",{class:"btn-ghost inline-flex items-center gap-1.5 whitespace-nowrap",onClick:hl(bt=>jn(K.id),["stop"])},[A(Q,{name:"play",size:14}),E[33]||(E[33]=z(" Track ",-1))],8,vS)])],10,sS))),128))])])])):(p(),m("div",tS," No aircraft connected yet. Devices appear here as they come online. "))])])):Me.value==="Live flights"?(p(),m("div",_S,[a("div",bS,[a("span",yS,x(h.value||"No device selected"),1),q.value&&!J.value?(p(),m("span",xS,"Offline")):I("",!0),S.value.length?(p(),m("div",wS,[(p(!0),m(ae,null,ze(S.value,K=>(p(),m("button",{key:K,class:Pe(["flex items-center gap-2 rounded border px-3 py-1.5 font-mono text-xs font-bold transition",K===h.value?"border-accent bg-accent-soft text-accent-soft-fg":"border-line bg-surface-1 text-ink-secondary hover:border-line-strong"]),onClick:_t=>h.value=K},[a("span",{class:Pe(["h-2 w-2 rounded-full",u[K].online?"bg-ready":"bg-ink-muted"])},null,2),z(" "+x(K),1)],10,kS))),128))])):I("",!0)]),S.value.length?(p(),m(ae,{key:1},[a("div",{class:Pe(["mb-4 grid gap-3",!J.value&&q.value?"opacity-60":""]),style:{"grid-template-columns":"repeat(auto-fit, minmax(150px, 1fr))"}},[a("div",TS,[E[36]||(E[36]=a("div",{class:"eyebrow"},"Registration",-1)),a("div",{class:Pe(["mt-1 text-sm font-semibold",J.value?((Oe=q.value)==null?void 0:Oe.registration)==="success"?"text-success-fg":"text-danger-fg":"text-ink"])},x(J.value&&((tt=q.value)!=null&&tt.registration)?q.value.registration:"—"),3)]),a("div",PS,[E[37]||(E[37]=a("div",{class:"eyebrow"},"Drone link",-1)),a("div",{class:Pe(["mt-1 text-sm font-semibold",J.value?(It=q.value)!=null&&It.connected?"text-success-fg":"text-danger-fg":"text-ink"])},x(q.value?J.value?q.value.connected?"connected":"no drone":"app offline":"—"),3)]),a("div",CS,[E[38]||(E[38]=a("div",{class:"eyebrow"},"Model",-1)),a("div",LS,x(((St=q.value)==null?void 0:St.model)||"—"),1)]),a("div",AS,[E[39]||(E[39]=a("div",{class:"eyebrow"},"Last update",-1)),a("div",MS,x((Et=q.value)!=null&&Et.lastSeenMs?$e(ku)(q.value.lastSeenMs):"—"),1)])],2),a("div",ES,[a("div",OS,[E[41]||(E[41]=a("div",{class:"mb-3 eyebrow"},"Battery",-1)),a("div",zS,[a("div",$S,[a("div",{class:Pe(["h-full transition-all",typeof W.value.batteryPercent=="number"?W.value.batteryPercent<20?"bg-warning":W.value.batteryPercent<40?"bg-caution":"bg-ready":""]),style:Eo({width:(typeof W.value.batteryPercent=="number"?W.value.batteryPercent:0)+"%"})},null,6)]),a("div",IS,[z(x(typeof W.value.batteryPercent=="number"?W.value.batteryPercent:"—"),1),E[40]||(E[40]=a("span",{class:"text-sm text-ink-secondary"},"%",-1))])])]),a("div",NS,[E[43]||(E[43]=a("div",{class:"mb-3 eyebrow"},"Altitude",-1)),a("div",FS,[z(x(Gt(W.value.altitude,1)),1),E[42]||(E[42]=a("span",{class:"text-sm text-ink-secondary"}," m",-1))])]),a("div",DS,[E[48]||(E[48]=a("div",{class:"mb-3 eyebrow"},"Flight",-1)),a("div",RS,[a("div",BS,[E[44]||(E[44]=a("span",{class:"text-ink-secondary"},"Mode",-1)),a("b",US,x(W.value.flightMode||"—"),1)]),a("div",VS,[E[45]||(E[45]=a("span",{class:"text-ink-secondary"},"Flying",-1)),a("b",ZS,x(W.value.isFlying==null?"—":W.value.isFlying?"yes":"no"),1)]),a("div",HS,[E[46]||(E[46]=a("span",{class:"text-ink-secondary"},"GPS sats",-1)),a("b",jS,x(W.value.satelliteCount==null?"—":W.value.satelliteCount),1)]),a("div",WS,[E[47]||(E[47]=a("span",{class:"text-ink-secondary"},"Speed (H)",-1)),a("b",KS,x(se.value==null?"—":Gt(se.value,2," m/s")),1)])])]),a("div",GS,[E[52]||(E[52]=a("div",{class:"mb-3 eyebrow"},"Position",-1)),a("div",qS,[a("div",YS,[E[49]||(E[49]=a("span",{class:"text-ink-secondary"},"Latitude",-1)),a("b",JS,x(Gt(W.value.latitude,6)),1)]),a("div",XS,[E[50]||(E[50]=a("span",{class:"text-ink-secondary"},"Longitude",-1)),a("b",QS,x(Gt(W.value.longitude,6)),1)]),a("div",e5,[E[51]||(E[51]=a("span",{class:"text-ink-secondary"},"Vert. speed",-1)),a("b",t5,x(Gt(typeof W.value.velocityZ=="number"?-W.value.velocityZ:void 0,2," m/s")),1)])])]),a("div",n5,[E[53]||(E[53]=a("div",{class:"mb-3 eyebrow"},"Track",-1)),A(Cu,{position:ce.value,trail:le.value},null,8,["position","trail"])]),a("div",i5,[E[54]||(E[54]=a("div",{class:"mb-3 eyebrow"},"Send command",-1)),a("div",o5,[ie(a("input",{"onUpdate:modelValue":E[7]||(E[7]=K=>At.value=K),class:"field flex-1",placeholder:"command (e.g. startConnection)"},null,512),[[me,At.value]]),ie(a("input",{"onUpdate:modelValue":E[8]||(E[8]=K=>Ut.value=K),class:"field flex-1",placeholder:"payload JSON (optional)"},null,512),[[me,Ut.value]]),a("button",{class:"btn-accent",onClick:Ii},"Send")]),a("div",s5,x(Pt.value),1)]),a("div",a5,[E[55]||(E[55]=a("div",{class:"mb-3 eyebrow"},"Event log",-1)),a("div",r5,[(p(!0),m(ae,null,ze(b,(K,_t)=>(p(),m("div",{key:_t,class:"border-b border-line py-1"},[a("span",l5,x(K.t),1),a("span",u5,x(K.tag),1),a("span",c5,x(K.text),1)]))),128))])])])],64)):(p(),m("div",SS,[A(Q,{name:"radio",size:28,class:"text-ink-muted"}),E[34]||(E[34]=a("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No aircraft online",-1)),E[35]||(E[35]=a("div",{class:"mt-1 text-xs text-ink-muted"},"Live telemetry appears here once a drone connects.",-1))]))])):Me.value==="Logbook"?(p(),nt(vx,{key:2,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):Me.value==="Drones"?(p(),nt(h0,{key:3,ref_key:"dronesView",ref:kn,"connected-fc-serials":Te.value,onDeleted:at},null,8,["connected-fc-serials"])):Me.value==="Routes"?(p(),nt(N2,{key:4})):Me.value==="Documents"?(p(),nt(Xw,{key:5,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):Me.value==="Settings"?(p(),nt(ty,{key:6,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName,onLogout:E[9]||(E[9]=K=>l("logout"))},null,8,["email","role","organization","organization-name"])):(p(),m("div",d5,[a("div",f5,[A(Q,{name:zt.value,size:28,class:"text-ink-muted"},null,8,["name"]),a("div",h5,x(Me.value),1),Me.value==="Drives"?(p(),m("div",p5,[E[56]||(E[56]=z(" Browse and transfer files here once a drive is connected. Configure drives in ",-1)),a("button",{class:"font-semibold text-accent hover:underline",onClick:E[10]||(E[10]=K=>Me.value="Settings")},"Settings → Integrations"),E[57]||(E[57]=z(". ",-1))])):(p(),m("div",m5,"This section is part of the console shell and has no backend yet."))])]))])])}}},b5={key:0,class:"h-full"},y5={key:1,class:"grid h-full place-items-center text-ink-muted text-sm"},x5={__name:"App",setup(t){const i=Y(!1),s=Y(null),l=Y("user"),u=Y(""),f=Y(""),h=Y("");function _(T){l.value=T&&T.role||"user",u.value=T&&T.organization||"",f.value=T&&T.organizationName||""}ti(async()=>{h.value=(await Qh()).apiBase||"";const T=await _u();T&&(s.value=T.email,_(T),await Tu()),i.value=!0});async function b(T){s.value=T,_(await _u()),await Tu()}async function C(){jp(),await tp(),s.value=null,l.value="user",u.value="",f.value=""}return(T,M)=>i.value?(p(),m("div",b5,[s.value?(p(),nt(_5,{key:0,email:s.value,role:l.value,organization:u.value,"organization-name":f.value,onLogout:C},null,8,["email","role","organization","organization-name"])):(p(),nt(lm,{key:1,"default-api-base":h.value,onSignedIn:b},null,8,["default-api-base"]))])):(p(),m("div",y5,"Loading…"))}};qh(x5).mount("#app"); diff --git a/Web App/server/dist/index.html b/Web App/server/dist/index.html index 3b063a5..f9fca42 100644 --- a/Web App/server/dist/index.html +++ b/Web App/server/dist/index.html @@ -35,7 +35,7 @@ })() PilotVault — Control Panel - + diff --git a/Web App/web/src/components/Logbook.vue b/Web App/web/src/components/Logbook.vue index d1e1ac8..5201056 100644 --- a/Web App/web/src/components/Logbook.vue +++ b/Web App/web/src/components/Logbook.vue @@ -71,8 +71,11 @@ const PURPOSES = [ const PATHS = [ { value: '', label: 'Auto (from drone)' }, { value: 'manual', label: 'Manual' }, - { value: 'automatic', label: 'Automatic (FDR)' }, + { value: 'automatic_flyapp', label: 'Automatic — Fly App (FDR)' }, + { value: 'automatic_flyagentapp', label: 'Automatic — Fly Agent (Remote ID)' }, ] +// Compliance reports the effective path as its raw value; show the same labels. +const pathLabel = (v) => PATHS.find((p) => p.value === v)?.label || v || '—' function blankFlight() { return { @@ -270,7 +273,7 @@ const stats = computed(() => { @@ -354,7 +357,7 @@ const stats = computed(() => {
- Logging path: {{ f.compliance?.loggingPath || '—' }} + Logging path: {{ pathLabel(f.compliance?.loggingPath) }} Category: {{ f.category || '—' }} Retain until: {{ (f.retentionUntil || '').slice(0, 10) || '—' }} Exempt: {{ f.compliance.exemptReason }}