From 6231b43076916bc1dea2078a5af902f5d21741bb Mon Sep 17 00:00:00 2001 From: tajniak81 <13187254+tajniak81@users.noreply.github.com> Date: Tue, 14 Jul 2026 11:21:10 +0200 Subject: [PATCH] Add OpenWeather plugin with full Web App settings cascade Builtin API Server connector for the OpenWeather API (current weather + 5-day forecast for a point, API-key auth, stdlib-only), surfaced to end users through the same three-layer settings cascade as OpenSky/WebDAV. - New builtin plugin (internal/plugins/builtin/openweather) with health probe, weather.current/forecast.5day capabilities, and tests. - resolveOpenWeather cascade (global -> org -> user) with per-field independent resolution and API-key masking; GET/PUT/health endpoints. - Web App BFF relays, api.js client, and a Settings card under APIs - External (scope switch, enable toggles, test connection). - Resolver unit tests + rebuilt embedded frontend. Co-Authored-By: Claude Opus 4.8 --- .../internal/api/integrations_openweather.go | 423 ++++++++++++++++++ .../api/integrations_openweather_test.go | 145 ++++++ API Server/internal/api/server.go | 3 + .../internal/plugins/builtin/builtin.go | 1 + .../builtin/openweather/openweather.go | 267 +++++++++++ .../builtin/openweather/openweather_test.go | 190 ++++++++ Web App/server/bff.go | 23 + Web App/server/dist/assets/index-BK_MuFN4.js | 20 + Web App/server/dist/assets/index-BfiNicZk.js | 20 - ...{index-CcgvhCJr.css => index-D7rbxd3q.css} | 2 +- Web App/server/dist/index.html | 4 +- Web App/server/main.go | 3 + Web App/web/src/api.js | 29 ++ Web App/web/src/components/Settings.vue | 274 +++++++++++- 14 files changed, 1379 insertions(+), 25 deletions(-) create mode 100644 API Server/internal/api/integrations_openweather.go create mode 100644 API Server/internal/api/integrations_openweather_test.go create mode 100644 API Server/internal/plugins/builtin/openweather/openweather.go create mode 100644 API Server/internal/plugins/builtin/openweather/openweather_test.go create mode 100644 Web App/server/dist/assets/index-BK_MuFN4.js delete mode 100644 Web App/server/dist/assets/index-BfiNicZk.js rename Web App/server/dist/assets/{index-CcgvhCJr.css => index-D7rbxd3q.css} (52%) diff --git a/API Server/internal/api/integrations_openweather.go b/API Server/internal/api/integrations_openweather.go new file mode 100644 index 0000000..84ec1dc --- /dev/null +++ b/API Server/internal/api/integrations_openweather.go @@ -0,0 +1,423 @@ +package api + +import ( + "context" + "encoding/json" + "net/http" + "net/url" + "strings" +) + +// This file exposes the "openweather" plugin's settings to end users through the +// same three-layer cascade OpenSky uses (superadmin/global → organization → +// user); see integrations.go for the shared helpers (lockedFor, layerRank, +// maskPresent, callerFromRecord) and integrations_webdav.go for the endpoint shape. +// +// - global (L1): the plugin's config in plugins.json, set in the API Server panel. +// - org (L2): pluginSettings.openweather on the caller's organization record. +// - user (L3): pluginSettings.openweather on the caller's own user record. +// +// Unlike WebDAV (a connection group), every OpenWeather field resolves +// *independently* — top layer wins, a blank field falls through. There is a +// single secret (the API key) with no paired half, so no field group is needed. +// +// The API key is never returned to a lower-privileged client: the effective +// config is resolved server-side and only masked values leave the API. Live +// probes run server-side against the resolved config. + +const openWeatherPlugin = "openweather" + +// owFields are the plugin's ConfigField keys, in display order. Kept in sync with +// the plugin descriptor so the cascade covers every setting. +var owFields = []string{"apiKey", "units", "lat", "lon", "lang"} + +// owSecretKeys are masked in every view and preserved on save when left at the mask. +var owSecretKeys = map[string]bool{"apiKey": true} + +// owConfig is one layer's openweather settings. Values are strings to match the +// plugin's ConfigField keys 1:1 (they are handed straight to plugins.Init). +type owConfig struct { + APIKey string `json:"apiKey"` + Units string `json:"units"` + Lat string `json:"lat"` + Lon string `json:"lon"` + Lang string `json:"lang"` +} + +// owStored is what we persist per user/org under pluginSettings.openweather. +type owStored struct { + Config owConfig `json:"config"` + // Enabled is the personal per-user opt-in (user layer). Default false. + Enabled bool `json:"enabled"` + // Disabled is the organization layer's off switch, stored inverted so that + // absent == enabled (mirrors OpenSky). Only meaningful on the org record. + Disabled bool `json:"disabled,omitempty"` +} + +// owSettingsDoc is the openweather slice of the shared pluginSettings JSON. +type owSettingsDoc struct { + OpenWeather owStored `json:"openweather"` +} + +// owResolution is the fully-resolved openweather state for one caller. +type owResolution struct { + eff owConfig // effective (unmasked) — used only server-side (probes) + userOwn owConfig // caller's personal (L3) values (unmasked) + orgOwn owConfig // organization (L2) values (unmasked) + source map[string]string // field -> layer name (global|org|user|unset) + isSuper bool // superadmin: manages the global layer in the panel + canOrg bool // caller may edit the organization layer (org admin) + available bool // global master switch (plugin enabled in the panel) + orgEnabled bool // org master switch (default true; gates the org's users) + enabled bool // caller's personal enable flag +} + +// owConfigFromMap builds an owConfig from a flat string map (global plugin config). +func owConfigFromMap(m map[string]string) owConfig { + return owConfig{APIKey: m["apiKey"], Units: m["units"], Lat: m["lat"], Lon: m["lon"], Lang: m["lang"]} +} + +// owGet returns a config field by the plugin's key name. +func owGet(c owConfig, key string) string { + switch key { + case "apiKey": + return c.APIKey + case "units": + return c.Units + case "lat": + return c.Lat + case "lon": + return c.Lon + case "lang": + return c.Lang + } + return "" +} + +// owSet writes a config field by the plugin's key name. +func owSet(c *owConfig, key, v string) { + switch key { + case "apiKey": + c.APIKey = v + case "units": + c.Units = v + case "lat": + c.Lat = v + case "lon": + c.Lon = v + case "lang": + c.Lang = v + } +} + +// resolveOpenWeather computes the cascade for a caller. userRaw is the caller's +// pluginSettings blob (from their auth-refresh record). +func (s *Server) resolveOpenWeather(ctx context.Context, who *callerIdentity, userRaw json.RawMessage) owResolution { + g, masterEnabled, _ := s.plugins.RawConfig(openWeatherPlugin) + gc := owConfigFromMap(g) + + var oStored owStored + if who.OrgID != "" { + oStored, _ = s.orgOpenWeather(ctx, who.OrgID) + } + oc := oStored.Config + + var uStored owStored + if len(userRaw) > 0 { + var d owSettingsDoc + _ = json.Unmarshal(userRaw, &d) + uStored = d.OpenWeather + } + uc := uStored.Config + + res := owResolution{ + source: map[string]string{}, + userOwn: uc, + orgOwn: oc, + isSuper: who.isSuperadmin(), + // An org admin may edit the organization layer in addition to their own. + // Requires the service account (org writes go through it). + canOrg: who.isManager() && !who.isSuperadmin() && who.OrgID != "" && s.admin.configured(), + available: masterEnabled, + orgEnabled: !oStored.Disabled, + enabled: uStored.Enabled, + } + + // Ordered layers, top (highest priority) first. + type layer struct { + name string + c owConfig + } + layers := []layer{{"global", gc}} + if who.OrgID != "" { + layers = append(layers, layer{"org", oc}) + } + layers = append(layers, layer{"user", uc}) + + // Every field cascades independently: top wins, blanks fall through. + for _, key := range owFields { + src := "unset" + for _, l := range layers { + if v := strings.TrimSpace(owGet(l.c, key)); v != "" { + owSet(&res.eff, key, v) + src = l.name + break + } + } + res.source[key] = src + } + return res +} + +// orgOpenWeather reads an organization's stored openweather settings (config + the +// org gate) and its raw pluginSettings blob via the service account. Best effort: +// zero values on any miss so callers proceed as if the org layer were empty. +func (s *Server) orgOpenWeather(ctx context.Context, orgID string) (owStored, json.RawMessage) { + if orgID == "" || !s.admin.configured() { + return owStored{}, nil + } + data, status, err := s.admin.do(ctx, http.MethodGet, + "/api/collections/organizations/records/"+url.PathEscape(orgID)+"?fields=pluginSettings", nil) + if err != nil || status != http.StatusOK { + return owStored{}, nil + } + var rec struct { + PluginSettings json.RawMessage `json:"pluginSettings"` + } + _ = json.Unmarshal(data, &rec) + var doc owSettingsDoc + if len(rec.PluginSettings) > 0 { + _ = json.Unmarshal(rec.PluginSettings, &doc) + } + return doc.OpenWeather, rec.PluginSettings +} + +// mergeOpenWeather applies a mutation to the openweather entry of a pluginSettings +// blob, preserving any other plugin keys (e.g. opensky, webdav), and returns the +// new blob. +func mergeOpenWeather(existing json.RawMessage, apply func(*owStored)) json.RawMessage { + doc := map[string]json.RawMessage{} + if len(existing) > 0 { + _ = json.Unmarshal(existing, &doc) + } + if doc == nil { + doc = map[string]json.RawMessage{} // existing was JSON null + } + var ow owStored + if raw, ok := doc["openweather"]; ok { + _ = json.Unmarshal(raw, &ow) + } + apply(&ow) + b, _ := json.Marshal(ow) + doc["openweather"] = b + out, _ := json.Marshal(doc) + return out +} + +// GET /api/integrations/openweather — resolved view for the caller. +func (s *Server) handleGetOpenWeather(w http.ResponseWriter, r *http.Request) { + who, userRaw, ok := s.integrationCaller(w, r) + if !ok { + return + } + res := s.resolveOpenWeather(r.Context(), who, userRaw) + writeJSON(w, http.StatusOK, s.openWeatherView(who, res)) +} + +// owScopeView builds the masked field set for one editable scope. editable is the +// layer the caller edits ("user" | "org" | "none"); a field is locked when its +// effective value is set above that layer. +func (s *Server) owScopeView(res owResolution, editable string) map[string]any { + own := res.userOwn + if editable == "org" { + own = res.orgOwn + } + fields := map[string]osFieldView{} + for _, key := range owFields { + src := res.source[key] + fv := osFieldView{Source: src, Locked: lockedFor(src, editable)} + if owSecretKeys[key] { + fv.Effective, fv.Own = maskPresent(owGet(res.eff, key)), maskPresent(owGet(own, key)) + } else { + fv.Effective, fv.Own = owGet(res.eff, key), owGet(own, key) + } + fields[key] = fv + } + return map[string]any{"editableLayer": editable, "fields": fields} +} + +// openWeatherView builds the masked, client-safe response body. It exposes a +// "user" scope for everyone plus, for org admins, an "org" scope. +func (s *Server) openWeatherView(who *callerIdentity, res owResolution) map[string]any { + out := map[string]any{ + "available": res.available, + "orgEnabled": res.orgEnabled, + "enabled": res.enabled, + "role": who.Role, + "orgId": who.OrgID, + "canEditOrg": res.canOrg, + "isSuperadmin": res.isSuper, + } + if res.isSuper { + out["editableLayer"] = "none" + out["scopes"] = map[string]any{"user": s.owScopeView(res, "none")} + return out + } + scopes := map[string]any{"user": s.owScopeView(res, "user")} + if res.canOrg { + scopes["org"] = s.owScopeView(res, "org") + } + out["scopes"] = scopes + return out +} + +// PUT /api/integrations/openweather — save the caller's editable layer. Body: +// {enabled?, scope?, config?}. Fields locked above the caller are ignored; the +// API key left at the mask is preserved. +func (s *Server) handlePutOpenWeather(w http.ResponseWriter, r *http.Request) { + token := r.Header.Get("Authorization") + var body struct { + Enabled *bool `json:"enabled"` + Scope string `json:"scope"` + Config map[string]string `json:"config"` + } + if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + writeError(w, http.StatusBadRequest, "invalid json") + return + } + who, userRaw, ok := s.integrationCaller(w, r) + if !ok { + return + } + res := s.resolveOpenWeather(r.Context(), who, userRaw) + + // Resolve which layer this write targets. + editable := "user" + switch { + case res.isSuper: + editable = "none" + case strings.EqualFold(strings.TrimSpace(body.Scope), "org"): + if !res.canOrg { + writeError(w, http.StatusForbidden, "only an organization admin can edit organization settings") + return + } + editable = "org" + } + + // Overlay the fields the caller may change in this scope onto its own values. + newOwn := res.userOwn + if editable == "org" { + newOwn = res.orgOwn + } + for _, key := range owFields { + v, present := body.Config[key] + if !present || lockedFor(res.source[key], editable) { + continue + } + if owSecretKeys[key] && v == openSkySecretMask { + continue // keep current secret + } + owSet(&newOwn, key, strings.TrimSpace(v)) + } + + // Persist the organization layer (admins) via the service account. + if editable == "org" { + if who.OrgID == "" { + writeError(w, http.StatusForbidden, "your account is not attached to an organization") + return + } + if !s.admin.configured() { + writeError(w, http.StatusServiceUnavailable, "organization settings not configured on the server") + return + } + _, orgRaw := s.orgOpenWeather(r.Context(), who.OrgID) + newDoc := mergeOpenWeather(orgRaw, func(ow *owStored) { + ow.Config = newOwn + if body.Enabled != nil { + ow.Disabled = !*body.Enabled // org master switch, stored inverted + } + }) + _, st, err := s.admin.do(r.Context(), http.MethodPatch, + "/api/collections/organizations/records/"+url.PathEscape(who.OrgID), + map[string]json.RawMessage{"pluginSettings": newDoc}) + if err != nil { + writeJSON(w, http.StatusBadGateway, map[string]any{"error": "cannot reach PocketBase", "detail": err.Error()}) + return + } + if st != http.StatusOK { + writeError(w, http.StatusBadGateway, "could not save organization settings") + return + } + } + + // Persist the user record: the personal enable flag lives here (user/superadmin + // scope), and so does the personal config layer when this write targets user. + personalEnable := body.Enabled != nil && editable != "org" + if personalEnable || editable == "user" { + newDoc := mergeOpenWeather(userRaw, func(ow *owStored) { + if personalEnable { + ow.Enabled = *body.Enabled + } + if editable == "user" { + ow.Config = newOwn + } + }) + if code, err := s.patchUserPluginSettings(r.Context(), token, who.ID, newDoc); err != nil { + writeJSON(w, http.StatusBadGateway, map[string]any{"error": "cannot reach PocketBase", "detail": err.Error()}) + return + } else if code != http.StatusOK { + writeError(w, http.StatusBadGateway, "could not save user settings") + return + } + } + + // Re-resolve and return the fresh view. + fresh, st, err := s.pbAuthRefresh(r.Context(), token) + if err != nil || st != http.StatusOK || fresh == nil { + writeJSON(w, http.StatusOK, map[string]any{"ok": true}) + return + } + res2 := s.resolveOpenWeather(r.Context(), who, fresh.Record["pluginSettings"]) + writeJSON(w, http.StatusOK, s.openWeatherView(who, res2)) +} + +// POST /api/integrations/openweather/health — live probe using the caller's +// resolved config. Never returns the API key. +func (s *Server) handleOpenWeatherHealth(w http.ResponseWriter, r *http.Request) { + who, userRaw, ok := s.integrationCaller(w, r) + if !ok { + return + } + if !who.isSuperadmin() { + if _, _, ok := s.plugins.RawConfig(openWeatherPlugin); !ok { + writeError(w, http.StatusNotFound, "unknown plugin") + return + } + } + res := s.resolveOpenWeather(r.Context(), who, userRaw) + if !res.available { + writeJSON(w, http.StatusOK, map[string]any{"health": map[string]any{ + "status": "down", "detail": "OpenWeather is disabled by the administrator"}}) + return + } + if !res.orgEnabled { + writeJSON(w, http.StatusOK, map[string]any{"health": map[string]any{ + "status": "down", "detail": "OpenWeather is disabled for your organization"}}) + return + } + if strings.TrimSpace(res.eff.APIKey) == "" { + writeJSON(w, http.StatusOK, map[string]any{"health": map[string]any{ + "status": "down", "detail": "No API key configured — add one to connect"}}) + return + } + cfg := map[string]string{} + for _, k := range owFields { + cfg[k] = owGet(res.eff, k) + } + h, err := s.plugins.HealthCheckWith(r.Context(), openWeatherPlugin, cfg) + if err != nil { + writeJSON(w, http.StatusBadGateway, map[string]any{"error": err.Error()}) + return + } + writeJSON(w, http.StatusOK, map[string]any{"health": h}) +} diff --git a/API Server/internal/api/integrations_openweather_test.go b/API Server/internal/api/integrations_openweather_test.go new file mode 100644 index 0000000..ad63daa --- /dev/null +++ b/API Server/internal/api/integrations_openweather_test.go @@ -0,0 +1,145 @@ +package api + +import ( + "context" + "encoding/json" + "testing" + + "pilotvault/apiserver/internal/plugins" +) + +// newOWServer builds a minimal Server whose plugin manager has openweather +// enabled with the given global config. admin is left nil (not configured), so +// the org layer is skipped and the cascade covers global + user only. +func newOWServer(t *testing.T, global map[string]string) *Server { + t.Helper() + mgr := plugins.NewManager(t.TempDir() + "/plugins.json") + if _, err := mgr.Upsert(context.Background(), openWeatherPlugin, true, global); err != nil { + t.Fatalf("enable openweather: %v", err) + } + return &Server{plugins: mgr} +} + +// userRaw builds a pluginSettings blob with an openweather user layer. +func userRaw(t *testing.T, cfg owConfig, enabled bool) json.RawMessage { + t.Helper() + b, err := json.Marshal(owSettingsDoc{OpenWeather: owStored{Config: cfg, Enabled: enabled}}) + if err != nil { + t.Fatal(err) + } + return b +} + +func TestResolveOpenWeatherCascade(t *testing.T) { + // Global supplies the API key + units and leaves the location blank so the + // user layer fills it in. (A value set globally locks the lower layers — that + // is verified separately by the masked/locked apiKey below.) + s := newOWServer(t, map[string]string{"apiKey": "GLOBAL-KEY", "units": "metric"}) + who := &callerIdentity{ID: "u1", Role: roleUser} // org-less + uRaw := userRaw(t, owConfig{Lat: "51.5", Lon: "-0.12"}, true) + + res := s.resolveOpenWeather(context.Background(), who, uRaw) + + if !res.available { + t.Error("available should be true when the plugin is enabled") + } + if !res.enabled { + t.Error("enabled should reflect the user's personal opt-in") + } + // API key + units come from global (user left them blank). + if res.eff.APIKey != "GLOBAL-KEY" || res.source["apiKey"] != "global" { + t.Errorf("apiKey = %q src %q, want GLOBAL-KEY/global", res.eff.APIKey, res.source["apiKey"]) + } + if res.eff.Units != "metric" || res.source["units"] != "global" { + t.Errorf("units = %q src %q, want metric/global", res.eff.Units, res.source["units"]) + } + // Location comes from the user layer (top-wins over the global default). + if res.eff.Lat != "51.5" || res.source["lat"] != "user" { + t.Errorf("lat = %q src %q, want 51.5/user", res.eff.Lat, res.source["lat"]) + } + if res.eff.Lon != "-0.12" || res.source["lon"] != "user" { + t.Errorf("lon = %q src %q, want -0.12/user", res.eff.Lon, res.source["lon"]) + } +} + +// A field set globally locks the lower layers: even when the user supplies units, +// the global value stays in force and is sourced to "global". +func TestResolveOpenWeatherGlobalLocksUser(t *testing.T) { + s := newOWServer(t, map[string]string{"apiKey": "K", "units": "metric"}) + who := &callerIdentity{ID: "u1", Role: roleUser} + uRaw := userRaw(t, owConfig{Units: "imperial"}, false) + + res := s.resolveOpenWeather(context.Background(), who, uRaw) + if res.eff.Units != "metric" || res.source["units"] != "global" { + t.Errorf("units = %q src %q, want metric/global (global must lock the user's imperial)", res.eff.Units, res.source["units"]) + } +} + +// The view must never leak the concrete API key — only presence, masked. +func TestOpenWeatherViewMasksKey(t *testing.T) { + s := newOWServer(t, map[string]string{"apiKey": "GLOBAL-KEY", "units": "metric"}) + who := &callerIdentity{ID: "u1", Role: roleUser} + res := s.resolveOpenWeather(context.Background(), who, nil) + + view := s.openWeatherView(who, res) + scopes := view["scopes"].(map[string]any) + user := scopes["user"].(map[string]any) + fields := user["fields"].(map[string]osFieldView) + + if got := fields["apiKey"].Effective; got != openSkySecretMask { + t.Errorf("apiKey effective = %q, want the mask (never the raw key)", got) + } + if fields["apiKey"].Source != "global" || !fields["apiKey"].Locked { + t.Errorf("apiKey field = %+v, want source global + locked for a plain user", fields["apiKey"]) + } + // A non-secret field is shown in the clear. + if fields["units"].Effective != "metric" { + t.Errorf("units effective = %q, want metric", fields["units"].Effective) + } +} + +// mergeOpenWeather must preserve sibling plugin keys (opensky/webdav) untouched. +func TestMergeOpenWeatherPreservesSiblings(t *testing.T) { + existing := json.RawMessage(`{"opensky":{"enabled":true},"webdav":{"config":{"baseURL":"https://x"}}}`) + out := mergeOpenWeather(existing, func(ow *owStored) { + ow.Config.APIKey = "K" + ow.Enabled = true + }) + + var doc map[string]json.RawMessage + if err := json.Unmarshal(out, &doc); err != nil { + t.Fatal(err) + } + if _, ok := doc["opensky"]; !ok { + t.Error("opensky key was dropped by mergeOpenWeather") + } + if _, ok := doc["webdav"]; !ok { + t.Error("webdav key was dropped by mergeOpenWeather") + } + var ow owStored + if err := json.Unmarshal(doc["openweather"], &ow); err != nil { + t.Fatal(err) + } + if ow.Config.APIKey != "K" || !ow.Enabled { + t.Errorf("openweather entry = %+v, want APIKey K + enabled", ow) + } +} + +// A saved secret left at the mask on PUT must not be re-checked here, but the +// merge/keep logic lives in the handler; this guards the field/secret metadata +// the handler relies on stays consistent with the plugin descriptor. +func TestOpenWeatherFieldMetadata(t *testing.T) { + if !owSecretKeys["apiKey"] { + t.Error("apiKey must be a secret key") + } + // Every declared field must round-trip through owGet/owSet. + var c owConfig + for _, k := range owFields { + owSet(&c, k, "v-"+k) + } + for _, k := range owFields { + if owGet(c, k) != "v-"+k { + t.Errorf("owGet/owSet mismatch for %q", k) + } + } +} diff --git a/API Server/internal/api/server.go b/API Server/internal/api/server.go index 5621c1f..6ca333a 100644 --- a/API Server/internal/api/server.go +++ b/API Server/internal/api/server.go @@ -112,6 +112,9 @@ func (s *Server) Handler() http.Handler { mux.HandleFunc("GET /api/integrations/webdav", s.handleGetWebDav) mux.HandleFunc("PUT /api/integrations/webdav", s.handlePutWebDav) mux.HandleFunc("POST /api/integrations/webdav/health", s.handleWebDavHealth) + mux.HandleFunc("GET /api/integrations/openweather", s.handleGetOpenWeather) + mux.HandleFunc("PUT /api/integrations/openweather", s.handlePutOpenWeather) + mux.HandleFunc("POST /api/integrations/openweather/health", s.handleOpenWeatherHealth) // User-management — gated on the caller being a manager (admin or superadmin). // Admins are scoped to their own organization inside each handler. diff --git a/API Server/internal/plugins/builtin/builtin.go b/API Server/internal/plugins/builtin/builtin.go index 1108269..470b98f 100644 --- a/API Server/internal/plugins/builtin/builtin.go +++ b/API Server/internal/plugins/builtin/builtin.go @@ -7,5 +7,6 @@ import ( _ "pilotvault/apiserver/internal/plugins/builtin/filetransfer" _ "pilotvault/apiserver/internal/plugins/builtin/localstorage" _ "pilotvault/apiserver/internal/plugins/builtin/opensky" + _ "pilotvault/apiserver/internal/plugins/builtin/openweather" _ "pilotvault/apiserver/internal/plugins/builtin/webdav" ) diff --git a/API Server/internal/plugins/builtin/openweather/openweather.go b/API Server/internal/plugins/builtin/openweather/openweather.go new file mode 100644 index 0000000..d39dc4a --- /dev/null +++ b/API Server/internal/plugins/builtin/openweather/openweather.go @@ -0,0 +1,267 @@ +// Package openweather is a built-in plugin connecting the OpenWeather API +// (current conditions and 5-day/3-hour forecast for a point location). Like the +// opensky connector it demonstrates a real third-party integration behind the +// plugin contract, here using simple API-key auth. +// +// Docs: https://openweathermap.org/current https://openweathermap.org/forecast5 +package openweather + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "net/url" + "strconv" + "strings" + "sync" + "time" + + "pilotvault/apiserver/internal/plugins" +) + +// apiBase is the OpenWeather REST root. It is copied into the plugin instance in +// Init so tests can point the connector at an httptest server. +const apiBase = "https://api.openweathermap.org" + +// Default probe location — Warsaw, Poland. Used by the health probe and as the +// default point for weather.current / forecast.5day when a call supplies none. +const ( + defaultLat = "52.2297" + defaultLon = "21.0122" +) + +func init() { + plugins.Register("openweather", func() plugins.Plugin { return &Plugin{} }) +} + +// Plugin is the OpenWeather connector. +type Plugin struct { + mu sync.Mutex + apiKey string + units string + lang string + lat string + lon string + + base string + client *http.Client +} + +// errNoKey is returned when a probe/call has no resolved API key. OpenWeather has +// no anonymous tier, so a key is required for any live request. +var errNoKey = errors.New("no API key configured") + +func (p *Plugin) Descriptor() plugins.Descriptor { + return plugins.Descriptor{ + Name: "openweather", + Provider: "OpenWeather", + Version: "1.0.0", + Kind: plugins.KindBuiltin, + Category: plugins.CategoryAPIsExternal, + Capabilities: []plugins.Capability{ + {ID: "weather.current", Method: "GET", Endpoint: "/data/2.5/weather?lat&lon", + Description: "Current weather for the configured (or a supplied) lat/lon."}, + {ID: "forecast.5day", Method: "GET", Endpoint: "/data/2.5/forecast?lat&lon", + Description: "5-day / 3-hour forecast for the configured (or a supplied) lat/lon."}, + }, + AuthType: plugins.AuthAPIKey, + ConfigFields: []plugins.ConfigField{ + {Key: "apiKey", Label: "API key", Type: "password", Secret: true, + Help: "Your OpenWeather API key (the appid query parameter). Required for any live request — OpenWeather has no anonymous tier. Leave blank to enable the plugin as a master switch and supply the key at another layer."}, + {Key: "units", Label: "Units", Type: "select", Default: "metric", + Options: []plugins.SelectOption{ + {Value: "standard", Label: "Standard — Kelvin, m/s"}, + {Value: "metric", Label: "Metric — °C, m/s"}, + {Value: "imperial", Label: "Imperial — °F, mph"}, + }, + Help: "Measurement system for temperatures and wind speed in responses."}, + {Key: "lat", Label: "Default latitude", Type: "text", Default: defaultLat, + Help: "Latitude used by the health probe and by calls that supply no location (−90…90)."}, + {Key: "lon", Label: "Default longitude", Type: "text", Default: defaultLon, + Help: "Longitude used by the health probe and by calls that supply no location (−180…180)."}, + {Key: "lang", Label: "Language", Type: "text", + Help: "Optional ISO language code for human-readable weather descriptions (e.g. en, pl, de). Leave blank for the API default."}, + }, + } +} + +func (p *Plugin) Init(_ context.Context, config map[string]string) error { + p.mu.Lock() + defer p.mu.Unlock() + p.apiKey = strings.TrimSpace(config["apiKey"]) + p.units = strings.TrimSpace(config["units"]) + if p.units == "" { + p.units = "metric" + } + p.lang = strings.TrimSpace(config["lang"]) + p.lat = strings.TrimSpace(config["lat"]) + if p.lat == "" { + p.lat = defaultLat + } + p.lon = strings.TrimSpace(config["lon"]) + if p.lon == "" { + p.lon = defaultLon + } + p.base = apiBase + p.client = &http.Client{Timeout: 10 * time.Second} + return nil +} + +// requestURL builds an absolute OpenWeather request URL for the given path, +// merging the caller's query with the configured units, language and API key. +// The API key is never included when unset (callers must guard on errNoKey). +func (p *Plugin) requestURL(path string, q url.Values) string { + p.mu.Lock() + base, key, units, lang := p.base, p.apiKey, p.units, p.lang + p.mu.Unlock() + + if q == nil { + q = url.Values{} + } + if units != "" { + q.Set("units", units) + } + if lang != "" { + q.Set("lang", lang) + } + if key != "" { + q.Set("appid", key) + } + return strings.TrimRight(base, "/") + path + "?" + q.Encode() +} + +// pointQuery returns a lat/lon query, preferring caller-supplied coordinates and +// falling back to the configured defaults. +func (p *Plugin) pointQuery(lat, lon string) url.Values { + p.mu.Lock() + dlat, dlon := p.lat, p.lon + p.mu.Unlock() + if strings.TrimSpace(lat) == "" { + lat = dlat + } + if strings.TrimSpace(lon) == "" { + lon = dlon + } + return url.Values{"lat": {strings.TrimSpace(lat)}, "lon": {strings.TrimSpace(lon)}} +} + +// HealthCheck performs a live current-weather query at the configured location +// and classifies the outcome. +func (p *Plugin) HealthCheck(ctx context.Context) plugins.Health { + start := time.Now() + + p.mu.Lock() + key := p.apiKey + p.mu.Unlock() + if key == "" { + return plugins.Health{Status: plugins.StatusDown, LatencyMs: time.Since(start).Milliseconds(), + Detail: errNoKey.Error()} + } + + target := p.requestURL("/data/2.5/weather", p.pointQuery("", "")) + req, _ := http.NewRequestWithContext(ctx, http.MethodGet, target, nil) + resp, err := p.client.Do(req) + lat := time.Since(start).Milliseconds() + if err != nil { + return plugins.Health{Status: plugins.StatusDown, LatencyMs: lat, Detail: err.Error()} + } + defer resp.Body.Close() + data, _ := io.ReadAll(io.LimitReader(resp.Body, 1<<20)) + + h := plugins.Health{LatencyMs: lat} + switch { + case resp.StatusCode >= 200 && resp.StatusCode < 300: + h.Status, h.Detail = plugins.StatusOK, "OpenWeather reachable" + if summary := currentSummary(data); summary != "" { + h.Detail += " · " + summary + } + case resp.StatusCode == http.StatusUnauthorized: + h.Status, h.Detail = plugins.StatusDegraded, "API key rejected (HTTP 401)" + case resp.StatusCode == http.StatusTooManyRequests: + h.Status, h.Detail = plugins.StatusDegraded, "rate limited (HTTP 429)" + default: + h.Status, h.Detail = plugins.StatusDown, "HTTP "+resp.Status + } + return h +} + +// currentSummary renders a short "place: 12°C, clear sky" line from a current +// weather payload. Returns "" when the body can't be parsed. +func currentSummary(data []byte) string { + var out struct { + Name string `json:"name"` + Main struct { + Temp float64 `json:"temp"` + } `json:"main"` + Weather []struct { + Description string `json:"description"` + } `json:"weather"` + } + if json.Unmarshal(data, &out) != nil { + return "" + } + parts := []string{} + if out.Name != "" { + parts = append(parts, out.Name) + } + temp := strconv.FormatFloat(out.Main.Temp, 'f', -1, 64) + "°" + if len(out.Weather) > 0 && out.Weather[0].Description != "" { + temp += ", " + out.Weather[0].Description + } + if len(parts) == 0 { + return temp + } + return parts[0] + ": " + temp +} + +// invokeParams is the optional per-call override accepted by Invoke actions. +type invokeParams struct { + Lat string `json:"lat"` + Lon string `json:"lon"` +} + +// Invoke exposes weather.current / forecast.5day. Both accept an optional +// {lat,lon} override and otherwise use the configured default location. +func (p *Plugin) Invoke(ctx context.Context, action string, params json.RawMessage) (json.RawMessage, error) { + p.mu.Lock() + key := p.apiKey + p.mu.Unlock() + if key == "" { + return nil, errNoKey + } + + var in invokeParams + if len(params) > 0 { + if err := json.Unmarshal(params, &in); err != nil { + return nil, fmt.Errorf("invalid params: %w", err) + } + } + + var path string + switch action { + case "weather.current": + path = "/data/2.5/weather" + case "forecast.5day": + path = "/data/2.5/forecast" + default: + return nil, errors.New("unknown action: " + action) + } + + target := p.requestURL(path, p.pointQuery(in.Lat, in.Lon)) + req, _ := http.NewRequestWithContext(ctx, http.MethodGet, target, nil) + resp, err := p.client.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + data, _ := io.ReadAll(io.LimitReader(resp.Body, 8<<20)) + if resp.StatusCode < 200 || resp.StatusCode >= 300 { + return nil, fmt.Errorf("openweather %s: HTTP %s", action, resp.Status) + } + return data, nil +} + +func (p *Plugin) Shutdown(context.Context) error { return nil } diff --git a/API Server/internal/plugins/builtin/openweather/openweather_test.go b/API Server/internal/plugins/builtin/openweather/openweather_test.go new file mode 100644 index 0000000..d553236 --- /dev/null +++ b/API Server/internal/plugins/builtin/openweather/openweather_test.go @@ -0,0 +1,190 @@ +package openweather + +import ( + "context" + "encoding/json" + "net/http" + "net/http/httptest" + "strings" + "testing" + + "pilotvault/apiserver/internal/plugins" +) + +func TestDescriptor(t *testing.T) { + p := &Plugin{} + d := p.Descriptor() + if d.Name != "openweather" { + t.Fatalf("name = %q, want openweather", d.Name) + } + if d.Kind != plugins.KindBuiltin { + t.Fatalf("kind = %q, want builtin", d.Kind) + } + if d.Category != plugins.CategoryAPIsExternal { + t.Fatalf("category = %q, want %q", d.Category, plugins.CategoryAPIsExternal) + } + if d.AuthType != plugins.AuthAPIKey { + t.Fatalf("authType = %q, want %q", d.AuthType, plugins.AuthAPIKey) + } + if len(d.Capabilities) == 0 { + t.Fatal("expected capabilities") + } + // The apiKey field must be flagged so the manager masks it, and no field may + // be Required (so the plugin can be enabled as an empty master switch). + for _, f := range d.ConfigFields { + if f.Key == "apiKey" && !f.Secret { + t.Errorf("config field %q must be Secret", f.Key) + } + if f.Required { + t.Errorf("config field %q must not be Required", f.Key) + } + } +} + +func TestInitDefaults(t *testing.T) { + p := &Plugin{} + if err := p.Init(context.Background(), nil); err != nil { + t.Fatal(err) + } + if p.units != "metric" { + t.Errorf("default units = %q, want metric", p.units) + } + if p.lat != defaultLat || p.lon != defaultLon { + t.Errorf("default location = %q,%q, want %q,%q", p.lat, p.lon, defaultLat, defaultLon) + } + if p.client == nil { + t.Error("Init must build an http client") + } +} + +func TestRequestURL(t *testing.T) { + p := &Plugin{} + _ = p.Init(context.Background(), map[string]string{ + "apiKey": "secret", "units": "imperial", "lang": "pl", + }) + got := p.requestURL("/data/2.5/weather", p.pointQuery("10", "20")) + for _, want := range []string{"lat=10", "lon=20", "units=imperial", "lang=pl", "appid=secret", "/data/2.5/weather?"} { + if !strings.Contains(got, want) { + t.Errorf("requestURL %q missing %q", got, want) + } + } +} + +// TestRequestURLNoKey confirms the appid param is omitted when no key is set, so +// a key is never leaked as an empty value. +func TestRequestURLNoKey(t *testing.T) { + p := &Plugin{} + _ = p.Init(context.Background(), nil) + if got := p.requestURL("/data/2.5/weather", p.pointQuery("", "")); strings.Contains(got, "appid") { + t.Errorf("requestURL %q must not contain appid when key is unset", got) + } +} + +// TestHealthCheckNoKey confirms a missing key is reported as down, not a panic. +func TestHealthCheckNoKey(t *testing.T) { + p := &Plugin{} + _ = p.Init(context.Background(), nil) + if h := p.HealthCheck(context.Background()); h.Status != plugins.StatusDown { + t.Errorf("status = %q, want down (detail=%q)", h.Status, h.Detail) + } +} + +func TestRegistered(t *testing.T) { + m := plugins.NewManager(t.TempDir() + "/plugins.json") + if _, ok := m.Get("openweather"); !ok { + t.Fatal("openweather not registered in the plugin manager") + } +} + +// fakeOW is a minimal OpenWeather stand-in: it validates the appid and echoes a +// small current-weather body, and returns 401 for a wrong key. +func newFakeOW(t *testing.T) *httptest.Server { + t.Helper() + return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.Query().Get("appid") != "good-key" { + w.WriteHeader(http.StatusUnauthorized) + return + } + switch r.URL.Path { + case "/data/2.5/weather": + w.Header().Set("Content-Type", "application/json") + _, _ = w.Write([]byte(`{"name":"Warsaw","main":{"temp":12.5},"weather":[{"description":"clear sky"}]}`)) + case "/data/2.5/forecast": + w.Header().Set("Content-Type", "application/json") + _, _ = w.Write([]byte(`{"cnt":40,"list":[]}`)) + default: + w.WriteHeader(http.StatusNotFound) + } + })) +} + +func TestHealthCheckOK(t *testing.T) { + srv := newFakeOW(t) + defer srv.Close() + + p := &Plugin{} + _ = p.Init(context.Background(), map[string]string{"apiKey": "good-key"}) + p.base = srv.URL + + h := p.HealthCheck(context.Background()) + if h.Status != plugins.StatusOK { + t.Fatalf("status = %q, want ok (detail=%q)", h.Status, h.Detail) + } + if !strings.Contains(h.Detail, "Warsaw") || !strings.Contains(h.Detail, "clear sky") { + t.Errorf("detail = %q, want it to summarise the current conditions", h.Detail) + } +} + +func TestHealthCheckAuthFailure(t *testing.T) { + srv := newFakeOW(t) + defer srv.Close() + + p := &Plugin{} + _ = p.Init(context.Background(), map[string]string{"apiKey": "wrong"}) + p.base = srv.URL + + if h := p.HealthCheck(context.Background()); h.Status != plugins.StatusDegraded { + t.Errorf("status = %q, want degraded on 401 (detail=%q)", h.Status, h.Detail) + } +} + +func TestInvoke(t *testing.T) { + srv := newFakeOW(t) + defer srv.Close() + + p := &Plugin{} + _ = p.Init(context.Background(), map[string]string{"apiKey": "good-key"}) + p.base = srv.URL + ctx := context.Background() + + // current weather with an explicit location override + raw, err := p.Invoke(ctx, "weather.current", json.RawMessage(`{"lat":"51.5","lon":"-0.12"}`)) + if err != nil { + t.Fatalf("weather.current: %v", err) + } + var cur struct { + Name string `json:"name"` + } + if err := json.Unmarshal(raw, &cur); err != nil || cur.Name != "Warsaw" { + t.Fatalf("weather.current body = %s (err=%v)", raw, err) + } + + // 5-day forecast using the default location + if _, err := p.Invoke(ctx, "forecast.5day", nil); err != nil { + t.Fatalf("forecast.5day: %v", err) + } + + // unknown action + if _, err := p.Invoke(ctx, "nope", nil); err == nil { + t.Error("expected error for unknown action") + } +} + +// TestInvokeNoKey confirms Invoke refuses to call upstream without a key. +func TestInvokeNoKey(t *testing.T) { + p := &Plugin{} + _ = p.Init(context.Background(), nil) + if _, err := p.Invoke(context.Background(), "weather.current", nil); err == nil { + t.Error("expected errNoKey when no API key is configured") + } +} diff --git a/Web App/server/bff.go b/Web App/server/bff.go index f2c2d6a..e73ace4 100644 --- a/Web App/server/bff.go +++ b/Web App/server/bff.go @@ -321,6 +321,29 @@ func (a *App) handleWebDavHealth(w http.ResponseWriter, r *http.Request) { a.doRelay(w, req) } +// GET /bff/integrations/openweather → API Server /api/integrations/openweather +func (a *App) handleGetOpenWeather(w http.ResponseWriter, r *http.Request) { + req, _ := http.NewRequest(http.MethodGet, a.apiBaseFor(r)+"/api/integrations/openweather", nil) + req.Header.Set("Authorization", tokenOf(r)) + a.doRelay(w, req) +} + +// PUT /bff/integrations/openweather → API Server /api/integrations/openweather +func (a *App) handlePutOpenWeather(w http.ResponseWriter, r *http.Request) { + body, _ := io.ReadAll(r.Body) + req, _ := http.NewRequest(http.MethodPut, a.apiBaseFor(r)+"/api/integrations/openweather", bytes.NewReader(body)) + req.Header.Set("Authorization", tokenOf(r)) + req.Header.Set("Content-Type", "application/json") + a.doRelay(w, req) +} + +// POST /bff/integrations/openweather/health → API Server /api/integrations/openweather/health +func (a *App) handleOpenWeatherHealth(w http.ResponseWriter, r *http.Request) { + req, _ := http.NewRequest(http.MethodPost, a.apiBaseFor(r)+"/api/integrations/openweather/health", nil) + req.Header.Set("Authorization", tokenOf(r)) + a.doRelay(w, req) +} + // GET /bff/users → API Server /api/users (admin only, enforced upstream) func (a *App) handleListUsers(w http.ResponseWriter, r *http.Request) { req, _ := http.NewRequest(http.MethodGet, a.apiBaseFor(r)+"/api/users", nil) diff --git a/Web App/server/dist/assets/index-BK_MuFN4.js b/Web App/server/dist/assets/index-BK_MuFN4.js new file mode 100644 index 0000000..3580fcc --- /dev/null +++ b/Web App/server/dist/assets/index-BK_MuFN4.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 Yr(t){const i=Object.create(null);for(const s of t.split(","))i[s]=1;return s=>s in i}const bt={},qo=[],ni=()=>{},Ou=()=>!1,Ka=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Ga=t=>t.startsWith("onUpdate:"),Ft=Object.assign,Jr=(t,i)=>{const s=t.indexOf(i);s>-1&&t.splice(s,1)},pd=Object.prototype.hasOwnProperty,mt=(t,i)=>pd.call(t,i),Fe=Array.isArray,Yo=t=>Js(t)==="[object Map]",os=t=>Js(t)==="[object Set]",Ll=t=>Js(t)==="[object Date]",Je=t=>typeof t=="function",Pt=t=>typeof t=="string",Zn=t=>typeof t=="symbol",gt=t=>t!==null&&typeof t=="object",zu=t=>(gt(t)||Je(t))&&Je(t.then)&&Je(t.catch),Iu=Object.prototype.toString,Js=t=>Iu.call(t),md=t=>Js(t).slice(8,-1),$u=t=>Js(t)==="[object Object]",Xr=t=>Pt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ns=Yr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),qa=t=>{const i=Object.create(null);return(s=>i[s]||(i[s]=t(s)))},gd=/-\w/g,Un=qa(t=>t.replace(gd,i=>i.slice(1).toUpperCase())),vd=/\B([A-Z])/g,Wi=qa(t=>t.replace(vd,"-$1").toLowerCase()),Nu=qa(t=>t.charAt(0).toUpperCase()+t.slice(1)),br=qa(t=>t?`on${Nu(t)}`:""),ti=(t,i)=>!Object.is(t,i),za=(t,...i)=>{for(let s=0;s{Object.defineProperty(t,i,{configurable:!0,enumerable:!1,writable:l,value:s})},Ya=t=>{const i=parseFloat(t);return isNaN(i)?t:i},_d=t=>{const i=Pt(t)?Number(t):NaN;return isNaN(i)?t:i};let Al;const Ja=()=>Al||(Al=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ts(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 Me(t){let i="";if(Pt(t))i=t;else if(Fe(t))for(let s=0;sZi(s,i))}const Ru=t=>!!(t&&t.__v_isRef===!0),k=t=>Pt(t)?t:t==null?"":Fe(t)||gt(t)&&(t.toString===Iu||!Je(t.toString))?Ru(t)?k(t.value):JSON.stringify(t,Bu,2):String(t),Bu=(t,i)=>Ru(i)?Bu(t,i.value):Yo(i)?{[`Map(${i.size})`]:[...i.entries()].reduce((s,[l,u],f)=>(s[yr(l,f)+" =>"]=u,s),{})}:os(i)?{[`Set(${i.size})`]:[...i.values()].map(s=>yr(s))}:Zn(i)?yr(i):gt(i)&&!Fe(i)&&!$u(i)?String(i):i,yr=(t,i="")=>{var s;return Zn(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 Zt;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&&Zt&&(Zt.active?(this.parent=Zt,this.index=(Zt.scopes||(Zt.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(Zt===this)Zt=this.prevScope;else{let i=Zt;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(Fs){let i=Fs;for(Fs=void 0;i;){const s=i.next;i.next=void 0,i.flags&=-9,i=s}}let t;for(;Ds;){let i=Ds;for(Ds=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 Hu(t){for(let i=t.deps;i;i=i.nextDep)i.version=-1,i.prevActiveLink=i.dep.activeLink,i.dep.activeLink=i}function ju(t){let i,s=t.depsTail,l=s;for(;l;){const u=l.prevDep;l.version===-1?(l===s&&(s=u),nl(l),Ld(l)):i=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=u}t.deps=i,t.depsTail=s}function zr(t){for(let i=t.deps;i;i=i.nextDep)if(i.dep.version!==i.version||i.dep.computed&&(Wu(i.dep.computed)||i.dep.version!==i.version))return!0;return!!t._dirty}function Wu(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Zs)||(t.globalVersion=Zs,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!zr(t))))return;t.flags|=2;const i=t.dep,s=wt,l=Vn;wt=t,Vn=!0;try{Hu(t);const u=t.fn(t._value);(i.version===0||ti(u,t._value))&&(t.flags|=128,t._value=u,i.version++)}catch(u){throw i.version++,u}finally{wt=s,Vn=l,ju(t),t.flags&=-3}}function nl(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)nl(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 Vn=!0;const Ku=[];function ii(){Ku.push(Vn),Vn=!1}function oi(){const t=Ku.pop();Vn=t===void 0?!0:t}function Ml(t){const{cleanup:i}=t;if(t.cleanup=void 0,i){const s=wt;wt=void 0;try{i()}finally{wt=s}}}let Zs=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 il{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(!wt||!Vn||wt===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==wt)s=this.activeLink=new Ad(wt,this),wt.deps?(s.prevDep=wt.depsTail,wt.depsTail.nextDep=s,wt.depsTail=s):wt.deps=wt.depsTail=s,Gu(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=wt.depsTail,s.nextDep=void 0,wt.depsTail.nextDep=s,wt.depsTail=s,wt.deps===s&&(wt.deps=l)}return s}trigger(i){this.version++,Zs++,this.notify(i)}notify(i){el();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{tl()}}}function Gu(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)Gu(l)}const s=t.dep.subs;s!==t&&(t.prevSub=s,s&&(s.nextSub=t)),t.dep.subs=t}}const Ir=new WeakMap,_o=Symbol(""),$r=Symbol(""),Hs=Symbol("");function qt(t,i,s){if(Vn&&wt){let l=Ir.get(t);l||Ir.set(t,l=new Map);let u=l.get(s);u||(l.set(s,u=new il),u.map=l,u.key=s),u.track()}}function bi(t,i,s,l,u,f){const h=Ir.get(t);if(!h){Zs++;return}const _=y=>{y&&y.trigger()};if(el(),i==="clear")h.forEach(_);else{const y=Fe(t),C=y&&Xr(s);if(y&&s==="length"){const T=Number(l);h.forEach((M,R)=>{(R==="length"||R===Hs||!Zn(R)&&R>=T)&&_(M)})}else switch((s!==void 0||h.has(void 0))&&_(h.get(s)),C&&_(h.get(Hs)),i){case"add":y?C&&_(h.get("length")):(_(h.get(_o)),Yo(t)&&_(h.get($r)));break;case"delete":y||(_(h.get(_o)),Yo(t)&&_(h.get($r)));break;case"set":Yo(t)&&_(h.get(_o));break}}tl()}function Ko(t){const i=ft(t);return i===t?i:(qt(i,"iterate",Hs),On(t)?i:i.map(Hn))}function Xa(t){return qt(t=ft(t),"iterate",Hs),t}function Qn(t,i){return wi(t)?ns(bo(t)?Hn(i):i):Hn(i)}const Md={__proto__:null,[Symbol.iterator](){return wr(this,Symbol.iterator,t=>Qn(this,t))},concat(...t){return Ko(this).concat(...t.map(i=>Fe(i)?Ko(i):i))},entries(){return wr(this,"entries",t=>(t[1]=Qn(this,t[1]),t))},every(t,i){return mi(this,"every",t,i,void 0,arguments)},filter(t,i){return mi(this,"filter",t,i,s=>s.map(l=>Qn(this,l)),arguments)},find(t,i){return mi(this,"find",t,i,s=>Qn(this,s),arguments)},findIndex(t,i){return mi(this,"findIndex",t,i,void 0,arguments)},findLast(t,i){return mi(this,"findLast",t,i,s=>Qn(this,s),arguments)},findLastIndex(t,i){return mi(this,"findLastIndex",t,i,void 0,arguments)},forEach(t,i){return mi(this,"forEach",t,i,void 0,arguments)},includes(...t){return kr(this,"includes",t)},indexOf(...t){return kr(this,"indexOf",t)},join(t){return Ko(this).join(t)},lastIndexOf(...t){return kr(this,"lastIndexOf",t)},map(t,i){return mi(this,"map",t,i,void 0,arguments)},pop(){return Ls(this,"pop")},push(...t){return Ls(this,"push",t)},reduce(t,...i){return El(this,"reduce",t,i)},reduceRight(t,...i){return El(this,"reduceRight",t,i)},shift(){return Ls(this,"shift")},some(t,i){return mi(this,"some",t,i,void 0,arguments)},splice(...t){return Ls(this,"splice",t)},toReversed(){return Ko(this).toReversed()},toSorted(t){return Ko(this).toSorted(t)},toSpliced(...t){return Ko(this).toSpliced(...t)},unshift(...t){return Ls(this,"unshift",t)},values(){return wr(this,"values",t=>Qn(this,t))}};function wr(t,i,s){const l=Xa(t),u=l[i]();return l!==t&&!On(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 mi(t,i,s,l,u,f){const h=Xa(t),_=h!==t&&!On(t),y=h[i];if(y!==Ed[i]){const M=y.apply(t,f);return _?Hn(M):M}let C=s;h!==t&&(_?C=function(M,R){return s.call(this,Qn(t,M),R,t)}:s.length>2&&(C=function(M,R){return s.call(this,M,R,t)}));const T=y.call(h,C,l);return _&&u?u(T):T}function El(t,i,s,l){const u=Xa(t),f=u!==t&&!On(t);let h=s,_=!1;u!==t&&(f?(_=l.length===0,h=function(C,T,M){return _&&(_=!1,C=Qn(t,C)),s.call(this,C,Qn(t,T),M,t)}):s.length>3&&(h=function(C,T,M){return s.call(this,C,T,M,t)}));const y=u[i](h,...l);return _?Qn(t,y):y}function kr(t,i,s){const l=ft(t);qt(l,"iterate",Hs);const u=l[i](...s);return(u===-1||u===!1)&&al(s[0])?(s[0]=ft(s[0]),l[i](...s)):u}function Ls(t,i,s=[]){ii(),el();const l=ft(t)[i].apply(t,s);return tl(),oi(),l}const Od=Yr("__proto__,__v_isRef,__isVue"),qu=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Zn));function zd(t){Zn(t)||(t=String(t));const i=ft(this);return qt(i,"has",t),i.hasOwnProperty(t)}class Yu{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:ec:f?Qu:Xu).get(i)||Object.getPrototypeOf(i)===Object.getPrototypeOf(l)?i:void 0;const h=Fe(i);if(!u){let y;if(h&&(y=Md[s]))return y;if(s==="hasOwnProperty")return zd}const _=Reflect.get(i,s,Xt(i)?i:l);if((Zn(s)?qu.has(s):Od(s))||(u||qt(i,"get",s),f))return _;if(Xt(_)){const y=h&&Xr(s)?_:_.value;return u&>(y)?Dr(y):y}return gt(_)?u?Dr(_):kt(_):_}}class Ju extends Yu{constructor(i=!1){super(!1,i)}set(i,s,l,u){let f=i[s];const h=Fe(i)&&Xr(s);if(!this._isShallow){const C=wi(f);if(!On(l)&&!wi(l)&&(f=ft(f),l=ft(l)),!h&&Xt(f)&&!Xt(l))return C||(f.value=l),!0}const _=h?Number(s)t,Ca=t=>Reflect.getPrototypeOf(t);function Fd(t,i,s){return function(...l){const u=this.__v_raw,f=ft(u),h=Yo(f),_=t==="entries"||t===Symbol.iterator&&h,y=t==="keys"&&h,C=u[t](...l),T=s?Nr:i?ns:Hn;return!i&&qt(f,"iterate",y?$r:_o),Ft(Object.create(C),{next(){const{value:M,done:R}=C.next();return R?{value:M,done:R}:{value:_?[T(M[0]),T(M[1])]:T(M),done:R}}})}}function La(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=ft(f),_=ft(u);t||(ti(u,_)&&qt(h,"get",u),qt(h,"get",_));const{has:y}=Ca(h),C=i?Nr:t?ns:Hn;if(y.call(h,u))return C(f.get(u));if(y.call(h,_))return C(f.get(_));f!==h&&f.get(u)},get size(){const u=this.__v_raw;return!t&&qt(ft(u),"iterate",_o),u.size},has(u){const f=this.__v_raw,h=ft(f),_=ft(u);return t||(ti(u,_)&&qt(h,"has",u),qt(h,"has",_)),u===_?f.has(u):f.has(u)||f.has(_)},forEach(u,f){const h=this,_=h.__v_raw,y=ft(_),C=i?Nr:t?ns:Hn;return!t&&qt(y,"iterate",_o),_.forEach((T,M)=>u.call(f,C(T),C(M),h))}};return Ft(s,t?{add:La("add"),set:La("set"),delete:La("delete"),clear:La("clear")}:{add(u){const f=ft(this),h=Ca(f),_=ft(u),y=!i&&!On(u)&&!wi(u)?_:u;return h.has.call(f,y)||ti(u,y)&&h.has.call(f,u)||ti(_,y)&&h.has.call(f,_)||(f.add(y),bi(f,"add",y,y)),this},set(u,f){!i&&!On(f)&&!wi(f)&&(f=ft(f));const h=ft(this),{has:_,get:y}=Ca(h);let C=_.call(h,u);C||(u=ft(u),C=_.call(h,u));const T=y.call(h,u);return h.set(u,f),C?ti(f,T)&&bi(h,"set",u,f):bi(h,"add",u,f),this},delete(u){const f=ft(this),{has:h,get:_}=Ca(f);let y=h.call(f,u);y||(u=ft(u),y=h.call(f,u)),_&&_.call(f,u);const C=f.delete(u);return y&&bi(f,"delete",u,void 0),C},clear(){const u=ft(this),f=u.size!==0,h=u.clear();return f&&bi(u,"clear",void 0,void 0),h}}),["keys","values","entries",Symbol.iterator].forEach(u=>{s[u]=Fd(u,t,i)}),s}function ol(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(mt(s,u)&&u in l?s:l,u,f)}const Bd={get:ol(!1,!1)},Ud={get:ol(!1,!0)},Vd={get:ol(!0,!1)};const Xu=new WeakMap,Qu=new WeakMap,ec=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 kt(t){return wi(t)?t:sl(t,!1,$d,Bd,Xu)}function jd(t){return sl(t,!1,Dd,Ud,Qu)}function Dr(t){return sl(t,!0,Nd,Vd,ec)}function sl(t,i,s,l,u){if(!gt(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 bo(t){return wi(t)?bo(t.__v_raw):!!(t&&t.__v_isReactive)}function wi(t){return!!(t&&t.__v_isReadonly)}function On(t){return!!(t&&t.__v_isShallow)}function al(t){return t?!!t.__v_raw:!1}function ft(t){const i=t&&t.__v_raw;return i?ft(i):t}function Wd(t){return!mt(t,"__v_skip")&&Object.isExtensible(t)&&Du(t,"__v_skip",!0),t}const Hn=t=>gt(t)?kt(t):t,ns=t=>gt(t)?Dr(t):t;function Xt(t){return t?t.__v_isRef===!0:!1}function Z(t){return Kd(t,!1)}function Kd(t,i){return Xt(t)?t:new Gd(t,i)}class Gd{constructor(i,s){this.dep=new il,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?i:ft(i),this._value=s?i:Hn(i),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(i){const s=this._rawValue,l=this.__v_isShallow||On(i)||wi(i);i=l?i:ft(i),ti(i,s)&&(this._rawValue=i,this._value=l?i:Hn(i),this.dep.trigger())}}function Oe(t){return Xt(t)?t.value:t}const qd={get:(t,i,s)=>i==="__v_raw"?t:Oe(Reflect.get(t,i,s)),set:(t,i,s,l)=>{const u=t[i];return Xt(u)&&!Xt(s)?(u.value=s,!0):Reflect.set(t,i,s,l)}};function tc(t){return bo(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 il(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Zs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=l}notify(){if(this.flags|=16,!(this.flags&8)&&wt!==this)return Zu(this,!0),!0}get value(){const i=this.dep.track();return Wu(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 Aa={},$a=new WeakMap;let mo;function Xd(t,i=!1,s=mo){if(s){let l=$a.get(s);l||$a.set(s,l=[]),l.push(t)}}function Qd(t,i,s=bt){const{immediate:l,deep:u,once:f,scheduler:h,augmentJob:_,call:y}=s,C=fe=>u?fe:On(fe)||u===!1||u===0?yi(fe,1):yi(fe);let T,M,R,B,j=!1,F=!1;if(Xt(t)?(M=()=>t.value,j=On(t)):bo(t)?(M=()=>C(t),j=!0):Fe(t)?(F=!0,j=t.some(fe=>bo(fe)||On(fe)),M=()=>t.map(fe=>{if(Xt(fe))return fe.value;if(bo(fe))return C(fe);if(Je(fe))return y?y(fe,2):fe()})):Je(t)?i?M=y?()=>y(t,2):t:M=()=>{if(R){ii();try{R()}finally{oi()}}const fe=mo;mo=T;try{return y?y(t,3,[B]):t(B)}finally{mo=fe}}:M=ni,i&&u){const fe=M,Ue=u===!0?1/0:u;M=()=>yi(fe(),Ue)}const he=Cd(),pe=()=>{T.stop(),he&&he.active&&Jr(he.effects,T)};if(f&&i){const fe=i;i=(...Ue)=>{const $e=fe(...Ue);return pe(),$e}}let Y=F?new Array(t.length).fill(Aa):Aa;const Le=fe=>{if(!(!(T.flags&1)||!T.dirty&&!fe))if(i){const Ue=T.run();if(fe||u||j||(F?Ue.some(($e,Ie)=>ti($e,Y[Ie])):ti(Ue,Y))){R&&R();const $e=mo;mo=T;try{const Ie=[Ue,Y===Aa?void 0:F&&Y[0]===Aa?[]:Y,B];Y=Ue,y?y(i,3,Ie):i(...Ie)}finally{mo=$e}}}else T.run()};return _&&_(Le),T=new Uu(M),T.scheduler=h?()=>h(Le,!1):Le,B=fe=>Xd(fe,!1,T),R=T.onStop=()=>{const fe=$a.get(T);if(fe){if(y)y(fe,4);else for(const Ue of fe)Ue();$a.delete(T)}},i?l?Le(!0):Y=T.run():h?h(Le.bind(null,!0),!0):T.run(),pe.pause=T.pause.bind(T),pe.resume=T.resume.bind(T),pe.stop=pe,pe}function yi(t,i=1/0,s){if(i<=0||!gt(t)||t.__v_skip||(s=s||new Map,(s.get(t)||0)>=i))return t;if(s.set(t,i),i--,Xt(t))yi(t.value,i,s);else if(Fe(t))for(let l=0;l{yi(l,i,s)});else if($u(t)){for(const l in t)yi(t[l],i,s);for(const l of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,l)&&yi(t[l],i,s)}return t}/** +* @vue/runtime-core v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/function Xs(t,i,s,l){try{return l?t(...l):t()}catch(u){Qa(u,i,s)}}function In(t,i,s,l){if(Je(t)){const u=Xs(t,i,s,l);return u&&zu(u)&&u.catch(f=>{Qa(f,i,s)}),u}if(Fe(t)){const u=[];for(let f=0;f>>1,u=sn[l],f=js(u);f=js(s)?sn.push(t):sn.splice(tf(i),0,t),t.flags|=1,oc()}}function oc(){Na||(Na=nc.then(ac))}function nf(t){Fe(t)?Jo.push(...t):Vi&&t.id===-1?Vi.splice(Go+1,0,t):t.flags&1||(Jo.push(t),t.flags|=1),oc()}function Ol(t,i,s=Xn+1){for(;sjs(s)-js(l));if(Jo.length=0,Vi){Vi.push(...i);return}for(Vi=i,Go=0;Got.id==null?t.flags&2?-1:1/0:t.id;function ac(t){try{for(Xn=0;Xn{l._d&&Ba(-1);const f=Da(i);let h;try{h=t(...u)}finally{Da(f),l._d&&Ba(1)}return h};return l._n=!0,l._c=!0,l._d=!0,l}function ee(t,i){if(Jt===null)return t;const s=or(Jt),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=()=>Rs(of);function $t(t,i,s){return uc(t,i,s)}function uc(t,i,s=bt){const{immediate:l,deep:u,flush:f,once:h}=s,_=Ft({},s),y=i&&l||!i&&f!=="post";let C;if(qs){if(f==="sync"){const B=sf();C=B.__watcherHandles||(B.__watcherHandles=[])}else if(!y){const B=()=>{};return B.stop=ni,B.resume=ni,B.pause=ni,B}}const T=an;_.call=(B,j,F)=>In(B,T,j,F);let M=!1;f==="post"?_.scheduler=B=>{on(B,T&&T.suspense)}:f!=="sync"&&(M=!0,_.scheduler=(B,j)=>{j?B():rl(B)}),_.augmentJob=B=>{i&&(B.flags|=4),M&&(B.flags|=2,T&&(B.id=T.uid,B.i=T))};const R=Qd(t,i,_);return qs&&(C?C.push(R):y&&R()),R}function af(t,i,s){const l=this.proxy,u=Pt(t)?t.includes(".")?cc(l,t):()=>l[t]:t.bind(l,l);let f;Je(i)?f=i:(f=i.handler,s=i);const h=Qs(this),_=uc(u,f.bind(l),s);return h(),_}function cc(t,i){const s=i.split(".");return()=>{let l=t;for(let u=0;ut.__isTeleport,go=t=>t&&(t.disabled||t.disabled===""),rf=t=>t&&(t.defer||t.defer===""),zl=t=>typeof SVGElement<"u"&&t instanceof SVGElement,Il=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Fr=(t,i)=>{const s=t&&t.to;return Pt(s)?i?i(s):null:s},lf={name:"Teleport",__isTeleport:!0,process(t,i,s,l,u,f,h,_,y,C){const{mc:T,pc:M,pbc:R,o:{insert:B,querySelector:j,createText:F,createComment:he,parentNode:pe}}=C,Y=go(i.props);let{dynamicChildren:Le}=i;const fe=(Ie,qe,xe)=>{Ie.shapeFlag&16&&T(Ie.children,qe,xe,u,f,h,_,y)},Ue=(Ie=i)=>{const qe=go(Ie.props),xe=Ie.target=Fr(Ie.props,j),Se=Rr(xe,Ie,F,B);xe&&(h!=="svg"&&zl(xe)?h="svg":h!=="mathml"&&Il(xe)&&(h="mathml"),u&&u.isCE&&(u.ce._teleportTargets||(u.ce._teleportTargets=new Set)).add(xe),qe||(fe(Ie,xe,Se),Os(Ie,!1)))},$e=Ie=>{const qe=()=>{if(Ui.get(Ie)===qe){if(Ui.delete(Ie),go(Ie.props)){const xe=pe(Ie.el)||s;fe(Ie,xe,Ie.anchor),Os(Ie,!0)}Ue(Ie)}};Ui.set(Ie,qe),on(qe,f)};if(t==null){const Ie=i.el=F(""),qe=i.anchor=F("");if(B(Ie,s,l),B(qe,s,l),rf(i.props)||f&&f.pendingBranch){$e(i);return}Y&&(fe(i,s,qe),Os(i,!0)),Ue()}else{i.el=t.el;const Ie=i.anchor=t.anchor,qe=Ui.get(t);if(qe){qe.flags|=8,Ui.delete(t),$e(i);return}i.targetStart=t.targetStart;const xe=i.target=t.target,Se=i.targetAnchor=t.targetAnchor,ze=go(t.props),ie=ze?s:xe,je=ze?Ie:Se;if(h==="svg"||zl(xe)?h="svg":(h==="mathml"||Il(xe))&&(h="mathml"),Le?(R(t.dynamicChildren,Le,ie,u,f,h,_),cl(t,i,!0)):y||M(t,i,ie,je,u,f,h,_,!1),Y)ze?i.props&&t.props&&i.props.to!==t.props.to&&(i.props.to=t.props.to):Ma(i,s,Ie,C,1);else if((i.props&&i.props.to)!==(t.props&&t.props.to)){const oe=Fr(i.props,j);oe&&(i.target=oe,Ma(i,oe,null,C,0))}else ze&&Ma(i,xe,Se,C,1);Os(i,Y)}},remove(t,i,s,{um:l,o:{remove:u}},f){const{shapeFlag:h,children:_,anchor:y,targetStart:C,targetAnchor:T,target:M,props:R}=t,B=go(R),j=f||!B,F=Ui.get(t);if(F&&(F.flags|=8,Ui.delete(t)),M&&(u(C),u(T)),f&&u(y),!F&&(B||M)&&h&16)for(let he=0;he<_.length;he++){const pe=_[he];l(pe,i,s,j,!!pe.dynamicChildren)}},move:Ma,hydrate:uf};function Ma(t,i,s,{o:{insert:l},m:u},f=2){f===0&&l(t.targetAnchor,i,s);const{el:h,anchor:_,shapeFlag:y,children:C,props:T}=t,M=f===2;if(M&&l(h,i,s),!Ui.has(t)&&(!M||go(T))&&y&16)for(let R=0;R{t.isMounted=!0}),ss(()=>{t.isUnmounting=!0}),t}const Mn=[Function,Array],hc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Mn,onEnter:Mn,onAfterEnter:Mn,onEnterCancelled:Mn,onBeforeLeave:Mn,onLeave:Mn,onAfterLeave:Mn,onLeaveCancelled:Mn,onBeforeAppear:Mn,onAppear:Mn,onAfterAppear:Mn,onAppearCancelled:Mn},pc=t=>{const i=t.subTree;return i.component?pc(i.component):i},ff={name:"BaseTransition",props:hc,setup(t,{slots:i}){const s=Bc(),l=df();return()=>{const u=i.default&&vc(i.default(),!0),f=u&&u.length?mc(u):s.subTree?N():void 0;if(!f)return;const h=ft(t),{mode:_}=h;if(l.isLeaving)return Sr(f);const y=$l(f);if(!y)return Sr(f);let C=Br(y,h,l,s,M=>C=M);y.type!==Yt&&Ws(y,C);let T=s.subTree&&$l(s.subTree);if(T&&T.type!==Yt&&!vo(T,y)&&pc(s).type!==Yt){let M=Br(T,h,l,s);if(Ws(T,M),_==="out-in"&&y.type!==Yt)return l.isLeaving=!0,M.afterLeave=()=>{l.isLeaving=!1,s.job.flags&8||s.update(),delete M.afterLeave,T=void 0},Sr(f);_==="in-out"&&y.type!==Yt?M.delayLeave=(R,B,j)=>{const F=gc(l,T);F[String(T.key)]=T,R[En]=()=>{B(),R[En]=void 0,delete C.delayedLeave,T=void 0},C.delayedLeave=()=>{j(),delete C.delayedLeave,T=void 0}}:T=void 0}else T&&(T=void 0);return f}}};function mc(t){let i=t[0];if(t.length>1){for(const s of t)if(s.type!==Yt){i=s;break}}return i}const hf=ff;function gc(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 Br(t,i,s,l,u){const{appear:f,mode:h,persisted:_=!1,onBeforeEnter:y,onEnter:C,onAfterEnter:T,onEnterCancelled:M,onBeforeLeave:R,onLeave:B,onAfterLeave:j,onLeaveCancelled:F,onBeforeAppear:he,onAppear:pe,onAfterAppear:Y,onAppearCancelled:Le}=i,fe=String(t.key),Ue=gc(s,t),$e=(xe,Se)=>{xe&&In(xe,l,9,Se)},Ie=(xe,Se)=>{const ze=Se[1];$e(xe,Se),Fe(xe)?xe.every(ie=>ie.length<=1)&&ze():xe.length<=1&&ze()},qe={mode:h,persisted:_,beforeEnter(xe){let Se=y;if(!s.isMounted)if(f)Se=he||y;else return;xe[En]&&xe[En](!0);const ze=Ue[fe];ze&&vo(t,ze)&&ze.el[En]&&ze.el[En](),$e(Se,[xe])},enter(xe){if(Ue[fe]===t)return;let Se=C,ze=T,ie=M;if(!s.isMounted)if(f)Se=pe||C,ze=Y||T,ie=Le||M;else return;let je=!1;xe[As]=We=>{je||(je=!0,We?$e(ie,[xe]):$e(ze,[xe]),qe.delayedLeave&&qe.delayedLeave(),xe[As]=void 0)};const oe=xe[As].bind(null,!1);Se?Ie(Se,[xe,oe]):oe()},leave(xe,Se){const ze=String(t.key);if(xe[As]&&xe[As](!0),s.isUnmounting)return Se();$e(R,[xe]);let ie=!1;xe[En]=oe=>{ie||(ie=!0,Se(),oe?$e(F,[xe]):$e(j,[xe]),xe[En]=void 0,Ue[ze]===t&&delete Ue[ze])};const je=xe[En].bind(null,!1);Ue[ze]=t,B?Ie(B,[xe,je]):je()},clone(xe){const Se=Br(xe,i,s,l,u);return u&&u(Se),Se}};return qe}function Sr(t){if(er(t))return t=Hi(t),t.children=null,t}function $l(t){if(!er(t))return fc(t.type)&&t.children?mc(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 Ws(t,i){t.shapeFlag&6&&t.component?(t.transition=i,Ws(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 vc(t,i=!1,s){let l=[],u=0;for(let f=0;f1)for(let f=0;fBs(F,i&&(Fe(i)?i[he]:i),s,l,u));return}if(Xo(l)&&!u){l.shapeFlag&512&&l.type.__asyncResolved&&l.component.subTree.component&&Bs(t,i,s,l.component.subTree);return}const f=l.shapeFlag&4?or(l.component):l.el,h=u?null:f,{i:_,r:y}=t,C=i&&i.r,T=_.refs===bt?_.refs={}:_.refs,M=_.setupState,R=ft(M),B=M===bt?Ou:F=>Nl(T,F)?!1:mt(R,F),j=(F,he)=>!(he&&Nl(T,he));if(C!=null&&C!==y){if(Dl(i),Pt(C))T[C]=null,B(C)&&(M[C]=null);else if(Xt(C)){const F=i;j(C,F.k)&&(C.value=null),F.k&&(T[F.k]=null)}}if(Je(y)){ii();try{Xs(y,_,12,[h,T])}finally{oi()}}else{const F=Pt(y),he=Xt(y);if(F||he){const pe=()=>{if(t.f){const Y=F?B(y)?M[y]:T[y]:j()||!t.k?y.value:T[t.k];if(u)Fe(Y)&&Jr(Y,f);else if(Fe(Y))Y.includes(f)||Y.push(f);else if(F)T[y]=[f],B(y)&&(M[y]=T[y]);else{const Le=[f];j(y,t.k)&&(y.value=Le),t.k&&(T[t.k]=Le)}}else F?(T[y]=h,B(y)&&(M[y]=h)):he&&(j(y,t.k)&&(y.value=h),t.k&&(T[t.k]=h))};if(h){const Y=()=>{pe(),Fa.delete(t)};Y.id=-1,Fa.set(t,Y),on(Y,s)}else Dl(t),pe()}}}function Dl(t){const i=Fa.get(t);i&&(i.flags|=8,Fa.delete(t))}Ja().requestIdleCallback;Ja().cancelIdleCallback;const Xo=t=>!!t.type.__asyncLoader,er=t=>t.type.__isKeepAlive;function pf(t,i){bc(t,"a",i)}function mf(t,i){bc(t,"da",i)}function bc(t,i,s=an){const l=t.__wdc||(t.__wdc=()=>{let u=s;for(;u;){if(u.isDeactivated)return;u=u.parent}return t()});if(tr(i,l,s),s){let u=s.parent;for(;u&&u.parent;)er(u.parent.vnode)&&gf(l,i,s,u),u=u.parent}}function gf(t,i,s,l){const u=tr(i,t,l,!0);yc(()=>{Jr(l[i],u)},s)}function tr(t,i,s=an,l=!1){if(s){const u=s[t]||(s[t]=[]),f=i.__weh||(i.__weh=(...h)=>{ii();const _=Qs(s),y=In(i,s,t,h);return _(),oi(),y});return l?u.unshift(f):u.push(f),f}}const Si=t=>(i,s=an)=>{(!qs||t==="sp")&&tr(t,(...l)=>i(...l),s)},vf=Si("bm"),ki=Si("m"),_f=Si("bu"),bf=Si("u"),ss=Si("bum"),yc=Si("um"),yf=Si("sp"),xf=Si("rtg"),wf=Si("rtc");function kf(t,i=an){tr("ec",t,i)}const Sf=Symbol.for("v-ndc");function Re(t,i,s,l){let u;const f=s,h=Fe(t);if(h||Pt(t)){const _=h&&bo(t);let y=!1,C=!1;_&&(y=!On(t),C=wi(t),t=Xa(t)),u=new Array(t.length);for(let T=0,M=t.length;Ti(_,y,void 0,f));else{const _=Object.keys(t);u=new Array(_.length);for(let y=0,C=_.length;y0;return p(),ot(ue,null,[A("slot",s,l)],C?-2:64)}let f=t[i];f&&f._c&&(f._d=!1),p();const h=f&&xc(f(s)),_=s.key||h&&h.key,y=ot(ue,{key:(_&&!Zn(_)?_:`_${i}`)+(!h&&l?"_fb":"")},h||[],h&&t._===1?64:-2);return y.scopeId&&(y.slotScopeIds=[y.scopeId+"-s"]),f&&f._c&&(f._d=!0),y}function xc(t){return t.some(i=>Gs(i)?!(i.type===Yt||i.type===ue&&!xc(i.children)):!0)?t:null}const Ur=t=>t?Uc(t)?or(t):Ur(t.parent):null,Us=Ft(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=>Ur(t.parent),$root:t=>Ur(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>kc(t),$forceUpdate:t=>t.f||(t.f=()=>{rl(t.update)}),$nextTick:t=>t.n||(t.n=ic.bind(t.proxy)),$watch:t=>af.bind(t)}),Tr=(t,i)=>t!==bt&&!t.__isScriptSetup&&mt(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:y}=t;if(i[0]!=="$"){const R=h[i];if(R!==void 0)switch(R){case 1:return l[i];case 2:return u[i];case 4:return s[i];case 3:return f[i]}else{if(Tr(l,i))return h[i]=1,l[i];if(u!==bt&&mt(u,i))return h[i]=2,u[i];if(mt(f,i))return h[i]=3,f[i];if(s!==bt&&mt(s,i))return h[i]=4,s[i];Vr&&(h[i]=0)}}const C=Us[i];let T,M;if(C)return i==="$attrs"&&qt(t.attrs,"get",""),C(t);if((T=_.__cssModules)&&(T=T[i]))return T;if(s!==bt&&mt(s,i))return h[i]=4,s[i];if(M=y.config.globalProperties,mt(M,i))return M[i]},set({_:t},i,s){const{data:l,setupState:u,ctx:f}=t;return Tr(u,i)?(u[i]=s,!0):l!==bt&&mt(l,i)?(l[i]=s,!0):mt(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 y;return!!(s[_]||t!==bt&&_[0]!=="$"&&mt(t,_)||Tr(i,_)||mt(f,_)||mt(l,_)||mt(Us,_)||mt(u.config.globalProperties,_)||(y=h.__cssModules)&&y[_])},defineProperty(t,i,s){return s.get!=null?t._.accessCache[i]=0:mt(s,"value")&&this.set(t,i,s.value,null),Reflect.defineProperty(t,i,s)}};function Fl(t){return Fe(t)?t.reduce((i,s)=>(i[s]=null,i),{}):t}let Vr=!0;function Cf(t){const i=kc(t),s=t.proxy,l=t.ctx;Vr=!1,i.beforeCreate&&Rl(i.beforeCreate,t,"bc");const{data:u,computed:f,methods:h,watch:_,provide:y,inject:C,created:T,beforeMount:M,mounted:R,beforeUpdate:B,updated:j,activated:F,deactivated:he,beforeDestroy:pe,beforeUnmount:Y,destroyed:Le,unmounted:fe,render:Ue,renderTracked:$e,renderTriggered:Ie,errorCaptured:qe,serverPrefetch:xe,expose:Se,inheritAttrs:ze,components:ie,directives:je,filters:oe}=i;if(C&&Lf(C,l,null),h)for(const ce in h){const ae=h[ce];Je(ae)&&(l[ce]=ae.bind(s))}if(u){const ce=u.call(s,s);gt(ce)&&(t.data=kt(ce))}if(Vr=!0,f)for(const ce in f){const ae=f[ce],st=Je(ae)?ae.bind(s,s):Je(ae.get)?ae.get.bind(s,s):ni,te=!Je(ae)&&Je(ae.set)?ae.set.bind(s):ni,ke=ve({get:st,set:te});Object.defineProperty(l,ce,{enumerable:!0,configurable:!0,get:()=>ke.value,set:Ne=>ke.value=Ne})}if(_)for(const ce in _)wc(_[ce],l,s,ce);if(y){const ce=Je(y)?y.call(s):y;Reflect.ownKeys(ce).forEach(ae=>{lc(ae,ce[ae])})}T&&Rl(T,t,"c");function le(ce,ae){Fe(ae)?ae.forEach(st=>ce(st.bind(s))):ae&&ce(ae.bind(s))}if(le(vf,M),le(ki,R),le(_f,B),le(bf,j),le(pf,F),le(mf,he),le(kf,qe),le(wf,$e),le(xf,Ie),le(ss,Y),le(yc,fe),le(yf,xe),Fe(Se))if(Se.length){const ce=t.exposed||(t.exposed={});Se.forEach(ae=>{Object.defineProperty(ce,ae,{get:()=>s[ae],set:st=>s[ae]=st,enumerable:!0})})}else t.exposed||(t.exposed={});Ue&&t.render===ni&&(t.render=Ue),ze!=null&&(t.inheritAttrs=ze),ie&&(t.components=ie),je&&(t.directives=je),xe&&_c(t)}function Lf(t,i,s=ni){Fe(t)&&(t=Zr(t));for(const l in t){const u=t[l];let f;gt(u)?"default"in u?f=Rs(u.from||l,u.default,!0):f=Rs(u.from||l):f=Rs(u),Xt(f)?Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>f.value,set:h=>f.value=h}):i[l]=f}}function Rl(t,i,s){In(Fe(t)?t.map(l=>l.bind(i.proxy)):t.bind(i.proxy),i,s)}function wc(t,i,s,l){let u=l.includes(".")?cc(s,l):()=>s[l];if(Pt(t)){const f=i[t];Je(f)&&$t(u,f)}else if(Je(t))$t(u,t.bind(s));else if(gt(t))if(Fe(t))t.forEach(f=>wc(f,i,s,l));else{const f=Je(t.handler)?t.handler.bind(s):i[t.handler];Je(f)&&$t(u,f,t)}}function kc(t){const i=t.type,{mixins:s,extends:l}=i,{mixins:u,optionsCache:f,config:{optionMergeStrategies:h}}=t.appContext,_=f.get(i);let y;return _?y=_:!u.length&&!s&&!l?y=i:(y={},u.length&&u.forEach(C=>Ra(y,C,h,!0)),Ra(y,i,h)),gt(i)&&f.set(i,y),y}function Ra(t,i,s,l=!1){const{mixins:u,extends:f}=i;f&&Ra(t,f,s,!0),u&&u.forEach(h=>Ra(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:Bl,props:Ul,emits:Ul,methods:zs,computed:zs,beforeCreate:nn,created:nn,beforeMount:nn,mounted:nn,beforeUpdate:nn,updated:nn,beforeDestroy:nn,beforeUnmount:nn,destroyed:nn,unmounted:nn,activated:nn,deactivated:nn,errorCaptured:nn,serverPrefetch:nn,components:zs,directives:zs,watch:Ef,provide:Bl,inject:Mf};function Bl(t,i){return i?t?function(){return Ft(Je(t)?t.call(this,this):t,Je(i)?i.call(this,this):i)}:i:t}function Mf(t,i){return zs(Zr(t),Zr(i))}function Zr(t){if(Fe(t)){const i={};for(let s=0;si==="modelValue"||i==="model-value"?t.modelModifiers:t[`${i}Modifiers`]||t[`${Un(i)}Modifiers`]||t[`${Wi(i)}Modifiers`];function $f(t,i,...s){if(t.isUnmounted)return;const l=t.vnode.props||bt;let u=s;const f=i.startsWith("update:"),h=f&&If(l,i.slice(7));h&&(h.trim&&(u=s.map(T=>Pt(T)?T.trim():T)),h.number&&(u=s.map(Ya)));let _,y=l[_=br(i)]||l[_=br(Un(i))];!y&&f&&(y=l[_=br(Wi(i))]),y&&In(y,t,6,u);const C=l[_+"Once"];if(C){if(!t.emitted)t.emitted={};else if(t.emitted[_])return;t.emitted[_]=!0,In(C,t,6,u)}}const Nf=new WeakMap;function Tc(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 y=C=>{const T=Tc(C,i,!0);T&&(_=!0,Ft(h,T))};!s&&i.mixins.length&&i.mixins.forEach(y),t.extends&&y(t.extends),t.mixins&&t.mixins.forEach(y)}return!f&&!_?(gt(t)&&l.set(t,null),null):(Fe(f)?f.forEach(y=>h[y]=null):Ft(h,f),gt(t)&&l.set(t,h),h)}function nr(t,i){return!t||!Ka(i)?!1:(i=i.slice(2),i=i==="Once"?i:i.replace(/Once$/,""),mt(t,i[0].toLowerCase()+i.slice(1))||mt(t,Wi(i))||mt(t,i))}function Vl(t){const{type:i,vnode:s,proxy:l,withProxy:u,propsOptions:[f],slots:h,attrs:_,emit:y,render:C,renderCache:T,props:M,data:R,setupState:B,ctx:j,inheritAttrs:F}=t,he=Da(t);let pe,Y;try{if(s.shapeFlag&4){const fe=u||l,Ue=fe;pe=ei(C.call(Ue,fe,T,M,B,R,j)),Y=_}else{const fe=i;pe=ei(fe.length>1?fe(M,{attrs:_,slots:h,emit:y}):fe(M,null)),Y=i.props?_:Df(_)}}catch(fe){Vs.length=0,Qa(fe,t,1),pe=A(Yt)}let Le=pe;if(Y&&F!==!1){const fe=Object.keys(Y),{shapeFlag:Ue}=Le;fe.length&&Ue&7&&(f&&fe.some(Ga)&&(Y=Ff(Y,f)),Le=Hi(Le,Y,!1,!0))}return s.dirs&&(Le=Hi(Le,null,!1,!0),Le.dirs=Le.dirs?Le.dirs.concat(s.dirs):s.dirs),s.transition&&Ws(Le,s.transition),pe=Le,Da(he),pe}const Df=t=>{let i;for(const s in t)(s==="class"||s==="style"||Ka(s))&&((i||(i={}))[s]=t[s]);return i},Ff=(t,i)=>{const s={};for(const l in t)(!Ga(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:y}=i,C=f.emitsOptions;if(i.dirs||i.transition)return!0;if(s&&y>=0){if(y&1024)return!0;if(y&16)return l?Zl(l,h,C):!!h;if(y&8){const T=i.dynamicProps;for(let M=0;MObject.create(Cc),Ac=t=>Object.getPrototypeOf(t)===Cc;function Uf(t,i,s,l=!1){const u={},f=Lc();t.propsDefaults=Object.create(null),Mc(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,_=ft(u),[y]=t.propsOptions;let C=!1;if((l||h>0)&&!(h&16)){if(h&8){const T=t.vnode.dynamicProps;for(let M=0;M{y=!0;const[R,B]=Ec(M,i,!0);Ft(h,R),B&&_.push(...B)};!s&&i.mixins.length&&i.mixins.forEach(T),t.extends&&T(t.extends),t.mixins&&t.mixins.forEach(T)}if(!f&&!y)return gt(t)&&l.set(t,qo),qo;if(Fe(f))for(let T=0;Tt==="_"||t==="_ctx"||t==="$stable",ul=t=>Fe(t)?t.map(ei):[ei(t)],Hf=(t,i,s)=>{if(i._n)return i;const l=we((...u)=>ul(i(...u)),s);return l._c=!1,l},Oc=(t,i,s)=>{const l=t._ctx;for(const u in t){if(ll(u))continue;const f=t[u];if(Je(f))i[u]=Hf(u,f,l);else if(f!=null){const h=ul(f);i[u]=()=>h}}},zc=(t,i)=>{const s=ul(i);t.slots.default=()=>s},Ic=(t,i,s)=>{for(const l in i)(s||!ll(l))&&(t[l]=i[l])},jf=(t,i,s)=>{const l=t.slots=Lc();if(t.vnode.shapeFlag&32){const u=i._;u?(Ic(l,i,s),s&&Du(l,"_",u,!0)):Oc(i,l)}else i&&zc(t,i)},Wf=(t,i,s)=>{const{vnode:l,slots:u}=t;let f=!0,h=bt;if(l.shapeFlag&32){const _=i._;_?s&&_===1?f=!1:Ic(u,i,s):(f=!i.$stable,Oc(i,u)),h=i}else i&&(zc(t,i),h={default:1});if(f)for(const _ in u)!ll(_)&&h[_]==null&&delete u[_]},on=Jf;function Kf(t){return Gf(t)}function Gf(t,i){const s=Ja();s.__VUE__=!0;const{insert:l,remove:u,patchProp:f,createElement:h,createText:_,createComment:y,setText:C,setElementText:T,parentNode:M,nextSibling:R,setScopeId:B=ni,insertStaticContent:j}=t,F=(x,b,S,G=null,W=null,H=null,re=void 0,ne=null,Q=!!b.dynamicChildren)=>{if(x===b)return;x&&!vo(x,b)&&(G=E(x),Ne(x,W,H,!0),x=null),b.patchFlag===-2&&(Q=!1,b.dynamicChildren=null);const{type:q,ref:me,shapeFlag:se}=b;switch(q){case ir:he(x,b,S,G);break;case Yt:pe(x,b,S,G);break;case Cr:x==null&&Y(b,S,G,re);break;case ue:ie(x,b,S,G,W,H,re,ne,Q);break;default:se&1?Ue(x,b,S,G,W,H,re,ne,Q):se&6?je(x,b,S,G,W,H,re,ne,Q):(se&64||se&128)&&q.process(x,b,S,G,W,H,re,ne,Q,ut)}me!=null&&W?Bs(me,x&&x.ref,H,b||x,!b):me==null&&x&&x.ref!=null&&Bs(x.ref,null,H,x,!0)},he=(x,b,S,G)=>{if(x==null)l(b.el=_(b.children),S,G);else{const W=b.el=x.el;b.children!==x.children&&C(W,b.children)}},pe=(x,b,S,G)=>{x==null?l(b.el=y(b.children||""),S,G):b.el=x.el},Y=(x,b,S,G)=>{[x.el,x.anchor]=j(x.children,b,S,G,x.el,x.anchor)},Le=({el:x,anchor:b},S,G)=>{let W;for(;x&&x!==b;)W=R(x),l(x,S,G),x=W;l(b,S,G)},fe=({el:x,anchor:b})=>{let S;for(;x&&x!==b;)S=R(x),u(x),x=S;u(b)},Ue=(x,b,S,G,W,H,re,ne,Q)=>{if(b.type==="svg"?re="svg":b.type==="math"&&(re="mathml"),x==null)$e(b,S,G,W,H,re,ne,Q);else{const q=x.el&&x.el._isVueCE?x.el:null;try{q&&q._beginPatch(),xe(x,b,W,H,re,ne,Q)}finally{q&&q._endPatch()}}},$e=(x,b,S,G,W,H,re,ne)=>{let Q,q;const{props:me,shapeFlag:se,transition:Ce,dirs:Ae}=x;if(Q=x.el=h(x.type,H,me&&me.is,me),se&8?T(Q,x.children):se&16&&qe(x.children,Q,null,G,W,Pr(x,H),re,ne),Ae&&co(x,null,G,"created"),Ie(Q,x,x.scopeId,re,G),me){for(const et in me)et!=="value"&&!Ns(et)&&f(Q,et,null,me[et],H,G);"value"in me&&f(Q,"value",null,me.value,H),(q=me.onVnodeBeforeMount)&&Jn(q,G,x)}Ae&&co(x,null,G,"beforeMount");const He=qf(W,Ce);He&&Ce.beforeEnter(Q),l(Q,b,S),((q=me&&me.onVnodeMounted)||He||Ae)&&on(()=>{try{q&&Jn(q,G,x),He&&Ce.enter(Q),Ae&&co(x,null,G,"mounted")}finally{}},W)},Ie=(x,b,S,G,W)=>{if(S&&B(x,S),G)for(let H=0;H{for(let q=Q;q{const ne=b.el=x.el;let{patchFlag:Q,dynamicChildren:q,dirs:me}=b;Q|=x.patchFlag&16;const se=x.props||bt,Ce=b.props||bt;let Ae;if(S&&fo(S,!1),(Ae=Ce.onVnodeBeforeUpdate)&&Jn(Ae,S,b,x),me&&co(b,x,S,"beforeUpdate"),S&&fo(S,!0),q&&(!x.dynamicChildren||x.dynamicChildren.length!==q.length)&&(Q=0,re=!1,q=null),(se.innerHTML&&Ce.innerHTML==null||se.textContent&&Ce.textContent==null)&&T(ne,""),q?Se(x.dynamicChildren,q,ne,S,G,Pr(b,W),H):re||ae(x,b,ne,null,S,G,Pr(b,W),H,!1),Q>0){if(Q&16)ze(ne,se,Ce,S,W);else if(Q&2&&se.class!==Ce.class&&f(ne,"class",null,Ce.class,W),Q&4&&f(ne,"style",se.style,Ce.style,W),Q&8){const He=b.dynamicProps;for(let et=0;et{Ae&&Jn(Ae,S,b,x),me&&co(b,x,S,"updated")},G)},Se=(x,b,S,G,W,H,re)=>{for(let ne=0;ne{if(b!==S){if(b!==bt)for(const H in b)!Ns(H)&&!(H in S)&&f(x,H,b[H],null,W,G);for(const H in S){if(Ns(H))continue;const re=S[H],ne=b[H];re!==ne&&H!=="value"&&f(x,H,ne,re,W,G)}"value"in S&&f(x,"value",b.value,S.value,W)}},ie=(x,b,S,G,W,H,re,ne,Q)=>{const q=b.el=x?x.el:_(""),me=b.anchor=x?x.anchor:_("");let{patchFlag:se,dynamicChildren:Ce,slotScopeIds:Ae}=b;Ae&&(ne=ne?ne.concat(Ae):Ae),x==null?(l(q,S,G),l(me,S,G),qe(b.children||[],S,me,W,H,re,ne,Q)):se>0&&se&64&&Ce&&x.dynamicChildren&&x.dynamicChildren.length===Ce.length?(Se(x.dynamicChildren,Ce,S,W,H,re,ne),(b.key!=null||W&&b===W.subTree)&&cl(x,b,!0)):ae(x,b,S,me,W,H,re,ne,Q)},je=(x,b,S,G,W,H,re,ne,Q)=>{b.slotScopeIds=ne,x==null?b.shapeFlag&512?W.ctx.activate(b,S,G,re,Q):oe(b,S,G,W,H,re,Q):We(x,b,Q)},oe=(x,b,S,G,W,H,re)=>{const ne=x.component=oh(x,G,W);if(er(x)&&(ne.ctx.renderer=ut),sh(ne,!1,re),ne.asyncDep){if(W&&W.registerDep(ne,le,re),!x.el){const Q=ne.subTree=A(Yt);pe(null,Q,b,S),x.placeholder=Q.el}}else le(ne,x,b,S,W,H,re)},We=(x,b,S)=>{const G=b.component=x.component;if(Rf(x,b,S))if(G.asyncDep&&!G.asyncResolved){ce(G,b,S);return}else G.next=b,G.update();else b.el=x.el,G.vnode=b},le=(x,b,S,G,W,H,re)=>{const ne=()=>{if(x.isMounted){let{next:se,bu:Ce,u:Ae,parent:He,vnode:et}=x;{const vt=$c(x);if(vt){se&&(se.el=et.el,ce(x,se,re)),vt.asyncDep.then(()=>{on(()=>{x.isUnmounted||q()},W)});return}}let U=se,O;fo(x,!1),se?(se.el=et.el,ce(x,se,re)):se=et,Ce&&za(Ce),(O=se.props&&se.props.onVnodeBeforeUpdate)&&Jn(O,He,se,et),fo(x,!0);const Te=Vl(x),Ye=x.subTree;x.subTree=Te,F(Ye,Te,M(Ye.el),E(Ye),x,W,H),se.el=Te.el,U===null&&Bf(x,Te.el),Ae&&on(Ae,W),(O=se.props&&se.props.onVnodeUpdated)&&on(()=>Jn(O,He,se,et),W)}else{let se;const{el:Ce,props:Ae}=b,{bm:He,m:et,parent:U,root:O,type:Te}=x,Ye=Xo(b);fo(x,!1),He&&za(He),!Ye&&(se=Ae&&Ae.onVnodeBeforeMount)&&Jn(se,U,b),fo(x,!0);{O.ce&&O.ce._hasShadowRoot()&&O.ce._injectChildStyle(Te,x.parent?x.parent.type:void 0);const vt=x.subTree=Vl(x);F(null,vt,S,G,x,W,H),b.el=vt.el}if(et&&on(et,W),!Ye&&(se=Ae&&Ae.onVnodeMounted)){const vt=b;on(()=>Jn(se,U,vt),W)}(b.shapeFlag&256||U&&Xo(U.vnode)&&U.vnode.shapeFlag&256)&&x.a&&on(x.a,W),x.isMounted=!0,b=S=G=null}};x.scope.on();const Q=x.effect=new Uu(ne);x.scope.off();const q=x.update=Q.run.bind(Q),me=x.job=Q.runIfDirty.bind(Q);me.i=x,me.id=x.uid,Q.scheduler=()=>rl(me),fo(x,!0),q()},ce=(x,b,S)=>{b.component=x;const G=x.vnode.props;x.vnode=b,x.next=null,Vf(x,b.props,G,S),Wf(x,b.children,S),ii(),Ol(x),oi()},ae=(x,b,S,G,W,H,re,ne,Q=!1)=>{const q=x&&x.children,me=x?x.shapeFlag:0,se=b.children,{patchFlag:Ce,shapeFlag:Ae}=b;if(Ce>0){if(Ce&128){te(q,se,S,G,W,H,re,ne,Q);return}else if(Ce&256){st(q,se,S,G,W,H,re,ne,Q);return}}Ae&8?(me&16&&J(q,W,H),se!==q&&T(S,se)):me&16?Ae&16?te(q,se,S,G,W,H,re,ne,Q):J(q,W,H,!0):(me&8&&T(S,""),Ae&16&&qe(se,S,G,W,H,re,ne,Q))},st=(x,b,S,G,W,H,re,ne,Q)=>{x=x||qo,b=b||qo;const q=x.length,me=b.length,se=Math.min(q,me);let Ce;for(Ce=0;Ceme?J(x,W,H,!0,!1,se):qe(b,S,G,W,H,re,ne,Q,se)},te=(x,b,S,G,W,H,re,ne,Q)=>{let q=0;const me=b.length;let se=x.length-1,Ce=me-1;for(;q<=se&&q<=Ce;){const Ae=x[q],He=b[q]=Q?_i(b[q]):ei(b[q]);if(vo(Ae,He))F(Ae,He,S,null,W,H,re,ne,Q);else break;q++}for(;q<=se&&q<=Ce;){const Ae=x[se],He=b[Ce]=Q?_i(b[Ce]):ei(b[Ce]);if(vo(Ae,He))F(Ae,He,S,null,W,H,re,ne,Q);else break;se--,Ce--}if(q>se){if(q<=Ce){const Ae=Ce+1,He=AeCe)for(;q<=se;)Ne(x[q],W,H,!0),q++;else{const Ae=q,He=q,et=new Map;for(q=He;q<=Ce;q++){const de=b[q]=Q?_i(b[q]):ei(b[q]);de.key!=null&&et.set(de.key,q)}let U,O=0;const Te=Ce-He+1;let Ye=!1,vt=0;const yt=new Array(Te);for(q=0;q=Te){Ne(de,W,H,!0);continue}let St;if(de.key!=null)St=et.get(de.key);else for(U=He;U<=Ce;U++)if(yt[U-He]===0&&vo(de,b[U])){St=U;break}St===void 0?Ne(de,W,H,!0):(yt[St-He]=q+1,St>=vt?vt=St:Ye=!0,F(de,b[St],S,null,W,H,re,ne,Q),O++)}const rn=Ye?Yf(yt):qo;for(U=rn.length-1,q=Te-1;q>=0;q--){const de=He+q,St=b[de],pn=b[de+1],xo=de+1{const{el:H,type:re,transition:ne,children:Q,shapeFlag:q}=x;if(q&6){ke(x.component.subTree,b,S,G);return}if(q&128){x.suspense.move(b,S,G);return}if(q&64){re.move(x,b,S,ut);return}if(re===ue){l(H,b,S);for(let se=0;sene.enter(H),W));else{const{leave:se,delayLeave:Ce,afterLeave:Ae}=ne,He=()=>{x.ctx.isUnmounted?u(H):l(H,b,S)},et=()=>{const U=H._isLeaving||!!H[En];H._isLeaving&&H[En](!0),ne.persisted&&!U?He():se(H,()=>{He(),Ae&&Ae()})};Ce?Ce(H,He,et):et()}else l(H,b,S)},Ne=(x,b,S,G=!1,W=!1)=>{const{type:H,props:re,ref:ne,children:Q,dynamicChildren:q,shapeFlag:me,patchFlag:se,dirs:Ce,cacheIndex:Ae,memo:He}=x;if(se===-2&&(W=!1),ne!=null&&(ii(),Bs(ne,null,S,x,!0),oi()),Ae!=null&&(b.renderCache[Ae]=void 0),me&256){b.ctx.deactivate(x);return}const et=me&1&&Ce,U=!Xo(x);let O;if(U&&(O=re&&re.onVnodeBeforeUnmount)&&Jn(O,b,x),me&6)Ze(x.component,S,G);else{if(me&128){x.suspense.unmount(S,G);return}et&&co(x,null,b,"beforeUnmount"),me&64?x.type.remove(x,b,S,ut,G):q&&!q.hasOnce&&(H!==ue||se>0&&se&64)?J(q,b,S,!1,!0):(H===ue&&se&384||!W&&me&16)&&J(Q,b,S),G&&ht(x)}const Te=He!=null&&Ae==null;(U&&(O=re&&re.onVnodeUnmounted)||et||Te)&&on(()=>{O&&Jn(O,b,x),et&&co(x,null,b,"unmounted"),Te&&(x.el=null)},S)},ht=x=>{const{type:b,el:S,anchor:G,transition:W}=x;if(b===ue){lt(S,G);return}if(b===Cr){fe(x);return}const H=()=>{u(S),W&&!W.persisted&&W.afterLeave&&W.afterLeave()};if(x.shapeFlag&1&&W&&!W.persisted){const{leave:re,delayLeave:ne}=W,Q=()=>re(S,H);ne?ne(x.el,H,Q):Q()}else H()},lt=(x,b)=>{let S;for(;x!==b;)S=R(x),u(x),x=S;u(b)},Ze=(x,b,S)=>{const{bum:G,scope:W,job:H,subTree:re,um:ne,m:Q,a:q}=x;jl(Q),jl(q),G&&za(G),W.stop(),H&&(H.flags|=8,Ne(re,x,b,S)),ne&&on(ne,b),on(()=>{x.isUnmounted=!0},b)},J=(x,b,S,G=!1,W=!1,H=0)=>{for(let re=H;re{if(x.shapeFlag&6)return E(x.component.subTree);if(x.shapeFlag&128)return x.suspense.next();const b=R(x.anchor||x.el),S=b&&b[dc];return S?R(S):b};let z=!1;const _t=(x,b,S)=>{let G;x==null?b._vnode&&(Ne(b._vnode,null,null,!0),G=b._vnode.component):F(b._vnode||null,x,b,null,null,null,S),b._vnode=x,z||(z=!0,Ol(G),sc(),z=!1)},ut={p:F,um:Ne,m:ke,r:ht,mt:oe,mc:qe,pc:ae,pbc:Se,n:E,o:t};return{render:_t,hydrate:void 0,createApp:zf(_t)}}function Pr({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 fo({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 cl(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 $c(t){const i=t.subTree.component;if(i)return i.asyncDep&&!i.asyncResolved?i:$c(i)}function jl(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 ue=Symbol.for("v-fgt"),ir=Symbol.for("v-txt"),Yt=Symbol.for("v-cmt"),Cr=Symbol.for("v-stc"),Vs=[];let yn=null;function p(t=!1){Vs.push(yn=t?null:[])}function Xf(){Vs.pop(),yn=Vs[Vs.length-1]||null}let Ks=1;function Ba(t,i=!1){Ks+=t,t<0&&yn&&i&&(yn.hasOnce=!0)}function Fc(t){return t.dynamicChildren=Ks>0?yn||qo:null,Xf(),Ks>0&&yn&&yn.push(t),t}function m(t,i,s,l,u,f){return Fc(r(t,i,s,l,u,f,!0))}function ot(t,i,s,l,u){return Fc(A(t,i,s,l,u,!0))}function Gs(t){return t?t.__v_isVNode===!0:!1}function vo(t,i){return t.type===i.type&&t.key===i.key}const Rc=({key:t})=>t??null,Ia=({ref:t,ref_key:i,ref_for:s})=>(typeof t=="number"&&(t=""+t),t!=null?Pt(t)||Xt(t)||Je(t)?{i:Jt,r:t,k:i,f:!!s}:t:null);function r(t,i=null,s=null,l=0,u=null,f=t===ue?0:1,h=!1,_=!1){const y={__v_isVNode:!0,__v_skip:!0,type:t,props:i,key:i&&Rc(i),ref:i&&Ia(i),scopeId:rc,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:Jt};return _?(Ua(y,s),f&128&&t.normalize(y)):s&&(y.shapeFlag|=Pt(s)?8:16),Ks>0&&!h&&yn&&(y.patchFlag>0||f&6)&&y.patchFlag!==32&&yn.push(y),y}const A=Qf;function Qf(t,i=null,s=null,l=0,u=null,f=!1){if((!t||t===Sf)&&(t=Yt),Gs(t)){const _=Hi(t,i,!0);return s&&Ua(_,s),Ks>0&&!f&&yn&&(_.shapeFlag&6?yn[yn.indexOf(t)]=_:yn.push(_)),_.patchFlag=-2,_}if(uh(t)&&(t=t.__vccOpts),i){i=eh(i);let{class:_,style:y}=i;_&&!Pt(_)&&(i.class=Me(_)),gt(y)&&(al(y)&&!Fe(y)&&(y=Ft({},y)),i.style=ts(y))}const h=Pt(t)?1:Dc(t)?128:fc(t)?64:gt(t)?4:Je(t)?2:0;return r(t,i,s,l,u,h,f,!0)}function eh(t){return t?al(t)||Ac(t)?Ft({},t):t:null}function Hi(t,i,s=!1,l=!1){const{props:u,ref:f,patchFlag:h,children:_,transition:y}=t,C=i?th(u||{},i):u,T={__v_isVNode:!0,__v_skip:!0,type:t.type,props:C,key:C&&Rc(C),ref:i&&i.ref?s&&f?Fe(f)?f.concat(Ia(i)):[f,Ia(i)]:Ia(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!==ue?h===-1?16:h|16:h,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:y,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&Hi(t.ssContent),ssFallback:t.ssFallback&&Hi(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return y&&l&&Ws(T,y.clone(T)),T}function I(t=" ",i=0){return A(ir,null,t,i)}function N(t="",i=!1){return i?(p(),ot(Yt,null,t)):A(Yt,null,t)}function ei(t){return t==null||typeof t=="boolean"?A(Yt):Fe(t)?A(ue,null,t.slice()):Gs(t)?_i(t):A(ir,null,String(t))}function _i(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Hi(t)}function Ua(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),Ua(t,u()),u._c&&(u._d=!0));return}else{s=32;const u=i._;!u&&!Ac(i)?i._ctx=Jt:u===3&&Jt&&(Jt.slots._===1?i._=1:(i._=2,t.patchFlag|=1024))}else if(Je(i)){if(l&65){Ua(t,{default:i});return}i={default:i,_ctx:Jt},s=32}else i=String(i),l&64?(s=16,i=[I(i)]):s=8;t.children=i,t.shapeFlag|=s}function th(...t){const i={};for(let s=0;san||Jt;let Va,jr;{const t=Ja(),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)}};Va=i("__VUE_INSTANCE_SETTERS__",s=>an=s),jr=i("__VUE_SSR_SETTERS__",s=>qs=s)}const Qs=t=>{const i=an;return Va(t),t.scope.on(),()=>{t.scope.off(),Va(i)}},Wl=()=>{an&&an.scope.off(),Va(null)};function Uc(t){return t.vnode.shapeFlag&4}let qs=!1;function sh(t,i=!1,s=!1){i&&jr(i);const{props:l,children:u}=t.vnode,f=Uc(t);Uf(t,l,f,i),jf(t,u,s||i);const h=f?ah(t,i):void 0;return i&&jr(!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){ii();const u=t.setupContext=l.length>1?lh(t):null,f=Qs(t),h=Xs(l,t,0,[t.props,u]),_=zu(h);if(oi(),f(),(_||t.sp)&&!Xo(t)&&_c(t),_){if(h.then(Wl,Wl),i)return h.then(y=>{Kl(t,y)}).catch(y=>{Qa(y,t,0)});t.asyncDep=h}else Kl(t,h)}else Vc(t)}function Kl(t,i,s){Je(i)?t.type.__ssrInlineRender?t.ssrRender=i:t.render=i:gt(i)&&(t.setupState=tc(i)),Vc(t)}function Vc(t,i,s){const l=t.type;t.render||(t.render=l.render||ni);{const u=Qs(t);ii();try{Cf(t)}finally{oi(),u()}}}const rh={get(t,i){return qt(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 or(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(tc(Wd(t.exposed)),{get(i,s){if(s in i)return i[s];if(s in Us)return Us[s](t)},has(i,s){return s in i||s in Us}})):t.proxy}function uh(t){return Je(t)&&"__vccOpts"in t}const ve=(t,i)=>Jd(t,i,qs);function ch(t,i,s){try{Ba(-1);const l=arguments.length;return l===2?gt(i)&&!Fe(i)?Gs(i)?A(t,null,[i]):A(t,i):A(t,null,i):(l>3?s=Array.prototype.slice.call(arguments,2):l===3&&Gs(s)&&(s=[s]),A(t,i,s))}finally{Ba(1)}}const dh="3.5.39";/** +* @vue/runtime-dom v3.5.39 +* (c) 2018-present Yuxi (Evan) You and Vue contributors +* @license MIT +**/let Wr;const Gl=typeof window<"u"&&window.trustedTypes;if(Gl)try{Wr=Gl.createPolicy("vue",{createHTML:t=>t})}catch{}const Zc=Wr?t=>Wr.createHTML(t):t=>t,fh="http://www.w3.org/2000/svg",hh="http://www.w3.org/1998/Math/MathML",vi=typeof document<"u"?document:null,ql=vi&&vi.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"?vi.createElementNS(fh,t):i==="mathml"?vi.createElementNS(hh,t):s?vi.createElement(t,{is:s}):vi.createElement(t);return t==="select"&&l&&l.multiple!=null&&u.setAttribute("multiple",l.multiple),u},createText:t=>vi.createTextNode(t),createComment:t=>vi.createComment(t),setText:(t,i)=>{t.nodeValue=i},setElementText:(t,i)=>{t.textContent=i},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>vi.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{ql.innerHTML=Zc(l==="svg"?`${t}`:l==="mathml"?`${t}`:t);const _=ql.content;if(l==="svg"||l==="mathml"){const y=_.firstChild;for(;y.firstChild;)_.appendChild(y.firstChild);_.removeChild(y)}i.insertBefore(_,s)}return[h?h.nextSibling:i.firstChild,s?s.previousSibling:i.lastChild]}},Ri="transition",Ms="animation",Ys=Symbol("_vtc"),Hc={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=Ft({},hc,Hc),gh=t=>(t.displayName="Transition",t.props=mh,t),vh=gh((t,{slots:i})=>ch(hf,_h(t),i)),ho=(t,i=[])=>{Fe(t)?t.forEach(s=>s(...i)):t&&t(...i)},Yl=t=>t?Fe(t)?t.some(i=>i.length>1):t.length>1:!1;function _h(t){const i={};for(const ie in t)ie in Hc||(i[ie]=t[ie]);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:y=f,appearActiveClass:C=h,appearToClass:T=_,leaveFromClass:M=`${s}-leave-from`,leaveActiveClass:R=`${s}-leave-active`,leaveToClass:B=`${s}-leave-to`}=t,j=bh(u),F=j&&j[0],he=j&&j[1],{onBeforeEnter:pe,onEnter:Y,onEnterCancelled:Le,onLeave:fe,onLeaveCancelled:Ue,onBeforeAppear:$e=pe,onAppear:Ie=Y,onAppearCancelled:qe=Le}=i,xe=(ie,je,oe,We)=>{ie._enterCancelled=We,po(ie,je?T:_),po(ie,je?C:h),oe&&oe()},Se=(ie,je)=>{ie._isLeaving=!1,po(ie,M),po(ie,B),po(ie,R),je&&je()},ze=ie=>(je,oe)=>{const We=ie?Ie:Y,le=()=>xe(je,ie,oe);ho(We,[je,le]),Jl(()=>{po(je,ie?y:f),gi(je,ie?T:_),Yl(We)||Xl(je,l,F,le)})};return Ft(i,{onBeforeEnter(ie){ho(pe,[ie]),gi(ie,f),gi(ie,h)},onBeforeAppear(ie){ho($e,[ie]),gi(ie,y),gi(ie,C)},onEnter:ze(!1),onAppear:ze(!0),onLeave(ie,je){ie._isLeaving=!0;const oe=()=>Se(ie,je);gi(ie,M),ie._enterCancelled?(gi(ie,R),tu(ie)):(tu(ie),gi(ie,R)),Jl(()=>{ie._isLeaving&&(po(ie,M),gi(ie,B),Yl(fe)||Xl(ie,l,he,oe))}),ho(fe,[ie,oe])},onEnterCancelled(ie){xe(ie,!1,void 0,!0),ho(Le,[ie])},onAppearCancelled(ie){xe(ie,!0,void 0,!0),ho(qe,[ie])},onLeaveCancelled(ie){Se(ie),ho(Ue,[ie])}})}function bh(t){if(t==null)return null;if(gt(t))return[Lr(t.enter),Lr(t.leave)];{const i=Lr(t);return[i,i]}}function Lr(t){return _d(t)}function gi(t,i){i.split(/\s+/).forEach(s=>s&&t.classList.add(s)),(t[Ys]||(t[Ys]=new Set)).add(i)}function po(t,i){i.split(/\s+/).forEach(l=>l&&t.classList.remove(l));const s=t[Ys];s&&(s.delete(i),s.size||(t[Ys]=void 0))}function Jl(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let yh=0;function Xl(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:y}=xh(t,i);if(!h)return l();const C=h+"end";let T=0;const M=()=>{t.removeEventListener(C,R),f()},R=B=>{B.target===t&&++T>=y&&M()};setTimeout(()=>{T(s[j]||"").split(", "),u=l(`${Ri}Delay`),f=l(`${Ri}Duration`),h=Ql(u,f),_=l(`${Ms}Delay`),y=l(`${Ms}Duration`),C=Ql(_,y);let T=null,M=0,R=0;i===Ri?h>0&&(T=Ri,M=h,R=f.length):i===Ms?C>0&&(T=Ms,M=C,R=y.length):(M=Math.max(h,C),T=M>0?h>C?Ri:Ms:null,R=T?T===Ri?f.length:y.length:0);const B=T===Ri&&/\b(?:transform|all)(?:,|$)/.test(l(`${Ri}Property`).toString());return{type:T,timeout:M,propCount:R,hasTransform:B}}function Ql(t,i){for(;t.lengtheu(s)+eu(t[l])))}function eu(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function tu(t){return(t?t.ownerDocument:document).body.offsetHeight}function wh(t,i,s){const l=t[Ys];l&&(i=(i?[i,...l]:[...l]).join(" ")),i==null?t.removeAttribute("class"):s?t.setAttribute("class",i):t.className=i}const Za=Symbol("_vod"),jc=Symbol("_vsh"),kh={name:"show",beforeMount(t,{value:i},{transition:s}){t[Za]=t.style.display==="none"?"":t.style.display,s&&i?s.beforeEnter(t):Es(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),Es(t,!0),l.enter(t)):l.leave(t,()=>{Es(t,!1)}):Es(t,i))},beforeUnmount(t,{value:i}){Es(t,i)}};function Es(t,i){t.style.display=i?t[Za]:"none",t[jc]=!i}const Sh=Symbol(""),Th=/(?:^|;)\s*display\s*:/;function Ph(t,i,s){const l=t.style,u=Pt(s);let f=!1;if(s&&!u){if(i)if(Pt(i))for(const h of i.split(";")){const _=h.slice(0,h.indexOf(":")).trim();s[_]==null&&Is(l,_,"")}else for(const h in i)s[h]==null&&Is(l,h,"");for(const h in s){h==="display"&&(f=!0);const _=s[h];_!=null?Lh(t,h,!Pt(i)&&i?i[h]:void 0,_)||Is(l,h,_):Is(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");Za in t&&(t[Za]=f?l.display:"",t[jc]&&(l.display="none"))}const nu=/\s*!important$/;function Is(t,i,s){if(Fe(s))s.forEach(l=>Is(t,i,l));else if(s==null&&(s=""),i.startsWith("--"))t.setProperty(i,s);else{const l=Ch(t,i);nu.test(s)?t.setProperty(Wi(l),s.replace(nu,""),"important"):t[l]=s}}const iu=["Webkit","Moz","ms"],Ar={};function Ch(t,i){const s=Ar[i];if(s)return s;let l=Un(i);if(l!=="filter"&&l in t)return Ar[i]=l;l=Nu(l);for(let u=0;uMr||(Ih.then(()=>Mr=0),Mr=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 y=0;yt.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,Dh=(t,i,s,l,u,f)=>{const h=u==="svg";i==="class"?wh(t,l,h):i==="style"?Ph(t,s,l):Ka(i)?Ga(i)||Mh(t,i,s,l,f):(i[0]==="."?(i=i.slice(1),!0):i[0]==="^"?(i=i.slice(1),!1):Fh(t,i,l,h))?(au(t,i,l),!t.tagName.includes("-")&&(i==="value"||i==="checked"||i==="selected")&&su(t,i,l,h,f,i!=="value")):t._isVueCE&&(Rh(t,i)||t._def.__asyncLoader&&(/[A-Z]/.test(i)||!Pt(l)))?au(t,Un(i),l,f,i):(i==="true-value"?t._trueValue=l:i==="false-value"&&(t._falseValue=l),su(t,i,l,h))};function Fh(t,i,s,l){if(l)return!!(i==="innerHTML"||i==="textContent"||i in t&&lu(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 lu(i)&&Pt(s)?!1:i in t}function Rh(t,i){const s=t._def.props;if(!s)return!1;const l=Un(i);return Array.isArray(s)?s.some(u=>Un(u)===l):Object.keys(s).some(u=>Un(u)===l)}const ji=t=>{const i=t.props["onUpdate:modelValue"]||!1;return Fe(i)?s=>za(i,s):i};function Bh(t){t.target.composing=!0}function uu(t){const i=t.target;i.composing&&(i.composing=!1,i.dispatchEvent(new Event("input")))}const zn=Symbol("_assign");function cu(t,i,s){return i&&(t=t.trim()),s&&(t=Ya(t)),t}const ye={created(t,{modifiers:{lazy:i,trim:s,number:l}},u){t[zn]=ji(u);const f=l||u.props&&u.props.type==="number";xi(t,i?"change":"input",h=>{h.target.composing||t[zn](cu(t.value,s,f))}),(s||f)&&xi(t,"change",()=>{t.value=cu(t.value,s,f)}),i||(xi(t,"compositionstart",Bh),xi(t,"compositionend",uu),xi(t,"change",uu))},mounted(t,{value:i}){t.value=i??""},beforeUpdate(t,{value:i,oldValue:s,modifiers:{lazy:l,trim:u,number:f}},h){if(t[zn]=ji(h),t.composing)return;const _=(f||t.type==="number")&&!/^0\d/.test(t.value)?Ya(t.value):t.value,y=i??"";if(_===y)return;const C=t.getRootNode();(C instanceof Document||C instanceof ShadowRoot)&&C.activeElement===t&&t.type!=="range"&&(l&&i===s||u&&t.value.trim()===y)||(t.value=y)}},Ha={deep:!0,created(t,i,s){t[zn]=ji(s),xi(t,"change",()=>{const l=t._modelValue,u=is(t),f=t.checked,h=t[zn];if(Fe(l)){const _=Qr(l,u),y=_!==-1;if(f&&!y)h(l.concat(u));else if(!f&&y){const C=[...l];C.splice(_,1),h(C)}}else if(os(l)){const _=new Set(l);f?_.add(u):_.delete(u),h(_)}else h(Wc(t,f))})},mounted:du,beforeUpdate(t,i,s){t[zn]=ji(s),du(t,i,s)}};function du(t,{value:i,oldValue:s},l){t._modelValue=i;let u;if(Fe(i))u=Qr(i,l.props.value)>-1;else if(os(i))u=i.has(l.props.value);else{if(i===s)return;u=Zi(i,Wc(t,!0))}t.checked!==u&&(t.checked=u)}const Uh={created(t,{value:i},s){t.checked=Zi(i,s.props.value),t[zn]=ji(s),xi(t,"change",()=>{t[zn](is(t))})},beforeUpdate(t,{value:i,oldValue:s},l){t[zn]=ji(l),i!==s&&(t.checked=Zi(i,l.props.value))}},Ot={deep:!0,created(t,{value:i,modifiers:{number:s}},l){const u=os(i);xi(t,"change",()=>{const f=Array.prototype.filter.call(t.options,h=>h.selected).map(h=>s?Ya(is(h)):is(h));t[zn](t.multiple?u?new Set(f):f:f[0]),t._assigning=!0,ic(()=>{t._assigning=!1})}),t[zn]=ji(l)},mounted(t,{value:i}){fu(t,i)},beforeUpdate(t,i,s){t[zn]=ji(s)},updated(t,{value:i}){t._assigning||fu(t,i)}};function fu(t,i){const s=t.multiple,l=Fe(i);if(!(s&&!l&&!os(i))){for(let u=0,f=t.options.length;uString(C)===String(_)):h.selected=Qr(i,_)>-1}else h.selected=i.has(_);else if(Zi(is(h),i)){t.selectedIndex!==u&&(t.selectedIndex=u);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function is(t){return"_value"in t?t._value:t.value}function Wc(t,i){const s=i?"_trueValue":"_falseValue";return s in t?t[s]:i}const Vh={created(t,i,s){Ea(t,i,s,null,"created")},mounted(t,i,s){Ea(t,i,s,null,"mounted")},beforeUpdate(t,i,s,l){Ea(t,i,s,l,"beforeUpdate")},updated(t,i,s,l){Ea(t,i,s,l,"updated")}};function Zh(t,i){switch(t){case"SELECT":return Ot;case"TEXTAREA":return ye;default:switch(i){case"checkbox":return Ha;case"radio":return Uh;default:return ye}}}function Ea(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))},dl=(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=Wi(u.key);if(i.some(h=>h===f||Wh[h]===f))return t(u)}))},Kh=Ft({patchProp:Dh},ph);let pu;function Gh(){return pu||(pu=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 Pt(t)?document.querySelector(t):t}const Kc="pv_theme",mu={light:"#EEF0F3",dark:"#0B1730"},ja=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;function Gc(){return ja&&ja.matches?"dark":"light"}function Xh(){try{return localStorage.getItem(Kc)||"light"}catch{return"light"}}function qc(t){return t==="system"?Gc():t}function Yc(t){const i=document.documentElement;i.setAttribute("data-theme",t),i.style.backgroundColor=mu[t]||mu.light}const yo=Z(Xh()),es=Z(qc(yo.value));function Wa(t){yo.value=t;const i=qc(t);es.value=i,Yc(i);try{localStorage.setItem(Kc,t)}catch{}}function gu(){Wa(es.value==="dark"?"light":"dark")}ja&&ja.addEventListener("change",()=>{if(yo.value==="system"){const t=Gc();es.value=t,Yc(t)}});async function Qh(){try{const t=await fetch("/bff/config");return t.ok?await t.json():{apiBase:""}}catch{return{apiBase:""}}}async function vu(){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 _u(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 bu(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 Oa(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 yu(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 xu(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 Jc(){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 Sp(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 Tp(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 Pp(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 Cp(){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 Lp(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 Ap(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 Mp(t){const i=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function Ep(){return"/bff/logbook/export"}async function Op(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 zp(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 Ip(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 $p(t){const i=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function Er(t){return`/bff/documents/${encodeURIComponent(t)}/file`}function Np(t){return`/bff/documents/${encodeURIComponent(t)}/file?inline=1`}async function Dp(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",Kr={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 Fp(){try{return{...Kr,...JSON.parse(localStorage.getItem(Xc)||"{}")||{}}}catch{return{...Kr}}}const be=kt(Fp());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(Kr))i in t&&(be[i]=t[i]);return!0}const Rp={sm:15,md:16,lg:18};function fl(t){document.documentElement.style.fontSize=(Rp[t]||16)+"px"}function hl(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 wu(t){return td(t).time}function ku(t){const i=td(t);return`${i.date} ${i.time}`}let pl=!1,Gr=!1,qr=null;function Bp(){return{...JSON.parse(JSON.stringify(be)),themeMode:yo.value}}function ml(){!pl||Gr||(clearTimeout(qr),qr=setTimeout(()=>{fp(Bp())},600))}function Up(t){Gr=!0;try{ed(t),t.themeMode&&Wa(t.themeMode),fl(be.fontSize),hl(be.reduceMotion),Qc()}finally{Gr=!1}}async function Su(){pl=!0;const t=await dp();t&&Object.keys(t).length?Up(t):ml()}function Vp(){pl=!1,clearTimeout(qr)}$t(be,()=>{Qc(),ml()},{deep:!0});$t(yo,ml);$t(()=>be.fontSize,fl,{immediate:!0});$t(()=>be.reduceMotion,hl,{immediate:!0});const Zp=["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]=[r("g",{"stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"},[r("polyline",{points:"8,30 19,17 30,30",stroke:"var(--accent)"}),r("polyline",{points:"18,33 29,20 40,33",stroke:"currentColor"})],-1)])],8,Zp))}},Hp=["title","aria-label"],jp={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Wp={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Kp={__name:"ThemeToggle",setup(t){return(i,s)=>(p(),m("button",{class:"btn-icon",type:"button",title:Oe(es)==="dark"?"Switch to light":"Switch to dark","aria-label":Oe(es)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:s[0]||(s[0]=(...l)=>Oe(gu)&&Oe(gu)(...l))},[Oe(es)==="dark"?(p(),m("svg",jp,[...s[1]||(s[1]=[r("circle",{cx:"12",cy:"12",r:"4"},null,-1),r("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",Wp,[...s[2]||(s[2]=[r("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z"},null,-1)])]))],8,Hp))}},Gp={class:"relative grid h-full place-items-center p-5"},qp={class:"absolute right-5 top-5"},Yp={class:"mb-6 flex items-center gap-3 text-ink"},Jp={class:"relative mb-1"},Xp=["type"],Qp=["aria-label","title"],em={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]"},tm={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]"},nm={key:0,class:"mt-4"},im={key:1,class:"mt-4 rounded border border-line bg-danger-soft px-3 py-2 text-sm text-danger-fg"},om=["disabled"],sm={__name:"LoginView",props:{defaultApiBase:{type:String,default:""}},emits:["signed-in"],setup(t,{emit:i}){const s=t,l=i,u=Z(""),f=Z(""),h=Z(localStorage.getItem("api_url")||s.defaultApiBase||"http://localhost:8080"),_=Z(!1),y=Z(!1),C=Z(!1),T=Z("");async function M(){C.value=!0,T.value="",localStorage.setItem("api_url",h.value.trim());const{ok:R,status:B,body:j}=await ep(u.value.trim(),f.value,h.value.trim());if(C.value=!1,R){l("signed-in",j.email);return}T.value=B===400?"Invalid email or password.":B===502?"API server can't reach PocketBase.":j.message||j.error||"Cannot reach the API server."}return(R,B)=>(p(),m("div",Gp,[r("div",qp,[A(Kp)]),r("form",{class:"panel w-[380px] p-8 shadow-md",onSubmit:dl(M,["prevent"])},[r("div",Yp,[A(nd,{size:34}),B[5]||(B[5]=r("div",{class:"leading-tight"},[r("div",{class:"text-mode"},"PilotVault"),r("div",{class:"eyebrow mt-0.5"},"Control panel")],-1))]),B[9]||(B[9]=r("label",{class:"eyebrow mb-1.5 block"},"Email",-1)),ee(r("input",{"onUpdate:modelValue":B[0]||(B[0]=j=>u.value=j),type:"email",autocomplete:"username",required:"",class:"field mb-4",placeholder:"you@example.com"},null,512),[[ye,u.value]]),B[10]||(B[10]=r("label",{class:"eyebrow mb-1.5 block"},"Password",-1)),r("div",Jp,[ee(r("input",{"onUpdate:modelValue":B[1]||(B[1]=j=>f.value=j),type:y.value?"text":"password",autocomplete:"current-password",required:"",class:"field w-full pr-10",placeholder:"••••••••"},null,8,Xp),[[Vh,f.value]]),r("button",{type:"button",class:"absolute inset-y-0 right-0 grid w-10 place-items-center text-ink-muted transition hover:text-ink-secondary","aria-label":y.value?"Hide password":"Show password",title:y.value?"Hide password":"Show password",onClick:B[2]||(B[2]=j=>y.value=!y.value)},[y.value?(p(),m("svg",em,[...B[6]||(B[6]=[r("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),r("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])])):(p(),m("svg",tm,[...B[7]||(B[7]=[r("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),r("circle",{cx:"12",cy:"12",r:"3"},null,-1)])]))],8,Qp)]),_.value?(p(),m("div",nm,[B[8]||(B[8]=r("label",{class:"eyebrow mb-1.5 block"},"API Server",-1)),ee(r("input",{"onUpdate:modelValue":B[3]||(B[3]=j=>h.value=j),type:"text",class:"field font-mono",placeholder:"10.2.1.101:8080"},null,512),[[ye,h.value]])])):N("",!0),T.value?(p(),m("p",im,k(T.value),1)):N("",!0),r("button",{type:"submit",class:"btn-accent mt-6 w-full",disabled:C.value},k(C.value?"Signing in…":"Sign in"),9,om),r("button",{type:"button",class:"mx-auto mt-3 block text-xs text-ink-muted transition hover:text-ink-secondary",onClick:B[4]||(B[4]=j=>_.value=!_.value)},k(_.value?"Hide server settings":"Server settings"),1)],32)]))}};function am(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var $s={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 rm=$s.exports,Tu;function lm(){return Tu||(Tu=1,(function(t,i){(function(s,l){l(i)})(rm,(function(s){var l="1.9.4";function u(e){var n,o,a,c;for(o=1,a=arguments.length;o"u"||!L||!L.Mixin)){e=Le(e)?e:[e];for(var n=0;n0?Math.floor(e):Math.ceil(e)};ae.prototype={clone:function(){return new ae(this.x,this.y)},add:function(e){return this.clone()._add(te(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(te(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 ae(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new ae(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=te(e);var n=e.x-this.x,o=e.y-this.y;return Math.sqrt(n*n+o*o)},equals:function(e){return e=te(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=te(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+R(this.x)+", "+R(this.y)+")"}};function te(e,n,o){return e instanceof ae?e:Le(e)?new ae(e[0],e[1]):e==null?e:typeof e=="object"&&"x"in e&&"y"in e?new ae(e.x,e.y):new ae(e,n,o)}function ke(e,n){if(e)for(var o=n?[e,n]:e,a=0,c=o.length;a=this.min.x&&o.x<=this.max.x&&n.y>=this.min.y&&o.y<=this.max.y},intersects:function(e){e=Ne(e);var n=this.min,o=this.max,a=e.min,c=e.max,g=c.x>=n.x&&a.x<=o.x,P=c.y>=n.y&&a.y<=o.y;return g&&P},overlaps:function(e){e=Ne(e);var n=this.min,o=this.max,a=e.min,c=e.max,g=c.x>n.x&&a.xn.y&&a.y=n.lat&&c.lat<=o.lat&&a.lng>=n.lng&&c.lng<=o.lng},intersects:function(e){e=lt(e);var n=this._southWest,o=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),g=c.lat>=n.lat&&a.lat<=o.lat,P=c.lng>=n.lng&&a.lng<=o.lng;return g&&P},overlaps:function(e){e=lt(e);var n=this._southWest,o=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),g=c.lat>n.lat&&a.latn.lng&&a.lng1,Ti=(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})(),ta=(function(){return!!document.createElement("canvas").getContext})(),as=!!(document.createElementNS&&G("svg").createSVGRect),rs=!!as&&(function(){var e=document.createElement("div");return e.innerHTML="",(e.firstChild&&e.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),ls=!as&&(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}})(),sr=navigator.platform.indexOf("Mac")===0,xn=navigator.platform.indexOf("Linux")===0;function Qt(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var ge={ie:re,ielt9:ne,edge:Q,webkit:q,android:me,android23:se,androidStock:Ae,opera:He,chrome:et,gecko:U,safari:O,phantom:Te,opera12:Ye,win:vt,ie3d:yt,webkit3d:rn,gecko3d:de,any3d:St,mobile:pn,mobileWebkit:xo,mobileWebkit3d:ct,msPointer:si,pointer:wo,touch:Ki,touchNative:pt,mobileOpera:ko,mobileGecko:So,retina:$n,passiveEvents:Ti,canvas:ta,svg:as,vml:ls,inlineSvg:rs,mac:sr,linux:xn},en=ge.msPointer?"MSPointerDown":"pointerdown",Ct=ge.msPointer?"MSPointerMove":"pointermove",na=ge.msPointer?"MSPointerUp":"pointerup",us=ge.msPointer?"MSPointerCancel":"pointercancel",Gi={touchstart:en,touchmove:Ct,touchend:na,touchcancel:us},ia={touchstart:cs,touchmove:Nn,touchend:Nn,touchcancel:Nn},Pi={},oa=!1;function ar(e,n,o){return n==="touchstart"&&dt(),ia[n]?(o=ia[n].bind(this,o),e.addEventListener(Gi[n],o,!1),o):(console.warn("wrong event specified:",n),M)}function sa(e,n,o){if(!Gi[n]){console.warn("wrong event specified:",n);return}e.removeEventListener(Gi[n],o,!1)}function rr(e){Pi[e.pointerId]=e}function lr(e){Pi[e.pointerId]&&(Pi[e.pointerId]=e)}function aa(e){delete Pi[e.pointerId]}function dt(){oa||(document.addEventListener(en,rr,!0),document.addEventListener(Ct,lr,!0),document.addEventListener(na,aa,!0),document.addEventListener(us,aa,!0),oa=!0)}function Nn(e,n){if(n.pointerType!==(n.MSPOINTER_TYPE_MOUSE||"mouse")){n.touches=[];for(var o in Pi)n.touches.push(Pi[o]);n.changedTouches=[n],e(n)}}function cs(e,n){n.MSPOINTER_TYPE_TOUCH&&n.pointerType===n.MSPOINTER_TYPE_TOUCH&&It(n),Nn(e,n)}function Ht(e){var n={},o,a;for(a in e)o=e[a],n[a]=o&&o.bind?o.bind(e):o;return e=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var qi=200;function To(e,n){e.addEventListener("dblclick",n);var o=0,a;function c(g){if(g.detail!==1){a=g.detail;return}if(!(g.pointerType==="mouse"||g.sourceCapabilities&&!g.sourceCapabilities.firesTouchEvents)){var P=ua(g);if(!(P.some(function(D){return D instanceof HTMLLabelElement&&D.attributes.for})&&!P.some(function(D){return D instanceof HTMLInputElement||D instanceof HTMLSelectElement}))){var $=Date.now();$-o<=qi?(a++,a===2&&n(Ht(g))):a=1,o=$}}}return e.addEventListener("click",c),{dblclick:n,simDblclick:c}}function Po(e,n){e.removeEventListener("dblclick",n.dblclick),e.removeEventListener("click",n.simDblclick)}var mn=Mo(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),wn=Mo(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ra=wn==="webkitTransition"||wn==="OTransition"?wn+"End":"transitionend";function Co(e){return typeof e=="string"?document.getElementById(e):e}function ai(e,n){var o=e.style[n]||e.currentStyle&&e.currentStyle[n];if((!o||o==="auto")&&document.defaultView){var a=document.defaultView.getComputedStyle(e,null);o=a?a[n]:null}return o==="auto"?null:o}function at(e,n,o){var a=document.createElement(e);return a.className=n||"",o&&o.appendChild(a),a}function rt(e){var n=e.parentNode;n&&n.removeChild(e)}function gn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function vn(e){var n=e.parentNode;n&&n.lastChild!==e&&n.appendChild(e)}function Rt(e){var n=e.parentNode;n&&n.firstChild!==e&&n.insertBefore(e,n.firstChild)}function Lo(e,n){if(e.classList!==void 0)return e.classList.contains(n);var o=Ao(e);return o.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(o)}function Ke(e,n){if(e.classList!==void 0)for(var o=j(n),a=0,c=o.length;a0?2*window.devicePixelRatio:1;function Ji(e){return ge.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/Ei: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 di(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 zo={__proto__:null,on:De,off:nt,stopPropagation:ui,disableScrollPropagation:gs,disableClickPropagation:Mi,preventDefault:It,stop:ci,getPropagationPath:ua,getMousePosition:Ee,getWheelDelta:Ji,isExternalTarget:di,addListener:De,removeListener:nt},Xi=ce.extend({run:function(e,n,o,a){this.stop(),this._el=e,this._inProgress=!0,this._duration=o||.25,this._easeOutPower=1/Math.max(a||.5,.2),this._startPos=tt(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=ze(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(),a=this._limitCenter(o,this._zoom,lt(e));return o.equals(a)||this.panTo(a,n),this._enforcingBounds=!1,this},panInside:function(e,n){n=n||{};var o=te(n.paddingTopLeft||n.padding||[0,0]),a=te(n.paddingBottomRight||n.padding||[0,0]),c=this.project(this.getCenter()),g=this.project(e),P=this.getPixelBounds(),$=Ne([P.min.add(o),P.max.subtract(a)]),D=$.getSize();if(!$.contains(g)){this._enforcingBounds=!0;var X=g.subtract($.getCenter()),_e=$.extend(g).getSize().subtract(D);c.x+=X.x<0?-_e.x:_e.x,c.y+=X.y<0?-_e.y:_e.y,this.panTo(this.unproject(c),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(),a=n.divideBy(2).round(),c=o.divideBy(2).round(),g=a.subtract(c);return!g.x&&!g.y?this:(e.animate&&e.pan?this.panBy(g):(e.pan&&this._rawPanBy(g),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,a=new Ze(n,o),c=a.toBounds(e.coords.accuracy*2),g=this._locateOptions;if(g.setView){var P=this.getBoundsZoom(c);this.setView(a,g.maxZoom?Math.min(P,g.maxZoom):P)}var $={latlng:a,bounds:c,timestamp:e.timestamp};for(var D in e.coords)typeof e.coords[D]=="number"&&($[D]=e.coords[D]);this.fire("locationfound",$)}},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(),rt(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(ie(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)rt(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":""),a=at("div",o,n||this._mapPane);return e&&(this._panes[e]=a),a},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 ht(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=lt(e),o=te(o||[0,0]);var a=this.getZoom()||0,c=this.getMinZoom(),g=this.getMaxZoom(),P=e.getNorthWest(),$=e.getSouthEast(),D=this.getSize().subtract(o),X=Ne(this.project($,a),this.project(P,a)).getSize(),_e=ge.any3d?this.options.zoomSnap:1,Be=D.x/X.x,Qe=D.y/X.y,tn=n?Math.max(Be,Qe):Math.min(Be,Qe);return a=this.getScaleZoom(tn,a),_e&&(a=Math.round(a/(_e/100))*(_e/100),a=n?Math.ceil(a/_e)*_e:Math.floor(a/_e)*_e),Math.max(c,Math.min(g,a))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new ae(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 ke(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 a=o.zoom(e*o.scale(n));return isNaN(a)?1/0:a},project:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.latLngToPoint(J(e),n)},unproject:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.pointToLatLng(te(e),n)},layerPointToLatLng:function(e){var n=te(e).add(this.getPixelOrigin());return this.unproject(n)},latLngToLayerPoint:function(e){var n=this.project(J(e))._round();return n._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(J(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(lt(e))},distance:function(e,n){return this.options.crs.distance(J(e),J(n))},containerPointToLayerPoint:function(e){return te(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return te(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var n=this.containerPointToLayerPoint(te(e));return this.layerPointToLatLng(n)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(J(e)))},mouseEventToContainerPoint:function(e){return Ee(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=Co(e);if(n){if(n._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");De(n,"scroll",this._onScroll,this),this._containerId=y(n)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&ge.any3d,Ke(e,"leaflet-container"+(ge.touch?" leaflet-touch":"")+(ge.retina?" leaflet-retina":"")+(ge.ielt9?" leaflet-oldie":"")+(ge.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var n=ai(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),At(this._mapPane,new ae(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(Ke(e.markerPane,"leaflet-zoom-hide"),Ke(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,n,o){At(this._mapPane,new ae(0,0));var a=!this._loaded;this._loaded=!0,n=this._limitZoom(n),this.fire("viewprereset");var c=this._zoom!==n;this._moveStart(c,o)._move(e,n)._moveEnd(c),this.fire("viewreset"),a&&this.fire("load")},_moveStart:function(e,n){return e&&this.fire("zoomstart"),n||this.fire("movestart"),this},_move:function(e,n,o,a){n===void 0&&(n=this._zoom);var c=this._zoom!==n;return this._zoom=n,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),a?o&&o.pinch&&this.fire("zoom",o):((c||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 ie(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){At(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[y(this._container)]=this;var n=e?nt:De;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),ge.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){ie(this._resizeRequest),this._resizeRequest=ze(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=[],a,c=n==="mouseout"||n==="mouseover",g=e.target||e.srcElement,P=!1;g;){if(a=this._targets[y(g)],a&&(n==="click"||n==="preclick")&&this._draggableMoved(a)){P=!0;break}if(a&&a.listens(n,!0)&&(c&&!di(g,e)||(o.push(a),c))||g===this._container)break;g=g.parentNode}return!o.length&&!P&&!c&&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"&&Eo(n),this._fireDOMEvent(e,o)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,n,o){if(e.type==="click"){var a=u({},e);a.type="preclick",this._fireDOMEvent(a,a.type,o)}var c=this._findEventTargets(e,n);if(o){for(var g=[],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(),a=ge.any3d?this.options.zoomSnap:1;return a&&(e=Math.round(e/a)*a),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=at("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(n){var o=mn,a=this._proxy.style[o];ri(this._proxy,this.project(n.center,n.zoom),this.getZoomScale(n.zoom,1)),a===this._proxy.style[o]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){rt(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),n=this.getZoom();ri(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 a=this.getZoomScale(n),c=this._getCenterOffset(e)._divideBy(1-1/a);return o.animate!==!0&&!this.getSize().contains(c)?!1:(ze(function(){this._moveStart(!0,o.noMoveStart||!1)._animateZoom(e,n,!0)},this),!0)},_animateZoom:function(e,n,o,a){this._mapPane&&(o&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=n,Ke(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,zoom:n,noUpdate:a}),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 Oi(e,n){return new Ge(e,n)}var Ut=oe.extend({options:{position:"topright"},initialize:function(e){F(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(),a=e._controlCorners[o];return Ke(n,"leaflet-control"),o.indexOf("bottom")!==-1?a.insertBefore(n,a.firstChild):a.appendChild(n),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(rt(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()}}),zi=function(e){return new Ut(e)};Ge.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=at("div",n+"control-container",this._container);function a(c,g){var P=n+c+" "+n+g;e[c+g]=at("div",P,o)}a("top","left"),a("top","right"),a("bottom","left"),a("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)rt(this._controlCorners[e]);rt(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var Io=Ut.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,n,o,a){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(y(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='",a=document.createElement("div");return a.innerHTML=o,a.firstChild},_addItem:function(e){var n=document.createElement("label"),o=this._map.hasLayer(e.layer),a;e.overlay?(a=document.createElement("input"),a.type="checkbox",a.className="leaflet-control-layers-selector",a.defaultChecked=o):a=this._createRadioElement("leaflet-base-layers_"+y(this),o),this._layerControlInputs.push(a),a.layerId=y(e.layer),De(a,"click",this._onInputClick,this);var c=document.createElement("span");c.innerHTML=" "+e.name;var g=document.createElement("span");n.appendChild(g),g.appendChild(a),g.appendChild(c);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,a=[],c=[];this._handlingClick=!0;for(var g=e.length-1;g>=0;g--)n=e[g],o=this._getLayer(n.layerId).layer,n.checked?a.push(o):n.checked||c.push(o);for(g=0;g=0;c--)n=e[c],o=this._getLayer(n.layerId).layer,n.disabled=o.options.minZoom!==void 0&&ao.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,De(e,"click",It),this.expand();var n=this;setTimeout(function(){nt(e,"click",It),n._preventClick=!1})}}),vs=function(e,n,o){return new Io(e,n,o)},_s=Ut.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(e){var n="leaflet-control-zoom",o=at("div",n+" leaflet-bar"),a=this.options;return this._zoomInButton=this._createButton(a.zoomInText,a.zoomInTitle,n+"-in",o,this._zoomIn),this._zoomOutButton=this._createButton(a.zoomOutText,a.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,a,c){var g=at("a",o,a);return g.innerHTML=e,g.href="#",g.title=n,g.setAttribute("role","button"),g.setAttribute("aria-label",n),Mi(g),De(g,"click",ci),De(g,"click",c,this),De(g,"click",this._refocusOnMap,this),g},_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())&&(Ke(this._zoomOutButton,n),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(Ke(this._zoomInButton,n),this._zoomInButton.setAttribute("aria-disabled","true"))}});Ge.mergeOptions({zoomControl:!0}),Ge.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new _s,this.addControl(this.zoomControl))});var cn=function(e){return new _s(e)},Qi=Ut.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var n="leaflet-control-scale",o=at("div",n),a=this.options;return this._addScales(a,n+"-line",o),e.on(a.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=at("div",n,o)),e.imperial&&(this._iScale=at("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,a,c;n>5280?(o=n/5280,a=this._getRoundNum(o),this._updateScale(this._iScale,a+" mi",a/o)):(c=this._getRoundNum(n),this._updateScale(this._iScale,c+" ft",c/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}}),ca=function(e){return new Qi(e)},da='',bs=Ut.extend({options:{position:"bottomright",prefix:''+(ge.inlineSvg?da+" ":"")+"Leaflet"},initialize:function(e){F(this,e),this._attributions={}},onAdd:function(e){e.attributionControl=this,this._container=at("div","leaflet-control-attribution"),Mi(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(' ')}}});Ge.mergeOptions({attributionControl:!0}),Ge.addInitHook(function(){this.options.attributionControl&&new bs().addTo(this)});var fa=function(e){return new bs(e)};Ut.Layers=Io,Ut.Zoom=_s,Ut.Scale=Qi,Ut.Attribution=bs,zi.layers=vs,zi.zoom=cn,zi.scale=ca,zi.attribution=fa;var jt=oe.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}});jt.addTo=function(e,n){return e.addHandler(n,this),this};var ur={Events:le},ha=ge.touch?"touchstart mousedown":"mousedown",Wn=ce.extend({options:{clickTolerance:3},initialize:function(e,n,o,a){F(this,a),this._element=e,this._dragStartTarget=n||e,this._preventOutline=o},enable:function(){this._enabled||(De(this._dragStartTarget,ha,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Wn._dragging===this&&this.finishDrag(!0),nt(this._dragStartTarget,ha,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!Lo(this._element,"leaflet-zoom-anim"))){if(e.touches&&e.touches.length!==1){Wn._dragging===this&&this.finishDrag();return}if(!(Wn._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(Wn._dragging=this,this._preventOutline&&Eo(this._element),Ci(),kn(),!this._moving)){this.fire("down");var n=e.touches?e.touches[0]:e,o=Oo(this._element);this._startPoint=new ae(n.clientX,n.clientY),this._startPos=tt(this._element),this._parentScale=fs(o);var a=e.type==="mousedown";De(document,a?"mousemove":"touchmove",this._onMove,this),De(document,a?"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 ae(n.clientX,n.clientY)._subtract(this._startPoint);!o.x&&!o.y||Math.abs(o.x)+Math.abs(o.y)g&&(P=$,g=D);g>o&&(n[P]=1,eo(e,n,o,a,P),eo(e,n,o,P,c))}function ws(e,n){for(var o=[e[0]],a=1,c=0,g=e.length;an&&(o.push(e[a]),c=a);return cn.max.x&&(o|=2),e.yn.max.y&&(o|=8),o}function Ii(e,n){var o=n.x-e.x,a=n.y-e.y;return o*o+a*a}function $i(e,n,o,a){var c=n.x,g=n.y,P=o.x-c,$=o.y-g,D=P*P+$*$,X;return D>0&&(X=((e.x-c)*P+(e.y-g)*$)/D,X>1?(c=o.x,g=o.y):X>0&&(c+=P*X,g+=$*X)),P=e.x-c,$=e.y-g,a?P*P+$*$:new ae(c,g)}function dn(e){return!Le(e[0])||typeof e[0][0]!="object"&&typeof e[0][0]<"u"}function No(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),dn(e)}function _a(e,n){var o,a,c,g,P,$,D,X;if(!e||e.length===0)throw new Error("latlngs not passed");dn(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var _e=J([0,0]),Be=lt(e),Qe=Be.getNorthWest().distanceTo(Be.getSouthWest())*Be.getNorthEast().distanceTo(Be.getNorthWest());Qe<1700&&(_e=xs(e));var tn=e.length,Dt=[];for(o=0;oa){D=(g-a)/c,X=[$.x-D*($.x-P.x),$.y-D*($.y-P.y)];break}var fn=n.unproject(te(X));return J([fn.lat+_e.lat,fn.lng+_e.lng])}var fr={__proto__:null,simplify:ma,pointToSegmentDistance:ga,closestPointOnSegment:va,clipSegment:$o,_getEdgeIntersection:Xe,_getBitCode:Et,_sqClosestPointOnSegment:$i,isFlat:dn,_flat:No,polylineCenter:_a},ks={project:function(e){return new ae(e.lng,e.lat)},unproject:function(e){return new Ze(e.y,e.x)},bounds:new ke([-180,-90],[180,90])},Ss={R:6378137,R_MINOR:6356752314245179e-9,bounds:new ke([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(e){var n=Math.PI/180,o=this.R,a=e.lat*n,c=this.R_MINOR/o,g=Math.sqrt(1-c*c),P=g*Math.sin(a),$=Math.tan(Math.PI/4-a/2)/Math.pow((1-P)/(1+P),g/2);return a=-o*Math.log(Math.max($,1e-10)),new ae(e.lng*n*o,a)},unproject:function(e){for(var n=180/Math.PI,o=this.R,a=this.R_MINOR/o,c=Math.sqrt(1-a*a),g=Math.exp(-e.y/o),P=Math.PI/2-2*Math.atan(g),$=0,D=.1,X;$<15&&Math.abs(D)>1e-7;$++)X=c*Math.sin(P),X=Math.pow((1-X)/(1+X),c/2),D=Math.PI/2-2*Math.atan(g*X)-P,P+=D;return new Ze(P*n,e.x*n/o)}},no={__proto__:null,LonLat:ks,Mercator:Ss,SphericalMercator:ut},ba=u({},z,{code:"EPSG:3395",projection:Ss,transformation:(function(){var e=.5/(Math.PI*Ss.R);return x(e,.5,-e,.5)})()}),io=u({},z,{code:"EPSG:4326",projection:ks,transformation:x(1/180,1,-1/180,.5)}),oo=u({},E,{projection:ks,transformation:x(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,a=n.lat-e.lat;return Math.sqrt(o*o+a*a)},infinite:!0});E.Earth=z,E.EPSG3395=ba,E.EPSG3857=b,E.EPSG900913=S,E.EPSG4326=io,E.Simple=oo;var Wt=ce.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[y(e)]=this,this},removeInteractiveTarget:function(e){return delete this._map._targets[y(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})}}});Ge.include({addLayer:function(e){if(!e._layerAdd)throw new Error("The provided object is not a Layer.");var n=y(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=y(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 y(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?Le(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 Ze&&n[0].equals(n[o-1])&&n.pop(),n},_setLatLngs:function(e){Tn.prototype._setLatLngs.call(this,e),dn(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return dn(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,n=this.options.weight,o=new ae(n,n);if(e=new ke(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 a=0,c=this._rings.length,g;ae.y!=c.y>e.y&&e.x<(c.x-a.x)*(e.y-a.y)/(c.y-a.y)+a.x&&(n=!n);return n||Tn.prototype._containsPoint.call(this,e,!0)}});function xa(e,n){return new Pn(e,n)}var Kt=Fn.extend({initialize:function(e,n){F(this,n),this._layers={},e&&this.addData(e)},addData:function(e){var n=Le(e)?e:e.features,o,a,c;if(n){for(o=0,a=n.length;o0&&c.push(c[0].slice()),c}function Gn(e,n){return e.feature?u({},e.feature,{geometry:n}):Fo(n)}function Fo(e){return e.type==="Feature"||e.type==="FeatureCollection"?e:{type:"Feature",properties:{},geometry:e}}var Ro={toGeoJSON:function(e){return Gn(this,{type:"Point",coordinates:Cn(this.getLatLng(),e)})}};fi.include(Ro),Di.include(Ro),Mt.include(Ro),Tn.include({toGeoJSON:function(e){var n=!dn(this._latlngs),o=pi(this._latlngs,n?1:0,!1,e);return Gn(this,{type:(n?"Multi":"")+"LineString",coordinates:o})}}),Pn.include({toGeoJSON:function(e){var n=!dn(this._latlngs),o=n&&!dn(this._latlngs[0]),a=pi(this._latlngs,o?2:n?1:0,!0,e);return n||(a=[a]),Gn(this,{type:(o?"Multi":"")+"Polygon",coordinates:a})}}),Kn.include({toMultiPoint:function(e){var n=[];return this.eachLayer(function(o){n.push(o.toGeoJSON(e).geometry.coordinates)}),Gn(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",a=[];return this.eachLayer(function(c){if(c.toGeoJSON){var g=c.toGeoJSON(e);if(o)a.push(g.geometry);else{var P=Fo(g);P.type==="FeatureCollection"?a.push.apply(a,P.features):a.push(P)}}}),o?Gn(this,{geometries:a,type:"GeometryCollection"}):{type:"FeatureCollection",features:a}}});function ka(e,n){return new Kt(e,n)}var Bo=ka,qn=Wt.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(e,n,o){this._url=e,this._bounds=lt(n),F(this,o)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(Ke(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){rt(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&&vn(this._image),this},bringToBack:function(){return this._map&&Rt(this._image),this},setUrl:function(e){return this._url=e,this._image&&(this._image.src=e),this},setBounds:function(e){return this._bounds=lt(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:at("img");if(Ke(n,"leaflet-image-layer"),this._zoomAnimated&&Ke(n,"leaflet-zoom-animated"),this.options.className&&Ke(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;ri(this._image,o,n)},_reset:function(){var e=this._image,n=new ke(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),o=n.getSize();At(e,n.min),e.style.width=o.x+"px",e.style.height=o.y+"px"},_updateOpacity:function(){ln(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()}}),Uo=function(e,n,o){return new qn(e,n,o)},Fi=qn.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:at("video");if(Ke(n,"leaflet-image-layer"),this._zoomAnimated&&Ke(n,"leaflet-zoom-animated"),this.options.className&&Ke(n,this.options.className),n.onselectstart=M,n.onmousemove=M,n.onloadeddata=h(this.fire,this,"load"),e){for(var o=n.getElementsByTagName("source"),a=[],c=0;c0?a:[n.src];return}Le(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 g=0;gc?(n.height=c+"px",Ke(e,g)):Lt(e,g),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var n=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),o=this._getAnchor();At(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(ai(this._container,"marginBottom"),10)||0,o=this._container.offsetHeight+n,a=this._containerWidth,c=new ae(this._containerLeft,-o-this._containerBottom);c._add(tt(this._container));var g=e.layerPointToContainerPoint(c),P=te(this.options.autoPanPadding),$=te(this.options.autoPanPaddingTopLeft||P),D=te(this.options.autoPanPaddingBottomRight||P),X=e.getSize(),_e=0,Be=0;g.x+a+D.x>X.x&&(_e=g.x+a-X.x+D.x),g.x-_e-$.x<0&&(_e=g.x-$.x),g.y+o+D.y>X.y&&(Be=g.y+o-X.y+D.y),g.y-Be-$.y<0&&(Be=g.y-$.y),(_e||Be)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([_e,Be]))}},_getAnchor:function(){return te(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Sa=function(e,n){return new Vo(e,n)};Ge.mergeOptions({closePopupOnClick:!0}),Ge.include({openPopup:function(e,n,o){return this._initOverlay(Vo,e,n,o).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),Wt.include({bindPopup:function(e,n){return this._popup=this._initOverlay(Vo,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 Fn||(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)){ci(e);var n=e.layer||e.target;if(this._popup._source===n&&!(n instanceof _n)){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 lo=bn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){bn.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){bn.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=bn.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=at("div",n),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+y(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(e){var n,o,a=this._map,c=this._container,g=a.latLngToContainerPoint(a.getCenter()),P=a.layerPointToContainerPoint(e),$=this.options.direction,D=c.offsetWidth,X=c.offsetHeight,_e=te(this.options.offset),Be=this._getAnchor();$==="top"?(n=D/2,o=X):$==="bottom"?(n=D/2,o=0):$==="center"?(n=D/2,o=X/2):$==="right"?(n=0,o=X/2):$==="left"?(n=D,o=X/2):P.xthis.options.maxZoom||oa?this._retainParent(c,g,P,a):!1)},_retainChildren:function(e,n,o,a){for(var c=2*e;c<2*e+2;c++)for(var g=2*n;g<2*n+2;g++){var P=new ae(c,g);P.z=o+1;var $=this._tileCoordsToKey(P),D=this._tiles[$];if(D&&D.active){D.retain=!0;continue}else D&&D.loaded&&(D.retain=!0);o+1this.options.maxZoom||this.options.minZoom!==void 0&&c1){this._setView(e,o);return}for(var Be=c.min.y;Be<=c.max.y;Be++)for(var Qe=c.min.x;Qe<=c.max.x;Qe++){var tn=new ae(Qe,Be);if(tn.z=this._tileZoom,!!this._isValidTile(tn)){var Dt=this._tiles[this._tileCoordsToKey(tn)];Dt?Dt.current=!0:P.push(tn)}}if(P.sort(function(fn,Wo){return fn.distanceTo(g)-Wo.distanceTo(g)}),P.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var An=document.createDocumentFragment();for(Qe=0;Qeo.max.x)||!n.wrapLat&&(e.yo.max.y))return!1}if(!this.options.bounds)return!0;var a=this._tileCoordsToBounds(e);return lt(this.options.bounds).overlaps(a)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var n=this._map,o=this.getTileSize(),a=e.scaleBy(o),c=a.add(o),g=n.unproject(a,e.z),P=n.unproject(c,e.z);return[g,P]},_tileCoordsToBounds:function(e){var n=this._tileCoordsToNwSe(e),o=new ht(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 ae(+n[0],+n[1]);return o.z=+n[2],o},_removeTile:function(e){var n=this._tiles[e];n&&(rt(n.el),delete this._tiles[e],this.fire("tileunload",{tile:n.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){Ke(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,ge.ielt9&&this.options.opacity<1&&ln(e,this.options.opacity)},_addTile:function(e,n){var o=this._getTilePos(e),a=this._tileCoordsToKey(e),c=this.createTile(this._wrapCoords(e),h(this._tileReady,this,e));this._initTile(c),this.createTile.length<2&&ze(h(this._tileReady,this,e,null,c)),At(c,o),this._tiles[a]={el:c,coords:e,current:!0},n.appendChild(c),this.fire("tileloadstart",{tile:c,coords:e})},_tileReady:function(e,n,o){n&&this.fire("tileerror",{error:n,tile:o,coords:e});var a=this._tileCoordsToKey(e);o=this._tiles[a],o&&(o.loaded=+new Date,this._map._fadeAnimated?(ln(o.el,0),ie(this._fadeFrame),this._fadeFrame=ze(this._updateOpacity,this)):(o.active=!0,this._pruneTiles()),n||(Ke(o.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:o.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ge.ielt9||!this._map._fadeAnimated?ze(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 ae(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 ke(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 xt(e){return new uo(e)}var Ln=uo.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=F(this,n),n.detectRetina&&ge.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 De(o,"load",h(this._tileOnLoad,this,n,o)),De(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:ge.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 Y(this._url,u(n,this.options))},_tileOnLoad:function(e,n){ge.ielt9?setTimeout(h(e,this,null,n),0):e(null,n)},_tileOnError:function(e,n,o){var a=this.options.errorTileUrl;a&&n.getAttribute("src")!==a&&(n.src=a),e(o,n)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,n=this.options.maxZoom,o=this.options.zoomReverse,a=this.options.zoomOffset;return o&&(e=n-e),e+a},_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=Ue;var o=this._tiles[e].coords;rt(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",Ue),uo.prototype._removeTile.call(this,e)},_tileReady:function(e,n,o){if(!(!this._map||o&&o.getAttribute("src")===Ue))return uo.prototype._tileReady.call(this,e,n,o)}});function Ho(e,n){return new Ln(e,n)}var jo=Ln.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 a in n)a in this.options||(o[a]=n[a]);n=F(this,n);var c=n.detectRetina&&ge.retina?2:1,g=this.getTileSize();o.width=g.x*c,o.height=g.y*c,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,Ln.prototype.onAdd.call(this,e)},getTileUrl:function(e){var n=this._tileCoordsToNwSe(e),o=this._crs,a=Ne(o.project(n[0]),o.project(n[1])),c=a.min,g=a.max,P=(this._wmsVersion>=1.3&&this._crs===io?[c.y,c.x,g.y,g.x]:[c.x,c.y,g.x,g.y]).join(","),$=Ln.prototype.getTileUrl.call(this,e);return $+he(this.wmsParams,$,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+P},setParams:function(e,n){return u(this.wmsParams,e),n||this.redraw(),this}});function vr(e,n){return new jo(e,n)}Ln.WMS=jo,Ho.wms=vr;var Bn=Wt.extend({options:{padding:.1},initialize:function(e){F(this,e),y(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),Ke(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),a=this._map.getSize().multiplyBy(.5+this.options.padding),c=this._map.project(this._center,n),g=a.multiplyBy(-o).add(c).subtract(this._map._getNewPixelOrigin(e,n));ge.any3d?ri(this._container,g,o):At(this._container,g)},_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 ke(o,o.add(n.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),v=Bn.extend({options:{tolerance:0},getEvents:function(){var e=Bn.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Bn.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");De(e,"mousemove",this._onMouseMove,this),De(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),De(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){ie(this._redrawRequest),delete this._ctx,rt(this._container),nt(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)){Bn.prototype._update.call(this);var e=this._bounds,n=this._container,o=e.getSize(),a=ge.retina?2:1;At(n,e.min),n.width=a*o.x,n.height=a*o.y,n.style.width=o.x+"px",n.style.height=o.y+"px",ge.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){Bn.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(e){this._updateDashArray(e),this._layers[y(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,a=n.prev;o?o.prev=a:this._drawLast=a,a?a.next=o:this._drawFirst=o,delete e._order,delete this._layers[y(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=[],a,c;for(c=0;c')}}catch{}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),w={_initContainer:function(){this._container=at("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Bn.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var n=e._container=V("shape");Ke(n,"leaflet-vml-shape "+(this.options.className||"")),n.coordsize="1 1",e._path=V("path"),n.appendChild(e._path),this._updateStyle(e),this._layers[y(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;rt(n),e.removeInteractiveTarget(n),delete this._layers[y(e)]},_updateStyle:function(e){var n=e._stroke,o=e._fill,a=e.options,c=e._container;c.stroked=!!a.stroke,c.filled=!!a.fill,a.stroke?(n||(n=e._stroke=V("stroke")),c.appendChild(n),n.weight=a.weight+"px",n.color=a.color,n.opacity=a.opacity,a.dashArray?n.dashStyle=Le(a.dashArray)?a.dashArray.join(" "):a.dashArray.replace(/( *, *)/g," "):n.dashStyle="",n.endcap=a.lineCap.replace("butt","flat"),n.joinstyle=a.lineJoin):n&&(c.removeChild(n),e._stroke=null),a.fill?(o||(o=e._fill=V("fill")),c.appendChild(o),o.color=a.fillColor||a.color,o.opacity=a.fillOpacity):o&&(c.removeChild(o),e._fill=null)},_updateCircle:function(e){var n=e._point.round(),o=Math.round(e._radius),a=Math.round(e._radiusY||o);this._setPath(e,e._empty()?"M0 0":"AL "+n.x+","+n.y+" "+o+","+a+" 0,"+65535*360)},_setPath:function(e,n){e._path.v=n},_bringToFront:function(e){vn(e._container)},_bringToBack:function(e){Rt(e._container)}},Ve=ge.vml?V:G,Cs=Bn.extend({_initContainer:function(){this._container=Ve("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=Ve("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){rt(this._container),nt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){Bn.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)),At(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=Ve("path");e.options.className&&Ke(n,e.options.className),e.options.interactive&&Ke(n,"leaflet-interactive"),this._updateStyle(e),this._layers[y(e)]=e},_addPath:function(e){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(e._path),e.addInteractiveTarget(e._path)},_removePath:function(e){rt(e._path),e.removeInteractiveTarget(e._path),delete this._layers[y(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),a=Math.max(Math.round(e._radiusY),1)||o,c="a"+o+","+a+" 0 1,0 ",g=e._empty()?"M0 0":"M"+(n.x-o)+","+n.y+c+o*2+",0 "+c+-o*2+",0 ";this._setPath(e,g)},_setPath:function(e,n){e._path.setAttribute("d",n)},_bringToFront:function(e){vn(e._path)},_bringToBack:function(e){Rt(e._path)}});ge.vml&&Cs.include(w);function gl(e){return ge.svg||ge.vml?new Cs(e):null}Ge.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&&d(e)||gl(e)}});var vl=Pn.extend({initialize:function(e,n){Pn.prototype.initialize.call(this,this._boundsToLatLngs(e),n)},setBounds:function(e){return this.setLatLngs(this._boundsToLatLngs(e))},_boundsToLatLngs:function(e){return e=lt(e),[e.getSouthWest(),e.getNorthWest(),e.getNorthEast(),e.getSouthEast()]}});function id(e,n){return new vl(e,n)}Cs.create=Ve,Cs.pointsToPath=W,Kt.geometryToLayer=hi,Kt.coordsToLatLng=Ts,Kt.coordsToLatLngs=it,Kt.latLngToCoords=Cn,Kt.latLngsToCoords=pi,Kt.getFeature=Gn,Kt.asFeature=Fo,Ge.mergeOptions({boxZoom:!0});var _l=jt.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(){De(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){nt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){rt(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(),kn(),Ci(),this._startPoint=this._map.mouseEventToContainerPoint(e),De(document,{contextmenu:ci,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=at("div","leaflet-zoom-box",this._container),Ke(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var n=new ke(this._point,this._startPoint),o=n.getSize();At(this._box,n.min),this._box.style.width=o.x+"px",this._box.style.height=o.y+"px"},_finish:function(){this._moved&&(rt(this._box),Lt(this._container,"leaflet-crosshair")),li(),Li(),nt(document,{contextmenu:ci,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 ht(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())}});Ge.addInitHook("addHandler","boxZoom",_l),Ge.mergeOptions({doubleClickZoom:!0});var bl=jt.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(),a=n.options.zoomDelta,c=e.originalEvent.shiftKey?o-a:o+a;n.options.doubleClickZoom==="center"?n.setZoom(c):n.setZoomAround(e.containerPoint,c)}});Ge.addInitHook("addHandler","doubleClickZoom",bl),Ge.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var yl=jt.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new Wn(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))}Ke(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=lt(this._map.options.maxBounds);this._offsetLimit=Ne(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,a=this._draggable._newPos.x,c=(a-n+o)%e+n-o,g=(a+n+o)%e-n-o,P=Math.abs(c+o)0?g:-g))-n;this._delta=0,this._startTime=null,P&&(e.options.scrollWheelZoom==="center"?e.setZoom(n+P):e.setZoomAround(this._lastMousePos,n+P))}});Ge.addInitHook("addHandler","scrollWheelZoom",wl);var od=600;Ge.mergeOptions({tapHold:ge.touchNative&&ge.safari&&ge.mobile,tapTolerance:15});var kl=jt.extend({addHooks:function(){De(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){nt(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 ae(n.clientX,n.clientY),this._holdTimeout=setTimeout(h(function(){this._cancel(),this._isTapValid()&&(De(document,"touchend",It),De(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",n))},this),od),De(document,"touchend touchcancel contextmenu",this._cancel,this),De(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){nt(document,"touchend",It),nt(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),nt(document,"touchend touchcancel contextmenu",this._cancel,this),nt(document,"touchmove",this._onMove,this)},_onMove:function(e){var n=e.touches[0];this._newPos=new ae(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)}});Ge.addInitHook("addHandler","tapHold",kl),Ge.mergeOptions({touchZoom:ge.touch,bounceAtZoomLimits:!0});var Sl=jt.extend({addHooks:function(){Ke(this._map._container,"leaflet-touch-zoom"),De(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Lt(this._map._container,"leaflet-touch-zoom"),nt(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]),a=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(a)._divideBy(2))),this._startDist=o.distanceTo(a),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),De(document,"touchmove",this._onTouchMove,this),De(document,"touchend touchcancel",this._onTouchEnd,this),It(e)}},_onTouchMove:function(e){if(!(!e.touches||e.touches.length!==2||!this._zooming)){var n=this._map,o=n.mouseEventToContainerPoint(e.touches[0]),a=n.mouseEventToContainerPoint(e.touches[1]),c=o.distanceTo(a)/this._startDist;if(this._zoom=n.getScaleZoom(c,this._startZoom),!n.options.bounceAtZoomLimits&&(this._zoomn.getMaxZoom()&&c>1)&&(this._zoom=n._limitZoom(this._zoom)),n.options.touchZoom==="center"){if(this._center=this._startLatLng,c===1)return}else{var g=o._add(a)._divideBy(2)._subtract(this._centerPoint);if(c===1&&g.x===0&&g.y===0)return;this._center=n.unproject(n.project(this._pinchStartLatLng,this._zoom).subtract(g),this._zoom)}this._moved||(n._moveStart(!0,!1),this._moved=!0),ie(this._animRequest);var P=h(n._move,n,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=ze(P,this,!0),It(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,ie(this._animRequest),nt(document,"touchmove",this._onTouchMove,this),nt(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))}});Ge.addInitHook("addHandler","touchZoom",Sl),Ge.BoxZoom=_l,Ge.DoubleClickZoom=bl,Ge.Drag=yl,Ge.Keyboard=xl,Ge.ScrollWheelZoom=wl,Ge.TapHold=kl,Ge.TouchZoom=Sl,s.Bounds=ke,s.Browser=ge,s.CRS=E,s.Canvas=v,s.Circle=Di,s.CircleMarker=Mt,s.Class=oe,s.Control=Ut,s.DivIcon=Ta,s.DivOverlay=bn,s.DomEvent=zo,s.DomUtil=Sn,s.Draggable=Wn,s.Evented=ce,s.FeatureGroup=Fn,s.GeoJSON=Kt,s.GridLayer=uo,s.Handler=jt,s.Icon=Vt,s.ImageOverlay=qn,s.LatLng=Ze,s.LatLngBounds=ht,s.Layer=Wt,s.LayerGroup=Kn,s.LineUtil=fr,s.Map=Ge,s.Marker=fi,s.Mixin=ur,s.Path=_n,s.Point=ae,s.PolyUtil=cr,s.Polygon=Pn,s.Polyline=Tn,s.Popup=Vo,s.PosAnimation=Xi,s.Projection=no,s.Rectangle=vl,s.Renderer=Bn,s.SVG=Cs,s.SVGOverlay=Yn,s.TileLayer=Ln,s.Tooltip=lo,s.Transformation=Tt,s.Util=je,s.VideoOverlay=Fi,s.bind=h,s.bounds=Ne,s.canvas=d,s.circle=ro,s.circleMarker=Ni,s.control=zi,s.divIcon=Zo,s.extend=u,s.featureGroup=pr,s.geoJSON=ka,s.geoJson=Bo,s.gridLayer=xt,s.icon=mr,s.imageOverlay=Uo,s.latLng=J,s.latLngBounds=lt,s.layerGroup=hr,s.map=Oi,s.marker=ao,s.point=te,s.polygon=xa,s.polyline=Do,s.popup=Sa,s.rectangle=id,s.setOptions=F,s.stamp=y,s.svg=gl,s.svgOverlay=Ps,s.tileLayer=Ho,s.tooltip=gr,s.transformation=x,s.version=l,s.videoOverlay=Rn;var sd=window.L;s.noConflict=function(){return window.L=sd,this},window.L=s}))})($s,$s.exports)),$s.exports}var um=lm();const Bi=am(um),Pu={__name:"DeviceMap",props:{position:{type:Object,default:null},trail:{type:Array,default:()=>[]},aircraft:{type:Array,default:()=>[]}},setup(t){const i=t,s=Z(null);let l,u,f,h;const _=new Map;function y(j,F){const he=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0",pe=F?"#8a94a6":he,Y=typeof j=="number"?j:0;return Bi.divIcon({className:"plane-marker",iconSize:[22,22],iconAnchor:[11,11],html:``})}function C(j){const he=[`${j.callsign||j.icao24||"aircraft"}`];return j.country&&he.push(j.country),typeof j.altitude=="number"&&he.push(`${Math.round(j.altitude)} m`),typeof j.velocity=="number"&&he.push(`${Math.round(j.velocity*3.6)} km/h`),j.onGround&&he.push("on ground"),he.join(" · ")}function T(){if(!l)return;h||(h=Bi.layerGroup().addTo(l));const j=new Set;for(const F of i.aircraft){if(typeof F.lat!="number"||typeof F.lng!="number")continue;j.add(F.icao24);const he=[F.lat,F.lng];let pe=_.get(F.icao24);pe?(pe.setLatLng(he),pe.setIcon(y(F.heading,F.onGround)),pe.setTooltipContent(C(F))):(pe=Bi.marker(he,{icon:y(F.heading,F.onGround)}).bindTooltip(C(F)),pe.addTo(h),_.set(F.icao24,pe))}for(const[F,he]of _)j.has(F)||(h.removeLayer(he),_.delete(F))}function M(){if(!l)return;const j=i.position;if(j&&(j.lat||j.lng)){const F=[j.lat,j.lng];u?u.setLatLng(F):(u=Bi.marker(F).addTo(l),l.setView(F,17))}if(f&&f.remove(),i.trail.length){const F=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0";f=Bi.polyline(i.trail,{color:F,weight:3}).addTo(l)}}ki(()=>{l=Bi.map(s.value,{zoomControl:!0}).setView([20,0],2),Bi.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&&B()});let R=!1;function B(){if(R||!l||!i.aircraft.length)return;const j=i.aircraft.filter(F=>typeof F.lat=="number"&&typeof F.lng=="number").map(F=>[F.lat,F.lng]);j.length&&(l.fitBounds(Bi.latLngBounds(j).pad(.2)),R=!0)}return ss(()=>{l&&l.remove(),l=null}),$t(()=>i.position,M,{deep:!0}),$t(()=>i.trail,M,{deep:!0}),$t(()=>i.aircraft,()=>{T(),(!i.position||!i.position.lat&&!i.position.lng)&&B()},{deep:!0}),(j,F)=>(p(),m("div",{ref_key:"el",ref:s,class:"h-[320px] w-full rounded-lg"},null,512))}},cm=["width","height","stroke-width"],dm=["d"],K={__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(ue,null,Re(Oe(l),(h,_)=>(p(),m("path",{key:_,d:h},null,8,dm))),128))],8,cm))}},fm=["aria-checked","disabled"],Gt={__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:Me(["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))},[r("span",{class:Me(["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,fm))}},hm={class:"inline-flex rounded-[10px] border border-line bg-surface-2 p-0.5"},pm=["onClick"],hn={__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",hm,[(p(!0),m(ue,null,Re(t.options,f=>(p(),m("button",{key:f.value,type:"button",class:Me(["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(),ot(K,{key:0,name:f.icon,size:15},null,8,["name"])):N("",!0),I(" "+k(f.label),1)],10,pm))),128))]))}},mm={class:"text-sm font-semibold text-ink"},gm={key:0,class:"mt-0.5 text-xs text-ink-muted"},Pe={__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=Rs("settingsSearch",{value:""}),l=ve(()=>{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:Me(["border-b border-line py-4 last:border-0",t.block?"":"flex items-center justify-between gap-6"])},[r("div",{class:Me(t.block?"mb-3":"min-w-0")},[r("div",mm,k(t.title),1),t.desc?(p(),m("div",gm,k(t.desc),1)):N("",!0)],2),r("div",{class:Me(t.block?"":"shrink-0")},[Tf(u.$slots,"default")],2)],2)):N("",!0)}},ea=[{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"}],vm=new Map(ea.map(t=>[t.code,t]));function _m(t){const i=String(t||"").split(",").map(s=>Number(s.trim()));return i.length!==4||i.some(s=>Number.isNaN(s))?null:i}function bm(t){const i=vm.get(t);return i?i.bbox:""}function Or(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 ea){const f=_m(u.bbox);if(!f)continue;const[h,_,y,C]=f;if(ty||i<_||i>C)continue;const T=Math.abs(y-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 xm(){return ea.slice().sort((t,i)=>t.name.localeCompare(i.name)).map(t=>[t.code,t.name])}const wm=[["EU","European countries"],["AS","Asian countries"],["AF","African countries"],["NA","North American countries"],["SA","South American countries"],["OC","Oceanian countries"]];function km(){return wm.map(([t,i])=>({label:i,options:ea.filter(s=>s.continent===t).slice().sort((s,l)=>s.name.localeCompare(l.name)).map(s=>({value:s.bbox,label:s.name}))}))}const Sm=(t,i)=>{const s=t.__vccOpts||t;for(const[l,u]of i)s[l]=u;return s},Tm={class:"mx-auto max-w-[1280px] p-7"},Pm={class:"mb-5 flex flex-wrap items-end justify-between gap-4"},Cm={class:"flex h-10 w-full max-w-[280px] items-center gap-2 rounded border border-line-strong bg-surface-1 px-3"},Lm={class:"grid grid-cols-[210px_1fr] gap-6 max-[760px]:grid-cols-1"},Am={class:"flex flex-col gap-0.5 max-[760px]:flex-row max-[760px]:overflow-x-auto"},Mm=["onClick"],Em={class:"whitespace-nowrap"},Om={class:"min-w-0"},zm={key:0,class:"panel p-10 text-center text-sm text-ink-muted"},Im={key:0,class:"eyebrow mb-2 mt-5 first:mt-0 flex items-center gap-2"},$m={key:1,class:"panel mb-5 p-5"},Nm={class:"flex items-center gap-1"},Dm={class:"flex items-center gap-2"},Fm={class:"font-mono text-sm text-ink"},Rm={class:"inline-flex items-center gap-1 rounded-full bg-amber-soft px-2 py-0.5 text-[11px] font-semibold text-amber-fg"},Bm={key:0,class:"mt-2 text-xs text-ink-muted"},Um={class:"grid max-w-[420px] gap-2"},Vm={class:"flex items-center gap-3"},Zm={key:2,class:"panel mb-5 p-5"},Hm=["value"],jm=["value"],Wm=["value"],Km={class:"font-mono text-sm text-ink"},Gm={key:3},qm={key:0,class:"mb-5 flex items-center gap-1 overflow-x-auto border-b border-line"},Ym=["onClick"],Jm={class:"panel mb-5 p-5"},Xm={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Qm={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},eg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},tg={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"},ng={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},ig={key:0},og={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},sg={class:"font-semibold text-ink-secondary"},ag={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},rg={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"},lg={class:"flex items-center justify-between gap-3"},ug={class:"flex items-center gap-2 text-sm font-semibold text-ink"},cg={key:0,class:"text-[11px] text-ink-muted"},dg={class:"mt-2 flex items-baseline gap-1.5"},fg={class:"font-mono text-2xl font-semibold text-ink"},hg={class:"text-sm text-ink-muted"},pg={class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},mg={class:"mt-2 text-xs text-ink-muted"},gg={class:"mt-2 text-sm text-ink"},vg={class:"font-semibold"},_g={class:"mt-1 text-xs text-ink-muted"},bg={key:1,class:"mt-2 text-xs text-ink-muted"},yg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},xg={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"},wg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},kg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Sg={key:1,class:"flex flex-col items-end gap-2"},Tg={key:0,value:"__auto__"},Pg=["label"],Cg=["value"],Lg={key:0,class:"w-64 text-right text-[11px] leading-snug text-ink-muted"},Ag={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Mg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},Eg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Og={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},zg={key:8,class:"border-b border-line py-3 text-xs text-amber-fg"},Ig={class:"mt-4 flex flex-wrap items-center gap-3"},$g=["disabled"],Ng={key:1,class:"flex items-center gap-2",title:"Bounding box used for Test connection — smaller areas cost fewer OpenSky credits"},Dg=["label"],Fg=["value"],Rg=["disabled"],Bg={key:3,class:"text-xs text-danger-fg"},Ug={class:"panel mb-5 p-5"},Vg={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Zg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Hg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},jg={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"},Wg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Kg={key:0},Gg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},qg={class:"font-semibold text-ink-secondary"},Yg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Jg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Xg={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"},Qg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},ev={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"},tv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},nv={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"},iv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},ov={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"},sv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},av={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={class:"mt-4 flex flex-wrap items-center gap-3"},lv=["disabled"],uv=["disabled"],cv={key:2,class:"text-xs text-danger-fg"},dv={key:3,class:"text-[11px] text-ink-muted"},fv={class:"panel mb-5 p-5"},hv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},pv={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"},gv={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"},vv={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},_v={key:0},bv={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},yv={class:"font-semibold text-ink-secondary"},xv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},wv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},kv={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"},Sv={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"},Pv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Cv={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"},Av={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"},Mv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Ev={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"},zv={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"},Iv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},$v={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 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:0,class:"inline-flex items-center gap-2 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"},Bv={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"},Vv={class:"mt-4 flex flex-wrap items-center gap-3"},Zv=["disabled"],Hv=["disabled"],jv={key:2,class:"text-xs text-danger-fg"},Wv={key:3,class:"text-[11px] text-ink-muted"},Kv={class:"panel mb-5 p-5"},Gv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},qv={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Yv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Jv={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"},Xv={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Qv={key:0},e_={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},t_={class:"font-semibold text-ink-secondary"},n_={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},i_={key:0,class:"inline-flex items-center gap-2 break-all font-mono text-sm text-ink"},o_={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 font-mono text-sm text-ink"},a_={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"},r_={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},l_={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"},u_={key:0,class:"inline-flex items-center gap-2 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"},d_={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},f_={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"},h_={class:"mt-4 flex flex-wrap items-center gap-3"},p_=["disabled"],m_=["disabled"],g_={key:2,class:"text-xs text-danger-fg"},v_={key:3,class:"text-[11px] text-ink-muted"},__={key:3,class:"panel mb-5 p-5"},b_={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},y_={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},x_={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},w_={key:1,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},k_={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"},S_={key:5,class:"border-b border-line py-3 text-xs text-amber-fg"},T_={key:0},P_={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},C_={class:"font-semibold text-ink-secondary"},L_={key:7,class:"border-b border-line py-3 text-xs text-ink-muted"},A_={class:"flex w-full flex-col gap-2"},M_={class:"break-all font-mono text-sm text-ink"},E_={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},O_={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"},z_={key:0,class:"text-xs text-ink-muted"},I_={key:1,class:"border-b border-line py-3 text-xs text-ink-muted"},$_={key:0,class:"inline-flex items-center gap-2 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"},D_={class:"mt-4 flex flex-wrap items-center gap-3"},F_=["disabled"],R_=["disabled"],B_={key:2,class:"text-xs text-danger-fg"},U_={key:3,class:"text-[11px] text-ink-muted"},V_={key:4,class:"panel mb-5 p-5"},Z_={class:"flex items-center gap-4"},H_=["src"],j_={key:1,class:"grid h-16 w-16 place-items-center rounded-full bg-[var(--navy-800)] text-lg font-bold text-white"},W_={class:"flex gap-2"},K_={class:"btn-ghost cursor-pointer"},G_={class:"mt-1 text-right text-[11px] text-ink-muted"},q_={key:5,class:"panel mb-5 p-5"},Y_={class:"flex items-center gap-3"},J_={key:0,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},X_={class:"flex flex-wrap items-center gap-4"},Q_={class:"min-w-0"},e1={class:"mt-1 select-all font-mono text-sm font-bold text-ink"},t1={class:"mt-3 flex items-center gap-2"},n1={key:0,class:"mt-2 text-xs text-danger-fg"},i1={key:1,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},o1={class:"mt-2 grid grid-cols-2 gap-1 font-mono text-xs text-ink-secondary sm:grid-cols-4"},s1={class:"rounded-lg border border-line bg-surface-2 p-3"},a1={class:"flex items-center gap-3"},r1={class:"grid h-9 w-9 place-items-center rounded-full bg-accent-soft text-accent-soft-fg"},l1={class:"min-w-0 flex-1"},u1={class:"text-sm font-semibold text-ink"},c1={class:"font-mono text-[11px] text-ink-muted"},d1={key:6,class:"mb-5"},f1={key:0,class:"panel mb-5 p-5"},h1={class:"grid max-w-[520px] gap-2"},p1={class:"flex flex-wrap gap-2"},m1=["disabled","title"],g1=["value"],v1=["value"],_1={class:"flex items-center gap-2 py-1 text-sm text-ink-secondary"},b1={class:"flex items-center gap-3"},y1=["disabled"],x1={key:0,class:"text-xs text-danger-fg"},w1={key:1,class:"text-xs text-ink-muted"},k1={key:1,class:"panel mb-5 p-5"},S1={class:"grid max-w-[520px] gap-2"},T1={class:"flex flex-wrap gap-2"},P1=["value"],C1=["value"],L1={key:1,class:"text-xs text-ink-muted"},A1={class:"font-semibold text-ink-secondary"},M1={class:"flex items-center gap-3"},E1=["disabled"],O1={key:0,class:"text-xs text-danger-fg"},z1={class:"panel overflow-hidden p-0"},I1={class:"flex items-center justify-between px-5 py-4"},$1=["disabled"],N1={key:0,class:"px-5 pb-5 text-sm text-danger-fg"},D1={key:1,class:"px-5 pb-8 text-sm text-ink-muted"},F1={key:2,class:"overflow-x-auto"},R1={class:"w-full border-collapse text-sm"},B1={class:"text-left"},U1={class:"px-5 py-3"},V1={class:"text-ink"},Z1={key:0,class:"ml-1.5 text-[11px] text-ink-muted"},H1={class:"px-5 py-3"},j1={class:"px-5 py-3"},W1={class:"px-5 py-3"},K1={class:"px-5 py-3 text-right"},G1=["onClick"],q1={key:1,class:"inline-flex items-center gap-1.5"},Y1=["onClick"],J1=["onClick"],X1={key:7,class:"mb-5"},Q1={key:0,class:"panel mb-5 p-5"},eb={class:"grid max-w-[520px] gap-2"},tb={class:"flex items-center gap-3"},nb={key:0,class:"text-xs text-danger-fg"},ib={key:1,class:"panel mb-5 p-5"},ob={class:"grid max-w-[520px] gap-2"},sb={class:"flex items-center gap-3"},ab=["disabled"],rb={key:0,class:"text-xs text-danger-fg"},lb={class:"panel overflow-hidden p-0"},ub={key:0,class:"px-5 pb-8 text-sm text-ink-muted"},cb={key:1,class:"overflow-x-auto"},db={class:"w-full border-collapse text-sm"},fb={class:"text-left"},hb={class:"px-5 py-3"},pb={class:"inline-flex items-center gap-2 text-ink"},mb={class:"px-5 py-3 text-ink-secondary"},gb={class:"px-5 py-3 text-right"},vb=["onClick"],_b={key:1,class:"inline-flex items-center gap-1.5"},bb=["onClick"],yb=["disabled","title","onClick"],xb={key:8,class:"mb-5"},wb={class:"panel mb-5 p-5"},kb={class:"btn-ghost cursor-pointer"},Sb={key:0,class:"mt-2 text-xs text-ink-muted"},Tb={class:"rounded-lg border p-5",style:{"border-color":"color-mix(in srgb, var(--danger) 35%, transparent)",background:"var(--danger-soft)"}},Pb={class:"flex items-center gap-2 text-danger-fg"},Cb={class:"mt-4 rounded-lg border border-line bg-surface-1 p-4"},Lb={class:"mt-3 flex items-start gap-2 text-sm text-ink-secondary"},Ab={class:"mt-3"},Mb={class:"eyebrow mb-1 block"},Eb={class:"text-ink"},Ob=["placeholder"],zb={class:"mt-4 flex flex-wrap items-center gap-3"},Ib=["disabled"],$b=["disabled"],Nb={key:2,class:"text-xs text-ink-muted"},Db={key:0,class:"mt-3 rounded border border-line bg-surface-2 px-3 py-2 text-xs text-ink-secondary"},Fb={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"},Cu="pv.opensky.health",Lu="pv.filetransfer.health",Au="pv.webdav.health",Mu="pv.openweather.health",Eu="pv.localstorage.health",Rb={__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=ve(()=>s.role==="superadmin"),f=ve(()=>s.role==="admin"||s.role==="superadmin");function h(v){return v==="superadmin"?"Superadmin":v==="admin"?"Admin":"User"}function _(v){return v==="superadmin"||v==="admin"?"shield":"user"}function y(v){return v==="superadmin"||v==="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=ve(()=>{const v=[{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"},{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&&v.push({id:"team",label:"User management",icon:"users",kw:"users team members add remove create delete role admin permissions rights organization"}),u.value&&v.push({id:"organizations",label:"Organizations",icon:"grid",kw:"organization org tenant company create rename delete members"}),v.push({id:"advanced",label:"Advanced",icon:"alertTriangle",kw:"export import data delete account danger zone",danger:!0}),v}),M=Z("account"),R=Z("");lc("settingsSearch",R);const B=ve(()=>R.value.trim().length>0),j=ve(()=>R.value.trim().toLowerCase());function F(v){return j.value?(v.label+" "+v.kw).toLowerCase().includes(j.value)||pe(v.id):!0}const he={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"],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 pe(v){return j.value?(he[v]||[]).some(d=>d.includes(j.value)):!0}const Y=ve(()=>B.value?T.value.filter(F):T.value.filter(v=>v.id===M.value)),Le=ve({get:()=>yo.value,set:v=>Wa(v)}),fe=[{value:"light",label:"Light",icon:"sun"},{value:"dark",label:"Dark",icon:"moon"},{value:"system",label:"System",icon:"monitor"}],Ue=[{value:"sm",label:"Small"},{value:"md",label:"Default"},{value:"lg",label:"Large"}],$e=[{value:"12",label:"12-hour"},{value:"24",label:"24-hour"}],Ie=[["en","English"],["es","Español"],["de","Deutsch"],["fr","Français"],["pl","Polski"],["ja","日本語"]],qe=xm(),xe=ve(()=>(qe.find(([v])=>v===be.region)||[null,be.region])[1]),Se=[["MDY","MM/DD/YYYY"],["DMY","DD/MM/YYYY"],["YMD","YYYY/MM/DD"],["ISO","YYYY-MM-DD"]],ze=Z(Date.now());let ie=null;const je=ve(()=>ku(ze.value)),oe=kt({loaded:!1,available:!1,orgEnabled:!0,allowAnonymous:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),We=Z("user"),le=kt({clientId:"",clientSecret:"",plan:"",bbox:""}),ce=Z(""),ae=Z(!1),st=Z(!1),te=Z(null),ke=Z(null),Ne=ve(()=>te.value&&te.value.credits||null),ht=ve(()=>{const v=Ne.value;return!v||!v.daily||v.remaining==null?null:Math.max(0,Math.min(100,Math.round(v.remaining/v.daily*100)))}),lt=ve(()=>{const v=ht.value;return v==null?"bg-accent":v<=10?"bg-danger":v<=30?"bg-amber":"bg-success"});function Ze(v){return typeof v=="number"?v.toLocaleString():v}function J(){if(!ke.value)return"";const v=Math.max(0,Math.round((Date.now()-ke.value)/1e3));if(v<60)return"just now";const d=Math.round(v/60);if(d<60)return`${d} min ago`;const V=Math.round(d/60);return V<24?`${V} h ago`:`${Math.round(V/24)} d ago`}function E(){try{te.value&&localStorage.setItem(Cu,JSON.stringify({health:te.value,ts:ke.value}))}catch{}}function z(){try{const v=localStorage.getItem(Cu);if(!v)return;const d=JSON.parse(v);d&&d.health&&(te.value=d.health,ke.value=d.ts||null)}catch{}}const _t=[{value:"",label:"Not set"},{value:"anonymous",label:"Anonymous"},{value:"standard",label:"Standard"},{value:"contributor",label:"Contributor"}],ut=[{value:"user",label:"My settings",icon:"user"},{value:"org",label:"Organization",icon:"users"}],Tt=[{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:ym()},{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"}]}],x=Tt.flatMap(v=>v.options);function b(v){const d=String(v||"").split(",").map(w=>w.trim());if(d.length!==4)return"";const V=d.map(Number);return V.some(w=>Number.isNaN(w))?"":V.join(",")}function S(v){const d=b(v),V=d&&x.find(w=>b(w.value)===d);return V?V.label:""}const G=Z(!1),W=ve({get(){if(!me.value&&be.autoBbox)return"__auto__";if(G.value)return"__custom__";const v=b(le.bbox),d=v&&x.find(V=>b(V.value)===v);return d?d.value:"__custom__"},set(v){if(v==="__auto__"){me.value||(be.autoBbox=!0),G.value=!1;return}if(me.value||(be.autoBbox=!1),v==="__custom__"){G.value=!0;return}G.value=!1,le.bbox=v}}),H=ve(()=>W.value==="__custom__"),re=ve(()=>W.value==="__auto__"),ne=ve(()=>oe.isSuperadmin),Q=ve(()=>oe.isSuperadmin?"user":We.value),q=ve(()=>oe.scopes[Q.value]||{editableLayer:"user",fields:{}}),me=ve(()=>Q.value==="org");function se(v){return q.value.fields[v]||{effective:"",own:"",source:"unset",locked:!1}}function Ce(v){return ne.value||se(v).locked}function Ae(v){const d=se(v).source;return d==="global"?"Set by administrator":d==="org"?"Set by your organization":""}function He(){le.clientId=se("clientId").own||"",le.clientSecret=se("clientSecret").own||"",le.plan=se("plan").own||"",le.bbox=se("bbox").own||"",G.value=!1}function et(v){oe.available=!!v.available,oe.orgEnabled=v.orgEnabled!==!1,oe.allowAnonymous=!!v.allowAnonymous,oe.enabled=!!v.enabled,oe.canEditOrg=!!v.canEditOrg,oe.isSuperadmin=!!v.isSuperadmin,oe.scopes=v.scopes||{},We.value==="org"&&!oe.canEditOrg&&(We.value="user"),He(),oe.loaded=!0}$t(We,()=>{ce.value="",He()});async function U(){z();const{ok:v,body:d}=await hp();v&&et(d)}async function O(v){const d=me.value;d?oe.orgEnabled=v:oe.enabled=v;const{ok:V,body:w}=await _u(d?{scope:"org",enabled:v}:{scope:"user",enabled:v});V?(et(w),Xe(d?v?"OpenSky enabled for your organization.":"OpenSky disabled for your organization.":v?"OpenSky enabled.":"OpenSky disabled.")):(d?oe.orgEnabled=!v:oe.enabled=!v,Xe(w.error||"Could not update."))}async function Te(){ce.value="",ae.value=!0;const v={};for(const Ve of["clientId","clientSecret","plan","bbox"])Ce(Ve)||(v[Ve]=le[Ve]);const d={scope:Q.value,config:v};me.value||(d.enabled=oe.enabled);const{ok:V,body:w}=await _u(d);if(ae.value=!1,!V){ce.value=w.error||"Could not save settings.";return}et(w),Xe(me.value?"Organization OpenSky settings saved.":"OpenSky settings saved.")}const Ye=[{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"}]},...km()],vt=Ye.flatMap(v=>v.options),yt=Z(""),rn=Z(!1),de=ve({get(){if(rn.value)return"__custom__";if(!yt.value)return"__default__";const v=b(yt.value),d=v&&vt.find(V=>b(V.value)===v);return d?d.value:"__custom__"},set(v){if(v==="__default__"){rn.value=!1,yt.value="";return}if(v==="__custom__"){rn.value=!0;return}rn.value=!1,yt.value=v}}),St=ve(()=>de.value==="__custom__");async function pn(){st.value=!0,te.value=null;const{ok:v,body:d}=await pp((yt.value||"").trim()||void 0);st.value=!1,te.value=v&&d.health?d.health:{status:"down",detail:d.error||"Probe failed."},ke.value=Date.now(),E()}function xo(v){return v==="ok"?C.success:v==="degraded"?C.warning:C.danger}const ct=kt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),si=Z("user"),wo=["protocol","host","port","username","password","privateKey","keyPassphrase","hostKeyFingerprint","insecureSkipVerify","basePath"],pt=kt(Object.fromEntries(wo.map(v=>[v,""]))),Ki=Z(""),ko=Z(!1),So=Z(!1),$n=Z(null),Ti=Z(null),ta=[{value:"sftp",label:"SFTP"},{value:"ftps",label:"FTPS"},{value:"ftp",label:"FTP"}],as=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],rs=ve(()=>ct.isSuperadmin),ls=ve(()=>ct.isSuperadmin?"user":si.value),sr=ve(()=>ct.scopes[ls.value]||{editableLayer:"user",fields:{}}),xn=ve(()=>ls.value==="org"),Qt=ve(()=>(en("protocol")?ge("protocol").effective:pt.protocol)||"sftp");function ge(v){return sr.value.fields[v]||{effective:"",own:"",source:"unset",locked:!1}}function en(v){return rs.value||ge(v).locked}function Ct(v){const d=ge(v).source;return d==="global"?"Set by administrator":d==="org"?"Set by your organization":""}function na(v){return(ta.find(d=>d.value===v)||{}).label||v||"—"}function us(){for(const v of wo)pt[v]=ge(v).own||"";pt.protocol||(pt.protocol="sftp"),pt.insecureSkipVerify||(pt.insecureSkipVerify="false")}function Gi(v){ct.available=!!v.available,ct.orgEnabled=v.orgEnabled!==!1,ct.enabled=!!v.enabled,ct.canEditOrg=!!v.canEditOrg,ct.isSuperadmin=!!v.isSuperadmin,ct.scopes=v.scopes||{},si.value==="org"&&!ct.canEditOrg&&(si.value="user"),us(),ct.loaded=!0}$t(si,()=>{Ki.value="",us()});function ia(){if(!Ti.value)return"";const v=Math.max(0,Math.round((Date.now()-Ti.value)/1e3));if(v<60)return"just now";const d=Math.round(v/60);if(d<60)return`${d} min ago`;const V=Math.round(d/60);return V<24?`${V} h ago`:`${Math.round(V/24)} d ago`}function Pi(){try{$n.value&&localStorage.setItem(Lu,JSON.stringify({health:$n.value,ts:Ti.value}))}catch{}}function oa(){try{const v=localStorage.getItem(Lu);if(!v)return;const d=JSON.parse(v);d&&d.health&&($n.value=d.health,Ti.value=d.ts||null)}catch{}}async function ar(){oa();const{ok:v,body:d}=await gp();v&&Gi(d)}async function sa(v){const d=xn.value;d?ct.orgEnabled=v:ct.enabled=v;const{ok:V,body:w}=await bu(d?{scope:"org",enabled:v}:{scope:"user",enabled:v});V?(Gi(w),Xe(d?v?"File transfer enabled for your organization.":"File transfer disabled for your organization.":v?"File transfer enabled.":"File transfer disabled.")):(d?ct.orgEnabled=!v:ct.enabled=!v,Xe(w.error||"Could not update."))}async function rr(){Ki.value="",ko.value=!0;const v={};for(const Ve of wo)en(Ve)||(v[Ve]=pt[Ve]);const d={scope:ls.value,config:v};xn.value||(d.enabled=ct.enabled);const{ok:V,body:w}=await bu(d);if(ko.value=!1,!V){Ki.value=w.error||"Could not save settings.";return}Gi(w),Xe(xn.value?"Organization file-transfer settings saved.":"File-transfer settings saved.")}async function lr(){So.value=!0,$n.value=null;const{ok:v,body:d}=await vp();So.value=!1,$n.value=v&&d.health?d.health:{status:"down",detail:d.error||"Probe failed."},Ti.value=Date.now(),Pi()}function aa(v){return v==="ok"?C.success:v==="degraded"?C.warning:C.danger}const dt=kt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),Nn=Z("user"),cs=["baseURL","username","password","insecureSkipVerify","basePath"],Ht=kt(Object.fromEntries(cs.map(v=>[v,""]))),qi=Z(""),To=Z(!1),Po=Z(!1),mn=Z(null),wn=Z(null),ra=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],Co=ve(()=>dt.isSuperadmin),ai=ve(()=>dt.isSuperadmin?"user":Nn.value),at=ve(()=>dt.scopes[ai.value]||{editableLayer:"user",fields:{}}),rt=ve(()=>ai.value==="org");function gn(v){return at.value.fields[v]||{effective:"",own:"",source:"unset",locked:!1}}function vn(v){return Co.value||gn(v).locked}function Rt(v){const d=gn(v).source;return d==="global"?"Set by administrator":d==="org"?"Set by your organization":""}function Lo(){for(const v of cs)Ht[v]=gn(v).own||"";Ht.insecureSkipVerify||(Ht.insecureSkipVerify="false")}function Ke(v){dt.available=!!v.available,dt.orgEnabled=v.orgEnabled!==!1,dt.enabled=!!v.enabled,dt.canEditOrg=!!v.canEditOrg,dt.isSuperadmin=!!v.isSuperadmin,dt.scopes=v.scopes||{},Nn.value==="org"&&!dt.canEditOrg&&(Nn.value="user"),Lo(),dt.loaded=!0}$t(Nn,()=>{qi.value="",Lo()});function Lt(){if(!wn.value)return"";const v=Math.max(0,Math.round((Date.now()-wn.value)/1e3));if(v<60)return"just now";const d=Math.round(v/60);if(d<60)return`${d} min ago`;const V=Math.round(d/60);return V<24?`${V} h ago`:`${Math.round(V/24)} d ago`}function ds(){try{mn.value&&localStorage.setItem(Au,JSON.stringify({health:mn.value,ts:wn.value}))}catch{}}function Ao(){try{const v=localStorage.getItem(Au);if(!v)return;const d=JSON.parse(v);d&&d.health&&(mn.value=d.health,wn.value=d.ts||null)}catch{}}async function ln(){Ao();const{ok:v,body:d}=await yp();v&&Ke(d)}async function la(v){const d=rt.value;d?dt.orgEnabled=v:dt.enabled=v;const{ok:V,body:w}=await yu(d?{scope:"org",enabled:v}:{scope:"user",enabled:v});V?(Ke(w),Xe(d?v?"WebDAV enabled for your organization.":"WebDAV disabled for your organization.":v?"WebDAV enabled.":"WebDAV disabled.")):(d?dt.orgEnabled=!v:dt.enabled=!v,Xe(w.error||"Could not update."))}async function Mo(){qi.value="",To.value=!0;const v={};for(const Ve of cs)vn(Ve)||(v[Ve]=Ht[Ve]);const d={scope:ai.value,config:v};rt.value||(d.enabled=dt.enabled);const{ok:V,body:w}=await yu(d);if(To.value=!1,!V){qi.value=w.error||"Could not save settings.";return}Ke(w),Xe(rt.value?"Organization WebDAV settings saved.":"WebDAV settings saved.")}async function ri(){Po.value=!0,mn.value=null;const{ok:v,body:d}=await xp();Po.value=!1,mn.value=v&&d.health?d.health:{status:"down",detail:d.error||"Probe failed."},wn.value=Date.now(),ds()}function At(v){return v==="ok"?C.success:v==="degraded"?C.warning:C.danger}const tt=kt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),kn=Z("user"),li=["apiKey","units","lat","lon","lang"],Nt=kt(Object.fromEntries(li.map(v=>[v,""]))),Dn=Z(""),Ci=Z(!1),Li=Z(!1),un=Z(null),jn=Z(null),Eo=[{value:"metric",label:"Metric (°C)"},{value:"imperial",label:"Imperial (°F)"},{value:"standard",label:"Standard (K)"}],Ai=ve(()=>tt.isSuperadmin),Oo=ve(()=>tt.isSuperadmin?"user":kn.value),fs=ve(()=>tt.scopes[Oo.value]||{editableLayer:"user",fields:{}}),Sn=ve(()=>Oo.value==="org");function De(v){return fs.value.fields[v]||{effective:"",own:"",source:"unset",locked:!1}}function Bt(v){return Ai.value||De(v).locked}function nt(v){const d=De(v).source;return d==="global"?"Set by administrator":d==="org"?"Set by your organization":""}function hs(){for(const v of li)Nt[v]=De(v).own||"";Nt.units||(Nt.units="metric")}function Yi(v){tt.available=!!v.available,tt.orgEnabled=v.orgEnabled!==!1,tt.enabled=!!v.enabled,tt.canEditOrg=!!v.canEditOrg,tt.isSuperadmin=!!v.isSuperadmin,tt.scopes=v.scopes||{},kn.value==="org"&&!tt.canEditOrg&&(kn.value="user"),hs(),tt.loaded=!0}$t(kn,()=>{Dn.value="",hs()});function ps(){if(!jn.value)return"";const v=Math.max(0,Math.round((Date.now()-jn.value)/1e3));if(v<60)return"just now";const d=Math.round(v/60);if(d<60)return`${d} min ago`;const V=Math.round(d/60);return V<24?`${V} h ago`:`${Math.round(V/24)} d ago`}function ms(){try{un.value&&localStorage.setItem(Mu,JSON.stringify({health:un.value,ts:jn.value}))}catch{}}function ui(){try{const v=localStorage.getItem(Mu);if(!v)return;const d=JSON.parse(v);d&&d.health&&(un.value=d.health,jn.value=d.ts||null)}catch{}}async function gs(){ui();const{ok:v,body:d}=await wp();v&&Yi(d)}async function Mi(v){const d=Sn.value;d?tt.orgEnabled=v:tt.enabled=v;const{ok:V,body:w}=await xu(d?{scope:"org",enabled:v}:{scope:"user",enabled:v});V?(Yi(w),Xe(d?v?"OpenWeather enabled for your organization.":"OpenWeather disabled for your organization.":v?"OpenWeather enabled.":"OpenWeather disabled.")):(d?tt.orgEnabled=!v:tt.enabled=!v,Xe(w.error||"Could not update."))}async function It(){Dn.value="",Ci.value=!0;const v={};for(const Ve of li)Bt(Ve)||(v[Ve]=Nt[Ve]);const d={scope:Oo.value,config:v};Sn.value||(d.enabled=tt.enabled);const{ok:V,body:w}=await xu(d);if(Ci.value=!1,!V){Dn.value=w.error||"Could not save settings.";return}Yi(w),Xe(Sn.value?"Organization OpenWeather settings saved.":"OpenWeather settings saved.")}async function ci(){Li.value=!0,un.value=null;const{ok:v,body:d}=await kp();Li.value=!1,un.value=v&&d.health?d.health:{status:"down",detail:d.error||"Probe failed."},jn.value=Date.now(),ms()}function ua(v){return v==="ok"?C.success:v==="degraded"?C.warning:C.danger}const Ee=kt({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,isOrgUser:!1,mounts:[],privateFolder:!1,privateEnabled:!1,allowPrivate:!0,rootConfigured:!1,scopes:{}}),Ei=Z("user"),Ji=Z(""),di=Z(""),zo=Z(!1),Xi=Z(!1),Ge=Z(null),Oi=Z(null),Ut=Z({}),zi=[{value:"",label:"Inherit"},{value:"false",label:"Read-write"},{value:"true",label:"Read-only"}],Io=ve(()=>Ee.isSuperadmin),vs=ve(()=>Ee.isSuperadmin?"user":Ei.value),_s=ve(()=>Ee.scopes[vs.value]||{editableLayer:"user",fields:{}}),cn=ve(()=>vs.value==="org");function Qi(v){return _s.value.fields[v]||{effective:"",own:"",source:"unset",locked:!1}}function ca(v){return Io.value||Qi(v).locked}function da(v){const d=Qi(v).source;return d==="global"?"Set by administrator":d==="org"?"Set by your organization":""}function bs(v){return(zi.find(d=>d.value===v)||{}).label||"Inherit"}function fa(){Ji.value=Qi("readOnly").own||""}function jt(v){Ee.available=!!v.available,Ee.orgEnabled=v.orgEnabled!==!1,Ee.enabled=!!v.enabled,Ee.canEditOrg=!!v.canEditOrg,Ee.isSuperadmin=!!v.isSuperadmin,Ee.isOrgUser=!!v.isOrgUser,Ee.mounts=Array.isArray(v.mounts)?v.mounts:[],Ee.privateFolder=!!v.privateFolder,Ee.privateEnabled=!!v.privateEnabled,Ee.allowPrivate=v.allowPrivate!==!1,Ee.rootConfigured=!!v.rootConfigured,Ee.scopes=v.scopes||{},Ei.value==="org"&&!Ee.canEditOrg&&(Ei.value="user"),fa(),Ee.loaded=!0}$t(Ei,()=>{di.value="",fa()});function ur(){if(!Oi.value)return"";const v=Math.max(0,Math.round((Date.now()-Oi.value)/1e3));if(v<60)return"just now";const d=Math.round(v/60);if(d<60)return`${d} min ago`;const V=Math.round(d/60);return V<24?`${V} h ago`:`${Math.round(V/24)} d ago`}function ha(){try{Ge.value&&localStorage.setItem(Eu,JSON.stringify({health:Ge.value,ts:Oi.value}))}catch{}}function Wn(){try{const v=localStorage.getItem(Eu);if(!v)return;const d=JSON.parse(v);d&&d.health&&(Ge.value=d.health,Oi.value=d.ts||null)}catch{}}async function pa(){Wn();const{ok:v,body:d}=await _p();v&&jt(d)}async function ys(v){const d=cn.value;d?Ee.orgEnabled=v:Ee.enabled=v;const{ok:V,body:w}=await Oa(d?{scope:"org",enabled:v}:{scope:"user",enabled:v});V?(jt(w),Xe(d?v?"Local storage enabled for your organization.":"Local storage disabled for your organization.":v?"Local storage enabled.":"Local storage disabled.")):(d?Ee.orgEnabled=!v:Ee.enabled=!v,Xe(w.error||"Could not update."))}async function xs(v){Ee.privateFolder=v;const{ok:d,body:V}=await Oa({scope:"user",privateFolder:v});d?(jt(V),Xe(v?"Private folder enabled.":"Private folder disabled.")):(Ee.privateFolder=!v,Xe(V.error||"Could not update."))}async function cr(v){Ee.allowPrivate=v;const{ok:d,body:V}=await Oa({scope:"org",allowPrivate:v});d?(jt(V),Xe(v?"Members may now create private folders.":"Private folders disabled for your organization.")):(Ee.allowPrivate=!v,Xe(V.error||"Could not update."))}async function ma(){di.value="",zo.value=!0;const v={};ca("readOnly")||(v.readOnly=Ji.value);const d={scope:vs.value,config:v};cn.value||(d.enabled=Ee.enabled);const{ok:V,body:w}=await Oa(d);if(zo.value=!1,!V){di.value=w.error||"Could not save settings.";return}jt(w),Xe(cn.value?"Organization local-storage settings saved.":"Local-storage settings saved.")}async function ga(){Xi.value=!0,Ge.value=null,Ut.value={};const{ok:v,body:d}=await bp();Xi.value=!1,Ge.value=v&&d.health?d.health:{status:"down",detail:d.error||"Probe failed."};const V={};if(Array.isArray(d.mounts))for(const w of d.mounts)V[w.id]={status:w.status,detail:w.detail};Ut.value=V,Oi.value=Date.now(),ha()}function va(v){return v==="ok"?C.success:v==="degraded"?C.warning:C.danger}const dr=[{id:"apis-external",label:"APIs — External",icon:"globe"},{id:"drives-external",label:"Drives — External",icon:"server"},{id:"drives-local",label:"Drives — Local",icon:"monitor"}],eo=Z("apis-external");function ws(v){return B.value||eo.value===v}const to=Z("");let $o=null;function Xe(v){to.value=v,clearTimeout($o),$o=setTimeout(()=>to.value="",2200)}const Et=kt({current:"",next:"",confirm:""}),Ii=Z(""),$i=Z(!1);function dn(){if($i.value=!1,!Et.current)return Ii.value="Enter your current password.";if(Et.next.length<8)return Ii.value="New password must be at least 8 characters.";if(Et.next!==Et.confirm)return Ii.value="New passwords do not match.";Ii.value="Validated. Connecting to the account service is pending — no password endpoint yet.",Et.current=Et.next=Et.confirm=""}const No=Z("");function _a(){No.value="Verification link would be sent once the account service is wired up."}function fr(v){const d=v.target.files&&v.target.files[0];if(!d)return;if(d.size>1.5*1024*1024){Xe("Image too large (max ~1.5 MB).");return}const V=new FileReader;V.onload=()=>{be.avatar=String(V.result),Xe("Photo updated.")},V.readAsDataURL(d)}function ks(){be.avatar="",Xe("Photo removed.")}const Ss=ve(()=>{var V,w,Ve;const d=(be.displayName||be.name||s.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((V=d[0])==null?void 0:V[0])||"P")+(((w=d[1])==null?void 0:w[0])||((Ve=d[0])==null?void 0:Ve[1])||"V")).toUpperCase()}),no=Z(!1),ba=Z(""),io=Z(""),oo=Z(""),Wt=Z([]);function Kn(v){const d="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let V="";for(let w=0;wKn(4).toLowerCase()+"-"+Kn(4).toLowerCase()),oo.value=""}function pr(){be.twoFactor=!1,Wt.value=[],no.value=!1}const Vt=navigator.userAgent;function mr(){return/Edg\//.test(Vt)?"Edge":/OPR\//.test(Vt)?"Opera":/Chrome\//.test(Vt)?"Chrome":/Firefox\//.test(Vt)?"Firefox":/Safari\//.test(Vt)?"Safari":"Browser"}function so(){return/Windows/.test(Vt)?"Windows":/Mac OS X/.test(Vt)?"macOS":/Android/.test(Vt)?"Android":/iPhone|iPad/.test(Vt)?"iOS":/Linux/.test(Vt)?"Linux":"Unknown OS"}const ya=Date.now(),fi=Z([]),ao=Z(!1),_n=Z(""),Mt=kt({email:"",password:"",role:"user",organization:""}),Ni=Z(""),Di=Z(!1),ro=Z(""),Tn=ve(()=>{const v=[{value:"user",label:"User"},{value:"admin",label:"Admin"}];return u.value&&v.push({value:"superadmin",label:"Superadmin"}),v}),Do=Z([]);async function Pn(){if(!f.value)return;const v=await rp();v.ok&&(Do.value=v.organizations.slice().sort((d,V)=>d.name.localeCompare(V.name)))}const xa=ve(()=>{const v=Do.value.map(d=>({value:d.id,label:d.name}));return u.value&&v.unshift({value:"",label:"No organization"}),v});async function Kt(){if(!f.value)return;ao.value=!0,_n.value="";const v=await ip();if(ao.value=!1,!v.ok){_n.value=v.status===403?"Manager role required.":"Could not load users.";return}fi.value=v.users.slice().sort((d,V)=>d.email.localeCompare(V.email))}function hi(v){try{const d=v.data||{},V=Object.keys(d)[0];return V&&d[V]&&d[V].message||v.message||v.error||"Invalid input."}catch{return v.error||"Could not create user."}}async function wa(){Ni.value="";const v=Mt.email.trim().toLowerCase();if(!v.includes("@"))return Ni.value="Enter a valid email.";if(Mt.password.length<8)return Ni.value="Password must be at least 8 characters.";Di.value=!0;const d=u.value?Mt.organization:s.organization,{ok:V,body:w}=await op(v,Mt.password,Mt.role,d);if(Di.value=!1,!V)return Ni.value=hi(w);Mt.email="",Mt.password="",Mt.role="user",Mt.organization="",Xe("User created."),Kt()}async function Ts(v){const{ok:d,body:V}=await ap(v.id);if(ro.value="",!d)return Xe(V.error||"Could not remove user.");Xe("User removed."),Kt()}const it=kt({id:"",email:"",role:"user",verified:!1,password:"",organization:""}),Cn=Z(""),pi=Z(!1),Gn=ve(()=>!!it.id&&it.email===s.email);function Fo(v){ro.value="",it.id=v.id,it.email=v.email,it.role=v.role||"user",it.verified=!!v.verified,it.password="",it.organization=v.organization||"",Cn.value=""}function Ro(){it.id="",Cn.value=""}async function ka(){Cn.value="";const v=it.email.trim().toLowerCase();if(!v.includes("@"))return Cn.value="Enter a valid email.";if(it.password&&it.password.length<8)return Cn.value="New password must be at least 8 characters (or leave blank).";const d={email:v,role:it.role,verified:it.verified};u.value&&(d.organization=it.organization),it.password&&(d.password=it.password),pi.value=!0;const{ok:V,body:w}=await sp(it.id,d);if(pi.value=!1,!V)return Cn.value=hi(w);Xe("User updated."),Ro(),Kt()}const Bo=kt({name:""}),qn=Z(""),Uo=Z(!1),Fi=Z(""),Rn=kt({id:"",name:""}),Yn=Z(""),Ps=ve(()=>{const v={};for(const d of fi.value)d.organization&&(v[d.organization]=(v[d.organization]||0)+1);return v});async function bn(){qn.value="";const v=Bo.name.trim();if(!v)return qn.value="Enter an organization name.";Uo.value=!0;const{ok:d,body:V}=await lp(v);if(Uo.value=!1,!d)return qn.value=hi(V);Bo.name="",Xe("Organization created."),Pn()}function Vo(v){Fi.value="",Rn.id=v.id,Rn.name=v.name,Yn.value=""}function Sa(){Rn.id="",Yn.value=""}async function lo(){Yn.value="";const v=Rn.name.trim();if(!v)return Yn.value="Enter an organization name.";const{ok:d,body:V}=await up(Rn.id,v);if(!d)return Yn.value=hi(V);Xe("Organization renamed."),Sa(),Pn(),Kt()}async function gr(v){const{ok:d,body:V}=await cp(v.id);if(Fi.value="",!d)return Xe(V.error||"Could not delete organization.");Xe("Organization deleted."),Pn()}function Ta(){const v={_app:"PilotVault",_kind:"settings-export",exportedAt:new Date().toISOString(),email:s.email,prefs:{...be},themeMode:yo.value},d=new Blob([JSON.stringify(v,null,2)],{type:"application/json"}),V=URL.createObjectURL(d),w=document.createElement("a");w.href=V,w.download=`pilotvault-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(w),w.click(),w.remove(),URL.revokeObjectURL(V),Xe("Settings exported.")}const Zo=Z("");function uo(v){const d=v.target.files&&v.target.files[0];if(!d)return;const V=new FileReader;V.onload=()=>{try{const w=JSON.parse(String(V.result)),Ve=w.prefs||w;if(!ed(Ve))throw new Error("bad shape");w.themeMode&&Wa(w.themeMode),fl(be.fontSize),hl(be.reduceMotion),Zo.value="Settings imported and applied."}catch{Zo.value="That file is not a valid PilotVault settings export."}},V.readAsText(d),v.target.value=""}const xt=kt({understand:!1,typed:"",cooldown:0,armed:!1,msg:""});let Ln=null;const Ho=ve(()=>s.email||"DELETE MY ACCOUNT"),jo=ve(()=>xt.understand&&xt.typed===Ho.value);function vr(){jo.value&&(xt.armed=!0,xt.cooldown=5,clearInterval(Ln),Ln=setInterval(()=>{xt.cooldown--,xt.cooldown<=0&&clearInterval(Ln)},1e3))}$t(jo,v=>{!v&&xt.armed&&(xt.armed=!1,xt.cooldown=0,clearInterval(Ln))});function Bn(){if(!(!xt.armed||xt.cooldown>0)){try{localStorage.removeItem("pv_prefs")}catch{}xt.msg="Account deletion requires the account service. Local data was cleared and you were signed out.",setTimeout(()=>l("logout"),900)}}return ki(()=>{ie=setInterval(()=>ze.value=Date.now(),1e3),Pn(),Kt(),U(),ar(),ln(),gs(),pa()}),ss(()=>{clearInterval(ie),clearInterval(Ln),clearTimeout($o)}),(v,d)=>(p(),m("div",Tm,[r("div",Pm,[d[71]||(d[71]=r("div",null,[r("div",{class:"eyebrow"},"Preferences"),r("h2",{class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},"Settings")],-1)),r("div",Cm,[A(K,{name:"search",size:16,class:"text-ink-muted"}),ee(r("input",{"onUpdate:modelValue":d[0]||(d[0]=V=>R.value=V),placeholder:"Search settings…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ye,R.value]]),R.value?(p(),m("button",{key:0,class:"text-ink-muted hover:text-ink","aria-label":"Clear search",onClick:d[1]||(d[1]=V=>R.value="")},[A(K,{name:"x",size:15})])):N("",!0)])]),r("div",Lm,[ee(r("nav",Am,[(p(!0),m(ue,null,Re(T.value,V=>(p(),m("button",{key:V.id,class:Me(["flex items-center gap-2.5 rounded px-3 py-2.5 text-left text-sm transition",[M.value===V.id?V.danger?"bg-danger-soft font-semibold text-danger-fg":"bg-accent-soft font-semibold text-accent-soft-fg":V.danger?"font-medium text-danger-fg hover:bg-danger-soft":"font-medium text-ink-secondary hover:bg-surface-2"]]),onClick:w=>M.value=V.id},[A(K,{name:V.icon,size:17},null,8,["name"]),r("span",Em,k(V.label),1)],10,Mm))),128))],512),[[kh,!B.value]]),r("div",Om,[B.value&&!Y.value.length?(p(),m("div",zm," No settings match “"+k(R.value)+"”. ",1)):N("",!0),(p(!0),m(ue,null,Re(Y.value,V=>(p(),m(ue,{key:V.id},[B.value?(p(),m("div",Im,[A(K,{name:V.icon,size:14},null,8,["name"]),I(" "+k(V.label),1)])):N("",!0),V.id==="account"?(p(),m("div",$m,[A(Pe,{title:"Full name",desc:"Shown to your team on flights and audit logs.",keywords:"full name account"},{default:we(()=>[ee(r("input",{"onUpdate:modelValue":d[2]||(d[2]=w=>Oe(be).name=w),class:"field w-56",placeholder:"Jane Operator",onBlur:d[3]||(d[3]=w=>Xe("Saved."))},null,544),[[ye,Oe(be).name]])]),_:1}),A(Pe,{title:"Username",desc:"Your unique handle within PilotVault.",keywords:"username handle"},{default:we(()=>[r("div",Nm,[d[72]||(d[72]=r("span",{class:"text-sm text-ink-muted"},"@",-1)),ee(r("input",{"onUpdate:modelValue":d[4]||(d[4]=w=>Oe(be).username=w),class:"field w-48",placeholder:"jane",onBlur:d[5]||(d[5]=w=>Xe("Saved."))},null,544),[[ye,Oe(be).username]])])]),_:1}),A(Pe,{title:"Email address",desc:"Used for sign-in and notifications.",keywords:"email verification verify"},{default:we(()=>[r("div",Dm,[r("span",Fm,k(t.email||"—"),1),r("span",Rm,[A(K,{name:"mail",size:12}),d[73]||(d[73]=I(" Unverified ",-1))])])]),_:1}),A(Pe,{title:"Role",desc:"Your access level in PilotVault.",keywords:"role admin user superadmin access rights permissions"},{default:we(()=>[r("span",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(t.role)])},[A(K,{name:_(t.role),size:12},null,8,["name"]),I(k(h(t.role)),1)],2)]),_:1}),A(Pe,{title:"Organization",desc:"The organization your account belongs to.",keywords:"organization org tenant company"},{default:we(()=>[r("span",{class:Me(["text-sm",t.organizationName?"text-ink":"text-ink-muted"])},k(t.organizationName||(u.value?"All organizations":"None")),3)]),_:1}),A(Pe,{block:"",title:"Verify email",desc:"Confirm ownership to enable password resets and alerts.",keywords:"verify email resend"},{default:we(()=>[r("button",{class:"btn-ghost",onClick:_a},"Send verification link"),No.value?(p(),m("p",Bm,k(No.value),1)):N("",!0)]),_:1}),A(Pe,{block:"",title:"Change password",desc:"Use at least 8 characters.",keywords:"password change current new"},{default:we(()=>[r("div",Um,[ee(r("input",{"onUpdate:modelValue":d[6]||(d[6]=w=>Et.current=w),type:"password",class:"field",placeholder:"Current password"},null,512),[[ye,Et.current]]),ee(r("input",{"onUpdate:modelValue":d[7]||(d[7]=w=>Et.next=w),type:"password",class:"field",placeholder:"New password"},null,512),[[ye,Et.next]]),ee(r("input",{"onUpdate:modelValue":d[8]||(d[8]=w=>Et.confirm=w),type:"password",class:"field",placeholder:"Confirm new password"},null,512),[[ye,Et.confirm]]),r("div",Vm,[r("button",{class:"btn-accent",onClick:dn},"Update password"),Ii.value?(p(),m("span",{key:0,class:Me(["text-xs",$i.value?"text-success-fg":"text-ink-muted"])},k(Ii.value),3)):N("",!0)])])]),_:1})])):V.id==="appearance"?(p(),m("div",Zm,[A(Pe,{title:"Theme",desc:"Light, dark, or follow your system.",keywords:"theme light dark system appearance"},{default:we(()=>[A(hn,{modelValue:Le.value,"onUpdate:modelValue":d[9]||(d[9]=w=>Le.value=w),options:fe},null,8,["modelValue"])]),_:1}),A(Pe,{title:"Font size",desc:"Scales the entire interface for readability.",keywords:"font size accessibility text"},{default:we(()=>[A(hn,{modelValue:Oe(be).fontSize,"onUpdate:modelValue":d[10]||(d[10]=w=>Oe(be).fontSize=w),options:Ue},null,8,["modelValue"])]),_:1}),A(Pe,{title:"Reduce motion",desc:"Minimise animations and transitions.",keywords:"reduce motion accessibility animation"},{default:we(()=>[A(Gt,{modelValue:Oe(be).reduceMotion,"onUpdate:modelValue":d[11]||(d[11]=w=>Oe(be).reduceMotion=w)},null,8,["modelValue"])]),_:1}),A(Pe,{title:"Language",desc:"Interface language.",keywords:"language locale"},{default:we(()=>[ee(r("select",{"onUpdate:modelValue":d[12]||(d[12]=w=>Oe(be).language=w),class:"field w-48"},[(p(),m(ue,null,Re(Ie,([w,Ve])=>r("option",{key:w,value:w},k(Ve),9,Hm)),64))],512),[[Ot,Oe(be).language]])]),_:1}),A(Pe,{title:"Region",desc:"Affects number, unit and date defaults.",keywords:"region country locale"},{default:we(()=>[ee(r("select",{"onUpdate:modelValue":d[13]||(d[13]=w=>Oe(be).region=w),class:"field w-48"},[(p(!0),m(ue,null,Re(Oe(qe),([w,Ve])=>(p(),m("option",{key:w,value:w},k(Ve),9,jm))),128))],512),[[Ot,Oe(be).region]])]),_:1}),A(Pe,{title:"Date format",desc:"How calendar dates are displayed.",keywords:"date format"},{default:we(()=>[ee(r("select",{"onUpdate:modelValue":d[14]||(d[14]=w=>Oe(be).dateFormat=w),class:"field w-48"},[(p(),m(ue,null,Re(Se,([w,Ve])=>r("option",{key:w,value:w},k(Ve),9,Wm)),64))],512),[[Ot,Oe(be).dateFormat]])]),_:1}),A(Pe,{title:"Time format",desc:"12- or 24-hour clock.",keywords:"time format clock 12 24 hour"},{default:we(()=>[A(hn,{modelValue:Oe(be).timeFormat,"onUpdate:modelValue":d[15]||(d[15]=w=>Oe(be).timeFormat=w),options:$e},null,8,["modelValue"])]),_:1}),A(Pe,{title:"Preview",desc:"How timestamps appear across the app.",keywords:"preview date time"},{default:we(()=>[r("span",Km,k(je.value),1)]),_:1}),d[74]||(d[74]=r("p",{class:"mt-3 text-xs text-ink-muted"}," Language & region are stored now; full localisation ships with the account service. ",-1))])):V.id==="integrations"?(p(),m("div",Gm,[B.value?N("",!0):(p(),m("div",qm,[(p(),m(ue,null,Re(dr,w=>r("button",{key:w.id,type:"button",class:Me(["-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",eo.value===w.id?"border-accent text-ink":"border-transparent text-ink-secondary hover:text-ink"]),onClick:Ve=>eo.value=w.id},[A(K,{name:w.icon,size:16},null,8,["name"]),I(k(w.label),1)],10,Ym)),64))])),ws("apis-external")?(p(),m(ue,{key:1},[r("div",Jm,[r("div",Xm,[r("div",Qm,[A(K,{name:"radio",size:20})]),d[75]||(d[75]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"OpenSky Network"),r("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))]),oe.loaded&&!oe.available?(p(),m("div",eg,[A(K,{name:"lock",size:14,class:"mr-1 inline"}),d[76]||(d[76]=I(" OpenSky is currently disabled by your administrator. Contact them to enable it. ",-1))])):N("",!0),oe.canEditOrg?(p(),m("div",tg,[d[77]||(d[77]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(hn,{modelValue:We.value,"onUpdate:modelValue":d[16]||(d[16]=w=>We.value=w),options:ut},null,8,["modelValue"])])):N("",!0),me.value?(p(),ot(Pe,{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(Gt,{"model-value":oe.orgEnabled,disabled:!oe.available,"onUpdate:modelValue":O},null,8,["model-value","disabled"])]),_:1})):(p(),ot(Pe,{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(Gt,{"model-value":oe.enabled,disabled:!oe.available||!oe.orgEnabled,"onUpdate:modelValue":O},null,8,["model-value","disabled"])]),_:1})),!me.value&&oe.available&&!oe.orgEnabled?(p(),m("div",ng,[A(K,{name:"lock",size:13,class:"mr-1 inline"}),d[79]||(d[79]=I("OpenSky is turned off for your organization",-1)),oe.canEditOrg?(p(),m("span",ig,[...d[78]||(d[78]=[I(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),I(" to turn it back on",-1)])])):N("",!0),d[80]||(d[80]=I(". ",-1))])):N("",!0),me.value?(p(),m("div",og,[A(K,{name:"users",size:13,class:"mr-1 inline"}),d[81]||(d[81]=I("These are organization-wide settings — they apply to everyone in ",-1)),r("span",sg,k(t.organizationName||"your organization"),1),d[82]||(d[82]=I(". Leave a field blank to let each user choose their own; a value set here overrides the user's. ",-1))])):ne.value?(p(),m("div",ag," As a superadmin you manage the global OpenSky configuration in the API Server panel. The effective configuration is shown below. ")):N("",!0),oe.available&&!me.value?(p(),m("div",rg,[r("div",lg,[r("div",ug,[A(K,{name:"signal",size:15}),d[83]||(d[83]=I("Credit usage ",-1))]),ke.value?(p(),m("span",cg,"Checked "+k(J()),1)):N("",!0)]),Ne.value?(p(),m(ue,{key:0},[Ne.value.remaining!=null?(p(),m(ue,{key:0},[r("div",dg,[r("span",fg,k(Ze(Ne.value.remaining)),1),r("span",hg,"/ "+k(Ze(Ne.value.daily))+" credits left today",1)]),r("div",pg,[r("div",{class:Me(["h-full rounded-full transition-all",lt.value]),style:ts({width:ht.value+"%"})},null,6)]),r("div",mg," Used "+k(Ze(Ne.value.daily-Ne.value.remaining))+" today · "+k(Ne.value.probeCost)+" credit"+k(Ne.value.probeCost===1?"":"s")+" per query · "+k(Ne.value.mode),1)],64)):(p(),m(ue,{key:1},[r("div",gg,[d[84]||(d[84]=I("Daily allowance: ",-1)),r("span",vg,k(Ze(Ne.value.daily)),1),d[85]||(d[85]=I(" credits",-1))]),r("div",_g,k(Ne.value.probeCost)+" credit"+k(Ne.value.probeCost===1?"":"s")+" per query · "+k(Ne.value.mode)+". OpenSky only reports live remaining credits for authenticated requests — add OAuth2 credentials below to track usage. ",1)],64))],64)):(p(),m("div",bg,[...d[86]||(d[86]=[I(" Run ",-1),r("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),I(" below to fetch your live OpenSky credit balance. ",-1)])]))])):N("",!0),A(Pe,{title:"OpenSky plan",desc:"Your account tier — sets the daily credit allowance.",keywords:"plan tier credits"},{default:we(()=>[Ce("plan")?(p(),m("span",yg,[I(k((_t.find(w=>w.value===se("plan").effective)||{}).label||se("plan").effective||"—")+" ",1),Ae("plan")?(p(),m("span",xg,[A(K,{name:"lock",size:10}),I(k(Ae("plan")),1)])):N("",!0)])):(p(),ot(hn,{key:1,modelValue:le.plan,"onUpdate:modelValue":d[17]||(d[17]=w=>le.plan=w),options:_t},null,8,["modelValue"]))]),_:1}),A(Pe,{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(()=>[Ce("bbox")?(p(),m("span",wg,[I(k(S(se("bbox").effective)||se("bbox").effective||"—")+" ",1),Ae("bbox")?(p(),m("span",kg,[A(K,{name:"lock",size:10}),I(k(Ae("bbox")),1)])):N("",!0)])):(p(),m("div",Sg,[ee(r("select",{"onUpdate:modelValue":d[18]||(d[18]=w=>W.value=w),class:"field w-64"},[me.value?N("",!0):(p(),m("option",Tg,"Automatic (by location)")),(p(),m(ue,null,Re(Tt,w=>r("optgroup",{key:w.label,label:w.label},[(p(!0),m(ue,null,Re(w.options,Ve=>(p(),m("option",{key:Ve.value,value:Ve.value},k(Ve.label),9,Cg))),128))],8,Pg)),64)),d[87]||(d[87]=r("option",{value:"__custom__"},"Custom…",-1))],512),[[Ot,W.value]]),re.value?(p(),m("p",Lg," Live map follows drone location → your device location → your Region ("+k(xe.value)+"). ",1)):N("",!0),H.value?ee((p(),m("input",{key:1,"onUpdate:modelValue":d[19]||(d[19]=w=>le.bbox=w),class:"field w-64 font-mono",placeholder:"50.5,3.2,53.7,7.3"},null,512)),[[ye,le.bbox]]):N("",!0)]))]),_:1}),A(Pe,{title:"OAuth2 client ID",desc:"Optional — leave blank for anonymous access (lower limits).",keywords:"oauth client id credentials"},{default:we(()=>[Ce("clientId")?(p(),m("span",Ag,[I(k(se("clientId").effective||"—")+" ",1),Ae("clientId")?(p(),m("span",Mg,[A(K,{name:"lock",size:10}),I(k(Ae("clientId")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":d[20]||(d[20]=w=>le.clientId=w),class:"field w-64",placeholder:"your-api-client"},null,512)),[[ye,le.clientId]])]),_:1}),A(Pe,{title:"OAuth2 client secret",desc:"Paired with the client ID for authenticated access.",keywords:"oauth client secret credentials password"},{default:we(()=>[Ce("clientSecret")?(p(),m("span",Eg,[I(k(se("clientSecret").effective||"—")+" ",1),Ae("clientSecret")?(p(),m("span",Og,[A(K,{name:"lock",size:10}),I(k(Ae("clientSecret")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":d[21]||(d[21]=w=>le.clientSecret=w),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,le.clientSecret]])]),_:1}),oe.available&&!oe.allowAnonymous?(p(),m("div",zg," Anonymous access is disabled by the administrator — OpenSky needs OAuth2 credentials from some layer to work. ")):N("",!0),r("div",Ig,[ne.value?N("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:ae.value||!oe.available,onClick:Te},k(ae.value?"Saving…":me.value?"Save organization settings":"Save settings"),9,$g)),me.value?N("",!0):(p(),m("div",Ng,[d[90]||(d[90]=r("label",{class:"text-xs text-ink-muted"},"Test area",-1)),ee(r("select",{"onUpdate:modelValue":d[22]||(d[22]=w=>de.value=w),class:"field w-44"},[d[88]||(d[88]=r("option",{value:"__default__"},"Default bounding box",-1)),(p(),m(ue,null,Re(Ye,w=>r("optgroup",{key:w.label,label:w.label},[(p(!0),m(ue,null,Re(w.options,Ve=>(p(),m("option",{key:Ve.value,value:Ve.value},k(Ve.label),9,Fg))),128))],8,Dg)),64)),d[89]||(d[89]=r("option",{value:"__custom__"},"Custom…",-1))],512),[[Ot,de.value]]),St.value?ee((p(),m("input",{key:0,"onUpdate:modelValue":d[23]||(d[23]=w=>yt.value=w),class:"field w-44 font-mono",placeholder:"lamin,lomin,lamax,lomax"},null,512)),[[ye,yt.value]]):N("",!0)])),me.value?N("",!0):(p(),m("button",{key:2,class:"btn-ghost",disabled:st.value||!oe.available,onClick:pn},k(st.value?"Testing…":"Test connection"),9,Rg)),ce.value?(p(),m("span",Bg,k(ce.value),1)):N("",!0),te.value&&!me.value?(p(),m("span",{key:4,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",xo(te.value.status)])},[d[91]||(d[91]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),I(k(te.value.detail||te.value.status),1)],2)):N("",!0)])]),r("div",Ug,[r("div",Vg,[r("div",Zg,[A(K,{name:"sun",size:20})]),d[92]||(d[92]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"OpenWeather"),r("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))]),tt.loaded&&!tt.available?(p(),m("div",Hg,[A(K,{name:"lock",size:14,class:"mr-1 inline"}),d[93]||(d[93]=I(" OpenWeather is currently disabled by your administrator. Contact them to enable it. ",-1))])):N("",!0),tt.canEditOrg?(p(),m("div",jg,[d[94]||(d[94]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(hn,{modelValue:kn.value,"onUpdate:modelValue":d[24]||(d[24]=w=>kn.value=w),options:ut},null,8,["modelValue"])])):N("",!0),Sn.value?(p(),ot(Pe,{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(Gt,{"model-value":tt.orgEnabled,disabled:!tt.available,"onUpdate:modelValue":Mi},null,8,["model-value","disabled"])]),_:1})):(p(),ot(Pe,{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(Gt,{"model-value":tt.enabled,disabled:!tt.available||!tt.orgEnabled,"onUpdate:modelValue":Mi},null,8,["model-value","disabled"])]),_:1})),!Sn.value&&tt.available&&!tt.orgEnabled?(p(),m("div",Wg,[A(K,{name:"lock",size:13,class:"mr-1 inline"}),d[96]||(d[96]=I("OpenWeather is turned off for your organization",-1)),tt.canEditOrg?(p(),m("span",Kg,[...d[95]||(d[95]=[I(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),I(" to turn it back on",-1)])])):N("",!0),d[97]||(d[97]=I(". ",-1))])):N("",!0),Sn.value?(p(),m("div",Gg,[A(K,{name:"users",size:13,class:"mr-1 inline"}),d[98]||(d[98]=I("These are organization-wide settings — they apply to everyone in ",-1)),r("span",qg,k(t.organizationName||"your organization"),1),d[99]||(d[99]=I(". Leave the API key blank to let each user configure their own; a key set here overrides the user's. ",-1))])):Ai.value?(p(),m("div",Yg," As a superadmin you manage the global OpenWeather configuration in the API Server panel. The effective configuration is shown below. ")):N("",!0),A(Pe,{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(()=>[Bt("apiKey")?(p(),m("span",Jg,[I(k(De("apiKey").effective||"—")+" ",1),nt("apiKey")?(p(),m("span",Xg,[A(K,{name:"lock",size:10}),I(k(nt("apiKey")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":d[25]||(d[25]=w=>Nt.apiKey=w),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,Nt.apiKey]])]),_:1}),A(Pe,{title:"Units",desc:"Measurement system for temperatures and wind speed.",keywords:"units metric imperial standard celsius fahrenheit kelvin"},{default:we(()=>[Bt("units")?(p(),m("span",Qg,[I(k((Eo.find(w=>w.value===De("units").effective)||{}).label||De("units").effective||"—")+" ",1),nt("units")?(p(),m("span",ev,[A(K,{name:"lock",size:10}),I(k(nt("units")),1)])):N("",!0)])):(p(),ot(hn,{key:1,modelValue:Nt.units,"onUpdate:modelValue":d[26]||(d[26]=w=>Nt.units=w),options:Eo},null,8,["modelValue"]))]),_:1}),A(Pe,{title:"Default latitude",desc:"Latitude used by the health probe and calls with no location (−90…90).",keywords:"latitude location coordinates default"},{default:we(()=>[Bt("lat")?(p(),m("span",tv,[I(k(De("lat").effective||"—")+" ",1),nt("lat")?(p(),m("span",nv,[A(K,{name:"lock",size:10}),I(k(nt("lat")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":d[27]||(d[27]=w=>Nt.lat=w),inputmode:"decimal",class:"field w-40 font-mono",placeholder:"52.2297"},null,512)),[[ye,Nt.lat]])]),_:1}),A(Pe,{title:"Default longitude",desc:"Longitude used by the health probe and calls with no location (−180…180).",keywords:"longitude location coordinates default"},{default:we(()=>[Bt("lon")?(p(),m("span",iv,[I(k(De("lon").effective||"—")+" ",1),nt("lon")?(p(),m("span",ov,[A(K,{name:"lock",size:10}),I(k(nt("lon")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":d[28]||(d[28]=w=>Nt.lon=w),inputmode:"decimal",class:"field w-40 font-mono",placeholder:"21.0122"},null,512)),[[ye,Nt.lon]])]),_:1}),A(Pe,{title:"Language",desc:"Optional ISO code for human-readable weather descriptions, e.g. en, pl, de.",keywords:"language locale description"},{default:we(()=>[Bt("lang")?(p(),m("span",sv,[I(k(De("lang").effective||"—")+" ",1),nt("lang")?(p(),m("span",av,[A(K,{name:"lock",size:10}),I(k(nt("lang")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":d[29]||(d[29]=w=>Nt.lang=w),class:"field w-24 font-mono",placeholder:"en"},null,512)),[[ye,Nt.lang]])]),_:1}),r("div",rv,[Ai.value?N("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:Ci.value||!tt.available,onClick:It},k(Ci.value?"Saving…":Sn.value?"Save organization settings":"Save settings"),9,lv)),Sn.value?N("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:Li.value||!tt.available,onClick:ci},k(Li.value?"Testing…":"Test connection"),9,uv)),Dn.value?(p(),m("span",cv,k(Dn.value),1)):N("",!0),jn.value&&!Sn.value?(p(),m("span",dv,"Checked "+k(ps()),1)):N("",!0),un.value&&!Sn.value?(p(),m("span",{key:4,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",ua(un.value.status)])},[d[100]||(d[100]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),I(k(un.value.detail||un.value.status),1)],2)):N("",!0)])])],64)):N("",!0),ws("drives-external")?(p(),m(ue,{key:2},[r("div",fv,[r("div",hv,[r("div",pv,[A(K,{name:"server",size:20})]),d[101]||(d[101]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"File Transfer (FTP / SFTP)"),r("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))]),ct.loaded&&!ct.available?(p(),m("div",mv,[A(K,{name:"lock",size:14,class:"mr-1 inline"}),d[102]||(d[102]=I(" File transfer is currently disabled by your administrator. Contact them to enable it. ",-1))])):N("",!0),ct.canEditOrg?(p(),m("div",gv,[d[103]||(d[103]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(hn,{modelValue:si.value,"onUpdate:modelValue":d[30]||(d[30]=w=>si.value=w),options:ut},null,8,["modelValue"])])):N("",!0),xn.value?(p(),ot(Pe,{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(Gt,{"model-value":ct.orgEnabled,disabled:!ct.available,"onUpdate:modelValue":sa},null,8,["model-value","disabled"])]),_:1})):(p(),ot(Pe,{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(Gt,{"model-value":ct.enabled,disabled:!ct.available||!ct.orgEnabled,"onUpdate:modelValue":sa},null,8,["model-value","disabled"])]),_:1})),!xn.value&&ct.available&&!ct.orgEnabled?(p(),m("div",vv,[A(K,{name:"lock",size:13,class:"mr-1 inline"}),d[105]||(d[105]=I("File transfer is turned off for your organization",-1)),ct.canEditOrg?(p(),m("span",_v,[...d[104]||(d[104]=[I(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),I(" to turn it back on",-1)])])):N("",!0),d[106]||(d[106]=I(". ",-1))])):N("",!0),xn.value?(p(),m("div",bv,[A(K,{name:"users",size:13,class:"mr-1 inline"}),d[107]||(d[107]=I("These are organization-wide settings — they apply to everyone in ",-1)),r("span",yv,k(t.organizationName||"your organization"),1),d[108]||(d[108]=I(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):rs.value?(p(),m("div",xv," As a superadmin you manage the global file-transfer configuration in the API Server panel. The effective configuration is shown below. ")):N("",!0),A(Pe,{title:"Protocol",desc:"SFTP (over SSH), FTPS (FTP over TLS), or plain FTP.",keywords:"protocol sftp ftps ftp"},{default:we(()=>[en("protocol")?(p(),m("span",wv,[I(k(na(ge("protocol").effective))+" ",1),Ct("protocol")?(p(),m("span",kv,[A(K,{name:"lock",size:10}),I(k(Ct("protocol")),1)])):N("",!0)])):(p(),ot(hn,{key:1,modelValue:pt.protocol,"onUpdate:modelValue":d[31]||(d[31]=w=>pt.protocol=w),options:ta},null,8,["modelValue"]))]),_:1}),A(Pe,{title:"Host",desc:"Server hostname or IP address.",keywords:"host server address"},{default:we(()=>[en("host")?(p(),m("span",Sv,[I(k(ge("host").effective||"—")+" ",1),Ct("host")?(p(),m("span",Tv,[A(K,{name:"lock",size:10}),I(k(Ct("host")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":d[32]||(d[32]=w=>pt.host=w),class:"field w-64",placeholder:"files.example.com"},null,512)),[[ye,pt.host]])]),_:1}),A(Pe,{title:"Port",desc:"Leave blank for the protocol default (22 for SFTP, 21 for FTP/FTPS).",keywords:"port"},{default:we(()=>[en("port")?(p(),m("span",Pv,[I(k(ge("port").effective||"default")+" ",1),Ct("port")?(p(),m("span",Cv,[A(K,{name:"lock",size:10}),I(k(Ct("port")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":d[33]||(d[33]=w=>pt.port=w),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"22"},null,512)),[[ye,pt.port]])]),_:1}),A(Pe,{title:"Username",desc:"Account used to authenticate.",keywords:"username login account"},{default:we(()=>[en("username")?(p(),m("span",Lv,[I(k(ge("username").effective||"—")+" ",1),Ct("username")?(p(),m("span",Av,[A(K,{name:"lock",size:10}),I(k(Ct("username")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":d[34]||(d[34]=w=>pt.username=w),class:"field w-64",placeholder:"user"},null,512)),[[ye,pt.username]])]),_:1}),A(Pe,{title:"Password",desc:"Password auth for FTP/FTPS, or SFTP password login. Leave blank to use a key.",keywords:"password secret credentials"},{default:we(()=>[en("password")?(p(),m("span",Mv,[I(k(ge("password").effective||"—")+" ",1),Ct("password")?(p(),m("span",Ev,[A(K,{name:"lock",size:10}),I(k(Ct("password")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":d[35]||(d[35]=w=>pt.password=w),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,pt.password]])]),_:1}),Qt.value==="sftp"?(p(),ot(Pe,{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(()=>[en("privateKey")?(p(),m("span",Ov,[I(k(ge("privateKey").effective||"—")+" ",1),Ct("privateKey")?(p(),m("span",zv,[A(K,{name:"lock",size:10}),I(k(Ct("privateKey")),1)])):N("",!0)])):ee((p(),m("textarea",{key:1,"onUpdate:modelValue":d[36]||(d[36]=w=>pt.privateKey=w),rows:"3",class:"field w-full font-mono text-xs",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512)),[[ye,pt.privateKey]])]),_:1})):N("",!0),Qt.value==="sftp"?(p(),ot(Pe,{key:8,title:"Private key passphrase",desc:"Passphrase protecting the SSH private key, if any.",keywords:"passphrase key secret"},{default:we(()=>[en("keyPassphrase")?(p(),m("span",Iv,[I(k(ge("keyPassphrase").effective||"—")+" ",1),Ct("keyPassphrase")?(p(),m("span",$v,[A(K,{name:"lock",size:10}),I(k(Ct("keyPassphrase")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":d[37]||(d[37]=w=>pt.keyPassphrase=w),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,pt.keyPassphrase]])]),_:1})):N("",!0),Qt.value==="sftp"?(p(),ot(Pe,{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(()=>[en("hostKeyFingerprint")?(p(),m("span",Nv,[I(k(ge("hostKeyFingerprint").effective||"—")+" ",1),Ct("hostKeyFingerprint")?(p(),m("span",Dv,[A(K,{name:"lock",size:10}),I(k(Ct("hostKeyFingerprint")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":d[38]||(d[38]=w=>pt.hostKeyFingerprint=w),class:"field w-full font-mono text-xs",placeholder:"SHA256:…"},null,512)),[[ye,pt.hostKeyFingerprint]])]),_:1})):N("",!0),Qt.value==="ftps"?(p(),ot(Pe,{key:10,title:"TLS verification",desc:"Skip only for self-signed test servers.",keywords:"tls certificate verify insecure ftps"},{default:we(()=>[en("insecureSkipVerify")?(p(),m("span",Fv,[I(k(ge("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),Ct("insecureSkipVerify")?(p(),m("span",Rv,[A(K,{name:"lock",size:10}),I(k(Ct("insecureSkipVerify")),1)])):N("",!0)])):(p(),ot(hn,{key:1,modelValue:pt.insecureSkipVerify,"onUpdate:modelValue":d[39]||(d[39]=w=>pt.insecureSkipVerify=w),options:as},null,8,["modelValue"]))]),_:1})):N("",!0),A(Pe,{title:"Base path",desc:"Working directory and health-check target, e.g. /uploads.",keywords:"base path directory folder root"},{default:we(()=>[en("basePath")?(p(),m("span",Bv,[I(k(ge("basePath").effective||"—")+" ",1),Ct("basePath")?(p(),m("span",Uv,[A(K,{name:"lock",size:10}),I(k(Ct("basePath")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":d[40]||(d[40]=w=>pt.basePath=w),class:"field w-64 font-mono",placeholder:"/uploads"},null,512)),[[ye,pt.basePath]])]),_:1}),r("div",Vv,[rs.value?N("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:ko.value||!ct.available,onClick:rr},k(ko.value?"Saving…":xn.value?"Save organization settings":"Save settings"),9,Zv)),xn.value?N("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:So.value||!ct.available,onClick:lr},k(So.value?"Testing…":"Test connection"),9,Hv)),Ki.value?(p(),m("span",jv,k(Ki.value),1)):N("",!0),Ti.value&&!xn.value?(p(),m("span",Wv,"Checked "+k(ia()),1)):N("",!0),$n.value&&!xn.value?(p(),m("span",{key:4,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",aa($n.value.status)])},[d[109]||(d[109]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),I(k($n.value.detail||$n.value.status),1)],2)):N("",!0)])]),r("div",Kv,[r("div",Gv,[r("div",qv,[A(K,{name:"cloud",size:20})]),d[110]||(d[110]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"WebDAV"),r("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))]),dt.loaded&&!dt.available?(p(),m("div",Yv,[A(K,{name:"lock",size:14,class:"mr-1 inline"}),d[111]||(d[111]=I(" WebDAV is currently disabled by your administrator. Contact them to enable it. ",-1))])):N("",!0),dt.canEditOrg?(p(),m("div",Jv,[d[112]||(d[112]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(hn,{modelValue:Nn.value,"onUpdate:modelValue":d[41]||(d[41]=w=>Nn.value=w),options:ut},null,8,["modelValue"])])):N("",!0),rt.value?(p(),ot(Pe,{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(Gt,{"model-value":dt.orgEnabled,disabled:!dt.available,"onUpdate:modelValue":la},null,8,["model-value","disabled"])]),_:1})):(p(),ot(Pe,{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(Gt,{"model-value":dt.enabled,disabled:!dt.available||!dt.orgEnabled,"onUpdate:modelValue":la},null,8,["model-value","disabled"])]),_:1})),!rt.value&&dt.available&&!dt.orgEnabled?(p(),m("div",Xv,[A(K,{name:"lock",size:13,class:"mr-1 inline"}),d[114]||(d[114]=I("WebDAV is turned off for your organization",-1)),dt.canEditOrg?(p(),m("span",Qv,[...d[113]||(d[113]=[I(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),I(" to turn it back on",-1)])])):N("",!0),d[115]||(d[115]=I(". ",-1))])):N("",!0),rt.value?(p(),m("div",e_,[A(K,{name:"users",size:13,class:"mr-1 inline"}),d[116]||(d[116]=I("These are organization-wide settings — they apply to everyone in ",-1)),r("span",t_,k(t.organizationName||"your organization"),1),d[117]||(d[117]=I(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):Co.value?(p(),m("div",n_," As a superadmin you manage the global WebDAV configuration in the API Server panel. The effective configuration is shown below. ")):N("",!0),A(Pe,{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(()=>[vn("baseURL")?(p(),m("span",i_,[I(k(gn("baseURL").effective||"—")+" ",1),Rt("baseURL")?(p(),m("span",o_,[A(K,{name:"lock",size:10}),I(k(Rt("baseURL")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":d[42]||(d[42]=w=>Ht.baseURL=w),class:"field w-full font-mono text-xs",placeholder:"https://cloud.example.com/remote.php/dav/files/alice/"},null,512)),[[ye,Ht.baseURL]])]),_:1}),A(Pe,{title:"Username",desc:"Account used to authenticate (leave blank for a public share).",keywords:"username login account"},{default:we(()=>[vn("username")?(p(),m("span",s_,[I(k(gn("username").effective||"—")+" ",1),Rt("username")?(p(),m("span",a_,[A(K,{name:"lock",size:10}),I(k(Rt("username")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":d[43]||(d[43]=w=>Ht.username=w),class:"field w-64",placeholder:"user"},null,512)),[[ye,Ht.username]])]),_:1}),A(Pe,{title:"Password",desc:"Password or app-specific token for HTTP Basic auth.",keywords:"password secret credentials token"},{default:we(()=>[vn("password")?(p(),m("span",r_,[I(k(gn("password").effective||"—")+" ",1),Rt("password")?(p(),m("span",l_,[A(K,{name:"lock",size:10}),I(k(Rt("password")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":d[44]||(d[44]=w=>Ht.password=w),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[ye,Ht.password]])]),_:1}),A(Pe,{title:"TLS verification",desc:"Only affects HTTPS. Skip only for self-signed test servers.",keywords:"tls certificate verify insecure https"},{default:we(()=>[vn("insecureSkipVerify")?(p(),m("span",u_,[I(k(gn("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),Rt("insecureSkipVerify")?(p(),m("span",c_,[A(K,{name:"lock",size:10}),I(k(Rt("insecureSkipVerify")),1)])):N("",!0)])):(p(),ot(hn,{key:1,modelValue:Ht.insecureSkipVerify,"onUpdate:modelValue":d[45]||(d[45]=w=>Ht.insecureSkipVerify=w),options:ra},null,8,["modelValue"]))]),_:1}),A(Pe,{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(()=>[vn("basePath")?(p(),m("span",d_,[I(k(gn("basePath").effective||"—")+" ",1),Rt("basePath")?(p(),m("span",f_,[A(K,{name:"lock",size:10}),I(k(Rt("basePath")),1)])):N("",!0)])):ee((p(),m("input",{key:1,"onUpdate:modelValue":d[46]||(d[46]=w=>Ht.basePath=w),class:"field w-64 font-mono",placeholder:"/Documents"},null,512)),[[ye,Ht.basePath]])]),_:1}),r("div",h_,[Co.value?N("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:To.value||!dt.available,onClick:Mo},k(To.value?"Saving…":rt.value?"Save organization settings":"Save settings"),9,p_)),rt.value?N("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:Po.value||!dt.available,onClick:ri},k(Po.value?"Testing…":"Test connection"),9,m_)),qi.value?(p(),m("span",g_,k(qi.value),1)):N("",!0),wn.value&&!rt.value?(p(),m("span",v_,"Checked "+k(Lt()),1)):N("",!0),mn.value&&!rt.value?(p(),m("span",{key:4,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",At(mn.value.status)])},[d[118]||(d[118]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),I(k(mn.value.detail||mn.value.status),1)],2)):N("",!0)])])],64)):N("",!0),ws("drives-local")?(p(),m("div",__,[r("div",b_,[r("div",y_,[A(K,{name:"monitor",size:20})]),d[119]||(d[119]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"Local Storage"),r("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",x_,[A(K,{name:"lock",size:14,class:"mr-1 inline"}),d[120]||(d[120]=I(" Local storage is currently disabled by your administrator. Contact them to enable it. ",-1))])):Ee.loaded&&!Ee.rootConfigured?(p(),m("div",w_,[A(K,{name:"alertTriangle",size:14,class:"mr-1 inline"}),d[121]||(d[121]=I(" No storage root has been configured by your administrator yet. ",-1))])):N("",!0),Ee.canEditOrg?(p(),m("div",k_,[d[122]||(d[122]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),A(hn,{modelValue:Ei.value,"onUpdate:modelValue":d[47]||(d[47]=w=>Ei.value=w),options:ut},null,8,["modelValue"])])):N("",!0),cn.value?(p(),ot(Pe,{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(Gt,{"model-value":Ee.orgEnabled,disabled:!Ee.available,"onUpdate:modelValue":ys},null,8,["model-value","disabled"])]),_:1})):(p(),ot(Pe,{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(Gt,{"model-value":Ee.enabled,disabled:!Ee.available||!Ee.orgEnabled,"onUpdate:modelValue":ys},null,8,["model-value","disabled"])]),_:1})),!cn.value&&Ee.available&&!Ee.orgEnabled?(p(),m("div",S_,[A(K,{name:"lock",size:13,class:"mr-1 inline"}),d[124]||(d[124]=I("Local storage is turned off for your organization",-1)),Ee.canEditOrg?(p(),m("span",T_,[...d[123]||(d[123]=[I(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),I(" to turn it back on",-1)])])):N("",!0),d[125]||(d[125]=I(". ",-1))])):N("",!0),cn.value?(p(),m("div",P_,[A(K,{name:"users",size:13,class:"mr-1 inline"}),d[126]||(d[126]=I("These are organization-wide settings — they apply to everyone in ",-1)),r("span",C_,k(t.organizationName||"your organization"),1),d[127]||(d[127]=I(", who all share the organization folder. Members can additionally enable a private folder inside it. ",-1))])):Io.value?(p(),m("div",L_," As a superadmin you manage the global storage root in the API Server panel. The effective configuration is shown below. ")):N("",!0),cn.value?(p(),ot(Pe,{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(Gt,{"model-value":Ee.allowPrivate,disabled:!Ee.available,"onUpdate:modelValue":cr},null,8,["model-value","disabled"])]),_:1})):N("",!0),cn.value?N("",!0):(p(),m(ue,{key:9},[A(Pe,{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(()=>[r("div",A_,[(p(!0),m(ue,null,Re(Ee.mounts,w=>(p(),m("div",{key:w.id,class:"flex flex-wrap items-center gap-2"},[r("span",M_,k(w.path),1),w.kind==="shared"?(p(),m("span",E_,[A(K,{name:"users",size:10}),d[128]||(d[128]=I("Shared with your organization",-1))])):(p(),m("span",O_,[A(K,{name:"lock",size:10}),d[129]||(d[129]=I("Private to you",-1))])),Ut.value[w.id]?(p(),m("span",{key:2,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold",va(Ut.value[w.id].status)])},[d[130]||(d[130]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),I(k(Ut.value[w.id].status),1)],2)):N("",!0)]))),128)),Ee.mounts.length?N("",!0):(p(),m("div",z_,k(Ee.rootConfigured?"No folder assigned yet.":"Waiting for the administrator to configure a storage root."),1))])]),_:1}),Ee.isOrgUser&&Ee.allowPrivate?(p(),ot(Pe,{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(Gt,{"model-value":Ee.privateFolder,disabled:!Ee.available||!Ee.orgEnabled,"onUpdate:modelValue":xs},null,8,["model-value","disabled"])]),_:1})):Ee.isOrgUser&&!Ee.allowPrivate?(p(),m("div",I_,[A(K,{name:"lock",size:13,class:"mr-1 inline"}),d[131]||(d[131]=I("Private folders are turned off by your organization. ",-1))])):N("",!0)],64)),A(Pe,{title:"Access mode",desc:"Read-only prevents uploads, deletes and folder creation.",keywords:"read only write access mode permission"},{default:we(()=>[ca("readOnly")?(p(),m("span",$_,[I(k(bs(Qi("readOnly").effective))+" ",1),da("readOnly")?(p(),m("span",N_,[A(K,{name:"lock",size:10}),I(k(da("readOnly")),1)])):N("",!0)])):(p(),ot(hn,{key:1,modelValue:Ji.value,"onUpdate:modelValue":d[48]||(d[48]=w=>Ji.value=w),options:zi},null,8,["modelValue"]))]),_:1}),r("div",D_,[Io.value?N("",!0):(p(),m("button",{key:0,class:"btn-accent",disabled:zo.value||!Ee.available,onClick:ma},k(zo.value?"Saving…":cn.value?"Save organization settings":"Save settings"),9,F_)),cn.value?N("",!0):(p(),m("button",{key:1,class:"btn-ghost",disabled:Xi.value||!Ee.available,onClick:ga},k(Xi.value?"Testing…":"Test folder"),9,R_)),di.value?(p(),m("span",B_,k(di.value),1)):N("",!0),Oi.value&&!cn.value?(p(),m("span",U_,"Checked "+k(ur()),1)):N("",!0),Ge.value&&!cn.value?(p(),m("span",{key:4,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",va(Ge.value.status)])},[d[132]||(d[132]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),I(k(Ge.value.detail||Ge.value.status),1)],2)):N("",!0)])])):N("",!0)])):V.id==="profile"?(p(),m("div",V_,[A(Pe,{block:"",title:"Profile photo",desc:"PNG or JPG, up to ~1.5 MB. Stored on this device.",keywords:"avatar photo picture"},{default:we(()=>[r("div",Z_,[Oe(be).avatar?(p(),m("img",{key:0,src:Oe(be).avatar,alt:"Avatar",class:"h-16 w-16 rounded-full object-cover"},null,8,H_)):(p(),m("div",j_,k(Ss.value),1)),r("div",W_,[r("label",K_,[A(K,{name:"upload",size:15,class:"mr-1.5 inline"}),d[133]||(d[133]=I("Upload ",-1)),r("input",{type:"file",accept:"image/*",class:"hidden",onChange:fr},null,32)]),Oe(be).avatar?(p(),m("button",{key:0,class:"btn-ghost",onClick:ks},"Remove")):N("",!0)])])]),_:1}),A(Pe,{title:"Display name",desc:"The name shown on your public profile.",keywords:"display name profile"},{default:we(()=>[ee(r("input",{"onUpdate:modelValue":d[49]||(d[49]=w=>Oe(be).displayName=w),class:"field w-56",placeholder:"Jane O.",onBlur:d[50]||(d[50]=w=>Xe("Saved."))},null,544),[[ye,Oe(be).displayName]])]),_:1}),A(Pe,{block:"",title:"Bio",desc:"A short description others can see.",keywords:"bio about description"},{default:we(()=>[ee(r("textarea",{"onUpdate:modelValue":d[51]||(d[51]=w=>Oe(be).bio=w),rows:"3",maxlength:"240",class:"field w-full resize-none",placeholder:"Flight director, North yard operations…",onBlur:d[52]||(d[52]=w=>Xe("Saved."))},null,544),[[ye,Oe(be).bio]]),r("div",G_,k((Oe(be).bio||"").length)+"/240",1)]),_:1}),A(Pe,{title:"Show email on profile",desc:"Let teammates see your email address.",keywords:"show email public visibility"},{default:we(()=>[A(Gt,{modelValue:Oe(be).showEmail,"onUpdate:modelValue":d[53]||(d[53]=w=>Oe(be).showEmail=w)},null,8,["modelValue"])]),_:1})])):V.id==="security"?(p(),m("div",q_,[A(Pe,{block:"",title:"Two-factor authentication",desc:"Require a one-time code at sign-in.",keywords:"two factor 2fa authentication security"},{default:we(()=>[r("div",Y_,[r("span",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Oe(be).twoFactor?"bg-success-soft text-success-fg":"bg-surface-2 text-ink-secondary"])},[d[134]||(d[134]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),I(k(Oe(be).twoFactor?"Enabled":"Disabled"),1)],2),!Oe(be).twoFactor&&!no.value?(p(),m("button",{key:0,class:"btn-accent",onClick:hr},"Enable 2FA")):Oe(be).twoFactor?(p(),m("button",{key:1,class:"btn-ghost",onClick:pr},"Disable")):N("",!0)]),no.value?(p(),m("div",J_,[r("div",X_,[d[136]||(d[136]=r("div",{class:"grid h-28 w-28 place-items-center rounded bg-white p-2"},[r("svg",{viewBox:"0 0 100 100",class:"h-full w-full"},[r("rect",{width:"100",height:"100",fill:"#fff"}),r("g",{fill:"#0F1E3D"},[r("rect",{x:"6",y:"6",width:"24",height:"24"}),r("rect",{x:"70",y:"6",width:"24",height:"24"}),r("rect",{x:"6",y:"70",width:"24",height:"24"}),r("rect",{x:"12",y:"12",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"76",y:"12",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"12",y:"76",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"40",y:"10",width:"8",height:"8"}),r("rect",{x:"52",y:"20",width:"8",height:"8"}),r("rect",{x:"40",y:"40",width:"8",height:"8"}),r("rect",{x:"60",y:"44",width:"8",height:"8"}),r("rect",{x:"44",y:"60",width:"8",height:"8"}),r("rect",{x:"70",y:"60",width:"8",height:"8"}),r("rect",{x:"80",y:"72",width:"8",height:"8"}),r("rect",{x:"60",y:"80",width:"8",height:"8"})])])],-1)),r("div",Q_,[d[135]||(d[135]=r("div",{class:"text-xs text-ink-secondary"},"Scan with an authenticator app, or enter this secret:",-1)),r("div",e1,k(ba.value),1),r("div",t1,[ee(r("input",{"onUpdate:modelValue":d[54]||(d[54]=w=>io.value=w),inputmode:"numeric",maxlength:"6",class:"field w-28 font-mono tracking-[0.3em]",placeholder:"000000"},null,512),[[ye,io.value]]),r("button",{class:"btn-accent",onClick:Fn},"Verify & enable")]),oo.value?(p(),m("p",n1,k(oo.value),1)):N("",!0)])])])):N("",!0),Oe(be).twoFactor&&Wt.value.length?(p(),m("div",i1,[d[137]||(d[137]=r("div",{class:"text-xs font-semibold text-ink"},"Recovery codes",-1)),d[138]||(d[138]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Store these somewhere safe — each works once.",-1)),r("div",o1,[(p(!0),m(ue,null,Re(Wt.value,w=>(p(),m("span",{key:w,class:"select-all"},k(w),1))),128))])])):N("",!0),d[139]||(d[139]=r("p",{class:"mt-2 text-xs text-ink-muted"},"Prototype — codes are generated locally until the account service verifies them.",-1))]),_:1}),A(Pe,{block:"",title:"Active sessions",desc:"Devices currently signed in to your account.",keywords:"sessions devices logout sign out remote"},{default:we(()=>[r("div",s1,[r("div",a1,[r("div",r1,[A(K,{name:"monitor",size:18})]),r("div",l1,[r("div",u1,[I(k(mr())+" on "+k(so())+" ",1),d[140]||(d[140]=r("span",{class:"ml-1 rounded-full bg-success-soft px-2 py-0.5 text-[10px] font-semibold text-success-fg"},"This device",-1))]),r("div",c1,"Signed in "+k(Oe(ku)(Oe(ya))),1)]),r("button",{class:"btn-ghost",onClick:d[55]||(d[55]=w=>l("logout"))},"Log out")])]),d[141]||(d[141]=r("button",{class:"btn-ghost mt-2 opacity-60",disabled:"",title:"Requires the account service"}," Log out all other devices ",-1)),d[142]||(d[142]=r("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})])):V.id==="team"?(p(),m("div",d1,[it.id?(p(),m("div",f1,[A(Pe,{block:"",title:`Edit user — ${it.email}`,desc:"Update details, change role, reset password, or set verified.",keywords:"edit user update role password verified organization"},{default:we(()=>[r("div",h1,[r("div",p1,[ee(r("input",{"onUpdate:modelValue":d[56]||(d[56]=w=>it.email=w),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ye,it.email]]),ee(r("select",{"onUpdate:modelValue":d[57]||(d[57]=w=>it.role=w),class:"field w-32",disabled:Gn.value,title:Gn.value?"You cannot change your own role":""},[(p(!0),m(ue,null,Re(Tn.value,w=>(p(),m("option",{key:w.value,value:w.value},k(w.label),9,g1))),128))],8,m1),[[Ot,it.role]])]),u.value?ee((p(),m("select",{key:0,"onUpdate:modelValue":d[58]||(d[58]=w=>it.organization=w),class:"field",title:"Organization"},[(p(!0),m(ue,null,Re(xa.value,w=>(p(),m("option",{key:w.value,value:w.value},k(w.label),9,v1))),128))],512)),[[Ot,it.organization]]):N("",!0),ee(r("input",{"onUpdate:modelValue":d[59]||(d[59]=w=>it.password=w),type:"password",class:"field",placeholder:"New password (leave blank to keep current)"},null,512),[[ye,it.password]]),r("label",_1,[A(Gt,{modelValue:it.verified,"onUpdate:modelValue":d[60]||(d[60]=w=>it.verified=w)},null,8,["modelValue"]),d[143]||(d[143]=I(" Email verified ",-1))]),r("div",b1,[r("button",{class:"btn-accent",disabled:pi.value,onClick:ka},k(pi.value?"Saving…":"Save changes"),9,y1),r("button",{class:"btn-ghost",onClick:Ro},"Cancel"),Cn.value?(p(),m("span",x1,k(Cn.value),1)):N("",!0),Gn.value?(p(),m("span",w1,"Editing your own account — role locked.")):N("",!0)])])]),_:1},8,["title"])])):(p(),m("div",k1,[A(Pe,{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(()=>[r("div",S1,[r("div",T1,[ee(r("input",{"onUpdate:modelValue":d[61]||(d[61]=w=>Mt.email=w),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[ye,Mt.email]]),ee(r("select",{"onUpdate:modelValue":d[62]||(d[62]=w=>Mt.role=w),class:"field w-32"},[(p(!0),m(ue,null,Re(Tn.value,w=>(p(),m("option",{key:w.value,value:w.value},k(w.label),9,P1))),128))],512),[[Ot,Mt.role]])]),u.value?ee((p(),m("select",{key:0,"onUpdate:modelValue":d[63]||(d[63]=w=>Mt.organization=w),class:"field",title:"Organization"},[(p(!0),m(ue,null,Re(xa.value,w=>(p(),m("option",{key:w.value,value:w.value},k(w.label),9,C1))),128))],512)),[[Ot,Mt.organization]]):(p(),m("div",L1,[d[144]||(d[144]=I(" New users join your organization: ",-1)),r("span",A1,k(t.organizationName||"—"),1)])),ee(r("input",{"onUpdate:modelValue":d[64]||(d[64]=w=>Mt.password=w),type:"password",class:"field",placeholder:"Temporary password (min 8 chars)"},null,512),[[ye,Mt.password]]),r("div",M1,[r("button",{class:"btn-accent",disabled:Di.value,onClick:wa},k(Di.value?"Creating…":"Create user"),9,E1),Ni.value?(p(),m("span",O1,k(Ni.value),1)):N("",!0)])])]),_:1})])),r("div",z1,[r("div",I1,[d[145]||(d[145]=r("div",null,[r("div",{class:"eyebrow"},"Team"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All users")],-1)),r("button",{class:"btn-ghost",disabled:ao.value,onClick:Kt},k(ao.value?"Loading…":"Refresh"),9,$1)]),_n.value?(p(),m("div",N1,k(_n.value),1)):!fi.value.length&&!ao.value?(p(),m("div",D1,"No users yet.")):(p(),m("div",F1,[r("table",R1,[r("thead",null,[r("tr",B1,[(p(),m(ue,null,Re(["User","Role","Organization","Status",""],w=>r("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"},k(w),1)),64))])]),r("tbody",null,[(p(!0),m(ue,null,Re(fi.value,w=>(p(),m("tr",{key:w.id,class:Me(["border-b border-line last:border-0",it.id===w.id?"bg-accent-soft":""])},[r("td",U1,[r("span",V1,k(w.email),1),w.email===t.email?(p(),m("span",Z1,"(you)")):N("",!0)]),r("td",H1,[r("span",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",y(w.role||"user")])},[A(K,{name:_(w.role||"user"),size:12},null,8,["name"]),I(k(h(w.role||"user")),1)],2)]),r("td",j1,[r("span",{class:Me(["text-sm",w.organizationName?"text-ink-secondary":"text-ink-muted"])},k(w.organizationName||"—"),3)]),r("td",W1,[r("span",{class:Me(["text-xs",w.verified?"text-success-fg":"text-ink-muted"])},k(w.verified?"Verified":"Unverified"),3)]),r("td",K1,[ro.value===w.id?(p(),m(ue,{key:0},[d[146]||(d[146]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Remove?",-1)),r("button",{class:"btn-ghost mr-1",onClick:d[65]||(d[65]=Ve=>ro.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Ve=>Ts(w)}," Remove ",8,G1)],64)):(p(),m("div",q1,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Ve=>Fo(w)},[A(K,{name:"settings",size:14}),d[147]||(d[147]=I(" Edit ",-1))],8,Y1),w.email!==t.email?(p(),m("button",{key:0,class:"btn-ghost inline-flex items-center gap-1.5",onClick:Ve=>ro.value=w.id},[A(K,{name:"trash",size:14}),d[148]||(d[148]=I(" Remove ",-1))],8,J1)):N("",!0)]))])],2))),128))])])]))])])):V.id==="organizations"?(p(),m("div",X1,[Rn.id?(p(),m("div",Q1,[A(Pe,{block:"",title:"Rename organization",desc:"Update the organization's display name.",keywords:"rename organization edit"},{default:we(()=>[r("div",eb,[ee(r("input",{"onUpdate:modelValue":d[66]||(d[66]=w=>Rn.name=w),class:"field",placeholder:"Organization name",onKeyup:hu(lo,["enter"])},null,544),[[ye,Rn.name]]),r("div",tb,[r("button",{class:"btn-accent",onClick:lo},"Save changes"),r("button",{class:"btn-ghost",onClick:Sa},"Cancel"),Yn.value?(p(),m("span",nb,k(Yn.value),1)):N("",!0)])])]),_:1})])):(p(),m("div",ib,[A(Pe,{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(()=>[r("div",ob,[ee(r("input",{"onUpdate:modelValue":d[67]||(d[67]=w=>Bo.name=w),class:"field",placeholder:"e.g. Northwind Aerial",onKeyup:hu(bn,["enter"])},null,544),[[ye,Bo.name]]),r("div",sb,[r("button",{class:"btn-accent",disabled:Uo.value,onClick:bn},k(Uo.value?"Creating…":"Create organization"),9,ab),qn.value?(p(),m("span",rb,k(qn.value),1)):N("",!0)])])]),_:1})])),r("div",lb,[r("div",{class:"flex items-center justify-between px-5 py-4"},[d[149]||(d[149]=r("div",null,[r("div",{class:"eyebrow"},"Tenancy"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All organizations")],-1)),r("button",{class:"btn-ghost",onClick:Pn},"Refresh")]),Do.value.length?(p(),m("div",cb,[r("table",db,[r("thead",null,[r("tr",fb,[(p(),m(ue,null,Re(["Organization","Members",""],w=>r("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"},k(w),1)),64))])]),r("tbody",null,[(p(!0),m(ue,null,Re(Do.value,w=>(p(),m("tr",{key:w.id,class:Me(["border-b border-line last:border-0",Rn.id===w.id?"bg-accent-soft":""])},[r("td",hb,[r("span",pb,[A(K,{name:"grid",size:14,class:"text-ink-muted"}),I(k(w.name),1)])]),r("td",mb,k(Ps.value[w.id]||0),1),r("td",gb,[Fi.value===w.id?(p(),m(ue,{key:0},[d[150]||(d[150]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:d[68]||(d[68]=Ve=>Fi.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:Ve=>gr(w)}," Delete ",8,vb)],64)):(p(),m("div",_b,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:Ve=>Vo(w)},[A(K,{name:"settings",size:14}),d[151]||(d[151]=I(" Rename ",-1))],8,bb),r("button",{class:"btn-ghost inline-flex items-center gap-1.5",disabled:(Ps.value[w.id]||0)>0,title:(Ps.value[w.id]||0)>0?"Reassign or remove members first":"",onClick:Ve=>Fi.value=w.id},[A(K,{name:"trash",size:14}),d[152]||(d[152]=I(" Delete ",-1))],8,yb)]))])],2))),128))])])])):(p(),m("div",ub,"No organizations yet."))])])):V.id==="advanced"?(p(),m("div",xb,[r("div",wb,[A(Pe,{title:"Export data",desc:"Download your settings and profile as JSON.",keywords:"export data download backup"},{default:we(()=>[r("button",{class:"btn-ghost",onClick:Ta},[A(K,{name:"download",size:15,class:"mr-1.5 inline"}),d[153]||(d[153]=I("Export",-1))])]),_:1}),A(Pe,{block:"",title:"Import data",desc:"Restore settings from a previous export.",keywords:"import data upload restore"},{default:we(()=>[r("label",kb,[A(K,{name:"upload",size:15,class:"mr-1.5 inline"}),d[154]||(d[154]=I("Choose file… ",-1)),r("input",{type:"file",accept:"application/json,.json",class:"hidden",onChange:uo},null,32)]),Zo.value?(p(),m("p",Sb,k(Zo.value),1)):N("",!0)]),_:1})]),r("div",Tb,[r("div",Pb,[A(K,{name:"alertTriangle",size:18}),d[155]||(d[155]=r("h3",{class:"text-sm font-bold uppercase tracking-caps"},"Danger zone",-1))]),d[160]||(d[160]=r("p",{class:"mt-1 text-xs text-ink-secondary"},"Deleting your account is permanent and cannot be undone.",-1)),r("div",Cb,[d[159]||(d[159]=r("div",{class:"text-sm font-semibold text-ink"},"Delete account",-1)),r("label",Lb,[ee(r("input",{"onUpdate:modelValue":d[69]||(d[69]=w=>xt.understand=w),type:"checkbox",class:"mt-0.5 h-4 w-4 accent-[var(--danger)]"},null,512),[[Ha,xt.understand]]),d[156]||(d[156]=I(" I understand this permanently deletes my account and all associated data. ",-1))]),r("div",Ab,[r("label",Mb,[d[157]||(d[157]=I("Type ",-1)),r("span",Eb,k(Ho.value),1),d[158]||(d[158]=I(" to confirm",-1))]),ee(r("input",{"onUpdate:modelValue":d[70]||(d[70]=w=>xt.typed=w),class:"field w-full max-w-[360px] font-mono",placeholder:Ho.value},null,8,Ob),[[ye,xt.typed]])]),r("div",zb,[xt.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:xt.cooldown>0,onClick:Bn},k(xt.cooldown>0?`Confirm in ${xt.cooldown}s…`:"Permanently delete account"),9,$b)):(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:!jo.value,onClick:vr}," Delete account… ",8,Ib)),xt.armed&&xt.cooldown>0?(p(),m("span",Nb,"Cooling-off period — read once more.")):N("",!0)]),xt.msg?(p(),m("p",Db,k(xt.msg),1)):N("",!0)])])])):N("",!0)],64))),128))])]),A(vh,{name:"fade"},{default:we(()=>[to.value?(p(),m("div",Fb,[A(K,{name:"check",size:16,class:"text-success-fg"}),I(k(to.value),1)])):N("",!0)]),_:1})]))}},Bb=Sm(Rb,[["__scopeId","data-v-f90edc26"]]),Ub={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Vb={class:"flex flex-wrap items-center gap-3"},Zb={class:"inline-flex rounded-lg border border-line bg-surface-1 p-0.5"},Hb=["onClick"],jb={class:"ml-auto flex items-center gap-2"},Wb=["href"],Kb={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},Gb={class:"eyebrow"},qb={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},Yb={key:0,class:"panel p-5"},Jb={class:"mb-4 flex items-center justify-between"},Xb={class:"eyebrow"},Qb={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},ey={class:"block"},ty={class:"block"},ny={class:"block"},iy={class:"block"},oy={key:0,value:""},sy=["value"],ay={class:"block"},ry={class:"block"},ly={class:"block"},uy={class:"block"},cy={class:"block"},dy=["value"],fy={class:"block"},hy=["value"],py={class:"block"},my=["value"],gy={class:"block"},vy={class:"mt-3 block"},_y={key:0,class:"mt-3 grid grid-cols-2 gap-3 max-[760px]:grid-cols-1"},by={class:"block"},yy={class:"block"},xy={class:"block"},wy={class:"block"},ky={class:"col-span-2 block max-[760px]:col-span-1"},Sy={class:"mt-4 flex items-center gap-3"},Ty=["disabled"],Py={key:0,class:"text-sm text-danger-fg"},Cy={class:"panel overflow-hidden p-0"},Ly={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Ay={key:1,class:"grid place-items-center px-5 py-16 text-center"},My={key:2,class:"overflow-x-auto"},Ey={class:"w-full border-collapse text-sm"},Oy={class:"text-left"},zy={class:"whitespace-nowrap px-5 py-3 font-mono text-ink"},Iy={key:0,class:"text-ink-muted"},$y={class:"px-5 py-3 text-ink-secondary"},Ny=["title"],Dy={class:"px-5 py-3 font-mono text-ink-secondary"},Fy={class:"px-5 py-3 text-ink-secondary"},Ry={class:"px-5 py-3"},By=["onClick"],Uy={class:"whitespace-nowrap px-5 py-3 text-right"},Vy=["onClick"],Zy=["onClick"],Hy=["onClick"],jy={key:0,class:"border-b border-line bg-surface-2"},Wy={colspan:"7",class:"px-5 py-3"},Ky={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},Gy={class:"text-ink-secondary"},qy={class:"text-ink"},Yy={class:"text-ink-secondary"},Jy={class:"text-ink"},Xy={class:"text-ink-secondary"},Qy={class:"font-mono text-ink"},ex={key:0,class:"text-ink-secondary"},tx={class:"text-ink"},nx={key:0,class:"mt-2 space-y-1"},ix={key:1,class:"mt-2 text-xs text-success-fg"},ox={key:0,class:"panel p-5"},sx={class:"mb-4 flex items-center justify-between"},ax={class:"eyebrow"},rx={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},lx={class:"block"},ux={class:"block"},cx={class:"block"},dx={class:"block"},fx={class:"block"},hx={class:"block"},px=["value"],mx={class:"mt-3 flex flex-wrap gap-6"},gx={class:"flex items-center gap-2 text-sm text-ink-secondary"},vx={class:"flex items-center gap-2 text-sm text-ink-secondary"},_x={class:"mt-4 flex items-center gap-3"},bx=["disabled"],yx={key:0,class:"text-sm text-danger-fg"},xx={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"},Sx={key:2,class:"overflow-x-auto"},Tx={class:"w-full border-collapse text-sm"},Px={class:"text-left"},Cx={class:"px-5 py-3 font-semibold text-ink"},Lx={class:"px-5 py-3 text-ink-secondary"},Ax={class:"px-5 py-3 font-mono text-ink-secondary"},Mx={class:"px-5 py-3"},Ex={key:1,class:"text-ink-muted"},Ox={class:"px-5 py-3"},zx={class:"whitespace-nowrap px-5 py-3 text-right"},Ix=["onClick"],$x=["onClick"],Nx=["onClick"],Dx={__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",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"},l=Z("flights"),u=Z([]),f=Z([]),h=Z(!1),_=Z("");async function y(){h.value=!0,_.value="";const[J,E]=await Promise.all([Jc(),Cp()]);(!J.ok||!E.ok)&&(_.value=J.status===503||E.status===503?"Logbook storage is not configured on the API Server (service account missing).":"Could not load the logbook."),u.value=J.drones,f.value=E.flights,h.value=!1}ki(y);function C(J){const E=J.compliance||{};return E.exempt?{tone:"neutral",label:"Exempt"}:(E.redFlags||[]).length?{tone:"danger",label:`${E.redFlags.length} issue${E.redFlags.length>1?"s":""}`}:{tone:"success",label:"Compliant"}}const T=Z("");function M(J){T.value=T.value===J?"":J}const R=[{value:"open",label:"Open"},{value:"specific",label:"Specific"},{value:"certified",label:"Certified"}],B=[{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 F(){var J;return{operationDate:new Date().toISOString().slice(0,10),startTime:"",endTime:"",drone:((J=u.value[0])==null?void 0:J.id)||"",areaRoute:"",maxAltitudeAgl:"",pilotName:i.email,certificateRef:"",category:"open",purpose:"commercial",loggingPath:"",rawFdrLogUrl:"",authorisationRef:"",weather:"",airspaceRef:"",observer:"",incidents:"",notes:""}}const he=Z(!1),pe=Z(""),Y=kt(F()),Le=Z(""),fe=Z(!1),Ue=Z(!1);function $e(){Object.assign(Y,F()),pe.value="",Le.value="",Ue.value=!1,he.value=!0}function Ie(J){Object.assign(Y,{operationDate:(J.operationDate||"").slice(0,10),startTime:J.startTime||"",endTime:J.endTime||"",drone:J.drone||"",areaRoute:J.areaRoute||"",maxAltitudeAgl:J.maxAltitudeAgl||"",pilotName:J.pilotName||"",certificateRef:J.certificateRef||"",category:J.category||"open",purpose:J.purpose||"commercial",loggingPath:J.loggingPath||"",rawFdrLogUrl:J.rawFdrLogUrl||"",authorisationRef:J.authorisationRef||"",weather:J.weather||"",airspaceRef:J.airspaceRef||"",observer:J.observer||"",incidents:J.incidents||"",notes:J.notes||""}),pe.value=J.id,Le.value="",Ue.value=!!(J.weather||J.airspaceRef||J.observer||J.incidents||J.notes),he.value=!0}function qe(){he.value=!1,pe.value=""}async function xe(){var z;if(Le.value="",!Y.drone){Le.value="Select a drone first (add one on the Drones tab).";return}fe.value=!0;const J={...Y,maxAltitudeAgl:Number(Y.maxAltitudeAgl)||0},E=pe.value?await Ap(pe.value,J):await Lp(J);if(fe.value=!1,!E.ok){Le.value=((z=E.body)==null?void 0:z.error)||"Could not save the flight.";return}he.value=!1,await y()}const Se=Z("");async function ze(J){const E=await Mp(J.id);Se.value="",E.ok&&await y()}const ie=["","C0","C1","C2","C3","C4","C5","C6"];function je(){return{name:"",model:"",serial:"",operatorNumber:"",mtomGrams:"",isToy:!1,autologsFlights:!1,cClass:""}}const oe=Z(!1),We=Z(""),le=kt(je()),ce=Z(""),ae=Z(!1);function st(){Object.assign(le,je()),We.value="",ce.value="",oe.value=!0}function te(J){Object.assign(le,{name:J.name||"",model:J.model||"",serial:J.serial||"",operatorNumber:J.operatorNumber||"",mtomGrams:J.mtomGrams||"",isToy:!!J.isToy,autologsFlights:!!J.autologsFlights,cClass:J.cClass||""}),We.value=J.id,ce.value="",oe.value=!0}function ke(){oe.value=!1,We.value=""}async function Ne(){var z;if(ce.value="",!le.name.trim()){ce.value="Give the drone a name.";return}ae.value=!0;const J={...le,mtomGrams:Number(le.mtomGrams)||0},E=We.value?await Tp(We.value,J):await Sp(J);if(ae.value=!1,!E.ok){ce.value=((z=E.body)==null?void 0:z.error)||"Could not save the drone.";return}oe.value=!1,await y()}const ht=Z("");async function lt(J){var z;const E=await Pp(J.id);ht.value="",E.ok?await y():ce.value=((z=E.body)==null?void 0:z.error)||"Could not delete the drone."}const Ze=ve(()=>{const J=f.value.length,E=f.value.filter(_t=>{var ut;return(((ut=_t.compliance)==null?void 0:ut.redFlags)||[]).length}).length,z=f.value.filter(_t=>{var ut;return(ut=_t.compliance)==null?void 0:ut.required}).length;return{total:J,flagged:E,required:z,fleet:u.value.length}});return(J,E)=>(p(),m("div",Ub,[r("div",Vb,[r("div",Zb,[(p(),m(ue,null,Re([["flights","Flights"],["drones","Drones"]],z=>r("button",{key:z[0],class:Me(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",l.value===z[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:_t=>l.value=z[0]},k(z[1]),11,Hb)),64))]),r("div",jb,[r("a",{href:Oe(Ep)(),class:"btn-ghost inline-flex items-center gap-2",title:"Download a compliance CSV (Trafikstyrelsen / police disclosure)"},[A(K,{name:"download",size:15}),E[29]||(E[29]=I(" Export CSV ",-1))],8,Wb),l.value==="flights"?(p(),m("button",{key:0,class:"btn-accent inline-flex items-center gap-2",onClick:$e},[A(K,{name:"plus",size:15}),E[30]||(E[30]=I(" Log flight ",-1))])):(p(),m("button",{key:1,class:"btn-accent inline-flex items-center gap-2",onClick:st},[A(K,{name:"plus",size:15}),E[31]||(E[31]=I(" Add drone ",-1))]))])]),r("div",Kb,[(p(!0),m(ue,null,Re([{label:"Flights logged",value:Ze.value.total,tone:"neutral"},{label:"Require logbook",value:Ze.value.required,tone:"neutral"},{label:"Compliance flags",value:Ze.value.flagged,tone:Ze.value.flagged?"danger":"success"},{label:"Registered drones",value:Ze.value.fleet,tone:"neutral"}],z=>(p(),m("div",{key:z.label,class:"panel p-5"},[r("div",Gb,k(z.label),1),r("div",{class:Me(["mt-2 text-[30px] font-bold leading-none tracking-tightest",z.tone==="danger"?"text-danger-fg":z.tone==="success"?"text-success-fg":"text-ink"])},k(z.value),3)]))),128))]),_.value?(p(),m("div",qb,k(_.value),1)):N("",!0),l.value==="flights"?(p(),m(ue,{key:1},[he.value?(p(),m("div",Yb,[r("div",Jb,[r("div",null,[r("div",Xb,k(pe.value?"Edit entry":"New entry"),1),E[32]||(E[32]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Logbook flight (BEK 1649 §5)",-1))]),r("button",{class:"btn-icon",onClick:qe},[A(K,{name:"x",size:16})])]),r("div",Qb,[r("label",ey,[E[33]||(E[33]=r("span",{class:"eyebrow mb-1 block"},"Date",-1)),ee(r("input",{"onUpdate:modelValue":E[0]||(E[0]=z=>Y.operationDate=z),type:"date",class:"field"},null,512),[[ye,Y.operationDate]])]),r("label",ty,[E[34]||(E[34]=r("span",{class:"eyebrow mb-1 block"},"Start",-1)),ee(r("input",{"onUpdate:modelValue":E[1]||(E[1]=z=>Y.startTime=z),type:"time",class:"field"},null,512),[[ye,Y.startTime]])]),r("label",ny,[E[35]||(E[35]=r("span",{class:"eyebrow mb-1 block"},"End",-1)),ee(r("input",{"onUpdate:modelValue":E[2]||(E[2]=z=>Y.endTime=z),type:"time",class:"field"},null,512),[[ye,Y.endTime]])]),r("label",iy,[E[36]||(E[36]=r("span",{class:"eyebrow mb-1 block"},"Drone",-1)),ee(r("select",{"onUpdate:modelValue":E[3]||(E[3]=z=>Y.drone=z),class:"field"},[u.value.length?N("",!0):(p(),m("option",oy,"— add a drone first —")),(p(!0),m(ue,null,Re(u.value,z=>(p(),m("option",{key:z.id,value:z.id},k(z.name)+k(z.model?` · ${z.model}`:""),9,sy))),128))],512),[[Ot,Y.drone]])]),r("label",ay,[E[37]||(E[37]=r("span",{class:"eyebrow mb-1 block"},"Max altitude (m AGL)",-1)),ee(r("input",{"onUpdate:modelValue":E[4]||(E[4]=z=>Y.maxAltitudeAgl=z),type:"number",min:"0",class:"field",placeholder:"120"},null,512),[[ye,Y.maxAltitudeAgl]])]),r("label",ry,[E[38]||(E[38]=r("span",{class:"eyebrow mb-1 block"},"Area / route",-1)),ee(r("input",{"onUpdate:modelValue":E[5]||(E[5]=z=>Y.areaRoute=z),class:"field",placeholder:"Field N of Roskilde, grid survey"},null,512),[[ye,Y.areaRoute]])]),r("label",ly,[E[39]||(E[39]=r("span",{class:"eyebrow mb-1 block"},"Remote pilot name",-1)),ee(r("input",{"onUpdate:modelValue":E[6]||(E[6]=z=>Y.pilotName=z),class:"field",placeholder:"Full name"},null,512),[[ye,Y.pilotName]])]),r("label",uy,[E[40]||(E[40]=r("span",{class:"eyebrow mb-1 block"},"Certificate ref",-1)),ee(r("input",{"onUpdate:modelValue":E[7]||(E[7]=z=>Y.certificateRef=z),class:"field",placeholder:"A2 / STS cert no."},null,512),[[ye,Y.certificateRef]])]),r("label",cy,[E[41]||(E[41]=r("span",{class:"eyebrow mb-1 block"},"Logging path",-1)),ee(r("select",{"onUpdate:modelValue":E[8]||(E[8]=z=>Y.loggingPath=z),class:"field"},[(p(),m(ue,null,Re(j,z=>r("option",{key:z.value,value:z.value},k(z.label),9,dy)),64))],512),[[Ot,Y.loggingPath]])]),r("label",fy,[E[42]||(E[42]=r("span",{class:"eyebrow mb-1 block"},"Category",-1)),ee(r("select",{"onUpdate:modelValue":E[9]||(E[9]=z=>Y.category=z),class:"field"},[(p(),m(ue,null,Re(R,z=>r("option",{key:z.value,value:z.value},k(z.label),9,hy)),64))],512),[[Ot,Y.category]])]),r("label",py,[E[43]||(E[43]=r("span",{class:"eyebrow mb-1 block"},"Purpose",-1)),ee(r("select",{"onUpdate:modelValue":E[10]||(E[10]=z=>Y.purpose=z),class:"field"},[(p(),m(ue,null,Re(B,z=>r("option",{key:z.value,value:z.value},k(z.label),9,my)),64))],512),[[Ot,Y.purpose]])]),r("label",gy,[E[44]||(E[44]=r("span",{class:"eyebrow mb-1 block"},"Authorisation ref",-1)),ee(r("input",{"onUpdate:modelValue":E[11]||(E[11]=z=>Y.authorisationRef=z),class:"field",placeholder:"Specific-category ref"},null,512),[[ye,Y.authorisationRef]])])]),r("label",vy,[E[45]||(E[45]=r("span",{class:"eyebrow mb-1 block"},"FDR log URL (automatic path)",-1)),ee(r("input",{"onUpdate:modelValue":E[12]||(E[12]=z=>Y.rawFdrLogUrl=z),class:"field",placeholder:"Link to the stored flight-data-recorder export"},null,512),[[ye,Y.rawFdrLogUrl]])]),r("button",{class:"mt-4 flex items-center gap-1.5 text-sm font-semibold text-accent",onClick:E[13]||(E[13]=z=>Ue.value=!Ue.value)},[A(K,{name:Ue.value?"x":"plus",size:14},null,8,["name"]),E[46]||(E[46]=I(" Operational details (weather, airspace, incidents) ",-1))]),Ue.value?(p(),m("div",_y,[r("label",by,[E[47]||(E[47]=r("span",{class:"eyebrow mb-1 block"},"Weather / wind",-1)),ee(r("input",{"onUpdate:modelValue":E[14]||(E[14]=z=>Y.weather=z),class:"field",placeholder:"6 m/s NW, CAVOK"},null,512),[[ye,Y.weather]])]),r("label",yy,[E[48]||(E[48]=r("span",{class:"eyebrow mb-1 block"},"Airspace / NOTAM ref",-1)),ee(r("input",{"onUpdate:modelValue":E[15]||(E[15]=z=>Y.airspaceRef=z),class:"field"},null,512),[[ye,Y.airspaceRef]])]),r("label",xy,[E[49]||(E[49]=r("span",{class:"eyebrow mb-1 block"},"Observer",-1)),ee(r("input",{"onUpdate:modelValue":E[16]||(E[16]=z=>Y.observer=z),class:"field"},null,512),[[ye,Y.observer]])]),r("label",wy,[E[50]||(E[50]=r("span",{class:"eyebrow mb-1 block"},"Incidents / anomalies",-1)),ee(r("input",{"onUpdate:modelValue":E[17]||(E[17]=z=>Y.incidents=z),class:"field",placeholder:"RTH trigger, GPS dropout…"},null,512),[[ye,Y.incidents]])]),r("label",ky,[E[51]||(E[51]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),ee(r("textarea",{"onUpdate:modelValue":E[18]||(E[18]=z=>Y.notes=z),rows:"2",class:"field"},null,512),[[ye,Y.notes]])])])):N("",!0),r("div",Sy,[r("button",{class:"btn-accent",disabled:fe.value,onClick:xe},k(fe.value?"Saving…":pe.value?"Save changes":"Log flight"),9,Ty),r("button",{class:"btn-ghost",onClick:qe},"Cancel"),Le.value?(p(),m("span",Py,k(Le.value),1)):N("",!0)])])):N("",!0),r("div",Cy,[h.value?(p(),m("div",Ly,"Loading…")):f.value.length?(p(),m("div",My,[r("table",Ey,[r("thead",null,[r("tr",Oy,[(p(),m(ue,null,Re(["Date","Drone","Area / route","Alt","Pilot","Compliance",""],z=>r("th",{key:z,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"},k(z),1)),64))])]),r("tbody",null,[(p(!0),m(ue,null,Re(f.value,z=>{var _t,ut,Tt,x;return p(),m(ue,{key:z.id},[r("tr",{class:Me(["border-b border-line last:border-0",pe.value===z.id?"bg-accent-soft":""])},[r("td",zy,[I(k((z.operationDate||"").slice(0,10))+" ",1),z.startTime?(p(),m("span",Iy,k(z.startTime),1)):N("",!0)]),r("td",$y,k(z.droneName||"—"),1),r("td",{class:"max-w-[220px] truncate px-5 py-3 text-ink-secondary",title:z.areaRoute},k(z.areaRoute||"—"),9,Ny),r("td",Dy,k(z.maxAltitudeAgl?z.maxAltitudeAgl+" m":"—"),1),r("td",Fy,k(z.pilotName||"—"),1),r("td",Ry,[r("button",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",s[C(z).tone]]),onClick:b=>M(z.id)},[C(z).tone==="danger"?(p(),ot(K,{key:0,name:"alertTriangle",size:12})):C(z).tone==="success"?(p(),ot(K,{key:1,name:"check",size:12})):N("",!0),I(" "+k(C(z).label),1)],10,By)]),r("td",Uy,[Se.value===z.id?(p(),m(ue,{key:0},[E[54]||(E[54]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:E[19]||(E[19]=b=>Se.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:b=>ze(z)},"Delete",8,Vy)],64)):(p(),m(ue,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:b=>Ie(z)},[A(K,{name:"sliders",size:13}),E[55]||(E[55]=I(" Edit",-1))],8,Zy),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:b=>Se.value=z.id},[A(K,{name:"trash",size:13})],8,Hy)],64))])],2),T.value===z.id?(p(),m("tr",jy,[r("td",Wy,[r("div",Ky,[r("span",Gy,[E[56]||(E[56]=I("Logging path: ",-1)),r("b",qy,k(((_t=z.compliance)==null?void 0:_t.loggingPath)||"—"),1)]),r("span",Yy,[E[57]||(E[57]=I("Category: ",-1)),r("b",Jy,k(z.category||"—"),1)]),r("span",Xy,[E[58]||(E[58]=I("Retain until: ",-1)),r("b",Qy,k((z.retentionUntil||"").slice(0,10)||"—"),1)]),(ut=z.compliance)!=null&&ut.exempt?(p(),m("span",ex,[E[59]||(E[59]=I("Exempt: ",-1)),r("b",tx,k(z.compliance.exemptReason),1)])):N("",!0)]),(((Tt=z.compliance)==null?void 0:Tt.redFlags)||[]).length?(p(),m("ul",nx,[(p(!0),m(ue,null,Re(z.compliance.redFlags,(b,S)=>(p(),m("li",{key:S,class:"flex items-start gap-2 text-xs text-danger-fg"},[A(K,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),I(" "+k(b),1)]))),128))])):(x=z.compliance)!=null&&x.exempt?N("",!0):(p(),m("div",ix,"No compliance gaps detected."))])])):N("",!0)],64)}),128))])])])):(p(),m("div",Ay,[A(K,{name:"book",size:26,class:"text-ink-muted"}),E[52]||(E[52]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No flights logged yet",-1)),E[53]||(E[53]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Log your first operation to start the 5-year retention record.",-1))]))])],64)):(p(),m(ue,{key:2},[oe.value?(p(),m("div",ox,[r("div",sx,[r("div",null,[r("div",ax,k(We.value?"Edit drone":"New drone"),1),E[60]||(E[60]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft registry",-1))]),r("button",{class:"btn-icon",onClick:ke},[A(K,{name:"x",size:16})])]),r("div",rx,[r("label",lx,[E[61]||(E[61]=r("span",{class:"eyebrow mb-1 block"},"Name",-1)),ee(r("input",{"onUpdate:modelValue":E[20]||(E[20]=z=>le.name=z),class:"field",placeholder:"Mavic-01"},null,512),[[ye,le.name]])]),r("label",ux,[E[62]||(E[62]=r("span",{class:"eyebrow mb-1 block"},"Model",-1)),ee(r("input",{"onUpdate:modelValue":E[21]||(E[21]=z=>le.model=z),class:"field",placeholder:"DJI Mavic 3 Enterprise"},null,512),[[ye,le.model]])]),r("label",cx,[E[63]||(E[63]=r("span",{class:"eyebrow mb-1 block"},"Serial",-1)),ee(r("input",{"onUpdate:modelValue":E[22]||(E[22]=z=>le.serial=z),class:"field"},null,512),[[ye,le.serial]])]),r("label",dx,[E[64]||(E[64]=r("span",{class:"eyebrow mb-1 block"},"Operator no.",-1)),ee(r("input",{"onUpdate:modelValue":E[23]||(E[23]=z=>le.operatorNumber=z),class:"field",placeholder:"DNK…"},null,512),[[ye,le.operatorNumber]])]),r("label",fx,[E[65]||(E[65]=r("span",{class:"eyebrow mb-1 block"},"MTOM (grams)",-1)),ee(r("input",{"onUpdate:modelValue":E[24]||(E[24]=z=>le.mtomGrams=z),type:"number",min:"0",class:"field",placeholder:"920"},null,512),[[ye,le.mtomGrams]])]),r("label",hx,[E[66]||(E[66]=r("span",{class:"eyebrow mb-1 block"},"C-class",-1)),ee(r("select",{"onUpdate:modelValue":E[25]||(E[25]=z=>le.cClass=z),class:"field"},[(p(),m(ue,null,Re(ie,z=>r("option",{key:z,value:z},k(z||"— none —"),9,px)),64))],512),[[Ot,le.cClass]])])]),r("div",mx,[r("label",gx,[ee(r("input",{"onUpdate:modelValue":E[26]||(E[26]=z=>le.autologsFlights=z),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[Ha,le.autologsFlights]]),E[67]||(E[67]=I(" Auto-logs flights (onboard FDR) ",-1))]),r("label",vx,[ee(r("input",{"onUpdate:modelValue":E[27]||(E[27]=z=>le.isToy=z),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[Ha,le.isToy]]),E[68]||(E[68]=I(" Toy drone (logbook-exempt) ",-1))])]),r("div",_x,[r("button",{class:"btn-accent",disabled:ae.value,onClick:Ne},k(ae.value?"Saving…":We.value?"Save changes":"Add drone"),9,bx),r("button",{class:"btn-ghost",onClick:ke},"Cancel"),ce.value?(p(),m("span",yx,k(ce.value),1)):N("",!0)])])):N("",!0),r("div",xx,[h.value?(p(),m("div",wx,"Loading…")):u.value.length?(p(),m("div",Sx,[r("table",Tx,[r("thead",null,[r("tr",Px,[(p(),m(ue,null,Re(["Name","Model","MTOM","Class","FDR",""],z=>r("th",{key:z,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"},k(z),1)),64))])]),r("tbody",null,[(p(!0),m(ue,null,Re(u.value,z=>(p(),m("tr",{key:z.id,class:Me(["border-b border-line last:border-0",We.value===z.id?"bg-accent-soft":""])},[r("td",Cx,k(z.name),1),r("td",Lx,k(z.model||"—"),1),r("td",Ax,k(z.mtomGrams?z.mtomGrams+" g":"—"),1),r("td",Mx,[z.cClass?(p(),m("span",{key:0,class:Me(["inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",s.accent])},k(z.cClass),3)):(p(),m("span",Ex,"—")),z.isToy?(p(),m("span",{key:2,class:Me(["ml-1 inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",s.neutral])},"toy",2)):N("",!0)]),r("td",Ox,[r("span",{class:Me(["text-xs",z.autologsFlights?"text-success-fg":"text-ink-muted"])},k(z.autologsFlights?"yes":"no"),3)]),r("td",zx,[ht.value===z.id?(p(),m(ue,{key:0},[E[71]||(E[71]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:E[28]||(E[28]=_t=>ht.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:_t=>lt(z)},"Delete",8,Ix)],64)):(p(),m(ue,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:_t=>te(z)},[A(K,{name:"sliders",size:13}),E[72]||(E[72]=I(" Edit",-1))],8,$x),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:_t=>ht.value=z.id},[A(K,{name:"trash",size:13})],8,Nx)],64))])],2))),128))])])])):(p(),m("div",kx,[A(K,{name:"drone",size:26,class:"text-ink-muted"}),E[69]||(E[69]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No drones registered",-1)),E[70]||(E[70]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Register the airframes you fly to log flights against them.",-1))]))])],64))]))}},Fx={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},Rx={class:"flex flex-wrap items-center gap-3"},Bx={class:"inline-flex flex-wrap rounded-lg border border-line bg-surface-1 p-0.5"},Ux=["onClick"],Vx={class:"ml-auto"},Zx={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},Hx={class:"eyebrow"},jx={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},Wx={key:1,class:"panel p-5"},Kx={class:"mb-4 flex items-center justify-between"},Gx={class:"eyebrow"},qx={class:"mt-0.5 text-base font-semibold text-ink"},Yx={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},Jx={class:"col-span-2 block max-[760px]:col-span-1"},Xx={class:"block"},Qx=["value"],e0={class:"block"},t0=["value"],n0={class:"block"},i0=["value"],o0={class:"block"},s0={class:"block"},a0={class:"block"},r0={class:"block"},l0=["value"],u0={class:"block"},c0={class:"block"},d0={class:"block"},f0=["value"],h0={class:"mt-3 block"},p0={key:0,class:"mt-3"},m0={class:"eyebrow mb-1 block"},g0={key:1,class:"mt-3 text-xs text-ink-muted"},v0={class:"mt-4 flex items-center gap-3"},_0=["disabled"],b0={key:0,class:"text-sm text-danger-fg"},y0={class:"panel overflow-hidden p-0"},x0={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},w0={key:1,class:"grid place-items-center px-5 py-16 text-center"},k0={class:"mt-3 text-sm font-medium text-ink-secondary"},S0={class:"mt-1 text-xs text-ink-muted"},T0={key:2,class:"overflow-x-auto"},P0={class:"w-full border-collapse text-sm"},C0={class:"text-left"},L0={class:"px-5 py-3"},A0={class:"font-semibold text-ink"},M0={key:0,class:"font-mono text-[11px] text-ink-muted"},E0={class:"px-5 py-3 text-ink-secondary"},O0={class:"px-5 py-3 text-ink-secondary"},z0={class:"px-5 py-3"},I0=["onClick"],$0={key:0,class:"mt-0.5 font-mono text-[10.5px] text-ink-muted"},N0={class:"px-5 py-3 font-mono text-ink-secondary"},D0={class:"whitespace-nowrap px-5 py-3 text-right"},F0=["onClick"],R0=["onClick"],B0=["href"],U0=["onClick"],V0=["onClick"],Z0=["onClick"],H0={key:0,class:"border-b border-line bg-surface-2"},j0={colspan:"6",class:"px-5 py-3"},W0={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},K0={class:"text-ink-secondary"},G0={class:"text-ink"},q0={class:"text-ink-secondary"},Y0={class:"text-ink"},J0={key:0,class:"text-ink-secondary"},X0={class:"text-ink"},Q0={key:1,class:"text-ink-secondary"},ew={class:"font-mono text-ink"},tw={key:2,class:"text-ink-secondary"},nw={class:"font-mono text-ink"},iw={class:"text-ink-secondary"},ow={class:"text-ink"},sw={key:0,class:"mt-2 space-y-1"},aw={key:1,class:"mt-2 text-xs text-success-fg"},rw={key:2,class:"mt-2 text-xs text-ink-secondary"},lw={class:"flex max-h-[90vh] w-full max-w-[920px] flex-col overflow-hidden rounded-lg border border-line bg-surface-1 shadow-2xl"},uw={class:"flex items-center gap-3 border-b border-line px-5 py-3"},cw={class:"min-w-0"},dw={class:"truncate text-sm font-semibold text-ink"},fw={class:"truncate font-mono text-[11px] text-ink-muted"},hw={class:"ml-auto flex items-center gap-2"},pw=["href"],mw=["href"],gw={class:"flex-1 overflow-auto bg-surface-2"},vw=["src","alt"],_w=["src","title"],bw={key:2,class:"grid place-items-center px-6 py-16 text-center"},yw={class:"mt-1 text-xs text-ink-muted"},xw=["href"],ww={__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(x=>[x.value,x.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"}],_=Z([]),y=Z([]),C=Z(!1),T=Z("");async function M(){C.value=!0,T.value="";const[x,b]=await Promise.all([Op(),Jc()]);x.ok||(T.value=x.status===503?"Document storage is not configured on the API Server (service account missing).":"Could not load documents."),_.value=x.documents,y.value=b.drones||[],C.value=!1}ki(M);const R=Z("all"),B=[["all","All"],["expiring","Expiring soon"],["expired","Expired"],["pending","Pending review"],["archived","Archived"]],j=ve(()=>{const x=_.value;switch(R.value){case"expiring":return x.filter(b=>{var S;return((S=b.expiry)==null?void 0:S.state)==="expiring_soon"&&b.status!=="archived"});case"expired":return x.filter(b=>{var S;return((S=b.expiry)==null?void 0:S.state)==="expired"&&b.status!=="archived"});case"pending":return x.filter(b=>b.status==="pending_review");case"archived":return x.filter(b=>b.status==="archived");default:return x.filter(b=>b.status!=="archived")}});function F(x){if(x.status==="archived")return{tone:"neutral",label:"Superseded",icon:""};const b=x.expiry||{};return b.state==="expired"?{tone:"danger",label:"Expired",icon:"alertTriangle"}:b.state==="expiring_soon"?{tone:"warning",label:`Expires in ${b.daysUntilExpiry}d`,icon:"clock"}:b.state==="valid"?{tone:"success",label:"Valid",icon:"check"}:{tone:"neutral",label:"No expiry",icon:""}}const he=Z("");function pe(x){he.value=he.value===x?"":x}function Y(x){return x.ownerDrone?x.ownerDroneName||"Aircraft":x.ownerRef?x.ownerRef:x.ownerType==="pilot"?"Pilot":x.ownerType?x.ownerType.charAt(0).toUpperCase()+x.ownerType.slice(1):"—"}const Le=["png","jpg","jpeg","gif","webp","svg","bmp","avif"],fe=["pdf","txt","csv","log","json","md","html","htm","xml"];function Ue(x){const b=(x||"").split(".").pop().toLowerCase();return Le.includes(b)?"image":fe.includes(b)?"frame":"none"}const $e=Z(null),Ie=ve(()=>$e.value?Ue($e.value.fileName):"none"),qe=ve(()=>$e.value?Np($e.value.id):"");function xe(x){$e.value=x}function Se(){$e.value=null}function ze(x){x.key==="Escape"&&$e.value&&Se()}ki(()=>window.addEventListener("keydown",ze)),ss(()=>window.removeEventListener("keydown",ze));function ie(){return{title:"",docType:"certificate",ownerType:"pilot",ownerDrone:"",ownerRef:"",reference:"",jurisdiction:"",issueDate:"",expiryDate:"",status:"active",accessTier:"ops",notes:""}}const je=Z(!1),oe=Z(""),We=Z(""),le=Z(""),ce=kt(ie()),ae=Z(null),st=Z(null),te=Z(""),ke=Z(!1);function Ne(){ae.value=null,st.value&&(st.value.value="")}function ht(){Object.assign(ce,ie()),oe.value="",We.value="",le.value="",Ne(),te.value="",je.value=!0}function lt(x){Object.assign(ce,{title:x.title||"",docType:x.docType||"certificate",ownerType:x.ownerType||"pilot",ownerDrone:x.ownerDrone||"",ownerRef:x.ownerRef||"",reference:x.reference||"",jurisdiction:x.jurisdiction||"",issueDate:x.issueDate||"",expiryDate:x.expiryDate||"",status:x.status||"active",accessTier:x.accessTier||"ops",notes:x.notes||""}),oe.value=x.id,We.value="",le.value="",Ne(),te.value="",je.value=!0}function Ze(x){lt(x),oe.value="",We.value=x.id,le.value=x.title,ce.status="active"}function J(){je.value=!1,oe.value="",We.value=""}function E(x){var b;ae.value=((b=x.target.files)==null?void 0:b[0])||null}async function z(){var b;if(te.value="",!ce.title.trim()){te.value="Give the document a title.";return}ke.value=!0;let x;if(oe.value)x=await Ip(oe.value,{...ce});else{const S={...ce};We.value&&(S.replaces=We.value),x=await zp(S,ae.value)}if(ke.value=!1,!x.ok){te.value=((b=x.body)==null?void 0:b.error)||"Could not save the document.";return}je.value=!1,oe.value="",We.value="",await M()}const _t=Z("");async function ut(x){var S;const b=await $p(x.id);_t.value="",b.ok?await M():te.value=((S=b.body)==null?void 0:S.error)||"Could not delete the document."}const Tt=ve(()=>{const x=_.value.filter(b=>b.status!=="archived");return{total:x.length,expiring:x.filter(b=>{var S;return((S=b.expiry)==null?void 0:S.state)==="expiring_soon"}).length,expired:x.filter(b=>{var S;return((S=b.expiry)==null?void 0:S.state)==="expired"}).length,pending:_.value.filter(b=>b.status==="pending_review").length}});return(x,b)=>(p(),m("div",Fx,[r("div",Rx,[r("div",Bx,[(p(),m(ue,null,Re(B,S=>r("button",{key:S[0],class:Me(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",R.value===S[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:G=>R.value=S[0]},k(S[1]),11,Ux)),64))]),r("div",Vx,[r("button",{class:"btn-accent inline-flex items-center gap-2",onClick:ht},[A(K,{name:"upload",size:15}),b[13]||(b[13]=I(" Add document ",-1))])])]),r("div",Zx,[(p(!0),m(ue,null,Re([{label:"Documents on file",value:Tt.value.total,tone:"neutral"},{label:"Expiring soon",value:Tt.value.expiring,tone:Tt.value.expiring?"warning":"neutral"},{label:"Expired",value:Tt.value.expired,tone:Tt.value.expired?"danger":"success"},{label:"Pending review",value:Tt.value.pending,tone:Tt.value.pending?"accent":"neutral"}],S=>(p(),m("div",{key:S.label,class:"panel p-5"},[r("div",Hx,k(S.label),1),r("div",{class:Me(["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"])},k(S.value),3)]))),128))]),T.value?(p(),m("div",jx,k(T.value),1)):N("",!0),je.value?(p(),m("div",Wx,[r("div",Kx,[r("div",null,[r("div",Gx,k(oe.value?"Edit document":We.value?"New version":"New document"),1),r("div",qx,k(We.value?`Supersedes “${le.value}”`:"Compliance & operational document"),1)]),r("button",{class:"btn-icon",onClick:J},[A(K,{name:"x",size:16})])]),r("div",Yx,[r("label",Jx,[b[14]||(b[14]=r("span",{class:"eyebrow mb-1 block"},"Title",-1)),ee(r("input",{"onUpdate:modelValue":b[0]||(b[0]=S=>ce.title=S),class:"field",placeholder:"A2 Remote Pilot Certificate — J. Dariusz"},null,512),[[ye,ce.title]])]),r("label",Xx,[b[15]||(b[15]=r("span",{class:"eyebrow mb-1 block"},"Type",-1)),ee(r("select",{"onUpdate:modelValue":b[1]||(b[1]=S=>ce.docType=S),class:"field"},[(p(),m(ue,null,Re(s,S=>r("option",{key:S.value,value:S.value},k(S.label),9,Qx)),64))],512),[[Ot,ce.docType]])]),r("label",e0,[b[16]||(b[16]=r("span",{class:"eyebrow mb-1 block"},"Owner type",-1)),ee(r("select",{"onUpdate:modelValue":b[2]||(b[2]=S=>ce.ownerType=S),class:"field"},[(p(),m(ue,null,Re(u,S=>r("option",{key:S.value,value:S.value},k(S.label),9,t0)),64))],512),[[Ot,ce.ownerType]])]),r("label",n0,[b[18]||(b[18]=r("span",{class:"eyebrow mb-1 block"},"Aircraft (if any)",-1)),ee(r("select",{"onUpdate:modelValue":b[3]||(b[3]=S=>ce.ownerDrone=S),class:"field"},[b[17]||(b[17]=r("option",{value:""},"— none —",-1)),(p(!0),m(ue,null,Re(y.value,S=>(p(),m("option",{key:S.id,value:S.id},k(S.name)+k(S.model?` · ${S.model}`:""),9,i0))),128))],512),[[Ot,ce.ownerDrone]])]),r("label",o0,[b[19]||(b[19]=r("span",{class:"eyebrow mb-1 block"},"Owner reference",-1)),ee(r("input",{"onUpdate:modelValue":b[4]||(b[4]=S=>ce.ownerRef=S),class:"field",placeholder:"Client name / serial / site"},null,512),[[ye,ce.ownerRef]])]),r("label",s0,[b[20]||(b[20]=r("span",{class:"eyebrow mb-1 block"},"Reference / number",-1)),ee(r("input",{"onUpdate:modelValue":b[5]||(b[5]=S=>ce.reference=S),class:"field",placeholder:"Cert / registration / policy no."},null,512),[[ye,ce.reference]])]),r("label",a0,[b[21]||(b[21]=r("span",{class:"eyebrow mb-1 block"},"Jurisdiction",-1)),ee(r("input",{"onUpdate:modelValue":b[6]||(b[6]=S=>ce.jurisdiction=S),class:"field",placeholder:"DK / EASA / FAA"},null,512),[[ye,ce.jurisdiction]])]),r("label",r0,[b[22]||(b[22]=r("span",{class:"eyebrow mb-1 block"},"Access tier",-1)),ee(r("select",{"onUpdate:modelValue":b[7]||(b[7]=S=>ce.accessTier=S),class:"field"},[(p(),m(ue,null,Re(h,S=>r("option",{key:S.value,value:S.value},k(S.label),9,l0)),64))],512),[[Ot,ce.accessTier]])]),r("label",u0,[b[23]||(b[23]=r("span",{class:"eyebrow mb-1 block"},"Issue date",-1)),ee(r("input",{"onUpdate:modelValue":b[8]||(b[8]=S=>ce.issueDate=S),type:"date",class:"field"},null,512),[[ye,ce.issueDate]])]),r("label",c0,[b[24]||(b[24]=r("span",{class:"eyebrow mb-1 block"},"Expiry date",-1)),ee(r("input",{"onUpdate:modelValue":b[9]||(b[9]=S=>ce.expiryDate=S),type:"date",class:"field"},null,512),[[ye,ce.expiryDate]])]),r("label",d0,[b[25]||(b[25]=r("span",{class:"eyebrow mb-1 block"},"Status",-1)),ee(r("select",{"onUpdate:modelValue":b[10]||(b[10]=S=>ce.status=S),class:"field"},[(p(),m(ue,null,Re(f,S=>r("option",{key:S.value,value:S.value},k(S.label),9,f0)),64))],512),[[Ot,ce.status]])])]),r("label",h0,[b[26]||(b[26]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),ee(r("textarea",{"onUpdate:modelValue":b[11]||(b[11]=S=>ce.notes=S),rows:"2",class:"field",placeholder:"Conditions, renewal contacts, anything worth recording"},null,512),[[ye,ce.notes]])]),oe.value?(p(),m("div",g0,[...b[28]||(b[28]=[I(" Editing updates metadata only. To replace the file, close this and use ",-1),r("b",{class:"text-ink-secondary"},"New version",-1),I(" on the document — the old version is kept for audit. ",-1)])])):(p(),m("div",p0,[r("span",m0,"File "+k(We.value?"(new version)":"(optional)"),1),r("input",{ref_key:"fileInput",ref:st,type:"file",class:"field",onChange:E},null,544),b[27]||(b[27]=r("p",{class:"mt-1 text-xs text-ink-muted"}," Stored in PocketBase for now (object storage later). Max 50 MB. ",-1))])),r("div",v0,[r("button",{class:"btn-accent",disabled:ke.value,onClick:z},k(ke.value?"Saving…":oe.value?"Save changes":We.value?"Upload new version":"Add document"),9,_0),r("button",{class:"btn-ghost",onClick:J},"Cancel"),te.value?(p(),m("span",b0,k(te.value),1)):N("",!0)])])):N("",!0),r("div",y0,[C.value?(p(),m("div",x0,"Loading…")):j.value.length?(p(),m("div",T0,[r("table",P0,[r("thead",null,[r("tr",C0,[(p(),m(ue,null,Re(["Title","Type","Owner","Expiry","Ver",""],S=>r("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"},k(S),1)),64))])]),r("tbody",null,[(p(!0),m(ue,null,Re(j.value,S=>{var G,W;return p(),m(ue,{key:S.id},[r("tr",{class:Me(["border-b border-line last:border-0",oe.value===S.id?"bg-accent-soft":""])},[r("td",L0,[r("div",A0,k(S.title),1),S.reference?(p(),m("div",M0,k(S.reference),1)):N("",!0)]),r("td",E0,k(Oe(l)[S.docType]||S.docType||"—"),1),r("td",O0,k(Y(S)),1),r("td",z0,[r("button",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",i[F(S).tone]]),onClick:H=>pe(S.id)},[F(S).icon?(p(),ot(K,{key:0,name:F(S).icon,size:12},null,8,["name"])):N("",!0),I(" "+k(F(S).label),1)],10,I0),S.expiryDate?(p(),m("div",$0,k(S.expiryDate),1)):N("",!0)]),r("td",N0,"v"+k(S.version||1),1),r("td",D0,[_t.value===S.id?(p(),m(ue,{key:0},[b[29]||(b[29]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:b[12]||(b[12]=H=>_t.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:H=>ut(S)},"Delete",8,F0)],64)):(p(),m(ue,{key:1},[S.hasFile?(p(),m("button",{key:0,class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Preview",onClick:H=>xe(S)},[A(K,{name:"eye",size:13})],8,R0)):N("",!0),S.hasFile?(p(),m("a",{key:1,href:Oe(Er)(S.id),class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Download file"},[A(K,{name:"download",size:13})],8,B0)):N("",!0),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Upload new version",onClick:H=>Ze(S)},[A(K,{name:"upload",size:13})],8,U0),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:H=>lt(S)},[A(K,{name:"sliders",size:13}),b[30]||(b[30]=I(" Edit",-1))],8,V0),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:H=>_t.value=S.id},[A(K,{name:"trash",size:13})],8,Z0)],64))])],2),he.value===S.id?(p(),m("tr",H0,[r("td",j0,[r("div",W0,[r("span",K0,[b[31]||(b[31]=I("Status: ",-1)),r("b",G0,k(S.status||"—"),1)]),r("span",q0,[b[32]||(b[32]=I("Access: ",-1)),r("b",Y0,k(S.accessTier||"—"),1)]),S.jurisdiction?(p(),m("span",J0,[b[33]||(b[33]=I("Jurisdiction: ",-1)),r("b",X0,k(S.jurisdiction),1)])):N("",!0),S.issueDate?(p(),m("span",Q0,[b[34]||(b[34]=I("Issued: ",-1)),r("b",ew,k(S.issueDate),1)])):N("",!0),S.expiryDate?(p(),m("span",tw,[b[35]||(b[35]=I("Expires: ",-1)),r("b",nw,k(S.expiryDate),1)])):N("",!0),r("span",iw,[b[36]||(b[36]=I("File: ",-1)),r("b",ow,k(S.hasFile?S.fileName:"none"),1)])]),(((G=S.expiry)==null?void 0:G.flags)||[]).length?(p(),m("ul",sw,[(p(!0),m(ue,null,Re(S.expiry.flags,(H,re)=>(p(),m("li",{key:re,class:Me(["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(K,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),I(" "+k(H),1)],2))),128))])):((W=S.expiry)==null?void 0:W.state)==="valid"?(p(),m("div",aw,"In force — no action needed.")):N("",!0),S.notes?(p(),m("div",rw,[b[37]||(b[37]=r("span",{class:"text-ink-muted"},"Notes:",-1)),I(" "+k(S.notes),1)])):N("",!0)])])):N("",!0)],64)}),128))])])])):(p(),m("div",w0,[A(K,{name:"fileText",size:26,class:"text-ink-muted"}),r("div",k0,k(R.value==="all"?"No documents on file yet":"Nothing in this view"),1),r("div",S0,k(R.value==="all"?"Add certificates, registrations, insurance and authorisations to track their expiry.":"Try a different filter."),1)]))]),(p(),ot(cf,{to:"body"},[$e.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:dl(Se,["self"])},[r("div",lw,[r("div",uw,[r("div",cw,[r("div",dw,k($e.value.title),1),r("div",fw,k($e.value.fileName),1)]),r("div",hw,[r("a",{href:qe.value,target:"_blank",rel:"noopener",class:"btn-ghost inline-flex items-center gap-1.5",title:"Open in new tab"},[A(K,{name:"globe",size:14}),b[38]||(b[38]=I(" New tab ",-1))],8,pw),r("a",{href:Oe(Er)($e.value.id),class:"btn-ghost inline-flex items-center gap-1.5",title:"Download"},[A(K,{name:"download",size:14}),b[39]||(b[39]=I(" Download ",-1))],8,mw),r("button",{class:"btn-icon",title:"Close",onClick:Se},[A(K,{name:"x",size:16})])])]),r("div",gw,[Ie.value==="image"?(p(),m("img",{key:0,src:qe.value,alt:$e.value.title,class:"mx-auto block max-w-full"},null,8,vw)):Ie.value==="frame"?(p(),m("iframe",{key:1,src:qe.value,class:"h-[74vh] w-full border-0 bg-white",title:$e.value.title},null,8,_w)):(p(),m("div",bw,[A(K,{name:"fileText",size:28,class:"text-ink-muted"}),b[41]||(b[41]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"Preview isn't available for this file type",-1)),r("div",yw,k($e.value.fileName),1),r("a",{href:Oe(Er)($e.value.id),class:"btn-accent mt-4 inline-flex items-center gap-2"},[A(K,{name:"download",size:15}),b[40]||(b[40]=I(" Download instead ",-1))],8,xw)]))])])])):N("",!0)]))]))}},kw={class:"grid h-full grid-cols-[248px_1fr] max-[900px]:grid-cols-1"},Sw={class:"flex flex-col border-r border-line bg-surface-1 px-4 py-5 max-[900px]:hidden"},Tw={class:"flex items-center gap-2.5 px-2 pb-5"},Pw={class:"flex flex-col gap-0.5"},Cw=["onClick"],Lw={class:"mt-auto flex flex-col gap-2.5"},Aw={class:"rounded-lg bg-surface-2 p-3"},Mw={class:"flex items-center gap-2"},Ew={class:"text-xs font-semibold text-ink"},Ow={class:"mt-1.5 block font-mono text-[10.5px] text-ink-muted"},zw={class:"flex items-center gap-2.5 px-2 py-1"},Iw={class:"grid h-8 w-8 place-items-center rounded-full bg-[var(--navy-800)] text-xs font-bold text-white"},$w={class:"min-w-0 flex-1"},Nw={class:"truncate text-[13px] font-semibold text-ink"},Dw={class:"flex items-center gap-1.5 text-[11px] text-ink-muted"},Fw=["title"],Rw={class:"overflow-y-auto"},Bw={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)"}},Uw={class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},Vw={class:"ml-auto flex items-center gap-3"},Zw={class:"flex h-10 w-60 items-center gap-2 rounded border border-line-strong bg-surface-1 px-3 max-[1100px]:hidden"},Hw={key:0,class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},jw={class:"grid grid-cols-4 gap-4 max-[1100px]:grid-cols-2 max-[560px]:grid-cols-1"},Ww={class:"flex items-center justify-between"},Kw={class:"eyebrow"},Gw={class:"mt-2.5 text-[34px] font-bold leading-none tracking-tightest text-ink"},qw={class:"grid grid-cols-[1.6fr_1fr] gap-5 max-[1100px]:grid-cols-1"},Yw={class:"panel p-5"},Jw={class:"mb-3.5 flex items-center justify-between"},Xw={class:"flex items-center gap-2"},Qw={class:"relative z-[1200]"},e2={class:"panel absolute right-0 z-[1200] mt-1.5 w-72 p-3.5 shadow-lg"},t2={class:"flex items-center justify-between gap-3"},n2={class:"mb-1.5 flex items-center justify-between"},i2={class:"font-mono text-[11px] text-ink-muted"},o2=["value"],s2={key:0,class:"mt-1.5 text-[11px] text-ink-muted"},a2={key:0,class:"mt-2.5 text-xs text-ink-muted"},r2={key:1,class:"mt-2.5 text-xs text-ink-muted"},l2={key:2,class:"mt-2.5 text-xs text-ink-muted"},u2={class:"panel p-5"},c2={class:"mb-3.5 flex items-center justify-between"},d2={class:"grid place-items-center py-10 text-center"},f2={class:"panel overflow-hidden p-0"},h2={class:"flex items-center justify-between px-5 py-4"},p2={class:"flex gap-2"},m2={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},g2={key:1,class:"overflow-x-auto"},v2={class:"w-full border-collapse text-sm"},_2={class:"text-left"},b2=["onClick"],y2={class:"px-5 py-3 font-mono font-bold text-ink"},x2={class:"px-5 py-3 text-ink-secondary"},w2={class:"px-5 py-3"},k2={class:"px-5 py-3 font-mono text-ink-secondary"},S2={class:"px-5 py-3"},T2={key:0,class:"flex items-center gap-2"},P2={class:"h-1.5 w-12 overflow-hidden rounded bg-surface-2"},C2={class:"font-mono text-xs text-ink-secondary"},L2={key:1,class:"font-mono text-xs text-ink-muted"},A2={class:"px-5 py-3 font-mono text-ink-secondary"},M2={class:"px-5 py-3 text-right"},E2=["onClick"],O2={key:1,class:"p-7"},z2={class:"mb-4 flex flex-wrap items-center gap-3"},I2={class:"font-mono text-mode font-bold text-ink"},$2={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"},N2={key:1,class:"ml-auto flex flex-wrap gap-1.5"},D2=["onClick"],F2={key:0,class:"panel grid place-items-center p-16 text-center"},R2={class:"pill"},B2={class:"pill"},U2={class:"pill"},V2={class:"mt-1 text-sm font-semibold text-ink"},Z2={class:"pill"},H2={class:"mt-1 font-mono text-sm font-bold tabular text-ink"},j2={class:"grid grid-cols-2 gap-4 max-[820px]:grid-cols-1"},W2={class:"panel p-4"},K2={class:"flex items-center gap-4"},G2={class:"h-9 flex-1 overflow-hidden rounded border border-line bg-surface-2"},q2={class:"readout"},Y2={class:"panel p-4"},J2={class:"readout"},X2={class:"panel p-4"},Q2={class:"space-y-1.5 text-sm"},ek={class:"flex justify-between"},tk={class:"text-ink"},nk={class:"flex justify-between"},ik={class:"text-ink"},ok={class:"flex justify-between"},sk={class:"font-mono tabular text-ink"},ak={class:"flex justify-between"},rk={class:"font-mono tabular text-ink"},lk={class:"panel p-4"},uk={class:"space-y-1.5 text-sm"},ck={class:"flex justify-between"},dk={class:"font-mono tabular text-ink"},fk={class:"flex justify-between"},hk={class:"font-mono tabular text-ink"},pk={class:"flex justify-between"},mk={class:"font-mono tabular text-ink"},gk={class:"panel col-span-2 p-4 max-[820px]:col-span-1"},vk={class:"panel p-4"},_k={class:"flex flex-wrap gap-2"},bk={class:"mt-2 min-h-[16px] text-xs text-ink-muted"},yk={class:"panel p-4"},xk={class:"h-[180px] overflow-y-auto font-mono text-xs"},wk={class:"text-ink-muted"},kk={class:"font-semibold text-accent"},Sk={class:"break-all text-ink"},Tk={key:5,class:"p-7"},Pk={class:"panel grid place-items-center p-16 text-center"},Ck={class:"mt-3 text-sm font-medium text-ink-secondary"},Lk={key:0,class:"mt-1 text-xs text-ink-muted"},Ak={key:1,class:"mt-1 text-xs text-ink-muted"},Mk="34,-25,72,45",Ek={__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=kt({}),f=kt({}),h=Z(null),_=Z(!1),y=kt([]),C=Z(""),T=Z([]),M=kt({unavailable:!1,detail:"",loaded:!1,plan:"",recommendedInterval:30}),R=ve(()=>T.value.filter(U=>!U.onGround).length),B=Z(!1);let j=null;const F=[{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"}],he=ve(()=>{if(be.airTrafficInterval==="auto")return M.recommendedInterval||30;const U=Number(be.airTrafficInterval);return Number.isFinite(U)&&U>0?U:30}),pe=Z(null);let Y=!1;function Le(){if(!(Y||pe.value!==null)){if(typeof navigator>"u"||!navigator.geolocation){pe.value=!1;return}Y=!0,navigator.geolocation.getCurrentPosition(U=>{pe.value={lat:U.coords.latitude,lng:U.coords.longitude},Y=!1},()=>{pe.value=!1,Y=!1},{timeout:8e3,maximumAge:6e5})}}function fe(U,O,Te){const Ye=U&&U.telemetry||{},vt=Ye[O],yt=Ye[Te];return typeof vt=="number"&&typeof yt=="number"&&(vt||yt)?{lat:vt,lng:yt}:null}function Ue(){const U=fe(te.value,"latitude","longitude")||st.value.map(Ye=>fe(u[Ye],"latitude","longitude")).find(Boolean);if(U){const Ye=Or(U.lat,U.lng);if(Ye)return Ye.bbox}const O=fe(te.value,"phoneLatitude","phoneLongitude")||st.value.map(Ye=>fe(u[Ye],"phoneLatitude","phoneLongitude")).find(Boolean);if(O){const Ye=Or(O.lat,O.lng);if(Ye)return Ye.bbox}if(Le(),pe.value){const Ye=Or(pe.value.lat,pe.value.lng);if(Ye)return Ye.bbox}const Te=bm(be.region);return Te||Mk}async function $e(){if(!be.showAirTraffic)return;const U=be.autoBbox?Ue():void 0,{states:O,unavailable:Te,detail:Ye,plan:vt,recommendedInterval:yt}=await mp(U);T.value=O,M.unavailable=Te,M.detail=Ye,M.plan=vt||"",yt&&(M.recommendedInterval=yt),M.loaded=!0}function Ie(){j&&clearInterval(j),j=setInterval(()=>{Se.value==="Overview"&&be.showAirTraffic&&$e()},he.value*1e3)}function qe(){$e(),Ie()}function xe(){j&&clearInterval(j),j=null}const Se=Z("Overview"),ze=[["grid","Overview"],["radio","Live flights"],["route","Routes"],["calendar","Schedule"],["book","Logbook"],["fileText","Documents"],["server","Drives"],["settings","Settings"]],ie=ve(()=>(ze.find(([,U])=>U===Se.value)||["grid"])[0]),je=Z(""),oe=Z(""),We=Z("");let le=null,ce=null,ae=!1;const st=ve(()=>Object.keys(u).sort((U,O)=>(u[O].online?1:0)-(u[U].online?1:0)||U.localeCompare(O))),te=ve(()=>h.value?u[h.value]:null),ke=ve(()=>te.value&&te.value.telemetry||{}),Ne=ve(()=>!!(te.value&&te.value.online)),ht=ve(()=>{const U=ke.value;return typeof U.latitude=="number"&&typeof U.longitude=="number"&&(U.latitude||U.longitude)?{lat:U.latitude,lng:U.longitude}:null}),lt=ve(()=>h.value&&f[h.value]||[]),Ze=ve(()=>{const U=ke.value;return typeof U.velocityX=="number"&&typeof U.velocityY=="number"?Math.hypot(U.velocityX,U.velocityY):null});function J(U){return U.online?U.connected?["In flight","success"]:["Standby","accent"]:["Offline","neutral"]}function E(U){const O=U&&U.telemetry||{};return typeof O.velocityX=="number"&&typeof O.velocityY=="number"?Math.hypot(O.velocityX,O.velocityY):null}const z=ve(()=>st.value.map(U=>{const O=u[U],Te=O.telemetry||{},[Ye,vt]=J(O);return{id:U,mission:O.model||(O.connected?"Drone linked":O.online?"App online":"No signal"),status:Ye,tone:vt,alt:typeof Te.altitude=="number"?Te.altitude.toFixed(0)+" m":"—",battery:typeof Te.batteryPercent=="number"?Te.batteryPercent:null,speed:E(O)}})),_t=ve(()=>st.value.filter(U=>u[U].online).length),ut=ve(()=>st.value.filter(U=>u[U].online&&u[U].connected).length),Tt=ve(()=>st.value.filter(U=>!u[U].online).length),x=ve(()=>{const U=st.value.map(O=>{var Te;return(Te=u[O].telemetry)==null?void 0:Te.batteryPercent}).filter(O=>typeof O=="number");return U.length?Math.round(U.reduce((O,Te)=>O+Te,0)/U.length):null}),b=ve(()=>[{label:"Active flights",value:String(ut.value),delta:`${_t.value} online`,tone:"success",icon:"radio"},{label:"Avg battery",value:x.value==null?"—":x.value+"%",delta:x.value==null?"no telemetry":x.value<40?"low — watch":"nominal",tone:x.value!=null&&x.value<40?"danger":"neutral",icon:"battery"},{label:"Fleet size",value:String(st.value.length),delta:`${ut.value} in flight`,tone:"neutral",icon:"grid"},{label:"Offline",value:String(Tt.value),delta:Tt.value?"needs attention":"all reachable",tone:Tt.value?"warning":"success",icon:"signal"}]),S={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"},G={success:"text-success-fg",danger:"text-danger-fg",warning:"text-amber-fg",neutral:"text-ink-muted",accent:"text-accent-soft-fg"},W=ve(()=>{var Te,Ye,vt;const O=(s.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((Te=O[0])==null?void 0:Te[0])||"P")+(((Ye=O[1])==null?void 0:Ye[0])||((vt=O[0])==null?void 0:vt[1])||"V")).toUpperCase()}),H={superadmin:"Superadmin",admin:"Admin",user:"Operator"},re=ve(()=>H[s.role]||"Operator"),ne=ve(()=>s.organizationName||(s.role==="superadmin"?"All organizations":"No organization"));function Q(U){var Te;u[U.deviceId]=U;const O=U.telemetry||{};typeof O.latitude=="number"&&typeof O.longitude=="number"&&(O.latitude||O.longitude)&&(f[U.deviceId]||(f[U.deviceId]=[]),f[U.deviceId].push([O.latitude,O.longitude]),f[U.deviceId].length>1e3&&f[U.deviceId].shift()),(!h.value||U.online&&!((Te=u[h.value])!=null&&Te.online))&&(h.value=U.deviceId)}function q(U){delete u[U],delete f[U],h.value===U&&(h.value=st.value[0]||null)}function me(U){y.unshift({t:wu(Date.now()),tag:U.type||"?",text:JSON.stringify(se(U))}),y.length>200&&y.pop()}function se(U){const O={...U};return delete O.type,O}function Ce(){const U=location.protocol==="https:"?"wss":"ws";le=new WebSocket(`${U}://${location.host}/bff/ws`),le.onopen=()=>_.value=!0,le.onclose=()=>{_.value=!1,ae||(ce=setTimeout(Ce,1500))},le.onerror=()=>le&&le.close(),le.onmessage=O=>{let Te;try{Te=JSON.parse(O.data)}catch{return}Te.type==="snapshot"?(Te.devices||[]).forEach(Q):Te.type==="update"&&Te.device?(Q(Te.device),Te.event&&Te.device.deviceId===h.value&&me(Te.event)):Te.type==="removed"&&Te.deviceId&&q(Te.deviceId)}}async function Ae(){if(!h.value)return We.value="No device selected.";if(!je.value.trim())return We.value="Enter a command name.";let U;if(oe.value.trim())try{U=JSON.parse(oe.value)}catch{return We.value="Payload is not valid JSON."}const{ok:O,body:Te}=await Dp(h.value,je.value.trim(),U);We.value=O?`Sent "${je.value.trim()}".`:`Error: ${Te.error||"failed"}`}function He(U,O,Te=""){return typeof U=="number"?U.toFixed(O)+Te:"—"}function et(U){h.value=U,Se.value="Live flights"}return $t(Se,U=>{U==="Overview"&&$e()}),$t(()=>be.showAirTraffic,U=>{U?$e():T.value=[]}),$t(he,Ie),ki(async()=>{(await np()).forEach(Q),Ce(),qe()}),ss(()=>{ae=!0,ce&&clearTimeout(ce),le&&le.close(),xe()}),(U,O)=>{var Te,Ye,vt,yt,rn;return p(),m("div",kw,[r("aside",Sw,[r("div",Tw,[A(nd,{size:26}),O[11]||(O[11]=r("span",{class:"text-[19px] tracking-tightest"},[r("span",{class:"font-medium text-ink-secondary"},"Pilot"),r("span",{class:"font-bold text-ink"},"Vault")],-1))]),r("nav",Pw,[(p(),m(ue,null,Re(ze,([de,St])=>r("button",{key:St,class:Me(["flex items-center gap-3 rounded px-3 py-2.5 text-left text-sm transition",Se.value===St?"bg-accent-soft font-semibold text-accent-soft-fg":"font-medium text-ink-secondary hover:bg-surface-2"]),onClick:pn=>Se.value=St},[A(K,{name:de,size:18,stroke:Se.value===St?2.2:1.8},null,8,["name","stroke"]),I(" "+k(St),1)],10,Cw)),64))]),r("div",Lw,[r("div",Aw,[r("div",Mw,[r("span",{class:Me(["h-2 w-2 rounded-full",_.value?"bg-ready":"bg-caution"])},null,2),r("span",Ew,k(_.value?"Link healthy":"Reconnecting…"),1)]),r("span",Ow,"API gateway · "+k(_.value?"streaming":"retrying"),1)]),r("div",zw,[r("div",Iw,k(W.value),1),r("div",$w,[r("div",Nw,k(t.email||"Operator"),1),r("div",Dw,[A(K,{name:"grid",size:11,class:"shrink-0"}),r("span",{class:"truncate",title:`${re.value} · ${ne.value}`},k(re.value)+" · "+k(ne.value),9,Fw)])]),r("button",{class:"text-ink-muted transition hover:text-ink",title:"Log out","aria-label":"Log out",onClick:O[0]||(O[0]=de=>l("logout"))},[A(K,{name:"logout",size:16})])])])]),r("main",Rw,[r("header",Bw,[r("div",null,[O[12]||(O[12]=r("div",{class:"eyebrow"},"Live operations",-1)),r("h1",Uw,k(Se.value),1)]),r("div",Vw,[r("div",Zw,[A(K,{name:"search",size:16,class:"text-ink-muted"}),ee(r("input",{"onUpdate:modelValue":O[1]||(O[1]=de=>C.value=de),placeholder:"Search drones, routes…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[ye,C.value]])]),r("button",{class:"btn-accent flex items-center gap-2",onClick:O[2]||(O[2]=de=>Se.value="Live flights")},[A(K,{name:"radio",size:16}),O[13]||(O[13]=I(" Live flights ",-1))])])]),Se.value==="Overview"?(p(),m("div",Hw,[r("div",jw,[(p(!0),m(ue,null,Re(b.value,de=>(p(),m("div",{key:de.label,class:"panel p-5"},[r("div",Ww,[r("span",Kw,k(de.label),1),A(K,{name:de.icon,size:16,class:"text-ink-muted"},null,8,["name"])]),r("div",Gw,k(de.value),1),r("span",{class:Me(["mt-2 block font-mono text-[11px]",G[de.tone]])},k(de.delta),3)]))),128))]),r("div",qw,[r("div",Yw,[r("div",Jw,[O[18]||(O[18]=r("div",null,[r("div",{class:"eyebrow"},"Airspace"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Live map")],-1)),r("div",Xw,[Oe(be).showAirTraffic&&R.value?(p(),m("span",{key:0,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",S.accent]),title:"Live aircraft from OpenSky Network"},[A(K,{name:"radio",size:12}),I(k(R.value)+" aircraft ",1)],2)):N("",!0),ut.value?(p(),m("span",{key:1,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",S.success])},[O[14]||(O[14]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),I(k(ut.value)+" drones ",1)],2)):N("",!0),r("div",Qw,[r("button",{type:"button",class:Me(["grid h-7 w-7 place-items-center rounded-md text-ink-muted transition hover:bg-surface-2 hover:text-ink",B.value?"bg-surface-2 text-ink":""]),title:"Map settings","aria-label":"Map settings",onClick:O[3]||(O[3]=de=>B.value=!B.value)},[A(K,{name:"settings",size:16})],2),B.value?(p(),m(ue,{key:0},[r("div",{class:"fixed inset-0 z-[1190]",onClick:O[4]||(O[4]=de=>B.value=!1)}),r("div",e2,[O[17]||(O[17]=r("div",{class:"eyebrow mb-2.5"},"Map settings",-1)),r("label",t2,[O[15]||(O[15]=r("span",{class:"text-sm text-ink-secondary"},"Show live air traffic",-1)),A(Gt,{modelValue:Oe(be).showAirTraffic,"onUpdate:modelValue":O[5]||(O[5]=de=>Oe(be).showAirTraffic=de)},null,8,["modelValue"])]),r("div",{class:Me(["mt-3.5",Oe(be).showAirTraffic?"":"pointer-events-none opacity-40"])},[r("div",n2,[O[16]||(O[16]=r("span",{class:"text-sm text-ink-secondary"},"Refresh interval",-1)),r("span",i2,"every "+k(he.value)+"s",1)]),ee(r("select",{"onUpdate:modelValue":O[6]||(O[6]=de=>Oe(be).airTrafficInterval=de),class:"field"},[(p(),m(ue,null,Re(F,de=>r("option",{key:de.value,value:de.value},k(de.label)+k(de.value==="auto"?` (plan: ${M.recommendedInterval}s)`:""),9,o2)),64))],512),[[Ot,Oe(be).airTrafficInterval]]),M.plan?(p(),m("p",s2," OpenSky plan: "+k(M.plan),1)):N("",!0)],2)])],64)):N("",!0)])])]),A(Pu,{position:ht.value,trail:lt.value,aircraft:Oe(be).showAirTraffic?T.value:[]},null,8,["position","trail","aircraft"]),Oe(be).showAirTraffic?M.loaded&&M.unavailable?(p(),m("p",r2,k(M.detail||"Live air traffic is unavailable."),1)):(p(),m("p",l2," Live air traffic from OpenSky Network · updates every "+k(he.value)+"s ",1)):(p(),m("p",a2," Live air traffic hidden · enable it in Map settings "))]),r("div",u2,[r("div",c2,[O[19]||(O[19]=r("div",null,[r("div",{class:"eyebrow"},"Today"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Schedule")],-1)),A(K,{name:"clock",size:16,class:"text-ink-muted"})]),r("div",d2,[A(K,{name:"calendar",size:24,class:"text-ink-muted"}),O[20]||(O[20]=r("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"No missions scheduled",-1)),O[21]||(O[21]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Scheduling is not wired to a backend yet.",-1))])])]),r("div",f2,[r("div",h2,[O[24]||(O[24]=r("div",null,[r("div",{class:"eyebrow"},"Fleet"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft status")],-1)),r("div",p2,[r("span",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",S.success])},[O[22]||(O[22]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),I(k(ut.value)+" in flight ",1)],2),Tt.value?(p(),m("span",{key:0,class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",S.warning])},[O[23]||(O[23]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),I(k(Tt.value)+" offline ",1)],2)):N("",!0)])]),z.value.length?(p(),m("div",g2,[r("table",v2,[r("thead",null,[r("tr",_2,[(p(),m(ue,null,Re(["Aircraft","Mission","Status","Alt","Battery","Speed",""],de=>r("th",{key:de,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"},k(de),1)),64))])]),r("tbody",null,[(p(!0),m(ue,null,Re(z.value,(de,St)=>(p(),m("tr",{key:de.id,class:Me(["cursor-pointer transition hover:bg-surface-2",Stet(de.id)},[r("td",y2,k(de.id),1),r("td",x2,k(de.mission),1),r("td",w2,[r("span",{class:Me(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",S[de.tone]])},[O[25]||(O[25]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),I(k(de.status),1)],2)]),r("td",k2,k(de.alt),1),r("td",S2,[de.battery!=null?(p(),m("div",T2,[r("div",P2,[r("div",{class:Me(["h-full",de.battery<40?"bg-caution":"bg-ready"]),style:ts({width:de.battery+"%"})},null,6)]),r("span",C2,k(de.battery)+"%",1)])):(p(),m("span",L2,"—"))]),r("td",A2,[I(k(de.speed==null?"—":de.speed.toFixed(1))+" ",1),O[26]||(O[26]=r("span",{class:"text-ink-muted"},"m/s",-1))]),r("td",M2,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5 whitespace-nowrap",onClick:dl(pn=>et(de.id),["stop"])},[A(K,{name:"play",size:14}),O[27]||(O[27]=I(" Track ",-1))],8,E2)])],10,b2))),128))])])])):(p(),m("div",m2," No aircraft connected yet. Devices appear here as they come online. "))])])):Se.value==="Live flights"?(p(),m("div",O2,[r("div",z2,[r("span",I2,k(h.value||"No device selected"),1),te.value&&!Ne.value?(p(),m("span",$2,"Offline")):N("",!0),st.value.length?(p(),m("div",N2,[(p(!0),m(ue,null,Re(st.value,de=>(p(),m("button",{key:de,class:Me(["flex items-center gap-2 rounded border px-3 py-1.5 font-mono text-xs font-bold transition",de===h.value?"border-accent bg-accent-soft text-accent-soft-fg":"border-line bg-surface-1 text-ink-secondary hover:border-line-strong"]),onClick:St=>h.value=de},[r("span",{class:Me(["h-2 w-2 rounded-full",u[de].online?"bg-ready":"bg-ink-muted"])},null,2),I(" "+k(de),1)],10,D2))),128))])):N("",!0)]),st.value.length?(p(),m(ue,{key:1},[r("div",{class:Me(["mb-4 grid gap-3",!Ne.value&&te.value?"opacity-60":""]),style:{"grid-template-columns":"repeat(auto-fit, minmax(150px, 1fr))"}},[r("div",R2,[O[30]||(O[30]=r("div",{class:"eyebrow"},"Registration",-1)),r("div",{class:Me(["mt-1 text-sm font-semibold",Ne.value?((Te=te.value)==null?void 0:Te.registration)==="success"?"text-success-fg":"text-danger-fg":"text-ink"])},k(Ne.value&&((Ye=te.value)!=null&&Ye.registration)?te.value.registration:"—"),3)]),r("div",B2,[O[31]||(O[31]=r("div",{class:"eyebrow"},"Drone link",-1)),r("div",{class:Me(["mt-1 text-sm font-semibold",Ne.value?(vt=te.value)!=null&&vt.connected?"text-success-fg":"text-danger-fg":"text-ink"])},k(te.value?Ne.value?te.value.connected?"connected":"no drone":"app offline":"—"),3)]),r("div",U2,[O[32]||(O[32]=r("div",{class:"eyebrow"},"Model",-1)),r("div",V2,k(((yt=te.value)==null?void 0:yt.model)||"—"),1)]),r("div",Z2,[O[33]||(O[33]=r("div",{class:"eyebrow"},"Last update",-1)),r("div",H2,k((rn=te.value)!=null&&rn.lastSeenMs?Oe(wu)(te.value.lastSeenMs):"—"),1)])],2),r("div",j2,[r("div",W2,[O[35]||(O[35]=r("div",{class:"mb-3 eyebrow"},"Battery",-1)),r("div",K2,[r("div",G2,[r("div",{class:Me(["h-full transition-all",typeof ke.value.batteryPercent=="number"?ke.value.batteryPercent<20?"bg-warning":ke.value.batteryPercent<40?"bg-caution":"bg-ready":""]),style:ts({width:(typeof ke.value.batteryPercent=="number"?ke.value.batteryPercent:0)+"%"})},null,6)]),r("div",q2,[I(k(typeof ke.value.batteryPercent=="number"?ke.value.batteryPercent:"—"),1),O[34]||(O[34]=r("span",{class:"text-sm text-ink-secondary"},"%",-1))])])]),r("div",Y2,[O[37]||(O[37]=r("div",{class:"mb-3 eyebrow"},"Altitude",-1)),r("div",J2,[I(k(He(ke.value.altitude,1)),1),O[36]||(O[36]=r("span",{class:"text-sm text-ink-secondary"}," m",-1))])]),r("div",X2,[O[42]||(O[42]=r("div",{class:"mb-3 eyebrow"},"Flight",-1)),r("div",Q2,[r("div",ek,[O[38]||(O[38]=r("span",{class:"text-ink-secondary"},"Mode",-1)),r("b",tk,k(ke.value.flightMode||"—"),1)]),r("div",nk,[O[39]||(O[39]=r("span",{class:"text-ink-secondary"},"Flying",-1)),r("b",ik,k(ke.value.isFlying==null?"—":ke.value.isFlying?"yes":"no"),1)]),r("div",ok,[O[40]||(O[40]=r("span",{class:"text-ink-secondary"},"GPS sats",-1)),r("b",sk,k(ke.value.satelliteCount==null?"—":ke.value.satelliteCount),1)]),r("div",ak,[O[41]||(O[41]=r("span",{class:"text-ink-secondary"},"Speed (H)",-1)),r("b",rk,k(Ze.value==null?"—":He(Ze.value,2," m/s")),1)])])]),r("div",lk,[O[46]||(O[46]=r("div",{class:"mb-3 eyebrow"},"Position",-1)),r("div",uk,[r("div",ck,[O[43]||(O[43]=r("span",{class:"text-ink-secondary"},"Latitude",-1)),r("b",dk,k(He(ke.value.latitude,6)),1)]),r("div",fk,[O[44]||(O[44]=r("span",{class:"text-ink-secondary"},"Longitude",-1)),r("b",hk,k(He(ke.value.longitude,6)),1)]),r("div",pk,[O[45]||(O[45]=r("span",{class:"text-ink-secondary"},"Vert. speed",-1)),r("b",mk,k(He(typeof ke.value.velocityZ=="number"?-ke.value.velocityZ:void 0,2," m/s")),1)])])]),r("div",gk,[O[47]||(O[47]=r("div",{class:"mb-3 eyebrow"},"Track",-1)),A(Pu,{position:ht.value,trail:lt.value},null,8,["position","trail"])]),r("div",vk,[O[48]||(O[48]=r("div",{class:"mb-3 eyebrow"},"Send command",-1)),r("div",_k,[ee(r("input",{"onUpdate:modelValue":O[7]||(O[7]=de=>je.value=de),class:"field flex-1",placeholder:"command (e.g. startConnection)"},null,512),[[ye,je.value]]),ee(r("input",{"onUpdate:modelValue":O[8]||(O[8]=de=>oe.value=de),class:"field flex-1",placeholder:"payload JSON (optional)"},null,512),[[ye,oe.value]]),r("button",{class:"btn-accent",onClick:Ae},"Send")]),r("div",bk,k(We.value),1)]),r("div",yk,[O[49]||(O[49]=r("div",{class:"mb-3 eyebrow"},"Event log",-1)),r("div",xk,[(p(!0),m(ue,null,Re(y,(de,St)=>(p(),m("div",{key:St,class:"border-b border-line py-1"},[r("span",wk,k(de.t),1),r("span",kk,k(de.tag),1),r("span",Sk,k(de.text),1)]))),128))])])])],64)):(p(),m("div",F2,[A(K,{name:"radio",size:28,class:"text-ink-muted"}),O[28]||(O[28]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No aircraft online",-1)),O[29]||(O[29]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Live telemetry appears here once a drone connects.",-1))]))])):Se.value==="Logbook"?(p(),ot(Dx,{key:2,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):Se.value==="Documents"?(p(),ot(ww,{key:3,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):Se.value==="Settings"?(p(),ot(Bb,{key:4,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName,onLogout:O[9]||(O[9]=de=>l("logout"))},null,8,["email","role","organization","organization-name"])):(p(),m("div",Tk,[r("div",Pk,[A(K,{name:ie.value,size:28,class:"text-ink-muted"},null,8,["name"]),r("div",Ck,k(Se.value),1),Se.value==="Drives"?(p(),m("div",Lk,[O[50]||(O[50]=I(" Browse and transfer files here once a drive is connected. Configure drives in ",-1)),r("button",{class:"font-semibold text-accent hover:underline",onClick:O[10]||(O[10]=de=>Se.value="Settings")},"Settings → Integrations"),O[51]||(O[51]=I(". ",-1))])):(p(),m("div",Ak,"This section is part of the console shell and has no backend yet."))])]))])])}}},Ok={key:0,class:"h-full"},zk={key:1,class:"grid h-full place-items-center text-ink-muted text-sm"},Ik={__name:"App",setup(t){const i=Z(!1),s=Z(null),l=Z("user"),u=Z(""),f=Z(""),h=Z("");function _(T){l.value=T&&T.role||"user",u.value=T&&T.organization||"",f.value=T&&T.organizationName||""}ki(async()=>{h.value=(await Qh()).apiBase||"";const T=await vu();T&&(s.value=T.email,_(T),await Su()),i.value=!0});async function y(T){s.value=T,_(await vu()),await Su()}async function C(){Vp(),await tp(),s.value=null,l.value="user",u.value="",f.value=""}return(T,M)=>i.value?(p(),m("div",Ok,[s.value?(p(),ot(Ek,{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(),ot(sm,{key:1,"default-api-base":h.value,onSignedIn:y},null,8,["default-api-base"]))])):(p(),m("div",zk,"Loading…"))}};qh(Ik).mount("#app"); diff --git a/Web App/server/dist/assets/index-BfiNicZk.js b/Web App/server/dist/assets/index-BfiNicZk.js deleted file mode 100644 index f8aa294..0000000 --- a/Web App/server/dist/assets/index-BfiNicZk.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 d of u)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&l(h)}).observe(document,{childList:!0,subtree:!0});function s(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function l(u){if(u.ep)return;u.ep=!0;const d=s(u);fetch(u.href,d)}})();/** -* @vue/shared v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function Or(t){const i=Object.create(null);for(const s of t.split(","))i[s]=1;return s=>s in i}const _t={},Io=[],Jn=()=>{},yu=()=>!1,Ma=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),Ea=t=>t.startsWith("onUpdate:"),Nt=Object.assign,zr=(t,i)=>{const s=t.indexOf(i);s>-1&&t.splice(s,1)},fd=Object.prototype.hasOwnProperty,ht=(t,i)=>fd.call(t,i),De=Array.isArray,$o=t=>Fs(t)==="[object Map]",Zo=t=>Fs(t)==="[object Set]",_l=t=>Fs(t)==="[object Date]",Je=t=>typeof t=="function",Tt=t=>typeof t=="string",Un=t=>typeof t=="symbol",pt=t=>t!==null&&typeof t=="object",xu=t=>(pt(t)||Je(t))&&Je(t.then)&&Je(t.catch),wu=Object.prototype.toString,Fs=t=>wu.call(t),hd=t=>Fs(t).slice(8,-1),ku=t=>Fs(t)==="[object Object]",Ir=t=>Tt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,ks=Or(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Oa=t=>{const i=Object.create(null);return(s=>i[s]||(i[s]=t(s)))},pd=/-\w/g,Rn=Oa(t=>t.replace(pd,i=>i.slice(1).toUpperCase())),md=/\B([A-Z])/g,Bi=Oa(t=>t.replace(md,"-$1").toLowerCase()),Su=Oa(t=>t.charAt(0).toUpperCase()+t.slice(1)),tr=Oa(t=>t?`on${Su(t)}`:""),Yn=(t,i)=>!Object.is(t,i),ga=(t,...i)=>{for(let s=0;s{Object.defineProperty(t,i,{configurable:!0,enumerable:!1,writable:l,value:s})},za=t=>{const i=parseFloat(t);return isNaN(i)?t:i},gd=t=>{const i=Tt(t)?Number(t):NaN;return isNaN(i)?t:i};let bl;const Ia=()=>bl||(bl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Bo(t){if(De(t)){const i={};for(let s=0;s{if(s){const l=s.split(_d);l.length>1&&(i[l[0].trim()]=l[1].trim())}}),i}function Ee(t){let i="";if(Tt(t))i=t;else if(De(t))for(let s=0;sDi(s,i))}const Cu=t=>!!(t&&t.__v_isRef===!0),S=t=>Tt(t)?t:t==null?"":De(t)||pt(t)&&(t.toString===wu||!Je(t.toString))?Cu(t)?S(t.value):JSON.stringify(t,Lu,2):String(t),Lu=(t,i)=>Cu(i)?Lu(t,i.value):$o(i)?{[`Map(${i.size})`]:[...i.entries()].reduce((s,[l,u],d)=>(s[nr(l,d)+" =>"]=u,s),{})}:Zo(i)?{[`Set(${i.size})`]:[...i.values()].map(s=>nr(s))}:Un(i)?nr(i):pt(i)&&!De(i)&&!ku(i)?String(i):i,nr=(t,i="")=>{var s;return Un(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 Rt;class Sd{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&&Rt&&(Rt.active?(this.parent=Rt,this.index=(Rt.scopes||(Rt.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(Rt===this)Rt=this.prevScope;else{let i=Rt;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(Ts){let i=Ts;for(Ts=void 0;i;){const s=i.next;i.next=void 0,i.flags&=-9,i=s}}let t;for(;Ss;){let i=Ss;for(Ss=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 Ou(t){for(let i=t.deps;i;i=i.nextDep)i.version=-1,i.prevActiveLink=i.dep.activeLink,i.dep.activeLink=i}function zu(t){let i,s=t.depsTail,l=s;for(;l;){const u=l.prevDep;l.version===-1?(l===s&&(s=u),Fr(l),Pd(l)):i=l,l.dep.activeLink=l.prevActiveLink,l.prevActiveLink=void 0,l=u}t.deps=i,t.depsTail=s}function mr(t){for(let i=t.deps;i;i=i.nextDep)if(i.dep.version!==i.version||i.dep.computed&&(Iu(i.dep.computed)||i.dep.version!==i.version))return!0;return!!t._dirty}function Iu(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Ms)||(t.globalVersion=Ms,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!mr(t))))return;t.flags|=2;const i=t.dep,s=xt,l=Bn;xt=t,Bn=!0;try{Ou(t);const u=t.fn(t._value);(i.version===0||Yn(u,t._value))&&(t.flags|=128,t._value=u,i.version++)}catch(u){throw i.version++,u}finally{xt=s,Bn=l,zu(t),t.flags&=-3}}function Fr(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 d=s.computed.deps;d;d=d.nextDep)Fr(d,!0)}!i&&!--s.sc&&s.map&&s.map.delete(s.key)}function Pd(t){const{prevDep:i,nextDep:s}=t;i&&(i.nextDep=s,t.prevDep=void 0),s&&(s.prevDep=i,t.nextDep=void 0)}let Bn=!0;const $u=[];function Xn(){$u.push(Bn),Bn=!1}function Qn(){const t=$u.pop();Bn=t===void 0?!0:t}function yl(t){const{cleanup:i}=t;if(t.cleanup=void 0,i){const s=xt;xt=void 0;try{i()}finally{xt=s}}}let Ms=0;class Cd{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 Rr{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||!Bn||xt===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==xt)s=this.activeLink=new Cd(xt,this),xt.deps?(s.prevDep=xt.depsTail,xt.depsTail.nextDep=s,xt.depsTail=s):xt.deps=xt.depsTail=s,Nu(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++,Ms++,this.notify(i)}notify(i){Nr();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{Dr()}}}function Nu(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)Nu(l)}const s=t.dep.subs;s!==t&&(t.prevSub=s,s&&(s.nextSub=t)),t.dep.subs=t}}const gr=new WeakMap,no=Symbol(""),vr=Symbol(""),Es=Symbol("");function Ut(t,i,s){if(Bn&&xt){let l=gr.get(t);l||gr.set(t,l=new Map);let u=l.get(s);u||(l.set(s,u=new Rr),u.map=l,u.key=s),u.track()}}function pi(t,i,s,l,u,d){const h=gr.get(t);if(!h){Ms++;return}const v=b=>{b&&b.trigger()};if(Nr(),i==="clear")h.forEach(v);else{const b=De(t),C=b&&Ir(s);if(b&&s==="length"){const T=Number(l);h.forEach((A,R)=>{(R==="length"||R===Es||!Un(R)&&R>=T)&&v(A)})}else switch((s!==void 0||h.has(void 0))&&v(h.get(s)),C&&v(h.get(Es)),i){case"add":b?C&&v(h.get("length")):(v(h.get(no)),$o(t)&&v(h.get(vr)));break;case"delete":b||(v(h.get(no)),$o(t)&&v(h.get(vr)));break;case"set":$o(t)&&v(h.get(no));break}}Dr()}function Oo(t){const i=ct(t);return i===t?i:(Ut(i,"iterate",Es),Cn(t)?i:i.map(Vn))}function $a(t){return Ut(t=ct(t),"iterate",Es),t}function Gn(t,i){return vi(t)?Uo(io(t)?Vn(i):i):Vn(i)}const Ld={__proto__:null,[Symbol.iterator](){return or(this,Symbol.iterator,t=>Gn(this,t))},concat(...t){return Oo(this).concat(...t.map(i=>De(i)?Oo(i):i))},entries(){return or(this,"entries",t=>(t[1]=Gn(this,t[1]),t))},every(t,i){return ci(this,"every",t,i,void 0,arguments)},filter(t,i){return ci(this,"filter",t,i,s=>s.map(l=>Gn(this,l)),arguments)},find(t,i){return ci(this,"find",t,i,s=>Gn(this,s),arguments)},findIndex(t,i){return ci(this,"findIndex",t,i,void 0,arguments)},findLast(t,i){return ci(this,"findLast",t,i,s=>Gn(this,s),arguments)},findLastIndex(t,i){return ci(this,"findLastIndex",t,i,void 0,arguments)},forEach(t,i){return ci(this,"forEach",t,i,void 0,arguments)},includes(...t){return sr(this,"includes",t)},indexOf(...t){return sr(this,"indexOf",t)},join(t){return Oo(this).join(t)},lastIndexOf(...t){return sr(this,"lastIndexOf",t)},map(t,i){return ci(this,"map",t,i,void 0,arguments)},pop(){return ms(this,"pop")},push(...t){return ms(this,"push",t)},reduce(t,...i){return xl(this,"reduce",t,i)},reduceRight(t,...i){return xl(this,"reduceRight",t,i)},shift(){return ms(this,"shift")},some(t,i){return ci(this,"some",t,i,void 0,arguments)},splice(...t){return ms(this,"splice",t)},toReversed(){return Oo(this).toReversed()},toSorted(t){return Oo(this).toSorted(t)},toSpliced(...t){return Oo(this).toSpliced(...t)},unshift(...t){return ms(this,"unshift",t)},values(){return or(this,"values",t=>Gn(this,t))}};function or(t,i,s){const l=$a(t),u=l[i]();return l!==t&&!Cn(t)&&(u._next=u.next,u.next=()=>{const d=u._next();return d.done||(d.value=s(d.value)),d}),u}const Ad=Array.prototype;function ci(t,i,s,l,u,d){const h=$a(t),v=h!==t&&!Cn(t),b=h[i];if(b!==Ad[i]){const A=b.apply(t,d);return v?Vn(A):A}let C=s;h!==t&&(v?C=function(A,R){return s.call(this,Gn(t,A),R,t)}:s.length>2&&(C=function(A,R){return s.call(this,A,R,t)}));const T=b.call(h,C,l);return v&&u?u(T):T}function xl(t,i,s,l){const u=$a(t),d=u!==t&&!Cn(t);let h=s,v=!1;u!==t&&(d?(v=l.length===0,h=function(C,T,A){return v&&(v=!1,C=Gn(t,C)),s.call(this,C,Gn(t,T),A,t)}):s.length>3&&(h=function(C,T,A){return s.call(this,C,T,A,t)}));const b=u[i](h,...l);return v?Gn(t,b):b}function sr(t,i,s){const l=ct(t);Ut(l,"iterate",Es);const u=l[i](...s);return(u===-1||u===!1)&&Vr(s[0])?(s[0]=ct(s[0]),l[i](...s)):u}function ms(t,i,s=[]){Xn(),Nr();const l=ct(t)[i].apply(t,s);return Dr(),Qn(),l}const Md=Or("__proto__,__v_isRef,__isVue"),Du=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Un));function Ed(t){Un(t)||(t=String(t));const i=ct(this);return Ut(i,"has",t),i.hasOwnProperty(t)}class Fu{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,d=this._isShallow;if(s==="__v_isReactive")return!u;if(s==="__v_isReadonly")return u;if(s==="__v_isShallow")return d;if(s==="__v_raw")return l===(u?d?Ud:Vu:d?Uu:Bu).get(i)||Object.getPrototypeOf(i)===Object.getPrototypeOf(l)?i:void 0;const h=De(i);if(!u){let b;if(h&&(b=Ld[s]))return b;if(s==="hasOwnProperty")return Ed}const v=Reflect.get(i,s,Ht(i)?i:l);if((Un(s)?Du.has(s):Md(s))||(u||Ut(i,"get",s),d))return v;if(Ht(v)){const b=h&&Ir(s)?v:v.value;return u&&pt(b)?br(b):b}return pt(v)?u?br(v):St(v):v}}class Ru extends Fu{constructor(i=!1){super(!1,i)}set(i,s,l,u){let d=i[s];const h=De(i)&&Ir(s);if(!this._isShallow){const C=vi(d);if(!Cn(l)&&!vi(l)&&(d=ct(d),l=ct(l)),!h&&Ht(d)&&!Ht(l))return C||(d.value=l),!0}const v=h?Number(s)t,ca=t=>Reflect.getPrototypeOf(t);function Nd(t,i,s){return function(...l){const u=this.__v_raw,d=ct(u),h=$o(d),v=t==="entries"||t===Symbol.iterator&&h,b=t==="keys"&&h,C=u[t](...l),T=s?_r:i?Uo:Vn;return!i&&Ut(d,"iterate",b?vr:no),Nt(Object.create(C),{next(){const{value:A,done:R}=C.next();return R?{value:A,done:R}:{value:v?[T(A[0]),T(A[1])]:T(A),done:R}}})}}function da(t){return function(...i){return t==="delete"?!1:t==="clear"?void 0:this}}function Dd(t,i){const s={get(u){const d=this.__v_raw,h=ct(d),v=ct(u);t||(Yn(u,v)&&Ut(h,"get",u),Ut(h,"get",v));const{has:b}=ca(h),C=i?_r:t?Uo:Vn;if(b.call(h,u))return C(d.get(u));if(b.call(h,v))return C(d.get(v));d!==h&&d.get(u)},get size(){const u=this.__v_raw;return!t&&Ut(ct(u),"iterate",no),u.size},has(u){const d=this.__v_raw,h=ct(d),v=ct(u);return t||(Yn(u,v)&&Ut(h,"has",u),Ut(h,"has",v)),u===v?d.has(u):d.has(u)||d.has(v)},forEach(u,d){const h=this,v=h.__v_raw,b=ct(v),C=i?_r:t?Uo:Vn;return!t&&Ut(b,"iterate",no),v.forEach((T,A)=>u.call(d,C(T),C(A),h))}};return Nt(s,t?{add:da("add"),set:da("set"),delete:da("delete"),clear:da("clear")}:{add(u){const d=ct(this),h=ca(d),v=ct(u),b=!i&&!Cn(u)&&!vi(u)?v:u;return h.has.call(d,b)||Yn(u,b)&&h.has.call(d,u)||Yn(v,b)&&h.has.call(d,v)||(d.add(b),pi(d,"add",b,b)),this},set(u,d){!i&&!Cn(d)&&!vi(d)&&(d=ct(d));const h=ct(this),{has:v,get:b}=ca(h);let C=v.call(h,u);C||(u=ct(u),C=v.call(h,u));const T=b.call(h,u);return h.set(u,d),C?Yn(d,T)&&pi(h,"set",u,d):pi(h,"add",u,d),this},delete(u){const d=ct(this),{has:h,get:v}=ca(d);let b=h.call(d,u);b||(u=ct(u),b=h.call(d,u)),v&&v.call(d,u);const C=d.delete(u);return b&&pi(d,"delete",u,void 0),C},clear(){const u=ct(this),d=u.size!==0,h=u.clear();return d&&pi(u,"clear",void 0,void 0),h}}),["keys","values","entries",Symbol.iterator].forEach(u=>{s[u]=Nd(u,t,i)}),s}function Br(t,i){const s=Dd(t,i);return(l,u,d)=>u==="__v_isReactive"?!t:u==="__v_isReadonly"?t:u==="__v_raw"?l:Reflect.get(ht(s,u)&&u in l?s:l,u,d)}const Fd={get:Br(!1,!1)},Rd={get:Br(!1,!0)},Bd={get:Br(!0,!1)};const Bu=new WeakMap,Uu=new WeakMap,Vu=new WeakMap,Ud=new WeakMap;function Vd(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function St(t){return vi(t)?t:Ur(t,!1,zd,Fd,Bu)}function Zd(t){return Ur(t,!1,$d,Rd,Uu)}function br(t){return Ur(t,!0,Id,Bd,Vu)}function Ur(t,i,s,l,u){if(!pt(t)||t.__v_raw&&!(i&&t.__v_isReactive)||t.__v_skip||!Object.isExtensible(t))return t;const d=u.get(t);if(d)return d;const h=Vd(hd(t));if(h===0)return t;const v=new Proxy(t,h===2?l:s);return u.set(t,v),v}function io(t){return vi(t)?io(t.__v_raw):!!(t&&t.__v_isReactive)}function vi(t){return!!(t&&t.__v_isReadonly)}function Cn(t){return!!(t&&t.__v_isShallow)}function Vr(t){return t?!!t.__v_raw:!1}function ct(t){const i=t&&t.__v_raw;return i?ct(i):t}function Hd(t){return!ht(t,"__v_skip")&&Object.isExtensible(t)&&Tu(t,"__v_skip",!0),t}const Vn=t=>pt(t)?St(t):t,Uo=t=>pt(t)?br(t):t;function Ht(t){return t?t.__v_isRef===!0:!1}function j(t){return jd(t,!1)}function jd(t,i){return Ht(t)?t:new Wd(t,i)}class Wd{constructor(i,s){this.dep=new Rr,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?i:ct(i),this._value=s?i:Vn(i),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(i){const s=this._rawValue,l=this.__v_isShallow||Cn(i)||vi(i);i=l?i:ct(i),Yn(i,s)&&(this._rawValue=i,this._value=l?i:Vn(i),this.dep.trigger())}}function Oe(t){return Ht(t)?t.value:t}const Kd={get:(t,i,s)=>i==="__v_raw"?t:Oe(Reflect.get(t,i,s)),set:(t,i,s,l)=>{const u=t[i];return Ht(u)&&!Ht(s)?(u.value=s,!0):Reflect.set(t,i,s,l)}};function Zu(t){return io(t)?t:new Proxy(t,Kd)}class Gd{constructor(i,s,l){this.fn=i,this.setter=s,this._value=void 0,this.dep=new Rr(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ms-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 Eu(this,!0),!0}get value(){const i=this.dep.track();return Iu(this),i&&(i.version=this.dep.version),this._value}set value(i){this.setter&&this.setter(i)}}function qd(t,i,s=!1){let l,u;return Je(t)?l=t:(l=t.get,u=t.set),new Gd(l,u,s)}const fa={},_a=new WeakMap;let Qi;function Yd(t,i=!1,s=Qi){if(s){let l=_a.get(s);l||_a.set(s,l=[]),l.push(t)}}function Jd(t,i,s=_t){const{immediate:l,deep:u,once:d,scheduler:h,augmentJob:v,call:b}=s,C=fe=>u?fe:Cn(fe)||u===!1||u===0?mi(fe,1):mi(fe);let T,A,R,B,Z=!1,F=!1;if(Ht(t)?(A=()=>t.value,Z=Cn(t)):io(t)?(A=()=>C(t),Z=!0):De(t)?(F=!0,Z=t.some(fe=>io(fe)||Cn(fe)),A=()=>t.map(fe=>{if(Ht(fe))return fe.value;if(io(fe))return C(fe);if(Je(fe))return b?b(fe,2):fe()})):Je(t)?i?A=b?()=>b(t,2):t:A=()=>{if(R){Xn();try{R()}finally{Qn()}}const fe=Qi;Qi=T;try{return b?b(t,3,[B]):t(B)}finally{Qi=fe}}:A=Jn,i&&u){const fe=A,Be=u===!0?1/0:u;A=()=>mi(fe(),Be)}const he=Td(),pe=()=>{T.stop(),he&&he.active&&zr(he.effects,T)};if(d&&i){const fe=i;i=(...Be)=>{const $e=fe(...Be);return pe(),$e}}let q=F?new Array(t.length).fill(fa):fa;const Ce=fe=>{if(!(!(T.flags&1)||!T.dirty&&!fe))if(i){const Be=T.run();if(fe||u||Z||(F?Be.some(($e,Ie)=>Yn($e,q[Ie])):Yn(Be,q))){R&&R();const $e=Qi;Qi=T;try{const Ie=[Be,q===fa?void 0:F&&q[0]===fa?[]:q,B];q=Be,b?b(i,3,Ie):i(...Ie)}finally{Qi=$e}}}else T.run()};return v&&v(Ce),T=new Au(A),T.scheduler=h?()=>h(Ce,!1):Ce,B=fe=>Yd(fe,!1,T),R=T.onStop=()=>{const fe=_a.get(T);if(fe){if(b)b(fe,4);else for(const Be of fe)Be();_a.delete(T)}},i?l?Ce(!0):q=T.run():h?h(Ce.bind(null,!0),!0):T.run(),pe.pause=T.pause.bind(T),pe.resume=T.resume.bind(T),pe.stop=pe,pe}function mi(t,i=1/0,s){if(i<=0||!pt(t)||t.__v_skip||(s=s||new Map,(s.get(t)||0)>=i))return t;if(s.set(t,i),i--,Ht(t))mi(t.value,i,s);else if(De(t))for(let l=0;l{mi(l,i,s)});else if(ku(t)){for(const l in t)mi(t[l],i,s);for(const l of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,l)&&mi(t[l],i,s)}return t}/** -* @vue/runtime-core v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/function Rs(t,i,s,l){try{return l?t(...l):t()}catch(u){Na(u,i,s)}}function An(t,i,s,l){if(Je(t)){const u=Rs(t,i,s,l);return u&&xu(u)&&u.catch(d=>{Na(d,i,s)}),u}if(De(t)){const u=[];for(let d=0;d>>1,u=Xt[l],d=Os(u);d=Os(s)?Xt.push(t):Xt.splice(Qd(i),0,t),t.flags|=1,Wu()}}function Wu(){ba||(ba=Hu.then(Gu))}function ef(t){De(t)?No.push(...t):Ni&&t.id===-1?Ni.splice(zo+1,0,t):t.flags&1||(No.push(t),t.flags|=1),Wu()}function wl(t,i,s=Kn+1){for(;sOs(s)-Os(l));if(No.length=0,Ni){Ni.push(...i);return}for(Ni=i,zo=0;zot.id==null?t.flags&2?-1:1/0:t.id;function Gu(t){try{for(Kn=0;Kn{l._d&&ka(-1);const d=ya(i);let h;try{h=t(...u)}finally{ya(d),l._d&&ka(1)}return h};return l._n=!0,l._c=!0,l._d=!0,l}function ne(t,i){if(Zt===null)return t;const s=Ua(Zt),l=t.dirs||(t.dirs=[]);for(let u=0;u1)return s&&Je(i)?i.call(l&&l.proxy):i}}const tf=Symbol.for("v-scx"),nf=()=>Ps(tf);function $t(t,i,s){return Ju(t,i,s)}function Ju(t,i,s=_t){const{immediate:l,deep:u,flush:d,once:h}=s,v=Nt({},s),b=i&&l||!i&&d!=="post";let C;if(Ns){if(d==="sync"){const B=nf();C=B.__watcherHandles||(B.__watcherHandles=[])}else if(!b){const B=()=>{};return B.stop=Jn,B.resume=Jn,B.pause=Jn,B}}const T=Qt;v.call=(B,Z,F)=>An(B,T,Z,F);let A=!1;d==="post"?v.scheduler=B=>{Jt(B,T&&T.suspense)}:d!=="sync"&&(A=!0,v.scheduler=(B,Z)=>{Z?B():Zr(B)}),v.augmentJob=B=>{i&&(B.flags|=4),A&&(B.flags|=2,T&&(B.id=T.uid,B.i=T))};const R=Jd(t,i,v);return Ns&&(C?C.push(R):b&&R()),R}function of(t,i,s){const l=this.proxy,u=Tt(t)?t.includes(".")?Xu(l,t):()=>l[t]:t.bind(l,l);let d;Je(i)?d=i:(d=i.handler,s=i);const h=Bs(this),v=Ju(u,d.bind(l),s);return h(),v}function Xu(t,i){const s=i.split(".");return()=>{let l=t;for(let u=0;ut.__isTeleport,eo=t=>t&&(t.disabled||t.disabled===""),sf=t=>t&&(t.defer||t.defer===""),kl=t=>typeof SVGElement<"u"&&t instanceof SVGElement,Sl=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,yr=(t,i)=>{const s=t&&t.to;return Tt(s)?i?i(s):null:s},af={name:"Teleport",__isTeleport:!0,process(t,i,s,l,u,d,h,v,b,C){const{mc:T,pc:A,pbc:R,o:{insert:B,querySelector:Z,createText:F,createComment:he,parentNode:pe}}=C,q=eo(i.props);let{dynamicChildren:Ce}=i;const fe=(Ie,Ge,be)=>{Ie.shapeFlag&16&&T(Ie.children,Ge,be,u,d,h,v,b)},Be=(Ie=i)=>{const Ge=eo(Ie.props),be=Ie.target=yr(Ie.props,Z),we=xr(be,Ie,F,B);be&&(h!=="svg"&&kl(be)?h="svg":h!=="mathml"&&Sl(be)&&(h="mathml"),u&&u.isCE&&(u.ce._teleportTargets||(u.ce._teleportTargets=new Set)).add(be),Ge||(fe(Ie,be,we),bs(Ie,!1)))},$e=Ie=>{const Ge=()=>{if($i.get(Ie)===Ge){if($i.delete(Ie),eo(Ie.props)){const be=pe(Ie.el)||s;fe(Ie,be,Ie.anchor),bs(Ie,!0)}Be(Ie)}};$i.set(Ie,Ge),Jt(Ge,d)};if(t==null){const Ie=i.el=F(""),Ge=i.anchor=F("");if(B(Ie,s,l),B(Ge,s,l),sf(i.props)||d&&d.pendingBranch){$e(i);return}q&&(fe(i,s,Ge),bs(i,!0)),Be()}else{i.el=t.el;const Ie=i.anchor=t.anchor,Ge=$i.get(t);if(Ge){Ge.flags|=8,$i.delete(t),$e(i);return}i.targetStart=t.targetStart;const be=i.target=t.target,we=i.targetAnchor=t.targetAnchor,ze=eo(t.props),ie=ze?s:be,He=ze?Ie:we;if(h==="svg"||kl(be)?h="svg":(h==="mathml"||Sl(be))&&(h="mathml"),Ce?(R(t.dynamicChildren,Ce,ie,u,d,h,v),Wr(t,i,!0)):b||A(t,i,ie,He,u,d,h,v,!1),q)ze?i.props&&t.props&&i.props.to!==t.props.to&&(i.props.to=t.props.to):ha(i,s,Ie,C,1);else if((i.props&&i.props.to)!==(t.props&&t.props.to)){const oe=yr(i.props,Z);oe&&(i.target=oe,ha(i,oe,null,C,0))}else ze&&ha(i,be,we,C,1);bs(i,q)}},remove(t,i,s,{um:l,o:{remove:u}},d){const{shapeFlag:h,children:v,anchor:b,targetStart:C,targetAnchor:T,target:A,props:R}=t,B=eo(R),Z=d||!B,F=$i.get(t);if(F&&(F.flags|=8,$i.delete(t)),A&&(u(C),u(T)),d&&u(b),!F&&(B||A)&&h&16)for(let he=0;he{t.isMounted=!0}),Ho(()=>{t.isUnmounting=!0}),t}const Sn=[Function,Array],tc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Sn,onEnter:Sn,onAfterEnter:Sn,onEnterCancelled:Sn,onBeforeLeave:Sn,onLeave:Sn,onAfterLeave:Sn,onLeaveCancelled:Sn,onBeforeAppear:Sn,onAppear:Sn,onAfterAppear:Sn,onAppearCancelled:Sn},nc=t=>{const i=t.subTree;return i.component?nc(i.component):i},cf={name:"BaseTransition",props:tc,setup(t,{slots:i}){const s=Lc(),l=uf();return()=>{const u=i.default&&sc(i.default(),!0),d=u&&u.length?ic(u):s.subTree?N():void 0;if(!d)return;const h=ct(t),{mode:v}=h;if(l.isLeaving)return ar(d);const b=Tl(d);if(!b)return ar(d);let C=wr(b,h,l,s,A=>C=A);b.type!==Vt&&zs(b,C);let T=s.subTree&&Tl(s.subTree);if(T&&T.type!==Vt&&!to(T,b)&&nc(s).type!==Vt){let A=wr(T,h,l,s);if(zs(T,A),v==="out-in"&&b.type!==Vt)return l.isLeaving=!0,A.afterLeave=()=>{l.isLeaving=!1,s.job.flags&8||s.update(),delete A.afterLeave,T=void 0},ar(d);v==="in-out"&&b.type!==Vt?A.delayLeave=(R,B,Z)=>{const F=oc(l,T);F[String(T.key)]=T,R[Pn]=()=>{B(),R[Pn]=void 0,delete C.delayedLeave,T=void 0},C.delayedLeave=()=>{Z(),delete C.delayedLeave,T=void 0}}:T=void 0}else T&&(T=void 0);return d}}};function ic(t){let i=t[0];if(t.length>1){for(const s of t)if(s.type!==Vt){i=s;break}}return i}const df=cf;function oc(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 wr(t,i,s,l,u){const{appear:d,mode:h,persisted:v=!1,onBeforeEnter:b,onEnter:C,onAfterEnter:T,onEnterCancelled:A,onBeforeLeave:R,onLeave:B,onAfterLeave:Z,onLeaveCancelled:F,onBeforeAppear:he,onAppear:pe,onAfterAppear:q,onAppearCancelled:Ce}=i,fe=String(t.key),Be=oc(s,t),$e=(be,we)=>{be&&An(be,l,9,we)},Ie=(be,we)=>{const ze=we[1];$e(be,we),De(be)?be.every(ie=>ie.length<=1)&&ze():be.length<=1&&ze()},Ge={mode:h,persisted:v,beforeEnter(be){let we=b;if(!s.isMounted)if(d)we=he||b;else return;be[Pn]&&be[Pn](!0);const ze=Be[fe];ze&&to(t,ze)&&ze.el[Pn]&&ze.el[Pn](),$e(we,[be])},enter(be){if(Be[fe]===t)return;let we=C,ze=T,ie=A;if(!s.isMounted)if(d)we=pe||C,ze=q||T,ie=Ce||A;else return;let He=!1;be[gs]=je=>{He||(He=!0,je?$e(ie,[be]):$e(ze,[be]),Ge.delayedLeave&&Ge.delayedLeave(),be[gs]=void 0)};const oe=be[gs].bind(null,!1);we?Ie(we,[be,oe]):oe()},leave(be,we){const ze=String(t.key);if(be[gs]&&be[gs](!0),s.isUnmounting)return we();$e(R,[be]);let ie=!1;be[Pn]=oe=>{ie||(ie=!0,we(),oe?$e(F,[be]):$e(Z,[be]),be[Pn]=void 0,Be[ze]===t&&delete Be[ze])};const He=be[Pn].bind(null,!1);Be[ze]=t,B?Ie(B,[be,He]):He()},clone(be){const we=wr(be,i,s,l,u);return u&&u(we),we}};return Ge}function ar(t){if(Da(t))return t=Fi(t),t.children=null,t}function Tl(t){if(!Da(t))return ec(t.type)&&t.children?ic(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 zs(t,i){t.shapeFlag&6&&t.component?(t.transition=i,zs(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 sc(t,i=!1,s){let l=[],u=0;for(let d=0;d1)for(let d=0;dCs(F,i&&(De(i)?i[he]:i),s,l,u));return}if(Do(l)&&!u){l.shapeFlag&512&&l.type.__asyncResolved&&l.component.subTree.component&&Cs(t,i,s,l.component.subTree);return}const d=l.shapeFlag&4?Ua(l.component):l.el,h=u?null:d,{i:v,r:b}=t,C=i&&i.r,T=v.refs===_t?v.refs={}:v.refs,A=v.setupState,R=ct(A),B=A===_t?yu:F=>Pl(T,F)?!1:ht(R,F),Z=(F,he)=>!(he&&Pl(T,he));if(C!=null&&C!==b){if(Cl(i),Tt(C))T[C]=null,B(C)&&(A[C]=null);else if(Ht(C)){const F=i;Z(C,F.k)&&(C.value=null),F.k&&(T[F.k]=null)}}if(Je(b)){Xn();try{Rs(b,v,12,[h,T])}finally{Qn()}}else{const F=Tt(b),he=Ht(b);if(F||he){const pe=()=>{if(t.f){const q=F?B(b)?A[b]:T[b]:Z()||!t.k?b.value:T[t.k];if(u)De(q)&&zr(q,d);else if(De(q))q.includes(d)||q.push(d);else if(F)T[b]=[d],B(b)&&(A[b]=T[b]);else{const Ce=[d];Z(b,t.k)&&(b.value=Ce),t.k&&(T[t.k]=Ce)}}else F?(T[b]=h,B(b)&&(A[b]=h)):he&&(Z(b,t.k)&&(b.value=h),t.k&&(T[t.k]=h))};if(h){const q=()=>{pe(),xa.delete(t)};q.id=-1,xa.set(t,q),Jt(q,s)}else Cl(t),pe()}}}function Cl(t){const i=xa.get(t);i&&(i.flags|=8,xa.delete(t))}Ia().requestIdleCallback;Ia().cancelIdleCallback;const Do=t=>!!t.type.__asyncLoader,Da=t=>t.type.__isKeepAlive;function ff(t,i){rc(t,"a",i)}function hf(t,i){rc(t,"da",i)}function rc(t,i,s=Qt){const l=t.__wdc||(t.__wdc=()=>{let u=s;for(;u;){if(u.isDeactivated)return;u=u.parent}return t()});if(Fa(i,l,s),s){let u=s.parent;for(;u&&u.parent;)Da(u.parent.vnode)&&pf(l,i,s,u),u=u.parent}}function pf(t,i,s,l){const u=Fa(i,t,l,!0);lc(()=>{zr(l[i],u)},s)}function Fa(t,i,s=Qt,l=!1){if(s){const u=s[t]||(s[t]=[]),d=i.__weh||(i.__weh=(...h)=>{Xn();const v=Bs(s),b=An(i,s,t,h);return v(),Qn(),b});return l?u.unshift(d):u.push(d),d}}const bi=t=>(i,s=Qt)=>{(!Ns||t==="sp")&&Fa(t,(...l)=>i(...l),s)},mf=bi("bm"),_i=bi("m"),gf=bi("bu"),vf=bi("u"),Ho=bi("bum"),lc=bi("um"),_f=bi("sp"),bf=bi("rtg"),yf=bi("rtc");function xf(t,i=Qt){Fa("ec",t,i)}const wf=Symbol.for("v-ndc");function Fe(t,i,s,l){let u;const d=s,h=De(t);if(h||Tt(t)){const v=h&&io(t);let b=!1,C=!1;v&&(b=!Cn(t),C=vi(t),t=$a(t)),u=new Array(t.length);for(let T=0,A=t.length;Ti(v,b,void 0,d));else{const v=Object.keys(t);u=new Array(v.length);for(let b=0,C=v.length;b0;return p(),at(ue,null,[E("slot",s,l)],C?-2:64)}let d=t[i];d&&d._c&&(d._d=!1),p();const h=d&&uc(d(s)),v=s.key||h&&h.key,b=at(ue,{key:(v&&!Un(v)?v:`_${i}`)+(!h&&l?"_fb":"")},h||[],h&&t._===1?64:-2);return b.scopeId&&(b.slotScopeIds=[b.scopeId+"-s"]),d&&d._c&&(d._d=!0),b}function uc(t){return t.some(i=>$s(i)?!(i.type===Vt||i.type===ue&&!uc(i.children)):!0)?t:null}const kr=t=>t?Ac(t)?Ua(t):kr(t.parent):null,Ls=Nt(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=>kr(t.parent),$root:t=>kr(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>dc(t),$forceUpdate:t=>t.f||(t.f=()=>{Zr(t.update)}),$nextTick:t=>t.n||(t.n=ju.bind(t.proxy)),$watch:t=>of.bind(t)}),rr=(t,i)=>t!==_t&&!t.__isScriptSetup&&ht(t,i),Sf={get({_:t},i){if(i==="__v_skip")return!0;const{ctx:s,setupState:l,data:u,props:d,accessCache:h,type:v,appContext:b}=t;if(i[0]!=="$"){const R=h[i];if(R!==void 0)switch(R){case 1:return l[i];case 2:return u[i];case 4:return s[i];case 3:return d[i]}else{if(rr(l,i))return h[i]=1,l[i];if(u!==_t&&ht(u,i))return h[i]=2,u[i];if(ht(d,i))return h[i]=3,d[i];if(s!==_t&&ht(s,i))return h[i]=4,s[i];Sr&&(h[i]=0)}}const C=Ls[i];let T,A;if(C)return i==="$attrs"&&Ut(t.attrs,"get",""),C(t);if((T=v.__cssModules)&&(T=T[i]))return T;if(s!==_t&&ht(s,i))return h[i]=4,s[i];if(A=b.config.globalProperties,ht(A,i))return A[i]},set({_:t},i,s){const{data:l,setupState:u,ctx:d}=t;return rr(u,i)?(u[i]=s,!0):l!==_t&&ht(l,i)?(l[i]=s,!0):ht(t.props,i)||i[0]==="$"&&i.slice(1)in t?!1:(d[i]=s,!0)},has({_:{data:t,setupState:i,accessCache:s,ctx:l,appContext:u,props:d,type:h}},v){let b;return!!(s[v]||t!==_t&&v[0]!=="$"&&ht(t,v)||rr(i,v)||ht(d,v)||ht(l,v)||ht(Ls,v)||ht(u.config.globalProperties,v)||(b=h.__cssModules)&&b[v])},defineProperty(t,i,s){return s.get!=null?t._.accessCache[i]=0:ht(s,"value")&&this.set(t,i,s.value,null),Reflect.defineProperty(t,i,s)}};function Ll(t){return De(t)?t.reduce((i,s)=>(i[s]=null,i),{}):t}let Sr=!0;function Tf(t){const i=dc(t),s=t.proxy,l=t.ctx;Sr=!1,i.beforeCreate&&Al(i.beforeCreate,t,"bc");const{data:u,computed:d,methods:h,watch:v,provide:b,inject:C,created:T,beforeMount:A,mounted:R,beforeUpdate:B,updated:Z,activated:F,deactivated:he,beforeDestroy:pe,beforeUnmount:q,destroyed:Ce,unmounted:fe,render:Be,renderTracked:$e,renderTriggered:Ie,errorCaptured:Ge,serverPrefetch:be,expose:we,inheritAttrs:ze,components:ie,directives:He,filters:oe}=i;if(C&&Pf(C,l,null),h)for(const ce in h){const ae=h[ce];Je(ae)&&(l[ce]=ae.bind(s))}if(u){const ce=u.call(s,s);pt(ce)&&(t.data=St(ce))}if(Sr=!0,d)for(const ce in d){const ae=d[ce],tt=Je(ae)?ae.bind(s,s):Je(ae.get)?ae.get.bind(s,s):Jn,ee=!Je(ae)&&Je(ae.set)?ae.set.bind(s):Jn,xe=ye({get:tt,set:ee});Object.defineProperty(l,ce,{enumerable:!0,configurable:!0,get:()=>xe.value,set:Ne=>xe.value=Ne})}if(v)for(const ce in v)cc(v[ce],l,s,ce);if(b){const ce=Je(b)?b.call(s):b;Reflect.ownKeys(ce).forEach(ae=>{Yu(ae,ce[ae])})}T&&Al(T,t,"c");function le(ce,ae){De(ae)?ae.forEach(tt=>ce(tt.bind(s))):ae&&ce(ae.bind(s))}if(le(mf,A),le(_i,R),le(gf,B),le(vf,Z),le(ff,F),le(hf,he),le(xf,Ge),le(yf,$e),le(bf,Ie),le(Ho,q),le(lc,fe),le(_f,be),De(we))if(we.length){const ce=t.exposed||(t.exposed={});we.forEach(ae=>{Object.defineProperty(ce,ae,{get:()=>s[ae],set:tt=>s[ae]=tt,enumerable:!0})})}else t.exposed||(t.exposed={});Be&&t.render===Jn&&(t.render=Be),ze!=null&&(t.inheritAttrs=ze),ie&&(t.components=ie),He&&(t.directives=He),be&&ac(t)}function Pf(t,i,s=Jn){De(t)&&(t=Tr(t));for(const l in t){const u=t[l];let d;pt(u)?"default"in u?d=Ps(u.from||l,u.default,!0):d=Ps(u.from||l):d=Ps(u),Ht(d)?Object.defineProperty(i,l,{enumerable:!0,configurable:!0,get:()=>d.value,set:h=>d.value=h}):i[l]=d}}function Al(t,i,s){An(De(t)?t.map(l=>l.bind(i.proxy)):t.bind(i.proxy),i,s)}function cc(t,i,s,l){let u=l.includes(".")?Xu(s,l):()=>s[l];if(Tt(t)){const d=i[t];Je(d)&&$t(u,d)}else if(Je(t))$t(u,t.bind(s));else if(pt(t))if(De(t))t.forEach(d=>cc(d,i,s,l));else{const d=Je(t.handler)?t.handler.bind(s):i[t.handler];Je(d)&&$t(u,d,t)}}function dc(t){const i=t.type,{mixins:s,extends:l}=i,{mixins:u,optionsCache:d,config:{optionMergeStrategies:h}}=t.appContext,v=d.get(i);let b;return v?b=v:!u.length&&!s&&!l?b=i:(b={},u.length&&u.forEach(C=>wa(b,C,h,!0)),wa(b,i,h)),pt(i)&&d.set(i,b),b}function wa(t,i,s,l=!1){const{mixins:u,extends:d}=i;d&&wa(t,d,s,!0),u&&u.forEach(h=>wa(t,h,s,!0));for(const h in i)if(!(l&&h==="expose")){const v=Cf[h]||s&&s[h];t[h]=v?v(t[h],i[h]):i[h]}return t}const Cf={data:Ml,props:El,emits:El,methods:ys,computed:ys,beforeCreate:Yt,created:Yt,beforeMount:Yt,mounted:Yt,beforeUpdate:Yt,updated:Yt,beforeDestroy:Yt,beforeUnmount:Yt,destroyed:Yt,unmounted:Yt,activated:Yt,deactivated:Yt,errorCaptured:Yt,serverPrefetch:Yt,components:ys,directives:ys,watch:Af,provide:Ml,inject:Lf};function Ml(t,i){return i?t?function(){return Nt(Je(t)?t.call(this,this):t,Je(i)?i.call(this,this):i)}:i:t}function Lf(t,i){return ys(Tr(t),Tr(i))}function Tr(t){if(De(t)){const i={};for(let s=0;si==="modelValue"||i==="model-value"?t.modelModifiers:t[`${i}Modifiers`]||t[`${Rn(i)}Modifiers`]||t[`${Bi(i)}Modifiers`];function zf(t,i,...s){if(t.isUnmounted)return;const l=t.vnode.props||_t;let u=s;const d=i.startsWith("update:"),h=d&&Of(l,i.slice(7));h&&(h.trim&&(u=s.map(T=>Tt(T)?T.trim():T)),h.number&&(u=s.map(za)));let v,b=l[v=tr(i)]||l[v=tr(Rn(i))];!b&&d&&(b=l[v=tr(Bi(i))]),b&&An(b,t,6,u);const C=l[v+"Once"];if(C){if(!t.emitted)t.emitted={};else if(t.emitted[v])return;t.emitted[v]=!0,An(C,t,6,u)}}const If=new WeakMap;function hc(t,i,s=!1){const l=s?If:i.emitsCache,u=l.get(t);if(u!==void 0)return u;const d=t.emits;let h={},v=!1;if(!Je(t)){const b=C=>{const T=hc(C,i,!0);T&&(v=!0,Nt(h,T))};!s&&i.mixins.length&&i.mixins.forEach(b),t.extends&&b(t.extends),t.mixins&&t.mixins.forEach(b)}return!d&&!v?(pt(t)&&l.set(t,null),null):(De(d)?d.forEach(b=>h[b]=null):Nt(h,d),pt(t)&&l.set(t,h),h)}function Ra(t,i){return!t||!Ma(i)?!1:(i=i.slice(2),i=i==="Once"?i:i.replace(/Once$/,""),ht(t,i[0].toLowerCase()+i.slice(1))||ht(t,Bi(i))||ht(t,i))}function Ol(t){const{type:i,vnode:s,proxy:l,withProxy:u,propsOptions:[d],slots:h,attrs:v,emit:b,render:C,renderCache:T,props:A,data:R,setupState:B,ctx:Z,inheritAttrs:F}=t,he=ya(t);let pe,q;try{if(s.shapeFlag&4){const fe=u||l,Be=fe;pe=qn(C.call(Be,fe,T,A,B,R,Z)),q=v}else{const fe=i;pe=qn(fe.length>1?fe(A,{attrs:v,slots:h,emit:b}):fe(A,null)),q=i.props?v:$f(v)}}catch(fe){As.length=0,Na(fe,t,1),pe=E(Vt)}let Ce=pe;if(q&&F!==!1){const fe=Object.keys(q),{shapeFlag:Be}=Ce;fe.length&&Be&7&&(d&&fe.some(Ea)&&(q=Nf(q,d)),Ce=Fi(Ce,q,!1,!0))}return s.dirs&&(Ce=Fi(Ce,null,!1,!0),Ce.dirs=Ce.dirs?Ce.dirs.concat(s.dirs):s.dirs),s.transition&&zs(Ce,s.transition),pe=Ce,ya(he),pe}const $f=t=>{let i;for(const s in t)(s==="class"||s==="style"||Ma(s))&&((i||(i={}))[s]=t[s]);return i},Nf=(t,i)=>{const s={};for(const l in t)(!Ea(l)||!(l.slice(9)in i))&&(s[l]=t[l]);return s};function Df(t,i,s){const{props:l,children:u,component:d}=t,{props:h,children:v,patchFlag:b}=i,C=d.emitsOptions;if(i.dirs||i.transition)return!0;if(s&&b>=0){if(b&1024)return!0;if(b&16)return l?zl(l,h,C):!!h;if(b&8){const T=i.dynamicProps;for(let A=0;AObject.create(mc),vc=t=>Object.getPrototypeOf(t)===mc;function Rf(t,i,s,l=!1){const u={},d=gc();t.propsDefaults=Object.create(null),_c(t,i,u,d);for(const h in t.propsOptions[0])h in u||(u[h]=void 0);s?t.props=l?u:Zd(u):t.type.props?t.props=u:t.props=d,t.attrs=d}function Bf(t,i,s,l){const{props:u,attrs:d,vnode:{patchFlag:h}}=t,v=ct(u),[b]=t.propsOptions;let C=!1;if((l||h>0)&&!(h&16)){if(h&8){const T=t.vnode.dynamicProps;for(let A=0;A{b=!0;const[R,B]=bc(A,i,!0);Nt(h,R),B&&v.push(...B)};!s&&i.mixins.length&&i.mixins.forEach(T),t.extends&&T(t.extends),t.mixins&&t.mixins.forEach(T)}if(!d&&!b)return pt(t)&&l.set(t,Io),Io;if(De(d))for(let T=0;Tt==="_"||t==="_ctx"||t==="$stable",jr=t=>De(t)?t.map(qn):[qn(t)],Vf=(t,i,s)=>{if(i._n)return i;const l=Le((...u)=>jr(i(...u)),s);return l._c=!1,l},yc=(t,i,s)=>{const l=t._ctx;for(const u in t){if(Hr(u))continue;const d=t[u];if(Je(d))i[u]=Vf(u,d,l);else if(d!=null){const h=jr(d);i[u]=()=>h}}},xc=(t,i)=>{const s=jr(i);t.slots.default=()=>s},wc=(t,i,s)=>{for(const l in i)(s||!Hr(l))&&(t[l]=i[l])},Zf=(t,i,s)=>{const l=t.slots=gc();if(t.vnode.shapeFlag&32){const u=i._;u?(wc(l,i,s),s&&Tu(l,"_",u,!0)):yc(i,l)}else i&&xc(t,i)},Hf=(t,i,s)=>{const{vnode:l,slots:u}=t;let d=!0,h=_t;if(l.shapeFlag&32){const v=i._;v?s&&v===1?d=!1:wc(u,i,s):(d=!i.$stable,yc(i,u)),h=i}else i&&(xc(t,i),h={default:1});if(d)for(const v in u)!Hr(v)&&h[v]==null&&delete u[v]},Jt=qf;function jf(t){return Wf(t)}function Wf(t,i){const s=Ia();s.__VUE__=!0;const{insert:l,remove:u,patchProp:d,createElement:h,createText:v,createComment:b,setText:C,setElementText:T,parentNode:A,nextSibling:R,setScopeId:B=Jn,insertStaticContent:Z}=t,F=(x,_,w,K=null,W=null,V=null,re=void 0,te=null,Q=!!_.dynamicChildren)=>{if(x===_)return;x&&!to(x,_)&&(K=M(x),Ne(x,W,V,!0),x=null),_.patchFlag===-2&&(Q=!1,_.dynamicChildren=null);const{type:G,ref:me,shapeFlag:se}=_;switch(G){case Ba:he(x,_,w,K);break;case Vt:pe(x,_,w,K);break;case ur:x==null&&q(_,w,K,re);break;case ue:ie(x,_,w,K,W,V,re,te,Q);break;default:se&1?Be(x,_,w,K,W,V,re,te,Q):se&6?He(x,_,w,K,W,V,re,te,Q):(se&64||se&128)&&G.process(x,_,w,K,W,V,re,te,Q,rt)}me!=null&&W?Cs(me,x&&x.ref,V,_||x,!_):me==null&&x&&x.ref!=null&&Cs(x.ref,null,V,x,!0)},he=(x,_,w,K)=>{if(x==null)l(_.el=v(_.children),w,K);else{const W=_.el=x.el;_.children!==x.children&&C(W,_.children)}},pe=(x,_,w,K)=>{x==null?l(_.el=b(_.children||""),w,K):_.el=x.el},q=(x,_,w,K)=>{[x.el,x.anchor]=Z(x.children,_,w,K,x.el,x.anchor)},Ce=({el:x,anchor:_},w,K)=>{let W;for(;x&&x!==_;)W=R(x),l(x,w,K),x=W;l(_,w,K)},fe=({el:x,anchor:_})=>{let w;for(;x&&x!==_;)w=R(x),u(x),x=w;u(_)},Be=(x,_,w,K,W,V,re,te,Q)=>{if(_.type==="svg"?re="svg":_.type==="math"&&(re="mathml"),x==null)$e(_,w,K,W,V,re,te,Q);else{const G=x.el&&x.el._isVueCE?x.el:null;try{G&&G._beginPatch(),be(x,_,W,V,re,te,Q)}finally{G&&G._endPatch()}}},$e=(x,_,w,K,W,V,re,te)=>{let Q,G;const{props:me,shapeFlag:se,transition:Te,dirs:Ae}=x;if(Q=x.el=h(x.type,V,me&&me.is,me),se&8?T(Q,x.children):se&16&&Ge(x.children,Q,null,K,W,lr(x,V),re,te),Ae&&qi(x,null,K,"created"),Ie(Q,x,x.scopeId,re,K),me){for(const et in me)et!=="value"&&!ks(et)&&d(Q,et,null,me[et],V,K);"value"in me&&d(Q,"value",null,me.value,V),(G=me.onVnodeBeforeMount)&&Wn(G,K,x)}Ae&&qi(x,null,K,"beforeMount");const Ze=Kf(W,Te);Ze&&Te.beforeEnter(Q),l(Q,_,w),((G=me&&me.onVnodeMounted)||Ze||Ae)&&Jt(()=>{try{G&&Wn(G,K,x),Ze&&Te.enter(Q),Ae&&qi(x,null,K,"mounted")}finally{}},W)},Ie=(x,_,w,K,W)=>{if(w&&B(x,w),K)for(let V=0;V{for(let G=Q;G{const te=_.el=x.el;let{patchFlag:Q,dynamicChildren:G,dirs:me}=_;Q|=x.patchFlag&16;const se=x.props||_t,Te=_.props||_t;let Ae;if(w&&Yi(w,!1),(Ae=Te.onVnodeBeforeUpdate)&&Wn(Ae,w,_,x),me&&qi(_,x,w,"beforeUpdate"),w&&Yi(w,!0),G&&(!x.dynamicChildren||x.dynamicChildren.length!==G.length)&&(Q=0,re=!1,G=null),(se.innerHTML&&Te.innerHTML==null||se.textContent&&Te.textContent==null)&&T(te,""),G?we(x.dynamicChildren,G,te,w,K,lr(_,W),V):re||ae(x,_,te,null,w,K,lr(_,W),V,!1),Q>0){if(Q&16)ze(te,se,Te,w,W);else if(Q&2&&se.class!==Te.class&&d(te,"class",null,Te.class,W),Q&4&&d(te,"style",se.style,Te.style,W),Q&8){const Ze=_.dynamicProps;for(let et=0;et{Ae&&Wn(Ae,w,_,x),me&&qi(_,x,w,"updated")},K)},we=(x,_,w,K,W,V,re)=>{for(let te=0;te<_.length;te++){const Q=x[te],G=_[te],me=Q.el&&(Q.type===ue||!to(Q,G)||Q.shapeFlag&198)?A(Q.el):w;F(Q,G,me,null,K,W,V,re,!0)}},ze=(x,_,w,K,W)=>{if(_!==w){if(_!==_t)for(const V in _)!ks(V)&&!(V in w)&&d(x,V,_[V],null,W,K);for(const V in w){if(ks(V))continue;const re=w[V],te=_[V];re!==te&&V!=="value"&&d(x,V,te,re,W,K)}"value"in w&&d(x,"value",_.value,w.value,W)}},ie=(x,_,w,K,W,V,re,te,Q)=>{const G=_.el=x?x.el:v(""),me=_.anchor=x?x.anchor:v("");let{patchFlag:se,dynamicChildren:Te,slotScopeIds:Ae}=_;Ae&&(te=te?te.concat(Ae):Ae),x==null?(l(G,w,K),l(me,w,K),Ge(_.children||[],w,me,W,V,re,te,Q)):se>0&&se&64&&Te&&x.dynamicChildren&&x.dynamicChildren.length===Te.length?(we(x.dynamicChildren,Te,w,W,V,re,te),(_.key!=null||W&&_===W.subTree)&&Wr(x,_,!0)):ae(x,_,w,me,W,V,re,te,Q)},He=(x,_,w,K,W,V,re,te,Q)=>{_.slotScopeIds=te,x==null?_.shapeFlag&512?W.ctx.activate(_,w,K,re,Q):oe(_,w,K,W,V,re,Q):je(x,_,Q)},oe=(x,_,w,K,W,V,re)=>{const te=x.component=nh(x,K,W);if(Da(x)&&(te.ctx.renderer=rt),ih(te,!1,re),te.asyncDep){if(W&&W.registerDep(te,le,re),!x.el){const Q=te.subTree=E(Vt);pe(null,Q,_,w),x.placeholder=Q.el}}else le(te,x,_,w,W,V,re)},je=(x,_,w)=>{const K=_.component=x.component;if(Df(x,_,w))if(K.asyncDep&&!K.asyncResolved){ce(K,_,w);return}else K.next=_,K.update();else _.el=x.el,K.vnode=_},le=(x,_,w,K,W,V,re)=>{const te=()=>{if(x.isMounted){let{next:se,bu:Te,u:Ae,parent:Ze,vnode:et}=x;{const gt=kc(x);if(gt){se&&(se.el=et.el,ce(x,se,re)),gt.asyncDep.then(()=>{Jt(()=>{x.isUnmounted||G()},W)});return}}let U=se,O;Yi(x,!1),se?(se.el=et.el,ce(x,se,re)):se=et,Te&&ga(Te),(O=se.props&&se.props.onVnodeBeforeUpdate)&&Wn(O,Ze,se,et),Yi(x,!0);const ke=Ol(x),Ye=x.subTree;x.subTree=ke,F(Ye,ke,A(Ye.el),M(Ye),x,W,V),se.el=ke.el,U===null&&Ff(x,ke.el),Ae&&Jt(Ae,W),(O=se.props&&se.props.onVnodeUpdated)&&Jt(()=>Wn(O,Ze,se,et),W)}else{let se;const{el:Te,props:Ae}=_,{bm:Ze,m:et,parent:U,root:O,type:ke}=x,Ye=Do(_);Yi(x,!1),Ze&&ga(Ze),!Ye&&(se=Ae&&Ae.onVnodeBeforeMount)&&Wn(se,U,_),Yi(x,!0);{O.ce&&O.ce._hasShadowRoot()&&O.ce._injectChildStyle(ke,x.parent?x.parent.type:void 0);const gt=x.subTree=Ol(x);F(null,gt,w,K,x,W,V),_.el=gt.el}if(et&&Jt(et,W),!Ye&&(se=Ae&&Ae.onVnodeMounted)){const gt=_;Jt(()=>Wn(se,U,gt),W)}(_.shapeFlag&256||U&&Do(U.vnode)&&U.vnode.shapeFlag&256)&&x.a&&Jt(x.a,W),x.isMounted=!0,_=w=K=null}};x.scope.on();const Q=x.effect=new Au(te);x.scope.off();const G=x.update=Q.run.bind(Q),me=x.job=Q.runIfDirty.bind(Q);me.i=x,me.id=x.uid,Q.scheduler=()=>Zr(me),Yi(x,!0),G()},ce=(x,_,w)=>{_.component=x;const K=x.vnode.props;x.vnode=_,x.next=null,Bf(x,_.props,K,w),Hf(x,_.children,w),Xn(),wl(x),Qn()},ae=(x,_,w,K,W,V,re,te,Q=!1)=>{const G=x&&x.children,me=x?x.shapeFlag:0,se=_.children,{patchFlag:Te,shapeFlag:Ae}=_;if(Te>0){if(Te&128){ee(G,se,w,K,W,V,re,te,Q);return}else if(Te&256){tt(G,se,w,K,W,V,re,te,Q);return}}Ae&8?(me&16&&Y(G,W,V),se!==G&&T(w,se)):me&16?Ae&16?ee(G,se,w,K,W,V,re,te,Q):Y(G,W,V,!0):(me&8&&T(w,""),Ae&16&&Ge(se,w,K,W,V,re,te,Q))},tt=(x,_,w,K,W,V,re,te,Q)=>{x=x||Io,_=_||Io;const G=x.length,me=_.length,se=Math.min(G,me);let Te;for(Te=0;Teme?Y(x,W,V,!0,!1,se):Ge(_,w,K,W,V,re,te,Q,se)},ee=(x,_,w,K,W,V,re,te,Q)=>{let G=0;const me=_.length;let se=x.length-1,Te=me-1;for(;G<=se&&G<=Te;){const Ae=x[G],Ze=_[G]=Q?hi(_[G]):qn(_[G]);if(to(Ae,Ze))F(Ae,Ze,w,null,W,V,re,te,Q);else break;G++}for(;G<=se&&G<=Te;){const Ae=x[se],Ze=_[Te]=Q?hi(_[Te]):qn(_[Te]);if(to(Ae,Ze))F(Ae,Ze,w,null,W,V,re,te,Q);else break;se--,Te--}if(G>se){if(G<=Te){const Ae=Te+1,Ze=AeTe)for(;G<=se;)Ne(x[G],W,V,!0),G++;else{const Ae=G,Ze=G,et=new Map;for(G=Ze;G<=Te;G++){const de=_[G]=Q?hi(_[G]):qn(_[G]);de.key!=null&&et.set(de.key,G)}let U,O=0;const ke=Te-Ze+1;let Ye=!1,gt=0;const bt=new Array(ke);for(G=0;G=ke){Ne(de,W,V,!0);continue}let wt;if(de.key!=null)wt=et.get(de.key);else for(U=Ze;U<=Te;U++)if(bt[U-Ze]===0&&to(de,_[U])){wt=U;break}wt===void 0?Ne(de,W,V,!0):(bt[wt-Ze]=G+1,wt>=gt?gt=wt:Ye=!0,F(de,_[wt],w,null,W,V,re,te,Q),O++)}const en=Ye?Gf(bt):Io;for(U=en.length-1,G=ke-1;G>=0;G--){const de=Ze+G,wt=_[de],an=_[de+1],so=de+1{const{el:V,type:re,transition:te,children:Q,shapeFlag:G}=x;if(G&6){xe(x.component.subTree,_,w,K);return}if(G&128){x.suspense.move(_,w,K);return}if(G&64){re.move(x,_,w,rt);return}if(re===ue){l(V,_,w);for(let se=0;sete.enter(V),W));else{const{leave:se,delayLeave:Te,afterLeave:Ae}=te,Ze=()=>{x.ctx.isUnmounted?u(V):l(V,_,w)},et=()=>{const U=V._isLeaving||!!V[Pn];V._isLeaving&&V[Pn](!0),te.persisted&&!U?Ze():se(V,()=>{Ze(),Ae&&Ae()})};Te?Te(V,Ze,et):et()}else l(V,_,w)},Ne=(x,_,w,K=!1,W=!1)=>{const{type:V,props:re,ref:te,children:Q,dynamicChildren:G,shapeFlag:me,patchFlag:se,dirs:Te,cacheIndex:Ae,memo:Ze}=x;if(se===-2&&(W=!1),te!=null&&(Xn(),Cs(te,null,w,x,!0),Qn()),Ae!=null&&(_.renderCache[Ae]=void 0),me&256){_.ctx.deactivate(x);return}const et=me&1&&Te,U=!Do(x);let O;if(U&&(O=re&&re.onVnodeBeforeUnmount)&&Wn(O,_,x),me&6)Ve(x.component,w,K);else{if(me&128){x.suspense.unmount(w,K);return}et&&qi(x,null,_,"beforeUnmount"),me&64?x.type.remove(x,_,w,rt,K):G&&!G.hasOnce&&(V!==ue||se>0&&se&64)?Y(G,_,w,!1,!0):(V===ue&&se&384||!W&&me&16)&&Y(Q,_,w),K&&dt(x)}const ke=Ze!=null&&Ae==null;(U&&(O=re&&re.onVnodeUnmounted)||et||ke)&&Jt(()=>{O&&Wn(O,_,x),et&&qi(x,null,_,"unmounted"),ke&&(x.el=null)},w)},dt=x=>{const{type:_,el:w,anchor:K,transition:W}=x;if(_===ue){st(w,K);return}if(_===ur){fe(x);return}const V=()=>{u(w),W&&!W.persisted&&W.afterLeave&&W.afterLeave()};if(x.shapeFlag&1&&W&&!W.persisted){const{leave:re,delayLeave:te}=W,Q=()=>re(w,V);te?te(x.el,V,Q):Q()}else V()},st=(x,_)=>{let w;for(;x!==_;)w=R(x),u(x),x=w;u(_)},Ve=(x,_,w)=>{const{bum:K,scope:W,job:V,subTree:re,um:te,m:Q,a:G}=x;$l(Q),$l(G),K&&ga(K),W.stop(),V&&(V.flags|=8,Ne(re,x,_,w)),te&&Jt(te,_),Jt(()=>{x.isUnmounted=!0},_)},Y=(x,_,w,K=!1,W=!1,V=0)=>{for(let re=V;re{if(x.shapeFlag&6)return M(x.component.subTree);if(x.shapeFlag&128)return x.suspense.next();const _=R(x.anchor||x.el),w=_&&_[Qu];return w?R(w):_};let z=!1;const vt=(x,_,w)=>{let K;x==null?_._vnode&&(Ne(_._vnode,null,null,!0),K=_._vnode.component):F(_._vnode||null,x,_,null,null,null,w),_._vnode=x,z||(z=!0,wl(K),Ku(),z=!1)},rt={p:F,um:Ne,m:xe,r:dt,mt:oe,mc:Ge,pc:ae,pbc:we,n:M,o:t};return{render:vt,hydrate:void 0,createApp:Ef(vt)}}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 Yi({effect:t,job:i},s){s?(t.flags|=32,i.flags|=4):(t.flags&=-33,i.flags&=-5)}function Kf(t,i){return(!t||t&&!t.pendingBranch)&&i&&!i.persisted}function Wr(t,i,s=!1){const l=t.children,u=i.children;if(De(l)&&De(u))for(let d=0;d>1,t[s[v]]0&&(i[l]=s[d-1]),s[d]=l)}}for(d=s.length,h=s[d-1];d-- >0;)s[d]=h,h=i[h];return s}function kc(t){const i=t.subTree.component;if(i)return i.asyncDep&&!i.asyncResolved?i:kc(i)}function $l(t){if(t)for(let i=0;it.__isSuspense;function qf(t,i){i&&i.pendingBranch?De(t)?i.effects.push(...t):i.effects.push(t):ef(t)}const ue=Symbol.for("v-fgt"),Ba=Symbol.for("v-txt"),Vt=Symbol.for("v-cmt"),ur=Symbol.for("v-stc"),As=[];let mn=null;function p(t=!1){As.push(mn=t?null:[])}function Yf(){As.pop(),mn=As[As.length-1]||null}let Is=1;function ka(t,i=!1){Is+=t,t<0&&mn&&i&&(mn.hasOnce=!0)}function Pc(t){return t.dynamicChildren=Is>0?mn||Io:null,Yf(),Is>0&&mn&&mn.push(t),t}function g(t,i,s,l,u,d){return Pc(r(t,i,s,l,u,d,!0))}function at(t,i,s,l,u){return Pc(E(t,i,s,l,u,!0))}function $s(t){return t?t.__v_isVNode===!0:!1}function to(t,i){return t.type===i.type&&t.key===i.key}const Cc=({key:t})=>t??null,va=({ref:t,ref_key:i,ref_for:s})=>(typeof t=="number"&&(t=""+t),t!=null?Tt(t)||Ht(t)||Je(t)?{i:Zt,r:t,k:i,f:!!s}:t:null);function r(t,i=null,s=null,l=0,u=null,d=t===ue?0:1,h=!1,v=!1){const b={__v_isVNode:!0,__v_skip:!0,type:t,props:i,key:i&&Cc(i),ref:i&&va(i),scopeId:qu,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:d,patchFlag:l,dynamicProps:u,dynamicChildren:null,appContext:null,ctx:Zt};return v?(Sa(b,s),d&128&&t.normalize(b)):s&&(b.shapeFlag|=Tt(s)?8:16),Is>0&&!h&&mn&&(b.patchFlag>0||d&6)&&b.patchFlag!==32&&mn.push(b),b}const E=Jf;function Jf(t,i=null,s=null,l=0,u=null,d=!1){if((!t||t===wf)&&(t=Vt),$s(t)){const v=Fi(t,i,!0);return s&&Sa(v,s),Is>0&&!d&&mn&&(v.shapeFlag&6?mn[mn.indexOf(t)]=v:mn.push(v)),v.patchFlag=-2,v}if(rh(t)&&(t=t.__vccOpts),i){i=Xf(i);let{class:v,style:b}=i;v&&!Tt(v)&&(i.class=Ee(v)),pt(b)&&(Vr(b)&&!De(b)&&(b=Nt({},b)),i.style=Bo(b))}const h=Tt(t)?1:Tc(t)?128:ec(t)?64:pt(t)?4:Je(t)?2:0;return r(t,i,s,l,u,h,d,!0)}function Xf(t){return t?Vr(t)||vc(t)?Nt({},t):t:null}function Fi(t,i,s=!1,l=!1){const{props:u,ref:d,patchFlag:h,children:v,transition:b}=t,C=i?Qf(u||{},i):u,T={__v_isVNode:!0,__v_skip:!0,type:t.type,props:C,key:C&&Cc(C),ref:i&&i.ref?s&&d?De(d)?d.concat(va(i)):[d,va(i)]:va(i):d,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:v,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:i&&t.type!==ue?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&&Fi(t.ssContent),ssFallback:t.ssFallback&&Fi(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return b&&l&&zs(T,b.clone(T)),T}function $(t=" ",i=0){return E(Ba,null,t,i)}function N(t="",i=!1){return i?(p(),at(Vt,null,t)):E(Vt,null,t)}function qn(t){return t==null||typeof t=="boolean"?E(Vt):De(t)?E(ue,null,t.slice()):$s(t)?hi(t):E(Ba,null,String(t))}function hi(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:Fi(t)}function Sa(t,i){let s=0;const{shapeFlag:l}=t;if(i==null)i=null;else if(De(i))s=16;else if(typeof i=="object")if(l&65){const u=i.default;u&&(u._c&&(u._d=!1),Sa(t,u()),u._c&&(u._d=!0));return}else{s=32;const u=i._;!u&&!vc(i)?i._ctx=Zt:u===3&&Zt&&(Zt.slots._===1?i._=1:(i._=2,t.patchFlag|=1024))}else if(Je(i)){if(l&65){Sa(t,{default:i});return}i={default:i,_ctx:Zt},s=32}else i=String(i),l&64?(s=16,i=[$(i)]):s=8;t.children=i,t.shapeFlag|=s}function Qf(...t){const i={};for(let s=0;sQt||Zt;let Ta,Cr;{const t=Ia(),i=(s,l)=>{let u;return(u=t[s])||(u=t[s]=[]),u.push(l),d=>{u.length>1?u.forEach(h=>h(d)):u[0](d)}};Ta=i("__VUE_INSTANCE_SETTERS__",s=>Qt=s),Cr=i("__VUE_SSR_SETTERS__",s=>Ns=s)}const Bs=t=>{const i=Qt;return Ta(t),t.scope.on(),()=>{t.scope.off(),Ta(i)}},Nl=()=>{Qt&&Qt.scope.off(),Ta(null)};function Ac(t){return t.vnode.shapeFlag&4}let Ns=!1;function ih(t,i=!1,s=!1){i&&Cr(i);const{props:l,children:u}=t.vnode,d=Ac(t);Rf(t,l,d,i),Zf(t,u,s||i);const h=d?oh(t,i):void 0;return i&&Cr(!1),h}function oh(t,i){const s=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Sf);const{setup:l}=s;if(l){Xn();const u=t.setupContext=l.length>1?ah(t):null,d=Bs(t),h=Rs(l,t,0,[t.props,u]),v=xu(h);if(Qn(),d(),(v||t.sp)&&!Do(t)&&ac(t),v){if(h.then(Nl,Nl),i)return h.then(b=>{Dl(t,b)}).catch(b=>{Na(b,t,0)});t.asyncDep=h}else Dl(t,h)}else Mc(t)}function Dl(t,i,s){Je(i)?t.type.__ssrInlineRender?t.ssrRender=i:t.render=i:pt(i)&&(t.setupState=Zu(i)),Mc(t)}function Mc(t,i,s){const l=t.type;t.render||(t.render=l.render||Jn);{const u=Bs(t);Xn();try{Tf(t)}finally{Qn(),u()}}}const sh={get(t,i){return Ut(t,"get",""),t[i]}};function ah(t){const i=s=>{t.exposed=s||{}};return{attrs:new Proxy(t.attrs,sh),slots:t.slots,emit:t.emit,expose:i}}function Ua(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Zu(Hd(t.exposed)),{get(i,s){if(s in i)return i[s];if(s in Ls)return Ls[s](t)},has(i,s){return s in i||s in Ls}})):t.proxy}function rh(t){return Je(t)&&"__vccOpts"in t}const ye=(t,i)=>qd(t,i,Ns);function lh(t,i,s){try{ka(-1);const l=arguments.length;return l===2?pt(i)&&!De(i)?$s(i)?E(t,null,[i]):E(t,i):E(t,null,i):(l>3?s=Array.prototype.slice.call(arguments,2):l===3&&$s(s)&&(s=[s]),E(t,i,s))}finally{ka(1)}}const uh="3.5.39";/** -* @vue/runtime-dom v3.5.39 -* (c) 2018-present Yuxi (Evan) You and Vue contributors -* @license MIT -**/let Lr;const Fl=typeof window<"u"&&window.trustedTypes;if(Fl)try{Lr=Fl.createPolicy("vue",{createHTML:t=>t})}catch{}const Ec=Lr?t=>Lr.createHTML(t):t=>t,ch="http://www.w3.org/2000/svg",dh="http://www.w3.org/1998/Math/MathML",fi=typeof document<"u"?document:null,Rl=fi&&fi.createElement("template"),fh={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"?fi.createElementNS(ch,t):i==="mathml"?fi.createElementNS(dh,t):s?fi.createElement(t,{is:s}):fi.createElement(t);return t==="select"&&l&&l.multiple!=null&&u.setAttribute("multiple",l.multiple),u},createText:t=>fi.createTextNode(t),createComment:t=>fi.createComment(t),setText:(t,i)=>{t.nodeValue=i},setElementText:(t,i)=>{t.textContent=i},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>fi.querySelector(t),setScopeId(t,i){t.setAttribute(i,"")},insertStaticContent(t,i,s,l,u,d){const h=s?s.previousSibling:i.lastChild;if(u&&(u===d||u.nextSibling))for(;i.insertBefore(u.cloneNode(!0),s),!(u===d||!(u=u.nextSibling)););else{Rl.innerHTML=Ec(l==="svg"?`${t}`:l==="mathml"?`${t}`:t);const v=Rl.content;if(l==="svg"||l==="mathml"){const b=v.firstChild;for(;b.firstChild;)v.appendChild(b.firstChild);v.removeChild(b)}i.insertBefore(v,s)}return[h?h.nextSibling:i.firstChild,s?s.previousSibling:i.lastChild]}},zi="transition",vs="animation",Ds=Symbol("_vtc"),Oc={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},hh=Nt({},tc,Oc),ph=t=>(t.displayName="Transition",t.props=hh,t),mh=ph((t,{slots:i})=>lh(df,gh(t),i)),Ji=(t,i=[])=>{De(t)?t.forEach(s=>s(...i)):t&&t(...i)},Bl=t=>t?De(t)?t.some(i=>i.length>1):t.length>1:!1;function gh(t){const i={};for(const ie in t)ie in Oc||(i[ie]=t[ie]);if(t.css===!1)return i;const{name:s="v",type:l,duration:u,enterFromClass:d=`${s}-enter-from`,enterActiveClass:h=`${s}-enter-active`,enterToClass:v=`${s}-enter-to`,appearFromClass:b=d,appearActiveClass:C=h,appearToClass:T=v,leaveFromClass:A=`${s}-leave-from`,leaveActiveClass:R=`${s}-leave-active`,leaveToClass:B=`${s}-leave-to`}=t,Z=vh(u),F=Z&&Z[0],he=Z&&Z[1],{onBeforeEnter:pe,onEnter:q,onEnterCancelled:Ce,onLeave:fe,onLeaveCancelled:Be,onBeforeAppear:$e=pe,onAppear:Ie=q,onAppearCancelled:Ge=Ce}=i,be=(ie,He,oe,je)=>{ie._enterCancelled=je,Xi(ie,He?T:v),Xi(ie,He?C:h),oe&&oe()},we=(ie,He)=>{ie._isLeaving=!1,Xi(ie,A),Xi(ie,B),Xi(ie,R),He&&He()},ze=ie=>(He,oe)=>{const je=ie?Ie:q,le=()=>be(He,ie,oe);Ji(je,[He,le]),Ul(()=>{Xi(He,ie?b:d),di(He,ie?T:v),Bl(je)||Vl(He,l,F,le)})};return Nt(i,{onBeforeEnter(ie){Ji(pe,[ie]),di(ie,d),di(ie,h)},onBeforeAppear(ie){Ji($e,[ie]),di(ie,b),di(ie,C)},onEnter:ze(!1),onAppear:ze(!0),onLeave(ie,He){ie._isLeaving=!0;const oe=()=>we(ie,He);di(ie,A),ie._enterCancelled?(di(ie,R),jl(ie)):(jl(ie),di(ie,R)),Ul(()=>{ie._isLeaving&&(Xi(ie,A),di(ie,B),Bl(fe)||Vl(ie,l,he,oe))}),Ji(fe,[ie,oe])},onEnterCancelled(ie){be(ie,!1,void 0,!0),Ji(Ce,[ie])},onAppearCancelled(ie){be(ie,!0,void 0,!0),Ji(Ge,[ie])},onLeaveCancelled(ie){we(ie),Ji(Be,[ie])}})}function vh(t){if(t==null)return null;if(pt(t))return[cr(t.enter),cr(t.leave)];{const i=cr(t);return[i,i]}}function cr(t){return gd(t)}function di(t,i){i.split(/\s+/).forEach(s=>s&&t.classList.add(s)),(t[Ds]||(t[Ds]=new Set)).add(i)}function Xi(t,i){i.split(/\s+/).forEach(l=>l&&t.classList.remove(l));const s=t[Ds];s&&(s.delete(i),s.size||(t[Ds]=void 0))}function Ul(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let _h=0;function Vl(t,i,s,l){const u=t._endId=++_h,d=()=>{u===t._endId&&l()};if(s!=null)return setTimeout(d,s);const{type:h,timeout:v,propCount:b}=bh(t,i);if(!h)return l();const C=h+"end";let T=0;const A=()=>{t.removeEventListener(C,R),d()},R=B=>{B.target===t&&++T>=b&&A()};setTimeout(()=>{T(s[Z]||"").split(", "),u=l(`${zi}Delay`),d=l(`${zi}Duration`),h=Zl(u,d),v=l(`${vs}Delay`),b=l(`${vs}Duration`),C=Zl(v,b);let T=null,A=0,R=0;i===zi?h>0&&(T=zi,A=h,R=d.length):i===vs?C>0&&(T=vs,A=C,R=b.length):(A=Math.max(h,C),T=A>0?h>C?zi:vs:null,R=T?T===zi?d.length:b.length:0);const B=T===zi&&/\b(?:transform|all)(?:,|$)/.test(l(`${zi}Property`).toString());return{type:T,timeout:A,propCount:R,hasTransform:B}}function Zl(t,i){for(;t.lengthHl(s)+Hl(t[l])))}function Hl(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function jl(t){return(t?t.ownerDocument:document).body.offsetHeight}function yh(t,i,s){const l=t[Ds];l&&(i=(i?[i,...l]:[...l]).join(" ")),i==null?t.removeAttribute("class"):s?t.setAttribute("class",i):t.className=i}const Pa=Symbol("_vod"),zc=Symbol("_vsh"),xh={name:"show",beforeMount(t,{value:i},{transition:s}){t[Pa]=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[Pa]:"none",t[zc]=!i}const wh=Symbol(""),kh=/(?:^|;)\s*display\s*:/;function Sh(t,i,s){const l=t.style,u=Tt(s);let d=!1;if(s&&!u){if(i)if(Tt(i))for(const h of i.split(";")){const v=h.slice(0,h.indexOf(":")).trim();s[v]==null&&xs(l,v,"")}else for(const h in i)s[h]==null&&xs(l,h,"");for(const h in s){h==="display"&&(d=!0);const v=s[h];v!=null?Ph(t,h,!Tt(i)&&i?i[h]:void 0,v)||xs(l,h,v):xs(l,h,"")}}else if(u){if(i!==s){const h=l[wh];h&&(s+=";"+h),l.cssText=s,d=kh.test(s)}}else i&&t.removeAttribute("style");Pa in t&&(t[Pa]=d?l.display:"",t[zc]&&(l.display="none"))}const Wl=/\s*!important$/;function xs(t,i,s){if(De(s))s.forEach(l=>xs(t,i,l));else if(s==null&&(s=""),i.startsWith("--"))t.setProperty(i,s);else{const l=Th(t,i);Wl.test(s)?t.setProperty(Bi(l),s.replace(Wl,""),"important"):t[l]=s}}const Kl=["Webkit","Moz","ms"],dr={};function Th(t,i){const s=dr[i];if(s)return s;let l=Rn(i);if(l!=="filter"&&l in t)return dr[i]=l;l=Su(l);for(let u=0;ufr||(Oh.then(()=>fr=0),fr=Date.now());function Ih(t,i){const s=l=>{if(!l._vts)l._vts=Date.now();else if(l._vts<=s.attached)return;const u=s.value;if(De(u)){const d=l.stopImmediatePropagation;l.stopImmediatePropagation=()=>{d.call(l),l._stopped=!0};const h=u.slice(),v=[l];for(let b=0;bt.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,$h=(t,i,s,l,u,d)=>{const h=u==="svg";i==="class"?yh(t,l,h):i==="style"?Sh(t,s,l):Ma(i)?Ea(i)||Lh(t,i,s,l,d):(i[0]==="."?(i=i.slice(1),!0):i[0]==="^"?(i=i.slice(1),!1):Nh(t,i,l,h))?(Yl(t,i,l),!t.tagName.includes("-")&&(i==="value"||i==="checked"||i==="selected")&&ql(t,i,l,h,d,i!=="value")):t._isVueCE&&(Dh(t,i)||t._def.__asyncLoader&&(/[A-Z]/.test(i)||!Tt(l)))?Yl(t,Rn(i),l,d,i):(i==="true-value"?t._trueValue=l:i==="false-value"&&(t._falseValue=l),ql(t,i,l,h))};function Nh(t,i,s,l){if(l)return!!(i==="innerHTML"||i==="textContent"||i in t&&Xl(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 Xl(i)&&Tt(s)?!1:i in t}function Dh(t,i){const s=t._def.props;if(!s)return!1;const l=Rn(i);return Array.isArray(s)?s.some(u=>Rn(u)===l):Object.keys(s).some(u=>Rn(u)===l)}const Ri=t=>{const i=t.props["onUpdate:modelValue"]||!1;return De(i)?s=>ga(i,s):i};function Fh(t){t.target.composing=!0}function Ql(t){const i=t.target;i.composing&&(i.composing=!1,i.dispatchEvent(new Event("input")))}const Ln=Symbol("_assign");function eu(t,i,s){return i&&(t=t.trim()),s&&(t=za(t)),t}const Se={created(t,{modifiers:{lazy:i,trim:s,number:l}},u){t[Ln]=Ri(u);const d=l||u.props&&u.props.type==="number";gi(t,i?"change":"input",h=>{h.target.composing||t[Ln](eu(t.value,s,d))}),(s||d)&&gi(t,"change",()=>{t.value=eu(t.value,s,d)}),i||(gi(t,"compositionstart",Fh),gi(t,"compositionend",Ql),gi(t,"change",Ql))},mounted(t,{value:i}){t.value=i??""},beforeUpdate(t,{value:i,oldValue:s,modifiers:{lazy:l,trim:u,number:d}},h){if(t[Ln]=Ri(h),t.composing)return;const v=(d||t.type==="number")&&!/^0\d/.test(t.value)?za(t.value):t.value,b=i??"";if(v===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)}},Ca={deep:!0,created(t,i,s){t[Ln]=Ri(s),gi(t,"change",()=>{const l=t._modelValue,u=Vo(t),d=t.checked,h=t[Ln];if(De(l)){const v=$r(l,u),b=v!==-1;if(d&&!b)h(l.concat(u));else if(!d&&b){const C=[...l];C.splice(v,1),h(C)}}else if(Zo(l)){const v=new Set(l);d?v.add(u):v.delete(u),h(v)}else h(Ic(t,d))})},mounted:tu,beforeUpdate(t,i,s){t[Ln]=Ri(s),tu(t,i,s)}};function tu(t,{value:i,oldValue:s},l){t._modelValue=i;let u;if(De(i))u=$r(i,l.props.value)>-1;else if(Zo(i))u=i.has(l.props.value);else{if(i===s)return;u=Di(i,Ic(t,!0))}t.checked!==u&&(t.checked=u)}const Rh={created(t,{value:i},s){t.checked=Di(i,s.props.value),t[Ln]=Ri(s),gi(t,"change",()=>{t[Ln](Vo(t))})},beforeUpdate(t,{value:i,oldValue:s},l){t[Ln]=Ri(l),i!==s&&(t.checked=Di(i,l.props.value))}},At={deep:!0,created(t,{value:i,modifiers:{number:s}},l){const u=Zo(i);gi(t,"change",()=>{const d=Array.prototype.filter.call(t.options,h=>h.selected).map(h=>s?za(Vo(h)):Vo(h));t[Ln](t.multiple?u?new Set(d):d:d[0]),t._assigning=!0,ju(()=>{t._assigning=!1})}),t[Ln]=Ri(l)},mounted(t,{value:i}){nu(t,i)},beforeUpdate(t,i,s){t[Ln]=Ri(s)},updated(t,{value:i}){t._assigning||nu(t,i)}};function nu(t,i){const s=t.multiple,l=De(i);if(!(s&&!l&&!Zo(i))){for(let u=0,d=t.options.length;uString(C)===String(v)):h.selected=$r(i,v)>-1}else h.selected=i.has(v);else if(Di(Vo(h),i)){t.selectedIndex!==u&&(t.selectedIndex=u);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Vo(t){return"_value"in t?t._value:t.value}function Ic(t,i){const s=i?"_trueValue":"_falseValue";return s in t?t[s]:i}const Bh={created(t,i,s){pa(t,i,s,null,"created")},mounted(t,i,s){pa(t,i,s,null,"mounted")},beforeUpdate(t,i,s,l){pa(t,i,s,l,"beforeUpdate")},updated(t,i,s,l){pa(t,i,s,l,"updated")}};function Uh(t,i){switch(t){case"SELECT":return At;case"TEXTAREA":return Se;default:switch(i){case"checkbox":return Ca;case"radio":return Rh;default:return Se}}}function pa(t,i,s,l,u){const h=Uh(t.tagName,s.props&&s.props.type)[u];h&&h(t,i,s,l)}const Vh=["ctrl","shift","alt","meta"],Zh={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)=>Vh.some(s=>t[`${s}Key`]&&!i.includes(s))},Kr=(t,i)=>{if(!t)return t;const s=t._withMods||(t._withMods={}),l=i.join(".");return s[l]||(s[l]=((u,...d)=>{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 d=Bi(u.key);if(i.some(h=>h===d||Hh[h]===d))return t(u)}))},jh=Nt({patchProp:$h},fh);let ou;function Wh(){return ou||(ou=jf(jh))}const Kh=((...t)=>{const i=Wh().createApp(...t),{mount:s}=i;return i.mount=l=>{const u=qh(l);if(!u)return;const d=i._component;!Je(d)&&!d.render&&!d.template&&(d.template=u.innerHTML),u.nodeType===1&&(u.textContent="");const h=s(u,!1,Gh(u));return u instanceof Element&&(u.removeAttribute("v-cloak"),u.setAttribute("data-v-app","")),h},i});function Gh(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function qh(t){return Tt(t)?document.querySelector(t):t}const $c="pv_theme",su={light:"#EEF0F3",dark:"#0B1730"},La=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;function Nc(){return La&&La.matches?"dark":"light"}function Yh(){try{return localStorage.getItem($c)||"light"}catch{return"light"}}function Dc(t){return t==="system"?Nc():t}function Fc(t){const i=document.documentElement;i.setAttribute("data-theme",t),i.style.backgroundColor=su[t]||su.light}const oo=j(Yh()),Ro=j(Dc(oo.value));function Aa(t){oo.value=t;const i=Dc(t);Ro.value=i,Fc(i);try{localStorage.setItem($c,t)}catch{}}function au(){Aa(Ro.value==="dark"?"light":"dark")}La&&La.addEventListener("change",()=>{if(oo.value==="system"){const t=Nc();Ro.value=t,Fc(t)}});async function Jh(){try{const t=await fetch("/bff/config");return t.ok?await t.json():{apiBase:""}}catch{return{apiBase:""}}}async function ru(){try{const t=await fetch("/bff/me");return t.ok?await t.json():null}catch{return null}}async function Xh(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 Qh(){try{await fetch("/bff/logout",{method:"POST"})}catch{}}async function ep(){try{const t=await fetch("/bff/devices");return t.ok?await t.json():[]}catch{return[]}}async function tp(){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 np(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 ip(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 op(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 sp(){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 ap(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 rp(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 lp(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 up(){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 cp(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 dp(){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 lu(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 fp(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 hp(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 pp(){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 uu(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 mp(){const t=await fetch("/bff/integrations/filetransfer/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function gp(){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 vp(){const t=await fetch("/bff/integrations/localstorage/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/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 cu(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 bp(){const t=await fetch("/bff/integrations/webdav/health",{method:"POST"});return{ok:t.ok,status:t.status,body:await t.json().catch(()=>({}))}}async function Rc(){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 yp(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 xp(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 wp(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 kp(){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 Sp(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 Tp(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 Pp(t){const i=await fetch(`/bff/flights/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function Cp(){return"/bff/logbook/export"}async function Lp(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 Ap(t,i){const s=new FormData;Object.entries(t).forEach(([u,d])=>{d!=null&&d!==""&&s.append(u,d)}),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 Mp(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 Ep(t){const i=await fetch(`/bff/documents/${encodeURIComponent(t)}`,{method:"DELETE"});return{ok:i.ok,status:i.status,body:await i.json().catch(()=>({}))}}function hr(t){return`/bff/documents/${encodeURIComponent(t)}/file`}function Op(t){return`/bff/documents/${encodeURIComponent(t)}/file?inline=1`}async function zp(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 Bc="pv_prefs",Ar={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 Ip(){try{return{...Ar,...JSON.parse(localStorage.getItem(Bc)||"{}")||{}}}catch{return{...Ar}}}const _e=St(Ip());function Uc(){try{localStorage.setItem(Bc,JSON.stringify(_e))}catch{}}function Vc(t){if(!t||typeof t!="object")return!1;for(const i of Object.keys(Ar))i in t&&(_e[i]=t[i]);return!0}const $p={sm:15,md:16,lg:18};function Gr(t){document.documentElement.style.fontSize=($p[t]||16)+"px"}function qr(t){document.documentElement.classList.toggle("reduce-motion",!!t)}function Zc(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 d;switch(_e.dateFormat){case"DMY":d=`${u}/${l}/${s}`;break;case"YMD":d=`${s}/${l}/${u}`;break;case"ISO":d=`${s}-${l}-${u}`;break;default:d=`${l}/${u}/${s}`}let h;return _e.timeFormat==="12"?h=i.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",second:"2-digit",hour12:!0}):h=`${String(i.getHours()).padStart(2,"0")}:${String(i.getMinutes()).padStart(2,"0")}:${String(i.getSeconds()).padStart(2,"0")}`,{date:d,time:h}}function du(t){return Zc(t).time}function fu(t){const i=Zc(t);return`${i.date} ${i.time}`}let Yr=!1,Mr=!1,Er=null;function Np(){return{...JSON.parse(JSON.stringify(_e)),themeMode:oo.value}}function Jr(){!Yr||Mr||(clearTimeout(Er),Er=setTimeout(()=>{cp(Np())},600))}function Dp(t){Mr=!0;try{Vc(t),t.themeMode&&Aa(t.themeMode),Gr(_e.fontSize),qr(_e.reduceMotion),Uc()}finally{Mr=!1}}async function hu(){Yr=!0;const t=await up();t&&Object.keys(t).length?Dp(t):Jr()}function Fp(){Yr=!1,clearTimeout(Er)}$t(_e,()=>{Uc(),Jr()},{deep:!0});$t(oo,Jr);$t(()=>_e.fontSize,Gr,{immediate:!0});$t(()=>_e.reduceMotion,qr,{immediate:!0});const Rp=["width","height"],Hc={__name:"BrandMark",props:{size:{type:[Number,String],default:28}},setup(t){return(i,s)=>(p(),g("svg",{width:t.size,height:t.size,viewBox:"0 0 48 48",fill:"none","aria-hidden":"true"},[...s[0]||(s[0]=[r("g",{"stroke-width":"4","stroke-linecap":"round","stroke-linejoin":"round"},[r("polyline",{points:"8,30 19,17 30,30",stroke:"var(--accent)"}),r("polyline",{points:"18,33 29,20 40,33",stroke:"currentColor"})],-1)])],8,Rp))}},Bp=["title","aria-label"],Up={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Vp={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},Zp={__name:"ThemeToggle",setup(t){return(i,s)=>(p(),g("button",{class:"btn-icon",type:"button",title:Oe(Ro)==="dark"?"Switch to light":"Switch to dark","aria-label":Oe(Ro)==="dark"?"Switch to light theme":"Switch to dark theme",onClick:s[0]||(s[0]=(...l)=>Oe(au)&&Oe(au)(...l))},[Oe(Ro)==="dark"?(p(),g("svg",Up,[...s[1]||(s[1]=[r("circle",{cx:"12",cy:"12",r:"4"},null,-1),r("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(),g("svg",Vp,[...s[2]||(s[2]=[r("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9z"},null,-1)])]))],8,Bp))}},Hp={class:"relative grid h-full place-items-center p-5"},jp={class:"absolute right-5 top-5"},Wp={class:"mb-6 flex items-center gap-3 text-ink"},Kp={class:"relative mb-1"},Gp=["type"],qp=["aria-label","title"],Yp={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]"},Jp={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]"},Xp={key:0,class:"mt-4"},Qp={key:1,class:"mt-4 rounded border border-line bg-danger-soft px-3 py-2 text-sm text-danger-fg"},em=["disabled"],tm={__name:"LoginView",props:{defaultApiBase:{type:String,default:""}},emits:["signed-in"],setup(t,{emit:i}){const s=t,l=i,u=j(""),d=j(""),h=j(localStorage.getItem("api_url")||s.defaultApiBase||"http://localhost:8080"),v=j(!1),b=j(!1),C=j(!1),T=j("");async function A(){C.value=!0,T.value="",localStorage.setItem("api_url",h.value.trim());const{ok:R,status:B,body:Z}=await Xh(u.value.trim(),d.value,h.value.trim());if(C.value=!1,R){l("signed-in",Z.email);return}T.value=B===400?"Invalid email or password.":B===502?"API server can't reach PocketBase.":Z.message||Z.error||"Cannot reach the API server."}return(R,B)=>(p(),g("div",Hp,[r("div",jp,[E(Zp)]),r("form",{class:"panel w-[380px] p-8 shadow-md",onSubmit:Kr(A,["prevent"])},[r("div",Wp,[E(Hc,{size:34}),B[5]||(B[5]=r("div",{class:"leading-tight"},[r("div",{class:"text-mode"},"PilotVault"),r("div",{class:"eyebrow mt-0.5"},"Control panel")],-1))]),B[9]||(B[9]=r("label",{class:"eyebrow mb-1.5 block"},"Email",-1)),ne(r("input",{"onUpdate:modelValue":B[0]||(B[0]=Z=>u.value=Z),type:"email",autocomplete:"username",required:"",class:"field mb-4",placeholder:"you@example.com"},null,512),[[Se,u.value]]),B[10]||(B[10]=r("label",{class:"eyebrow mb-1.5 block"},"Password",-1)),r("div",Kp,[ne(r("input",{"onUpdate:modelValue":B[1]||(B[1]=Z=>d.value=Z),type:b.value?"text":"password",autocomplete:"current-password",required:"",class:"field w-full pr-10",placeholder:"••••••••"},null,8,Gp),[[Bh,d.value]]),r("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:B[2]||(B[2]=Z=>b.value=!b.value)},[b.value?(p(),g("svg",Yp,[...B[6]||(B[6]=[r("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),r("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])])):(p(),g("svg",Jp,[...B[7]||(B[7]=[r("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),r("circle",{cx:"12",cy:"12",r:"3"},null,-1)])]))],8,qp)]),v.value?(p(),g("div",Xp,[B[8]||(B[8]=r("label",{class:"eyebrow mb-1.5 block"},"API Server",-1)),ne(r("input",{"onUpdate:modelValue":B[3]||(B[3]=Z=>h.value=Z),type:"text",class:"field font-mono",placeholder:"10.2.1.101:8080"},null,512),[[Se,h.value]])])):N("",!0),T.value?(p(),g("p",Qp,S(T.value),1)):N("",!0),r("button",{type:"submit",class:"btn-accent mt-6 w-full",disabled:C.value},S(C.value?"Signing in…":"Sign in"),9,em),r("button",{type:"button",class:"mx-auto mt-3 block text-xs text-ink-muted transition hover:text-ink-secondary",onClick:B[4]||(B[4]=Z=>v.value=!v.value)},S(v.value?"Hide server settings":"Server settings"),1)],32)]))}};function nm(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ws={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 im=ws.exports,pu;function om(){return pu||(pu=1,(function(t,i){(function(s,l){l(i)})(im,(function(s){var l="1.9.4";function u(e){var n,o,a,c;for(o=1,a=arguments.length;o"u"||!L||!L.Mixin)){e=Ce(e)?e:[e];for(var n=0;n0?Math.floor(e):Math.ceil(e)};ae.prototype={clone:function(){return new ae(this.x,this.y)},add:function(e){return this.clone()._add(ee(e))},_add:function(e){return this.x+=e.x,this.y+=e.y,this},subtract:function(e){return this.clone()._subtract(ee(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 ae(this.x*e.x,this.y*e.y)},unscaleBy:function(e){return new ae(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=tt(this.x),this.y=tt(this.y),this},distanceTo:function(e){e=ee(e);var n=e.x-this.x,o=e.y-this.y;return Math.sqrt(n*n+o*o)},equals:function(e){return e=ee(e),e.x===this.x&&e.y===this.y},contains:function(e){return e=ee(e),Math.abs(e.x)<=Math.abs(this.x)&&Math.abs(e.y)<=Math.abs(this.y)},toString:function(){return"Point("+R(this.x)+", "+R(this.y)+")"}};function ee(e,n,o){return e instanceof ae?e:Ce(e)?new ae(e[0],e[1]):e==null?e:typeof e=="object"&&"x"in e&&"y"in e?new ae(e.x,e.y):new ae(e,n,o)}function xe(e,n){if(e)for(var o=n?[e,n]:e,a=0,c=o.length;a=this.min.x&&o.x<=this.max.x&&n.y>=this.min.y&&o.y<=this.max.y},intersects:function(e){e=Ne(e);var n=this.min,o=this.max,a=e.min,c=e.max,m=c.x>=n.x&&a.x<=o.x,P=c.y>=n.y&&a.y<=o.y;return m&&P},overlaps:function(e){e=Ne(e);var n=this.min,o=this.max,a=e.min,c=e.max,m=c.x>n.x&&a.xn.y&&a.y=n.lat&&c.lat<=o.lat&&a.lng>=n.lng&&c.lng<=o.lng},intersects:function(e){e=st(e);var n=this._southWest,o=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),m=c.lat>=n.lat&&a.lat<=o.lat,P=c.lng>=n.lng&&a.lng<=o.lng;return m&&P},overlaps:function(e){e=st(e);var n=this._southWest,o=this._northEast,a=e.getSouthWest(),c=e.getNorthEast(),m=c.lat>n.lat&&a.latn.lng&&a.lng1,yi=(function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveEventSupport",A,n),window.removeEventListener("testPassiveEventSupport",A,n)}catch{}return e})(),Vs=(function(){return!!document.createElement("canvas").getContext})(),jo=!!(document.createElementNS&&K("svg").createSVGRect),Wo=!!jo&&(function(){var e=document.createElement("div");return e.innerHTML="",(e.firstChild&&e.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Ko=!jo&&(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}})(),Va=navigator.platform.indexOf("Mac")===0,gn=navigator.platform.indexOf("Linux")===0;function jt(e){return navigator.userAgent.toLowerCase().indexOf(e)>=0}var ge={ie:re,ielt9:te,edge:Q,webkit:G,android:me,android23:se,androidStock:Ae,opera:Ze,chrome:et,gecko:U,safari:O,phantom:ke,opera12:Ye,win:gt,ie3d:bt,webkit3d:en,gecko3d:de,any3d:wt,mobile:an,mobileWebkit:so,mobileWebkit3d:lt,msPointer:ei,pointer:ao,touch:Ui,touchNative:ft,mobileOpera:ro,mobileGecko:lo,retina:Mn,passiveEvents:yi,canvas:Vs,svg:jo,vml:Ko,inlineSvg:Wo,mac:Va,linux:gn},Wt=ge.msPointer?"MSPointerDown":"pointerdown",Pt=ge.msPointer?"MSPointerMove":"pointermove",Zs=ge.msPointer?"MSPointerUp":"pointerup",Go=ge.msPointer?"MSPointerCancel":"pointercancel",Vi={touchstart:Wt,touchmove:Pt,touchend:Zs,touchcancel:Go},Hs={touchstart:qo,touchmove:En,touchend:En,touchcancel:En},xi={},js=!1;function Za(e,n,o){return n==="touchstart"&&ut(),Hs[n]?(o=Hs[n].bind(this,o),e.addEventListener(Vi[n],o,!1),o):(console.warn("wrong event specified:",n),A)}function Ws(e,n,o){if(!Vi[n]){console.warn("wrong event specified:",n);return}e.removeEventListener(Vi[n],o,!1)}function Ha(e){xi[e.pointerId]=e}function ja(e){xi[e.pointerId]&&(xi[e.pointerId]=e)}function Ks(e){delete xi[e.pointerId]}function ut(){js||(document.addEventListener(Wt,Ha,!0),document.addEventListener(Pt,ja,!0),document.addEventListener(Zs,Ks,!0),document.addEventListener(Go,Ks,!0),js=!0)}function En(e,n){if(n.pointerType!==(n.MSPOINTER_TYPE_MOUSE||"mouse")){n.touches=[];for(var o in xi)n.touches.push(xi[o]);n.changedTouches=[n],e(n)}}function qo(e,n){n.MSPOINTER_TYPE_TOUCH&&n.pointerType===n.MSPOINTER_TYPE_TOUCH&&Mt(n),En(e,n)}function Bt(e){var n={},o,a;for(a in e)o=e[a],n[a]=o&&o.bind?o.bind(e):o;return e=n,n.type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}var Zi=200;function uo(e,n){e.addEventListener("dblclick",n);var o=0,a;function c(m){if(m.detail!==1){a=m.detail;return}if(!(m.pointerType==="mouse"||m.sourceCapabilities&&!m.sourceCapabilities.firesTouchEvents)){var P=Js(m);if(!(P.some(function(D){return D instanceof HTMLLabelElement&&D.attributes.for})&&!P.some(function(D){return D instanceof HTMLInputElement||D instanceof HTMLSelectElement}))){var I=Date.now();I-o<=Zi?(a++,a===2&&n(Bt(m))):a=1,o=I}}}return e.addEventListener("click",c),{dblclick:n,simDblclick:c}}function co(e,n){e.removeEventListener("dblclick",n.dblclick),e.removeEventListener("click",n.simDblclick)}var rn=mo(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),vn=mo(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),Gs=vn==="webkitTransition"||vn==="OTransition"?vn+"End":"transitionend";function fo(e){return typeof e=="string"?document.getElementById(e):e}function ti(e,n){var o=e.style[n]||e.currentStyle&&e.currentStyle[n];if((!o||o==="auto")&&document.defaultView){var a=document.defaultView.getComputedStyle(e,null);o=a?a[n]:null}return o==="auto"?null:o}function nt(e,n,o){var a=document.createElement(e);return a.className=n||"",o&&o.appendChild(a),a}function it(e){var n=e.parentNode;n&&n.removeChild(e)}function ln(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function un(e){var n=e.parentNode;n&&n.lastChild!==e&&n.appendChild(e)}function Dt(e){var n=e.parentNode;n&&n.firstChild!==e&&n.insertBefore(e,n.firstChild)}function ho(e,n){if(e.classList!==void 0)return e.classList.contains(n);var o=po(e);return o.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(o)}function We(e,n){if(e.classList!==void 0)for(var o=Z(n),a=0,c=o.length;a0?2*window.devicePixelRatio:1;function es(e){return ge.edge?e.wheelDeltaY/2:e.deltaY&&e.deltaMode===0?-e.deltaY/Wa: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 ts(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 ns={__proto__:null,on:Ue,off:mt,stopPropagation:ai,disableScrollPropagation:Qo,disableClickPropagation:Hi,preventDefault:Mt,stop:ri,getPropagationPath:Js,getMousePosition:Xs,getWheelDelta:es,isExternalTarget:ts,addListener:Ue,removeListener:mt},bo=ce.extend({run:function(e,n,o,a){this.stop(),this._el=e,this._inProgress=!0,this._duration=o||.25,this._easeOutPower=1/Math.max(a||.5,.2),this._startPos=Pe(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=ze(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(),a=this._limitCenter(o,this._zoom,st(e));return o.equals(a)||this.panTo(a,n),this._enforcingBounds=!1,this},panInside:function(e,n){n=n||{};var o=ee(n.paddingTopLeft||n.padding||[0,0]),a=ee(n.paddingBottomRight||n.padding||[0,0]),c=this.project(this.getCenter()),m=this.project(e),P=this.getPixelBounds(),I=Ne([P.min.add(o),P.max.subtract(a)]),D=I.getSize();if(!I.contains(m)){this._enforcingBounds=!0;var J=m.subtract(I.getCenter()),ve=I.extend(m).getSize().subtract(D);c.x+=J.x<0?-ve.x:ve.x,c.y+=J.y<0?-ve.y:ve.y,this.panTo(this.unproject(c),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(),a=n.divideBy(2).round(),c=o.divideBy(2).round(),m=a.subtract(c);return!m.x&&!m.y?this:(e.animate&&e.pan?this.panBy(m):(e.pan&&this._rawPanBy(m),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,a=new Ve(n,o),c=a.toBounds(e.coords.accuracy*2),m=this._locateOptions;if(m.setView){var P=this.getBoundsZoom(c);this.setView(a,m.maxZoom?Math.min(P,m.maxZoom):P)}var I={latlng:a,bounds:c,timestamp:e.timestamp};for(var D in e.coords)typeof e.coords[D]=="number"&&(I[D]=e.coords[D]);this.fire("locationfound",I)}},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(),it(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(ie(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)it(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":""),a=nt("div",o,n||this._mapPane);return e&&(this._panes[e]=a),a},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 dt(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=ee(o||[0,0]);var a=this.getZoom()||0,c=this.getMinZoom(),m=this.getMaxZoom(),P=e.getNorthWest(),I=e.getSouthEast(),D=this.getSize().subtract(o),J=Ne(this.project(I,a),this.project(P,a)).getSize(),ve=ge.any3d?this.options.zoomSnap:1,Re=D.x/J.x,Qe=D.y/J.y,qt=n?Math.max(Re,Qe):Math.min(Re,Qe);return a=this.getScaleZoom(qt,a),ve&&(a=Math.round(a/(ve/100))*(ve/100),a=n?Math.ceil(a/ve)*ve:Math.floor(a/ve)*ve),Math.max(c,Math.min(m,a))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new ae(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 xe(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 a=o.zoom(e*o.scale(n));return isNaN(a)?1/0:a},project:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.latLngToPoint(Y(e),n)},unproject:function(e,n){return n=n===void 0?this._zoom:n,this.options.crs.pointToLatLng(ee(e),n)},layerPointToLatLng:function(e){var n=ee(e).add(this.getPixelOrigin());return this.unproject(n)},latLngToLayerPoint:function(e){var n=this.project(Y(e))._round();return n._subtract(this.getPixelOrigin())},wrapLatLng:function(e){return this.options.crs.wrapLatLng(Y(e))},wrapLatLngBounds:function(e){return this.options.crs.wrapLatLngBounds(st(e))},distance:function(e,n){return this.options.crs.distance(Y(e),Y(n))},containerPointToLayerPoint:function(e){return ee(e).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(e){return ee(e).add(this._getMapPanePos())},containerPointToLatLng:function(e){var n=this.containerPointToLayerPoint(ee(e));return this.layerPointToLatLng(n)},latLngToContainerPoint:function(e){return this.layerPointToContainerPoint(this.latLngToLayerPoint(Y(e)))},mouseEventToContainerPoint:function(e){return Xs(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=fo(e);if(n){if(n._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Ue(n,"scroll",this._onScroll,this),this._containerId=b(n)},_initLayout:function(){var e=this._container;this._fadeAnimated=this.options.fadeAnimation&&ge.any3d,We(e,"leaflet-container"+(ge.touch?" leaflet-touch":"")+(ge.retina?" leaflet-retina":"")+(ge.ielt9?" leaflet-oldie":"")+(ge.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var n=ti(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),Lt(this._mapPane,new ae(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(We(e.markerPane,"leaflet-zoom-hide"),We(e.shadowPane,"leaflet-zoom-hide"))},_resetView:function(e,n,o){Lt(this._mapPane,new ae(0,0));var a=!this._loaded;this._loaded=!0,n=this._limitZoom(n),this.fire("viewprereset");var c=this._zoom!==n;this._moveStart(c,o)._move(e,n)._moveEnd(c),this.fire("viewreset"),a&&this.fire("load")},_moveStart:function(e,n){return e&&this.fire("zoomstart"),n||this.fire("movestart"),this},_move:function(e,n,o,a){n===void 0&&(n=this._zoom);var c=this._zoom!==n;return this._zoom=n,this._lastCenter=e,this._pixelOrigin=this._getNewPixelOrigin(e),a?o&&o.pinch&&this.fire("zoom",o):((c||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 ie(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(e){Lt(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?mt:Ue;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),ge.any3d&&this.options.transform3DLimit&&(e?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){ie(this._resizeRequest),this._resizeRequest=ze(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=[],a,c=n==="mouseout"||n==="mouseover",m=e.target||e.srcElement,P=!1;m;){if(a=this._targets[b(m)],a&&(n==="click"||n==="preclick")&&this._draggableMoved(a)){P=!0;break}if(a&&a.listens(n,!0)&&(c&&!ts(m,e)||(o.push(a),c))||m===this._container)break;m=m.parentNode}return!o.length&&!P&&!c&&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"&&go(n),this._fireDOMEvent(e,o)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(e,n,o){if(e.type==="click"){var a=u({},e);a.type="preclick",this._fireDOMEvent(a,a.type,o)}var c=this._findEventTargets(e,n);if(o){for(var m=[],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(),a=ge.any3d?this.options.zoomSnap:1;return a&&(e=Math.round(e/a)*a),Math.max(n,Math.min(o,e))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){Ct(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=nt("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(e),this.on("zoomanim",function(n){var o=rn,a=this._proxy.style[o];ni(this._proxy,this.project(n.center,n.zoom),this.getZoomScale(n.zoom,1)),a===this._proxy.style[o]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){it(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var e=this.getCenter(),n=this.getZoom();ni(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 a=this.getZoomScale(n),c=this._getCenterOffset(e)._divideBy(1-1/a);return o.animate!==!0&&!this.getSize().contains(c)?!1:(ze(function(){this._moveStart(!0,o.noMoveStart||!1)._animateZoom(e,n,!0)},this),!0)},_animateZoom:function(e,n,o,a){this._mapPane&&(o&&(this._animatingZoom=!0,this._animateToCenter=e,this._animateToZoom=n,We(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:e,zoom:n,noUpdate:a}),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&&Ct(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 is(e,n){return new Xe(e,n)}var Ke=oe.extend({options:{position:"topright"},initialize:function(e){F(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(),a=e._controlCorners[o];return We(n,"leaflet-control"),o.indexOf("bottom")!==-1?a.insertBefore(n,a.firstChild):a.appendChild(n),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(it(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()}}),zt=function(e){return new Ke(e)};Xe.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=nt("div",n+"control-container",this._container);function a(c,m){var P=n+c+" "+n+m;e[c+m]=nt("div",P,o)}a("top","left"),a("top","right"),a("bottom","left"),a("bottom","right")},_clearControlPos:function(){for(var e in this._controlCorners)it(this._controlCorners[e]);it(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var li=Ke.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(e,n,o,a){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='",a=document.createElement("div");return a.innerHTML=o,a.firstChild},_addItem:function(e){var n=document.createElement("label"),o=this._map.hasLayer(e.layer),a;e.overlay?(a=document.createElement("input"),a.type="checkbox",a.className="leaflet-control-layers-selector",a.defaultChecked=o):a=this._createRadioElement("leaflet-base-layers_"+b(this),o),this._layerControlInputs.push(a),a.layerId=b(e.layer),Ue(a,"click",this._onInputClick,this);var c=document.createElement("span");c.innerHTML=" "+e.name;var m=document.createElement("span");n.appendChild(m),m.appendChild(a),m.appendChild(c);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,a=[],c=[];this._handlingClick=!0;for(var m=e.length-1;m>=0;m--)n=e[m],o=this._getLayer(n.layerId).layer,n.checked?a.push(o):n.checked||c.push(o);for(m=0;m=0;c--)n=e[c],o=this._getLayer(n.layerId).layer,n.disabled=o.options.minZoom!==void 0&&ao.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var e=this._section;this._preventClick=!0,Ue(e,"click",Mt),this.expand();var n=this;setTimeout(function(){mt(e,"click",Mt),n._preventClick=!1})}}),Qs=function(e,n,o){return new li(e,n,o)},os=Ke.extend({options:{position:"topleft",zoomInText:'',zoomInTitle:"Zoom in",zoomOutText:'',zoomOutTitle:"Zoom out"},onAdd:function(e){var n="leaflet-control-zoom",o=nt("div",n+" leaflet-bar"),a=this.options;return this._zoomInButton=this._createButton(a.zoomInText,a.zoomInTitle,n+"-in",o,this._zoomIn),this._zoomOutButton=this._createButton(a.zoomOutText,a.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,a,c){var m=nt("a",o,a);return m.innerHTML=e,m.href="#",m.title=n,m.setAttribute("role","button"),m.setAttribute("aria-label",n),Hi(m),Ue(m,"click",ri),Ue(m,"click",c,this),Ue(m,"click",this._refocusOnMap,this),m},_updateDisabled:function(){var e=this._map,n="leaflet-disabled";Ct(this._zoomInButton,n),Ct(this._zoomOutButton,n),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||e._zoom===e.getMinZoom())&&(We(this._zoomOutButton,n),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||e._zoom===e.getMaxZoom())&&(We(this._zoomInButton,n),this._zoomInButton.setAttribute("aria-disabled","true"))}});Xe.mergeOptions({zoomControl:!0}),Xe.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new os,this.addControl(this.zoomControl))});var ss=function(e){return new os(e)},ea=Ke.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(e){var n="leaflet-control-scale",o=nt("div",n),a=this.options;return this._addScales(a,n+"-line",o),e.on(a.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=nt("div",n,o)),e.imperial&&(this._iScale=nt("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,a,c;n>5280?(o=n/5280,a=this._getRoundNum(o),this._updateScale(this._iScale,a+" mi",a/o)):(c=this._getRoundNum(n),this._updateScale(this._iScale,c+" ft",c/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}}),Ka=function(e){return new ea(e)},Ga='',as=Ke.extend({options:{position:"bottomright",prefix:''+(ge.inlineSvg?Ga+" ":"")+"Leaflet"},initialize:function(e){F(this,e),this._attributions={}},onAdd:function(e){e.attributionControl=this,this._container=nt("div","leaflet-control-attribution"),Hi(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(' ')}}});Xe.mergeOptions({attributionControl:!0}),Xe.addInitHook(function(){this.options.attributionControl&&new as().addTo(this)});var ji=function(e){return new as(e)};Ke.Layers=li,Ke.Zoom=os,Ke.Scale=ea,Ke.Attribution=as,zt.layers=Qs,zt.zoom=ss,zt.scale=Ka,zt.attribution=ji;var fn=oe.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}});fn.addTo=function(e,n){return e.addHandler(n,this),this};var yo={Events:le},Si=ge.touch?"touchstart mousedown":"mousedown",hn=ce.extend({options:{clickTolerance:3},initialize:function(e,n,o,a){F(this,a),this._element=e,this._dragStartTarget=n||e,this._preventOutline=o},enable:function(){this._enabled||(Ue(this._dragStartTarget,Si,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(hn._dragging===this&&this.finishDrag(!0),mt(this._dragStartTarget,Si,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(e){if(this._enabled&&(this._moved=!1,!ho(this._element,"leaflet-zoom-anim"))){if(e.touches&&e.touches.length!==1){hn._dragging===this&&this.finishDrag();return}if(!(hn._dragging||e.shiftKey||e.which!==1&&e.button!==1&&!e.touches)&&(hn._dragging=this,this._preventOutline&&go(this._element),wi(),_n(),!this._moving)){this.fire("down");var n=e.touches?e.touches[0]:e,o=vo(this._element);this._startPoint=new ae(n.clientX,n.clientY),this._startPos=Pe(this._element),this._parentScale=Jo(o);var a=e.type==="mousedown";Ue(document,a?"mousemove":"touchmove",this._onMove,this),Ue(document,a?"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 ae(n.clientX,n.clientY)._subtract(this._startPoint);!o.x&&!o.y||Math.abs(o.x)+Math.abs(o.y)m&&(P=I,m=D);m>o&&(n[P]=1,Ti(e,n,o,a,P),Ti(e,n,o,P,c))}function Wi(e,n){for(var o=[e[0]],a=1,c=0,m=e.length;an&&(o.push(e[a]),c=a);return cn.max.x&&(o|=2),e.yn.max.y&&(o|=8),o}function Gi(e,n){var o=n.x-e.x,a=n.y-e.y;return o*o+a*a}function Pi(e,n,o,a){var c=n.x,m=n.y,P=o.x-c,I=o.y-m,D=P*P+I*I,J;return D>0&&(J=((e.x-c)*P+(e.y-m)*I)/D,J>1?(c=o.x,m=o.y):J>0&&(c+=P*J,m+=I*J)),P=e.x-c,I=e.y-m,a?P*P+I*I:new ae(c,m)}function Ft(e){return!Ce(e[0])||typeof e[0][0]!="object"&&typeof e[0][0]<"u"}function Ci(e){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Ft(e)}function ls(e,n){var o,a,c,m,P,I,D,J;if(!e||e.length===0)throw new Error("latlngs not passed");Ft(e)||(console.warn("latlngs are not flat! Only the first ring will be used"),e=e[0]);var ve=Y([0,0]),Re=st(e),Qe=Re.getNorthWest().distanceTo(Re.getSouthWest())*Re.getNorthEast().distanceTo(Re.getNorthWest());Qe<1700&&(ve=rs(e));var qt=e.length,It=[];for(o=0;oa){D=(m-a)/c,J=[I.x-D*(I.x-P.x),I.y-D*(I.y-P.y)];break}var on=n.unproject(ee(J));return Y([on.lat+ve.lat,on.lng+ve.lng])}var Li={__proto__:null,simplify:pn,pointToSegmentDistance:na,closestPointOnSegment:Ya,clipSegment:Et,_getEdgeIntersection:zn,_getBitCode:bn,_sqClosestPointOnSegment:Pi,isFlat:Ft,_flat:Ci,polylineCenter:ls},Ai={project:function(e){return new ae(e.lng,e.lat)},unproject:function(e){return new Ve(e.y,e.x)},bounds:new xe([-180,-90],[180,90])},us={R:6378137,R_MINOR:6356752314245179e-9,bounds:new xe([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(e){var n=Math.PI/180,o=this.R,a=e.lat*n,c=this.R_MINOR/o,m=Math.sqrt(1-c*c),P=m*Math.sin(a),I=Math.tan(Math.PI/4-a/2)/Math.pow((1-P)/(1+P),m/2);return a=-o*Math.log(Math.max(I,1e-10)),new ae(e.lng*n*o,a)},unproject:function(e){for(var n=180/Math.PI,o=this.R,a=this.R_MINOR/o,c=Math.sqrt(1-a*a),m=Math.exp(-e.y/o),P=Math.PI/2-2*Math.atan(m),I=0,D=.1,J;I<15&&Math.abs(D)>1e-7;I++)J=c*Math.sin(P),J=Math.pow((1-J)/(1+J),c/2),D=Math.PI/2-2*Math.atan(m*J)-P,P+=D;return new Ve(P*n,e.x*n/o)}},Xa={__proto__:null,LonLat:Ai,Mercator:us,SphericalMercator:rt},ot=u({},z,{code:"EPSG:3395",projection:us,transformation:(function(){var e=.5/(Math.PI*us.R);return x(e,.5,-e,.5)})()}),In=u({},z,{code:"EPSG:4326",projection:Ai,transformation:x(1/180,1,-1/180,.5)}),wo=u({},M,{projection:Ai,transformation:x(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,a=n.lat-e.lat;return Math.sqrt(o*o+a*a)},infinite:!0});M.Earth=z,M.EPSG3395=ot,M.EPSG3857=_,M.EPSG900913=w,M.EPSG4326=In,M.Simple=wo;var Kt=ce.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})}}});Xe.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?Ce(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 Ve&&n[0].equals(n[o-1])&&n.pop(),n},_setLatLngs:function(e){Fn.prototype._setLatLngs.call(this,e),Ft(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Ft(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var e=this._renderer._bounds,n=this.options.weight,o=new ae(n,n);if(e=new xe(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 a=0,c=this._rings.length,m;ae.y!=c.y>e.y&&e.x<(c.x-a.x)*(e.y-a.y)/(c.y-a.y)+a.x&&(n=!n);return n||Fn.prototype._containsPoint.call(this,e,!0)}});function yt(e,n){return new Ei(e,n)}var Gt=$n.extend({initialize:function(e,n){F(this,n),this._layers={},e&&this.addData(e)},addData:function(e){var n=Ce(e)?e:e.features,o,a,c;if(n){for(o=0,a=n.length;o0&&c.push(c[0].slice()),c}function H(e,n){return e.feature?u({},e.feature,{geometry:n}):k(n)}function k(e){return e.type==="Feature"||e.type==="FeatureCollection"?e:{type:"Feature",properties:{},geometry:e}}var qe={toGeoJSON:function(e){return H(this,{type:"Point",coordinates:y(this.getLatLng(),e)})}};wn.include(qe),Po.include(qe),To.include(qe),Fn.include({toGeoJSON:function(e){var n=!Ft(this._latlngs),o=f(this._latlngs,n?1:0,!1,e);return H(this,{type:(n?"Multi":"")+"LineString",coordinates:o})}}),Ei.include({toGeoJSON:function(e){var n=!Ft(this._latlngs),o=n&&!Ft(this._latlngs[0]),a=f(this._latlngs,o?2:n?1:0,!0,e);return n||(a=[a]),H(this,{type:(o?"Multi":"")+"Polygon",coordinates:a})}}),Mi.include({toMultiPoint:function(e){var n=[];return this.eachLayer(function(o){n.push(o.toGeoJSON(e).geometry.coordinates)}),H(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",a=[];return this.eachLayer(function(c){if(c.toGeoJSON){var m=c.toGeoJSON(e);if(o)a.push(m.geometry);else{var P=k(m);P.type==="FeatureCollection"?a.push.apply(a,P.features):a.push(P)}}}),o?H(this,{geometries:a,type:"GeometryCollection"}):{type:"FeatureCollection",features:a}}});function Xr(e,n){return new Gt(e,n)}var jc=Xr,sa=Kt.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),F(this,o)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(We(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){it(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&&un(this._image),this},bringToBack:function(){return this._map&&Dt(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:nt("img");if(We(n,"leaflet-image-layer"),this._zoomAnimated&&We(n,"leaflet-zoom-animated"),this.options.className&&We(n,this.options.className),n.onselectstart=A,n.onmousemove=A,n.onload=h(this.fire,this,"load"),n.onerror=h(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(n.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),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;ni(this._image,o,n)},_reset:function(){var e=this._image,n=new xe(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),o=n.getSize();Lt(e,n.min),e.style.width=o.x+"px",e.style.height=o.y+"px"},_updateOpacity:function(){tn(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()}}),Wc=function(e,n,o){return new sa(e,n,o)},Qr=sa.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:nt("video");if(We(n,"leaflet-image-layer"),this._zoomAnimated&&We(n,"leaflet-zoom-animated"),this.options.className&&We(n,this.options.className),n.onselectstart=A,n.onmousemove=A,n.onloadeddata=h(this.fire,this,"load"),e){for(var o=n.getElementsByTagName("source"),a=[],c=0;c0?a:[n.src];return}Ce(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 m=0;mc?(n.height=c+"px",We(e,m)):Ct(e,m),this._containerWidth=this._container.offsetWidth},_animateZoom:function(e){var n=this._map._latLngToNewLayerPoint(this._latlng,e.zoom,e.center),o=this._getAnchor();Lt(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(ti(this._container,"marginBottom"),10)||0,o=this._container.offsetHeight+n,a=this._containerWidth,c=new ae(this._containerLeft,-o-this._containerBottom);c._add(Pe(this._container));var m=e.layerPointToContainerPoint(c),P=ee(this.options.autoPanPadding),I=ee(this.options.autoPanPaddingTopLeft||P),D=ee(this.options.autoPanPaddingBottomRight||P),J=e.getSize(),ve=0,Re=0;m.x+a+D.x>J.x&&(ve=m.x+a-J.x+D.x),m.x-ve-I.x<0&&(ve=m.x-I.x),m.y+o+D.y>J.y&&(Re=m.y+o-J.y+D.y),m.y-Re-I.y<0&&(Re=m.y-I.y),(ve||Re)&&(this.options.keepInView&&(this._autopanning=!0),e.fire("autopanstart").panBy([ve,Re]))}},_getAnchor:function(){return ee(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),qc=function(e,n){return new aa(e,n)};Xe.mergeOptions({closePopupOnClick:!0}),Xe.include({openPopup:function(e,n,o){return this._initOverlay(aa,e,n,o).openOn(this),this},closePopup:function(e){return e=arguments.length?e:this._popup,e&&e.close(),this}}),Kt.include({bindPopup:function(e,n){return this._popup=this._initOverlay(aa,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 $n||(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)){ri(e);var n=e.layer||e.target;if(this._popup._source===n&&!(n instanceof Dn)){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 ra=jn.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(e){jn.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){jn.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=jn.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=nt("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,a=this._map,c=this._container,m=a.latLngToContainerPoint(a.getCenter()),P=a.layerPointToContainerPoint(e),I=this.options.direction,D=c.offsetWidth,J=c.offsetHeight,ve=ee(this.options.offset),Re=this._getAnchor();I==="top"?(n=D/2,o=J):I==="bottom"?(n=D/2,o=0):I==="center"?(n=D/2,o=J/2):I==="right"?(n=0,o=J/2):I==="left"?(n=D,o=J/2):P.xthis.options.maxZoom||oa?this._retainParent(c,m,P,a):!1)},_retainChildren:function(e,n,o,a){for(var c=2*e;c<2*e+2;c++)for(var m=2*n;m<2*n+2;m++){var P=new ae(c,m);P.z=o+1;var I=this._tileCoordsToKey(P),D=this._tiles[I];if(D&&D.active){D.retain=!0;continue}else D&&D.loaded&&(D.retain=!0);o+1this.options.maxZoom||this.options.minZoom!==void 0&&c1){this._setView(e,o);return}for(var Re=c.min.y;Re<=c.max.y;Re++)for(var Qe=c.min.x;Qe<=c.max.x;Qe++){var qt=new ae(Qe,Re);if(qt.z=this._tileZoom,!!this._isValidTile(qt)){var It=this._tiles[this._tileCoordsToKey(qt)];It?It.current=!0:P.push(qt)}}if(P.sort(function(on,Eo){return on.distanceTo(m)-Eo.distanceTo(m)}),P.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var kn=document.createDocumentFragment();for(Qe=0;Qeo.max.x)||!n.wrapLat&&(e.yo.max.y))return!1}if(!this.options.bounds)return!0;var a=this._tileCoordsToBounds(e);return st(this.options.bounds).overlaps(a)},_keyToBounds:function(e){return this._tileCoordsToBounds(this._keyToTileCoords(e))},_tileCoordsToNwSe:function(e){var n=this._map,o=this.getTileSize(),a=e.scaleBy(o),c=a.add(o),m=n.unproject(a,e.z),P=n.unproject(c,e.z);return[m,P]},_tileCoordsToBounds:function(e){var n=this._tileCoordsToNwSe(e),o=new dt(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 ae(+n[0],+n[1]);return o.z=+n[2],o},_removeTile:function(e){var n=this._tiles[e];n&&(it(n.el),delete this._tiles[e],this.fire("tileunload",{tile:n.el,coords:this._keyToTileCoords(e)}))},_initTile:function(e){We(e,"leaflet-tile");var n=this.getTileSize();e.style.width=n.x+"px",e.style.height=n.y+"px",e.onselectstart=A,e.onmousemove=A,ge.ielt9&&this.options.opacity<1&&tn(e,this.options.opacity)},_addTile:function(e,n){var o=this._getTilePos(e),a=this._tileCoordsToKey(e),c=this.createTile(this._wrapCoords(e),h(this._tileReady,this,e));this._initTile(c),this.createTile.length<2&&ze(h(this._tileReady,this,e,null,c)),Lt(c,o),this._tiles[a]={el:c,coords:e,current:!0},n.appendChild(c),this.fire("tileloadstart",{tile:c,coords:e})},_tileReady:function(e,n,o){n&&this.fire("tileerror",{error:n,tile:o,coords:e});var a=this._tileCoordsToKey(e);o=this._tiles[a],o&&(o.loaded=+new Date,this._map._fadeAnimated?(tn(o.el,0),ie(this._fadeFrame),this._fadeFrame=ze(this._updateOpacity,this)):(o.active=!0,this._pruneTiles()),n||(We(o.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:o.el,coords:e})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),ge.ielt9||!this._map._fadeAnimated?ze(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 ae(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 xe(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 Xc(e){return new fs(e)}var Mo=fs.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=F(this,n),n.detectRetina&&ge.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 Ue(o,"load",h(this._tileOnLoad,this,n,o)),Ue(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:ge.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 q(this._url,u(n,this.options))},_tileOnLoad:function(e,n){ge.ielt9?setTimeout(h(e,this,null,n),0):e(null,n)},_tileOnError:function(e,n,o){var a=this.options.errorTileUrl;a&&n.getAttribute("src")!==a&&(n.src=a),e(o,n)},_onTileRemove:function(e){e.tile.onload=null},_getZoomForUrl:function(){var e=this._tileZoom,n=this.options.maxZoom,o=this.options.zoomReverse,a=this.options.zoomOffset;return o&&(e=n-e),e+a},_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=A,n.onerror=A,!n.complete)){n.src=Be;var o=this._tiles[e].coords;it(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",Be),fs.prototype._removeTile.call(this,e)},_tileReady:function(e,n,o){if(!(!this._map||o&&o.getAttribute("src")===Be))return fs.prototype._tileReady.call(this,e,n,o)}});function nl(e,n){return new Mo(e,n)}var il=Mo.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 a in n)a in this.options||(o[a]=n[a]);n=F(this,n);var c=n.detectRetina&&ge.retina?2:1,m=this.getTileSize();o.width=m.x*c,o.height=m.y*c,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,Mo.prototype.onAdd.call(this,e)},getTileUrl:function(e){var n=this._tileCoordsToNwSe(e),o=this._crs,a=Ne(o.project(n[0]),o.project(n[1])),c=a.min,m=a.max,P=(this._wmsVersion>=1.3&&this._crs===In?[c.y,c.x,m.y,m.x]:[c.x,c.y,m.x,m.y]).join(","),I=Mo.prototype.getTileUrl.call(this,e);return I+he(this.wmsParams,I,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+P},setParams:function(e,n){return u(this.wmsParams,e),n||this.redraw(),this}});function Qc(e,n){return new il(e,n)}Mo.WMS=il,nl.wms=Qc;var ui=Kt.extend({options:{padding:.1},initialize:function(e){F(this,e),b(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),We(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),a=this._map.getSize().multiplyBy(.5+this.options.padding),c=this._map.project(this._center,n),m=a.multiplyBy(-o).add(c).subtract(this._map._getNewPixelOrigin(e,n));ge.any3d?ni(this._container,m,o):Lt(this._container,m)},_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 xe(o,o.add(n.multiplyBy(1+e*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),ol=ui.extend({options:{tolerance:0},getEvents:function(){var e=ui.prototype.getEvents.call(this);return e.viewprereset=this._onViewPreReset,e},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){ui.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var e=this._container=document.createElement("canvas");Ue(e,"mousemove",this._onMouseMove,this),Ue(e,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Ue(e,"mouseout",this._handleMouseOut,this),e._leaflet_disable_events=!0,this._ctx=e.getContext("2d")},_destroyContainer:function(){ie(this._redrawRequest),delete this._ctx,it(this._container),mt(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)){ui.prototype._update.call(this);var e=this._bounds,n=this._container,o=e.getSize(),a=ge.retina?2:1;Lt(n,e.min),n.width=a*o.x,n.height=a*o.y,n.style.width=o.x+"px",n.style.height=o.y+"px",ge.retina&&this._ctx.scale(2,2),this._ctx.translate(-e.min.x,-e.min.y),this.fire("update")}},_reset:function(){ui.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,a=n.prev;o?o.prev=a:this._drawLast=a,a?a.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=[],a,c;for(c=0;c')}}catch{}return function(e){return document.createElement("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),ed={_initContainer:function(){this._container=nt("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(ui.prototype._update.call(this),this.fire("update"))},_initPath:function(e){var n=e._container=hs("shape");We(n,"leaflet-vml-shape "+(this.options.className||"")),n.coordsize="1 1",e._path=hs("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;it(n),e.removeInteractiveTarget(n),delete this._layers[b(e)]},_updateStyle:function(e){var n=e._stroke,o=e._fill,a=e.options,c=e._container;c.stroked=!!a.stroke,c.filled=!!a.fill,a.stroke?(n||(n=e._stroke=hs("stroke")),c.appendChild(n),n.weight=a.weight+"px",n.color=a.color,n.opacity=a.opacity,a.dashArray?n.dashStyle=Ce(a.dashArray)?a.dashArray.join(" "):a.dashArray.replace(/( *, *)/g," "):n.dashStyle="",n.endcap=a.lineCap.replace("butt","flat"),n.joinstyle=a.lineJoin):n&&(c.removeChild(n),e._stroke=null),a.fill?(o||(o=e._fill=hs("fill")),c.appendChild(o),o.color=a.fillColor||a.color,o.opacity=a.fillOpacity):o&&(c.removeChild(o),e._fill=null)},_updateCircle:function(e){var n=e._point.round(),o=Math.round(e._radius),a=Math.round(e._radiusY||o);this._setPath(e,e._empty()?"M0 0":"AL "+n.x+","+n.y+" "+o+","+a+" 0,"+65535*360)},_setPath:function(e,n){e._path.v=n},_bringToFront:function(e){un(e._container)},_bringToBack:function(e){Dt(e._container)}},la=ge.vml?hs:K,ps=ui.extend({_initContainer:function(){this._container=la("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=la("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){it(this._container),mt(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){ui.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)),Lt(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=la("path");e.options.className&&We(n,e.options.className),e.options.interactive&&We(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){it(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),a=Math.max(Math.round(e._radiusY),1)||o,c="a"+o+","+a+" 0 1,0 ",m=e._empty()?"M0 0":"M"+(n.x-o)+","+n.y+c+o*2+",0 "+c+-o*2+",0 ";this._setPath(e,m)},_setPath:function(e,n){e._path.setAttribute("d",n)},_bringToFront:function(e){un(e._path)},_bringToBack:function(e){Dt(e._path)}});ge.vml&&ps.include(ed);function al(e){return ge.svg||ge.vml?new ps(e):null}Xe.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&&sl(e)||al(e)}});var rl=Ei.extend({initialize:function(e,n){Ei.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 td(e,n){return new rl(e,n)}ps.create=la,ps.pointsToPath=W,Gt.geometryToLayer=Oi,Gt.coordsToLatLng=ds,Gt.coordsToLatLngs=Ao,Gt.latLngToCoords=y,Gt.latLngsToCoords=f,Gt.getFeature=H,Gt.asFeature=k,Xe.mergeOptions({boxZoom:!0});var ll=fn.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(){Ue(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){mt(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){it(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(),_n(),wi(),this._startPoint=this._map.mouseEventToContainerPoint(e),Ue(document,{contextmenu:ri,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(e){this._moved||(this._moved=!0,this._box=nt("div","leaflet-zoom-box",this._container),We(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(e);var n=new xe(this._point,this._startPoint),o=n.getSize();Lt(this._box,n.min),this._box.style.width=o.x+"px",this._box.style.height=o.y+"px"},_finish:function(){this._moved&&(it(this._box),Ct(this._container,"leaflet-crosshair")),Zn(),cn(),mt(document,{contextmenu:ri,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 dt(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())}});Xe.addInitHook("addHandler","boxZoom",ll),Xe.mergeOptions({doubleClickZoom:!0});var ul=fn.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(),a=n.options.zoomDelta,c=e.originalEvent.shiftKey?o-a:o+a;n.options.doubleClickZoom==="center"?n.setZoom(c):n.setZoomAround(e.containerPoint,c)}});Xe.addInitHook("addHandler","doubleClickZoom",ul),Xe.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var cl=fn.extend({addHooks:function(){if(!this._draggable){var e=this._map;this._draggable=new hn(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))}We(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){Ct(this._map._container,"leaflet-grab"),Ct(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=Ne(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,a=this._draggable._newPos.x,c=(a-n+o)%e+n-o,m=(a+n+o)%e-n-o,P=Math.abs(c+o)0?m:-m))-n;this._delta=0,this._startTime=null,P&&(e.options.scrollWheelZoom==="center"?e.setZoom(n+P):e.setZoomAround(this._lastMousePos,n+P))}});Xe.addInitHook("addHandler","scrollWheelZoom",fl);var nd=600;Xe.mergeOptions({tapHold:ge.touchNative&&ge.safari&&ge.mobile,tapTolerance:15});var hl=fn.extend({addHooks:function(){Ue(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){mt(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 ae(n.clientX,n.clientY),this._holdTimeout=setTimeout(h(function(){this._cancel(),this._isTapValid()&&(Ue(document,"touchend",Mt),Ue(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",n))},this),nd),Ue(document,"touchend touchcancel contextmenu",this._cancel,this),Ue(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function e(){mt(document,"touchend",Mt),mt(document,"touchend touchcancel",e)},_cancel:function(){clearTimeout(this._holdTimeout),mt(document,"touchend touchcancel contextmenu",this._cancel,this),mt(document,"touchmove",this._onMove,this)},_onMove:function(e){var n=e.touches[0];this._newPos=new ae(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)}});Xe.addInitHook("addHandler","tapHold",hl),Xe.mergeOptions({touchZoom:ge.touch,bounceAtZoomLimits:!0});var pl=fn.extend({addHooks:function(){We(this._map._container,"leaflet-touch-zoom"),Ue(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){Ct(this._map._container,"leaflet-touch-zoom"),mt(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]),a=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(a)._divideBy(2))),this._startDist=o.distanceTo(a),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),Ue(document,"touchmove",this._onTouchMove,this),Ue(document,"touchend touchcancel",this._onTouchEnd,this),Mt(e)}},_onTouchMove:function(e){if(!(!e.touches||e.touches.length!==2||!this._zooming)){var n=this._map,o=n.mouseEventToContainerPoint(e.touches[0]),a=n.mouseEventToContainerPoint(e.touches[1]),c=o.distanceTo(a)/this._startDist;if(this._zoom=n.getScaleZoom(c,this._startZoom),!n.options.bounceAtZoomLimits&&(this._zoomn.getMaxZoom()&&c>1)&&(this._zoom=n._limitZoom(this._zoom)),n.options.touchZoom==="center"){if(this._center=this._startLatLng,c===1)return}else{var m=o._add(a)._divideBy(2)._subtract(this._centerPoint);if(c===1&&m.x===0&&m.y===0)return;this._center=n.unproject(n.project(this._pinchStartLatLng,this._zoom).subtract(m),this._zoom)}this._moved||(n._moveStart(!0,!1),this._moved=!0),ie(this._animRequest);var P=h(n._move,n,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=ze(P,this,!0),Mt(e)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,ie(this._animRequest),mt(document,"touchmove",this._onTouchMove,this),mt(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))}});Xe.addInitHook("addHandler","touchZoom",pl),Xe.BoxZoom=ll,Xe.DoubleClickZoom=ul,Xe.Drag=cl,Xe.Keyboard=dl,Xe.ScrollWheelZoom=fl,Xe.TapHold=hl,Xe.TouchZoom=pl,s.Bounds=xe,s.Browser=ge,s.CRS=M,s.Canvas=ol,s.Circle=Po,s.CircleMarker=To,s.Class=oe,s.Control=Ke,s.DivIcon=tl,s.DivOverlay=jn,s.DomEvent=ns,s.DomUtil=nn,s.Draggable=hn,s.Evented=ce,s.FeatureGroup=$n,s.GeoJSON=Gt,s.GridLayer=fs,s.Handler=fn,s.Icon=yn,s.ImageOverlay=sa,s.LatLng=Ve,s.LatLngBounds=dt,s.Layer=Kt,s.LayerGroup=Mi,s.LineUtil=Li,s.Map=Xe,s.Marker=wn,s.Mixin=yo,s.Path=Dn,s.Point=ae,s.PolyUtil=qa,s.Polygon=Ei,s.Polyline=Fn,s.Popup=aa,s.PosAnimation=bo,s.Projection=Xa,s.Rectangle=rl,s.Renderer=ui,s.SVG=ps,s.SVGOverlay=el,s.TileLayer=Mo,s.Tooltip=ra,s.Transformation=kt,s.Util=He,s.VideoOverlay=Qr,s.bind=h,s.bounds=Ne,s.canvas=sl,s.circle=Qa,s.circleMarker=oa,s.control=zt,s.divIcon=Jc,s.extend=u,s.featureGroup=ko,s.geoJSON=Xr,s.geoJson=jc,s.gridLayer=Xc,s.icon=So,s.imageOverlay=Wc,s.latLng=Y,s.latLngBounds=st,s.layerGroup=ia,s.map=is,s.marker=cs,s.point=ee,s.polygon=yt,s.polyline=Co,s.popup=qc,s.rectangle=td,s.setOptions=F,s.stamp=b,s.svg=al,s.svgOverlay=Gc,s.tileLayer=nl,s.tooltip=Yc,s.transformation=x,s.version=l,s.videoOverlay=Kc;var id=window.L;s.noConflict=function(){return window.L=id,this},window.L=s}))})(ws,ws.exports)),ws.exports}var sm=om();const Ii=nm(sm),mu={__name:"DeviceMap",props:{position:{type:Object,default:null},trail:{type:Array,default:()=>[]},aircraft:{type:Array,default:()=>[]}},setup(t){const i=t,s=j(null);let l,u,d,h;const v=new Map;function b(Z,F){const he=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0",pe=F?"#8a94a6":he,q=typeof Z=="number"?Z:0;return Ii.divIcon({className:"plane-marker",iconSize:[22,22],iconAnchor:[11,11],html:``})}function C(Z){const he=[`${Z.callsign||Z.icao24||"aircraft"}`];return Z.country&&he.push(Z.country),typeof Z.altitude=="number"&&he.push(`${Math.round(Z.altitude)} m`),typeof Z.velocity=="number"&&he.push(`${Math.round(Z.velocity*3.6)} km/h`),Z.onGround&&he.push("on ground"),he.join(" · ")}function T(){if(!l)return;h||(h=Ii.layerGroup().addTo(l));const Z=new Set;for(const F of i.aircraft){if(typeof F.lat!="number"||typeof F.lng!="number")continue;Z.add(F.icao24);const he=[F.lat,F.lng];let pe=v.get(F.icao24);pe?(pe.setLatLng(he),pe.setIcon(b(F.heading,F.onGround)),pe.setTooltipContent(C(F))):(pe=Ii.marker(he,{icon:b(F.heading,F.onGround)}).bindTooltip(C(F)),pe.addTo(h),v.set(F.icao24,pe))}for(const[F,he]of v)Z.has(F)||(h.removeLayer(he),v.delete(F))}function A(){if(!l)return;const Z=i.position;if(Z&&(Z.lat||Z.lng)){const F=[Z.lat,Z.lng];u?u.setLatLng(F):(u=Ii.marker(F).addTo(l),l.setView(F,17))}if(d&&d.remove(),i.trail.length){const F=getComputedStyle(document.documentElement).getPropertyValue("--accent").trim()||"#3D7BF0";d=Ii.polyline(i.trail,{color:F,weight:3}).addTo(l)}}_i(()=>{l=Ii.map(s.value,{zoomControl:!0}).setView([20,0],2),Ii.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap",maxZoom:19}).addTo(l),setTimeout(()=>l.invalidateSize(),60),A(),T(),(!i.position||!i.position.lat&&!i.position.lng)&&i.aircraft.length&&B()});let R=!1;function B(){if(R||!l||!i.aircraft.length)return;const Z=i.aircraft.filter(F=>typeof F.lat=="number"&&typeof F.lng=="number").map(F=>[F.lat,F.lng]);Z.length&&(l.fitBounds(Ii.latLngBounds(Z).pad(.2)),R=!0)}return Ho(()=>{l&&l.remove(),l=null}),$t(()=>i.position,A,{deep:!0}),$t(()=>i.trail,A,{deep:!0}),$t(()=>i.aircraft,()=>{T(),(!i.position||!i.position.lat&&!i.position.lng)&&B()},{deep:!0}),(Z,F)=>(p(),g("div",{ref_key:"el",ref:s,class:"h-[320px] w-full rounded-lg"},null,512))}},am=["width","height","stroke-width"],rm=["d"],X={__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,d)=>d?"M"+u:u);return(u,d)=>(p(),g("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),g(ue,null,Fe(Oe(l),(h,v)=>(p(),g("path",{key:v,d:h},null,8,rm))),128))],8,am))}},lm=["aria-checked","disabled"],sn={__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(),g("button",{type:"button",role:"switch","aria-checked":t.modelValue,disabled:t.disabled,class:Ee(["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]=d=>s("update:modelValue",!t.modelValue))},[r("span",{class:Ee(["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,lm))}},um={class:"inline-flex rounded-[10px] border border-line bg-surface-2 p-0.5"},cm=["onClick"],Tn={__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(),g("div",um,[(p(!0),g(ue,null,Fe(t.options,d=>(p(),g("button",{key:d.value,type:"button",class:Ee(["inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[13px] font-semibold transition",t.modelValue===d.value?"bg-surface-1 text-ink shadow-xs":"text-ink-secondary hover:text-ink"]),onClick:h=>s("update:modelValue",d.value)},[d.icon?(p(),at(X,{key:0,name:d.icon,size:15},null,8,["name"])):N("",!0),$(" "+S(d.label),1)],10,cm))),128))]))}},dm={class:"text-sm font-semibold text-ink"},fm={key:0,class:"mt-0.5 text-xs text-ink-muted"},Me={__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=Ps("settingsSearch",{value:""}),l=ye(()=>{const u=(s.value||"").trim().toLowerCase();return u?`${i.title} ${i.desc} ${i.keywords}`.toLowerCase().includes(u):!0});return(u,d)=>l.value?(p(),g("div",{key:0,class:Ee(["border-b border-line py-4 last:border-0",t.block?"":"flex items-center justify-between gap-6"])},[r("div",{class:Ee(t.block?"mb-3":"min-w-0")},[r("div",dm,S(t.title),1),t.desc?(p(),g("div",fm,S(t.desc),1)):N("",!0)],2),r("div",{class:Ee(t.block?"":"shrink-0")},[kf(u.$slots,"default")],2)],2)):N("",!0)}},Us=[{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"}],hm=new Map(Us.map(t=>[t.code,t]));function pm(t){const i=String(t||"").split(",").map(s=>Number(s.trim()));return i.length!==4||i.some(s=>Number.isNaN(s))?null:i}function mm(t){const i=hm.get(t);return i?i.bbox:""}function pr(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 Us){const d=pm(u.bbox);if(!d)continue;const[h,v,b,C]=d;if(tb||iC)continue;const T=Math.abs(b-h)*Math.abs(C-v);Tt.continent==="EU").slice().sort((t,i)=>t.name.localeCompare(i.name)).map(t=>({value:t.bbox,label:t.name}))}function vm(){return Us.slice().sort((t,i)=>t.name.localeCompare(i.name)).map(t=>[t.code,t.name])}const _m=[["EU","European countries"],["AS","Asian countries"],["AF","African countries"],["NA","North American countries"],["SA","South American countries"],["OC","Oceanian countries"]];function bm(){return _m.map(([t,i])=>({label:i,options:Us.filter(s=>s.continent===t).slice().sort((s,l)=>s.name.localeCompare(l.name)).map(s=>({value:s.bbox,label:s.name}))}))}const ym=(t,i)=>{const s=t.__vccOpts||t;for(const[l,u]of i)s[l]=u;return s},xm={class:"mx-auto max-w-[1280px] p-7"},wm={class:"mb-5 flex flex-wrap items-end justify-between gap-4"},km={class:"flex h-10 w-full max-w-[280px] items-center gap-2 rounded border border-line-strong bg-surface-1 px-3"},Sm={class:"grid grid-cols-[210px_1fr] gap-6 max-[760px]:grid-cols-1"},Tm={class:"flex flex-col gap-0.5 max-[760px]:flex-row max-[760px]:overflow-x-auto"},Pm=["onClick"],Cm={class:"whitespace-nowrap"},Lm={class:"min-w-0"},Am={key:0,class:"panel p-10 text-center text-sm text-ink-muted"},Mm={key:0,class:"eyebrow mb-2 mt-5 first:mt-0 flex items-center gap-2"},Em={key:1,class:"panel mb-5 p-5"},Om={class:"flex items-center gap-1"},zm={class:"flex items-center gap-2"},Im={class:"font-mono text-sm text-ink"},$m={class:"inline-flex items-center gap-1 rounded-full bg-amber-soft px-2 py-0.5 text-[11px] font-semibold text-amber-fg"},Nm={key:0,class:"mt-2 text-xs text-ink-muted"},Dm={class:"grid max-w-[420px] gap-2"},Fm={class:"flex items-center gap-3"},Rm={key:2,class:"panel mb-5 p-5"},Bm=["value"],Um=["value"],Vm=["value"],Zm={class:"font-mono text-sm text-ink"},Hm={key:3},jm={key:0,class:"mb-5 flex items-center gap-1 overflow-x-auto border-b border-line"},Wm=["onClick"],Km={key:1,class:"panel mb-5 p-5"},Gm={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},qm={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Ym={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Jm={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"},Xm={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Qm={key:0},eg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},tg={class:"font-semibold text-ink-secondary"},ng={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},ig={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"},og={class:"flex items-center justify-between gap-3"},sg={class:"flex items-center gap-2 text-sm font-semibold text-ink"},ag={key:0,class:"text-[11px] text-ink-muted"},rg={class:"mt-2 flex items-baseline gap-1.5"},lg={class:"font-mono text-2xl font-semibold text-ink"},ug={class:"text-sm text-ink-muted"},cg={class:"mt-2 h-2 w-full overflow-hidden rounded-full bg-line"},dg={class:"mt-2 text-xs text-ink-muted"},fg={class:"mt-2 text-sm text-ink"},hg={class:"font-semibold"},pg={class:"mt-1 text-xs text-ink-muted"},mg={key:1,class:"mt-2 text-xs text-ink-muted"},gg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},vg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},_g={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},bg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},yg={key:1,class:"flex flex-col items-end gap-2"},xg={key:0,value:"__auto__"},wg=["label"],kg=["value"],Sg={key:0,class:"w-64 text-right text-[11px] leading-snug text-ink-muted"},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:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Lg={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"},Ag={key:8,class:"border-b border-line py-3 text-xs text-amber-fg"},Mg={class:"mt-4 flex flex-wrap items-center gap-3"},Eg=["disabled"],Og={key:1,class:"flex items-center gap-2",title:"Bounding box used for Test connection — smaller areas cost fewer OpenSky credits"},zg=["label"],Ig=["value"],$g=["disabled"],Ng={key:3,class:"text-xs text-danger-fg"},Dg={class:"panel mb-5 p-5"},Fg={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},Rg={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Bg={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Ug={key:1,class:"mb-4 flex flex-col gap-2 border-b border-line pb-4 sm:flex-row sm:items-center sm:justify-between"},Vg={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Zg={key:0},Hg={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},jg={class:"font-semibold text-ink-secondary"},Wg={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Kg={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},Gg={key:0,class:"inline-flex items-center gap-1 rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-ink-secondary"},qg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Yg={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"},Jg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Xg={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"},Qg={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},ev={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"},tv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},nv={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"},iv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},ov={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"},sv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},av={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"},lv={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 text-sm text-ink"},cv={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"},dv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},fv={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"},hv={class:"mt-4 flex flex-wrap items-center gap-3"},pv=["disabled"],mv=["disabled"],gv={key:2,class:"text-xs text-danger-fg"},vv={key:3,class:"text-[11px] text-ink-muted"},_v={class:"panel mb-5 p-5"},bv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},yv={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},xv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},wv={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"},kv={key:4,class:"border-b border-line py-3 text-xs text-amber-fg"},Sv={key:0},Tv={key:5,class:"border-b border-line py-3 text-xs text-ink-muted"},Pv={class:"font-semibold text-ink-secondary"},Cv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Lv={key:0,class:"inline-flex items-center gap-2 break-all font-mono text-sm text-ink"},Av={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"},Mv={key:0,class:"inline-flex items-center gap-2 font-mono text-sm text-ink"},Ev={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"},zv={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"},Iv={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},$v={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 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={class:"mt-4 flex flex-wrap items-center gap-3"},Rv=["disabled"],Bv=["disabled"],Uv={key:2,class:"text-xs text-danger-fg"},Vv={key:3,class:"text-[11px] text-ink-muted"},Zv={key:3,class:"panel mb-5 p-5"},Hv={class:"mb-4 flex items-start gap-3 border-b border-line pb-4"},jv={class:"grid h-10 w-10 place-items-center rounded-lg bg-accent-soft text-accent-soft-fg"},Wv={key:0,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Kv={key:1,class:"mb-4 rounded-lg border border-line bg-surface-2 px-4 py-3 text-xs text-ink-secondary"},Gv={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"},qv={key:5,class:"border-b border-line py-3 text-xs text-amber-fg"},Yv={key:0},Jv={key:6,class:"border-b border-line py-3 text-xs text-ink-muted"},Xv={class:"font-semibold text-ink-secondary"},Qv={key:7,class:"border-b border-line py-3 text-xs text-ink-muted"},e_={class:"flex w-full flex-col gap-2"},t_={class:"break-all 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_={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"},o_={key:0,class:"text-xs text-ink-muted"},s_={key:1,class:"border-b border-line py-3 text-xs text-ink-muted"},a_={key:0,class:"inline-flex items-center gap-2 text-sm text-ink"},r_={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"},u_=["disabled"],c_=["disabled"],d_={key:2,class:"text-xs text-danger-fg"},f_={key:3,class:"text-[11px] text-ink-muted"},h_={key:4,class:"panel mb-5 p-5"},p_={class:"flex items-center gap-4"},m_=["src"],g_={key:1,class:"grid h-16 w-16 place-items-center rounded-full bg-[var(--navy-800)] text-lg font-bold text-white"},v_={class:"flex gap-2"},__={class:"btn-ghost cursor-pointer"},b_={class:"mt-1 text-right text-[11px] text-ink-muted"},y_={key:5,class:"panel mb-5 p-5"},x_={class:"flex items-center gap-3"},w_={key:0,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},k_={class:"flex flex-wrap items-center gap-4"},S_={class:"min-w-0"},T_={class:"mt-1 select-all font-mono text-sm font-bold text-ink"},P_={class:"mt-3 flex items-center gap-2"},C_={key:0,class:"mt-2 text-xs text-danger-fg"},L_={key:1,class:"mt-4 rounded-lg border border-line bg-surface-2 p-4"},A_={class:"mt-2 grid grid-cols-2 gap-1 font-mono text-xs text-ink-secondary sm:grid-cols-4"},M_={class:"rounded-lg border border-line bg-surface-2 p-3"},E_={class:"flex items-center gap-3"},O_={class:"grid h-9 w-9 place-items-center rounded-full bg-accent-soft text-accent-soft-fg"},z_={class:"min-w-0 flex-1"},I_={class:"text-sm font-semibold text-ink"},$_={class:"font-mono text-[11px] text-ink-muted"},N_={key:6,class:"mb-5"},D_={key:0,class:"panel mb-5 p-5"},F_={class:"grid max-w-[520px] gap-2"},R_={class:"flex flex-wrap gap-2"},B_=["disabled","title"],U_=["value"],V_=["value"],Z_={class:"flex items-center gap-2 py-1 text-sm text-ink-secondary"},H_={class:"flex items-center gap-3"},j_=["disabled"],W_={key:0,class:"text-xs text-danger-fg"},K_={key:1,class:"text-xs text-ink-muted"},G_={key:1,class:"panel mb-5 p-5"},q_={class:"grid max-w-[520px] gap-2"},Y_={class:"flex flex-wrap gap-2"},J_=["value"],X_=["value"],Q_={key:1,class:"text-xs text-ink-muted"},e1={class:"font-semibold text-ink-secondary"},t1={class:"flex items-center gap-3"},n1=["disabled"],i1={key:0,class:"text-xs text-danger-fg"},o1={class:"panel overflow-hidden p-0"},s1={class:"flex items-center justify-between px-5 py-4"},a1=["disabled"],r1={key:0,class:"px-5 pb-5 text-sm text-danger-fg"},l1={key:1,class:"px-5 pb-8 text-sm text-ink-muted"},u1={key:2,class:"overflow-x-auto"},c1={class:"w-full border-collapse text-sm"},d1={class:"text-left"},f1={class:"px-5 py-3"},h1={class:"text-ink"},p1={key:0,class:"ml-1.5 text-[11px] text-ink-muted"},m1={class:"px-5 py-3"},g1={class:"px-5 py-3"},v1={class:"px-5 py-3"},_1={class:"px-5 py-3 text-right"},b1=["onClick"],y1={key:1,class:"inline-flex items-center gap-1.5"},x1=["onClick"],w1=["onClick"],k1={key:7,class:"mb-5"},S1={key:0,class:"panel mb-5 p-5"},T1={class:"grid max-w-[520px] gap-2"},P1={class:"flex items-center gap-3"},C1={key:0,class:"text-xs text-danger-fg"},L1={key:1,class:"panel mb-5 p-5"},A1={class:"grid max-w-[520px] gap-2"},M1={class:"flex items-center gap-3"},E1=["disabled"],O1={key:0,class:"text-xs text-danger-fg"},z1={class:"panel overflow-hidden p-0"},I1={key:0,class:"px-5 pb-8 text-sm text-ink-muted"},$1={key:1,class:"overflow-x-auto"},N1={class:"w-full border-collapse text-sm"},D1={class:"text-left"},F1={class:"px-5 py-3"},R1={class:"inline-flex items-center gap-2 text-ink"},B1={class:"px-5 py-3 text-ink-secondary"},U1={class:"px-5 py-3 text-right"},V1=["onClick"],Z1={key:1,class:"inline-flex items-center gap-1.5"},H1=["onClick"],j1=["disabled","title","onClick"],W1={key:8,class:"mb-5"},K1={class:"panel mb-5 p-5"},G1={class:"btn-ghost cursor-pointer"},q1={key:0,class:"mt-2 text-xs text-ink-muted"},Y1={class:"rounded-lg border p-5",style:{"border-color":"color-mix(in srgb, var(--danger) 35%, transparent)",background:"var(--danger-soft)"}},J1={class:"flex items-center gap-2 text-danger-fg"},X1={class:"mt-4 rounded-lg border border-line bg-surface-1 p-4"},Q1={class:"mt-3 flex items-start gap-2 text-sm text-ink-secondary"},eb={class:"mt-3"},tb={class:"eyebrow mb-1 block"},nb={class:"text-ink"},ib=["placeholder"],ob={class:"mt-4 flex flex-wrap items-center gap-3"},sb=["disabled"],ab=["disabled"],rb={key:2,class:"text-xs text-ink-muted"},lb={key:0,class:"mt-3 rounded border border-line bg-surface-2 px-3 py-2 text-xs text-ink-secondary"},ub={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"},gu="pv.opensky.health",vu="pv.filetransfer.health",_u="pv.webdav.health",bu="pv.localstorage.health",cb={__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=ye(()=>s.role==="superadmin"),d=ye(()=>s.role==="admin"||s.role==="superadmin");function h(y){return y==="superadmin"?"Superadmin":y==="admin"?"Admin":"User"}function v(y){return y==="superadmin"||y==="admin"?"shield":"user"}function b(y){return y==="superadmin"||y==="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=ye(()=>{const y=[{id:"account",label:"Account",icon:"user",kw:"name username email password verification login credentials role"},{id:"appearance",label:"Appearance",icon:"sliders",kw:"theme light dark system language region font size accessibility date time format motion"},{id:"integrations",label:"Integrations",icon:"radio",kw:"opensky flights adsb aircraft plugin oauth credentials bounding box plan connection ftp sftp ftps file transfer server host upload download local storage folder drive isolated private read only webdav nextcloud owncloud dav url https"},{id:"profile",label:"Profile",icon:"image",kw:"avatar photo display name bio public"},{id:"security",label:"Privacy & Security",icon:"shield",kw:"two factor authentication 2fa sessions devices logout security privacy"}];return d.value&&y.push({id:"team",label:"User management",icon:"users",kw:"users team members add remove create delete role admin permissions rights organization"}),u.value&&y.push({id:"organizations",label:"Organizations",icon:"grid",kw:"organization org tenant company create rename delete members"}),y.push({id:"advanced",label:"Advanced",icon:"alertTriangle",kw:"export import data delete account danger zone",danger:!0}),y}),A=j("account"),R=j("");Yu("settingsSearch",R);const B=ye(()=>R.value.trim().length>0),Z=ye(()=>R.value.trim().toLowerCase());function F(y){return Z.value?(y.label+" "+y.kw).toLowerCase().includes(Z.value)||pe(y.id):!0}const he={account:["full name","username","email address verification verify","password change current new"],appearance:["theme light dark system","language","region","font size accessibility","reduce motion","date format","time format clock"],integrations:["opensky live flights","enable plugin","oauth client id secret","plan credits","bounding box","test connection","file transfer ftp sftp ftps","server host port username password","private key passphrase","base path directory","local storage folder drive","private isolated folder","read only access mode","webdav nextcloud owncloud dav","server url username password tls","base path directory folder"],profile:["profile photo avatar","display name","bio about","show email public"],security:["two factor authentication","active sessions devices","sign out"],team:["add user create account","members list role admin remove delete","organization org assign"],organizations:["add organization create","rename organization","delete organization members"],advanced:["export data download","import data upload","delete account permanent danger"]};function pe(y){return Z.value?(he[y]||[]).some(f=>f.includes(Z.value)):!0}const q=ye(()=>B.value?T.value.filter(F):T.value.filter(y=>y.id===A.value)),Ce=ye({get:()=>oo.value,set:y=>Aa(y)}),fe=[{value:"light",label:"Light",icon:"sun"},{value:"dark",label:"Dark",icon:"moon"},{value:"system",label:"System",icon:"monitor"}],Be=[{value:"sm",label:"Small"},{value:"md",label:"Default"},{value:"lg",label:"Large"}],$e=[{value:"12",label:"12-hour"},{value:"24",label:"24-hour"}],Ie=[["en","English"],["es","Español"],["de","Deutsch"],["fr","Français"],["pl","Polski"],["ja","日本語"]],Ge=vm(),be=ye(()=>(Ge.find(([y])=>y===_e.region)||[null,_e.region])[1]),we=[["MDY","MM/DD/YYYY"],["DMY","DD/MM/YYYY"],["YMD","YYYY/MM/DD"],["ISO","YYYY-MM-DD"]],ze=j(Date.now());let ie=null;const He=ye(()=>fu(ze.value)),oe=St({loaded:!1,available:!1,orgEnabled:!0,allowAnonymous:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),je=j("user"),le=St({clientId:"",clientSecret:"",plan:"",bbox:""}),ce=j(""),ae=j(!1),tt=j(!1),ee=j(null),xe=j(null),Ne=ye(()=>ee.value&&ee.value.credits||null),dt=ye(()=>{const y=Ne.value;return!y||!y.daily||y.remaining==null?null:Math.max(0,Math.min(100,Math.round(y.remaining/y.daily*100)))}),st=ye(()=>{const y=dt.value;return y==null?"bg-accent":y<=10?"bg-danger":y<=30?"bg-amber":"bg-success"});function Ve(y){return typeof y=="number"?y.toLocaleString():y}function Y(){if(!xe.value)return"";const y=Math.max(0,Math.round((Date.now()-xe.value)/1e3));if(y<60)return"just now";const f=Math.round(y/60);if(f<60)return`${f} min ago`;const H=Math.round(f/60);return H<24?`${H} h ago`:`${Math.round(H/24)} d ago`}function M(){try{ee.value&&localStorage.setItem(gu,JSON.stringify({health:ee.value,ts:xe.value}))}catch{}}function z(){try{const y=localStorage.getItem(gu);if(!y)return;const f=JSON.parse(y);f&&f.health&&(ee.value=f.health,xe.value=f.ts||null)}catch{}}const vt=[{value:"",label:"Not set"},{value:"anonymous",label:"Anonymous"},{value:"standard",label:"Standard"},{value:"contributor",label:"Contributor"}],rt=[{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:gm()},{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"}]}],x=kt.flatMap(y=>y.options);function _(y){const f=String(y||"").split(",").map(k=>k.trim());if(f.length!==4)return"";const H=f.map(Number);return H.some(k=>Number.isNaN(k))?"":H.join(",")}function w(y){const f=_(y),H=f&&x.find(k=>_(k.value)===f);return H?H.label:""}const K=j(!1),W=ye({get(){if(!me.value&&_e.autoBbox)return"__auto__";if(K.value)return"__custom__";const y=_(le.bbox),f=y&&x.find(H=>_(H.value)===y);return f?f.value:"__custom__"},set(y){if(y==="__auto__"){me.value||(_e.autoBbox=!0),K.value=!1;return}if(me.value||(_e.autoBbox=!1),y==="__custom__"){K.value=!0;return}K.value=!1,le.bbox=y}}),V=ye(()=>W.value==="__custom__"),re=ye(()=>W.value==="__auto__"),te=ye(()=>oe.isSuperadmin),Q=ye(()=>oe.isSuperadmin?"user":je.value),G=ye(()=>oe.scopes[Q.value]||{editableLayer:"user",fields:{}}),me=ye(()=>Q.value==="org");function se(y){return G.value.fields[y]||{effective:"",own:"",source:"unset",locked:!1}}function Te(y){return te.value||se(y).locked}function Ae(y){const f=se(y).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function Ze(){le.clientId=se("clientId").own||"",le.clientSecret=se("clientSecret").own||"",le.plan=se("plan").own||"",le.bbox=se("bbox").own||"",K.value=!1}function et(y){oe.available=!!y.available,oe.orgEnabled=y.orgEnabled!==!1,oe.allowAnonymous=!!y.allowAnonymous,oe.enabled=!!y.enabled,oe.canEditOrg=!!y.canEditOrg,oe.isSuperadmin=!!y.isSuperadmin,oe.scopes=y.scopes||{},je.value==="org"&&!oe.canEditOrg&&(je.value="user"),Ze(),oe.loaded=!0}$t(je,()=>{ce.value="",Ze()});async function U(){z();const{ok:y,body:f}=await dp();y&&et(f)}async function O(y){const f=me.value;f?oe.orgEnabled=y:oe.enabled=y;const{ok:H,body:k}=await lu(f?{scope:"org",enabled:y}:{scope:"user",enabled:y});H?(et(k),Ke(f?y?"OpenSky enabled for your organization.":"OpenSky disabled for your organization.":y?"OpenSky enabled.":"OpenSky disabled.")):(f?oe.orgEnabled=!y:oe.enabled=!y,Ke(k.error||"Could not update."))}async function ke(){ce.value="",ae.value=!0;const y={};for(const qe of["clientId","clientSecret","plan","bbox"])Te(qe)||(y[qe]=le[qe]);const f={scope:Q.value,config:y};me.value||(f.enabled=oe.enabled);const{ok:H,body:k}=await lu(f);if(ae.value=!1,!H){ce.value=k.error||"Could not save settings.";return}et(k),Ke(me.value?"Organization OpenSky settings saved.":"OpenSky settings saved.")}const Ye=[{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"}]},...bm()],gt=Ye.flatMap(y=>y.options),bt=j(""),en=j(!1),de=ye({get(){if(en.value)return"__custom__";if(!bt.value)return"__default__";const y=_(bt.value),f=y&>.find(H=>_(H.value)===y);return f?f.value:"__custom__"},set(y){if(y==="__default__"){en.value=!1,bt.value="";return}if(y==="__custom__"){en.value=!0;return}en.value=!1,bt.value=y}}),wt=ye(()=>de.value==="__custom__");async function an(){tt.value=!0,ee.value=null;const{ok:y,body:f}=await fp((bt.value||"").trim()||void 0);tt.value=!1,ee.value=y&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},xe.value=Date.now(),M()}function so(y){return y==="ok"?C.success:y==="degraded"?C.warning:C.danger}const lt=St({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),ei=j("user"),ao=["protocol","host","port","username","password","privateKey","keyPassphrase","hostKeyFingerprint","insecureSkipVerify","basePath"],ft=St(Object.fromEntries(ao.map(y=>[y,""]))),Ui=j(""),ro=j(!1),lo=j(!1),Mn=j(null),yi=j(null),Vs=[{value:"sftp",label:"SFTP"},{value:"ftps",label:"FTPS"},{value:"ftp",label:"FTP"}],jo=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],Wo=ye(()=>lt.isSuperadmin),Ko=ye(()=>lt.isSuperadmin?"user":ei.value),Va=ye(()=>lt.scopes[Ko.value]||{editableLayer:"user",fields:{}}),gn=ye(()=>Ko.value==="org"),jt=ye(()=>(Wt("protocol")?ge("protocol").effective:ft.protocol)||"sftp");function ge(y){return Va.value.fields[y]||{effective:"",own:"",source:"unset",locked:!1}}function Wt(y){return Wo.value||ge(y).locked}function Pt(y){const f=ge(y).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function Zs(y){return(Vs.find(f=>f.value===y)||{}).label||y||"—"}function Go(){for(const y of ao)ft[y]=ge(y).own||"";ft.protocol||(ft.protocol="sftp"),ft.insecureSkipVerify||(ft.insecureSkipVerify="false")}function Vi(y){lt.available=!!y.available,lt.orgEnabled=y.orgEnabled!==!1,lt.enabled=!!y.enabled,lt.canEditOrg=!!y.canEditOrg,lt.isSuperadmin=!!y.isSuperadmin,lt.scopes=y.scopes||{},ei.value==="org"&&!lt.canEditOrg&&(ei.value="user"),Go(),lt.loaded=!0}$t(ei,()=>{Ui.value="",Go()});function Hs(){if(!yi.value)return"";const y=Math.max(0,Math.round((Date.now()-yi.value)/1e3));if(y<60)return"just now";const f=Math.round(y/60);if(f<60)return`${f} min ago`;const H=Math.round(f/60);return H<24?`${H} h ago`:`${Math.round(H/24)} d ago`}function xi(){try{Mn.value&&localStorage.setItem(vu,JSON.stringify({health:Mn.value,ts:yi.value}))}catch{}}function js(){try{const y=localStorage.getItem(vu);if(!y)return;const f=JSON.parse(y);f&&f.health&&(Mn.value=f.health,yi.value=f.ts||null)}catch{}}async function Za(){js();const{ok:y,body:f}=await pp();y&&Vi(f)}async function Ws(y){const f=gn.value;f?lt.orgEnabled=y:lt.enabled=y;const{ok:H,body:k}=await uu(f?{scope:"org",enabled:y}:{scope:"user",enabled:y});H?(Vi(k),Ke(f?y?"File transfer enabled for your organization.":"File transfer disabled for your organization.":y?"File transfer enabled.":"File transfer disabled.")):(f?lt.orgEnabled=!y:lt.enabled=!y,Ke(k.error||"Could not update."))}async function Ha(){Ui.value="",ro.value=!0;const y={};for(const qe of ao)Wt(qe)||(y[qe]=ft[qe]);const f={scope:Ko.value,config:y};gn.value||(f.enabled=lt.enabled);const{ok:H,body:k}=await uu(f);if(ro.value=!1,!H){Ui.value=k.error||"Could not save settings.";return}Vi(k),Ke(gn.value?"Organization file-transfer settings saved.":"File-transfer settings saved.")}async function ja(){lo.value=!0,Mn.value=null;const{ok:y,body:f}=await mp();lo.value=!1,Mn.value=y&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},yi.value=Date.now(),xi()}function Ks(y){return y==="ok"?C.success:y==="degraded"?C.warning:C.danger}const ut=St({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,scopes:{}}),En=j("user"),qo=["baseURL","username","password","insecureSkipVerify","basePath"],Bt=St(Object.fromEntries(qo.map(y=>[y,""]))),Zi=j(""),uo=j(!1),co=j(!1),rn=j(null),vn=j(null),Gs=[{value:"false",label:"Verify certificate"},{value:"true",label:"Skip verification"}],fo=ye(()=>ut.isSuperadmin),ti=ye(()=>ut.isSuperadmin?"user":En.value),nt=ye(()=>ut.scopes[ti.value]||{editableLayer:"user",fields:{}}),it=ye(()=>ti.value==="org");function ln(y){return nt.value.fields[y]||{effective:"",own:"",source:"unset",locked:!1}}function un(y){return fo.value||ln(y).locked}function Dt(y){const f=ln(y).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function ho(){for(const y of qo)Bt[y]=ln(y).own||"";Bt.insecureSkipVerify||(Bt.insecureSkipVerify="false")}function We(y){ut.available=!!y.available,ut.orgEnabled=y.orgEnabled!==!1,ut.enabled=!!y.enabled,ut.canEditOrg=!!y.canEditOrg,ut.isSuperadmin=!!y.isSuperadmin,ut.scopes=y.scopes||{},En.value==="org"&&!ut.canEditOrg&&(En.value="user"),ho(),ut.loaded=!0}$t(En,()=>{Zi.value="",ho()});function Ct(){if(!vn.value)return"";const y=Math.max(0,Math.round((Date.now()-vn.value)/1e3));if(y<60)return"just now";const f=Math.round(y/60);if(f<60)return`${f} min ago`;const H=Math.round(f/60);return H<24?`${H} h ago`:`${Math.round(H/24)} d ago`}function Yo(){try{rn.value&&localStorage.setItem(_u,JSON.stringify({health:rn.value,ts:vn.value}))}catch{}}function po(){try{const y=localStorage.getItem(_u);if(!y)return;const f=JSON.parse(y);f&&f.health&&(rn.value=f.health,vn.value=f.ts||null)}catch{}}async function tn(){po();const{ok:y,body:f}=await _p();y&&We(f)}async function qs(y){const f=it.value;f?ut.orgEnabled=y:ut.enabled=y;const{ok:H,body:k}=await cu(f?{scope:"org",enabled:y}:{scope:"user",enabled:y});H?(We(k),Ke(f?y?"WebDAV enabled for your organization.":"WebDAV disabled for your organization.":y?"WebDAV enabled.":"WebDAV disabled.")):(f?ut.orgEnabled=!y:ut.enabled=!y,Ke(k.error||"Could not update."))}async function mo(){Zi.value="",uo.value=!0;const y={};for(const qe of qo)un(qe)||(y[qe]=Bt[qe]);const f={scope:ti.value,config:y};it.value||(f.enabled=ut.enabled);const{ok:H,body:k}=await cu(f);if(uo.value=!1,!H){Zi.value=k.error||"Could not save settings.";return}We(k),Ke(it.value?"Organization WebDAV settings saved.":"WebDAV settings saved.")}async function ni(){co.value=!0,rn.value=null;const{ok:y,body:f}=await bp();co.value=!1,rn.value=y&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."},vn.value=Date.now(),Yo()}function Lt(y){return y==="ok"?C.success:y==="degraded"?C.warning:C.danger}const Pe=St({loaded:!1,available:!1,orgEnabled:!0,enabled:!1,canEditOrg:!1,isSuperadmin:!1,isOrgUser:!1,mounts:[],privateFolder:!1,privateEnabled:!1,allowPrivate:!0,rootConfigured:!1,scopes:{}}),_n=j("user"),Zn=j(""),ii=j(""),Hn=j(!1),wi=j(!1),cn=j(null),On=j(null),oi=j({}),go=[{value:"",label:"Inherit"},{value:"false",label:"Read-write"},{value:"true",label:"Read-only"}],ki=ye(()=>Pe.isSuperadmin),vo=ye(()=>Pe.isSuperadmin?"user":_n.value),Jo=ye(()=>Pe.scopes[vo.value]||{editableLayer:"user",fields:{}}),nn=ye(()=>vo.value==="org");function Ue(y){return Jo.value.fields[y]||{effective:"",own:"",source:"unset",locked:!1}}function dn(y){return ki.value||Ue(y).locked}function mt(y){const f=Ue(y).source;return f==="global"?"Set by administrator":f==="org"?"Set by your organization":""}function Ys(y){return(go.find(f=>f.value===y)||{}).label||"Inherit"}function _o(){Zn.value=Ue("readOnly").own||""}function si(y){Pe.available=!!y.available,Pe.orgEnabled=y.orgEnabled!==!1,Pe.enabled=!!y.enabled,Pe.canEditOrg=!!y.canEditOrg,Pe.isSuperadmin=!!y.isSuperadmin,Pe.isOrgUser=!!y.isOrgUser,Pe.mounts=Array.isArray(y.mounts)?y.mounts:[],Pe.privateFolder=!!y.privateFolder,Pe.privateEnabled=!!y.privateEnabled,Pe.allowPrivate=y.allowPrivate!==!1,Pe.rootConfigured=!!y.rootConfigured,Pe.scopes=y.scopes||{},_n.value==="org"&&!Pe.canEditOrg&&(_n.value="user"),_o(),Pe.loaded=!0}$t(_n,()=>{ii.value="",_o()});function Xo(){if(!On.value)return"";const y=Math.max(0,Math.round((Date.now()-On.value)/1e3));if(y<60)return"just now";const f=Math.round(y/60);if(f<60)return`${f} min ago`;const H=Math.round(f/60);return H<24?`${H} h ago`:`${Math.round(H/24)} d ago`}function ai(){try{cn.value&&localStorage.setItem(bu,JSON.stringify({health:cn.value,ts:On.value}))}catch{}}function Qo(){try{const y=localStorage.getItem(bu);if(!y)return;const f=JSON.parse(y);f&&f.health&&(cn.value=f.health,On.value=f.ts||null)}catch{}}async function Hi(){Qo();const{ok:y,body:f}=await gp();y&&si(f)}async function Mt(y){const f=nn.value;f?Pe.orgEnabled=y:Pe.enabled=y;const{ok:H,body:k}=await ma(f?{scope:"org",enabled:y}:{scope:"user",enabled:y});H?(si(k),Ke(f?y?"Local storage enabled for your organization.":"Local storage disabled for your organization.":y?"Local storage enabled.":"Local storage disabled.")):(f?Pe.orgEnabled=!y:Pe.enabled=!y,Ke(k.error||"Could not update."))}async function ri(y){Pe.privateFolder=y;const{ok:f,body:H}=await ma({scope:"user",privateFolder:y});f?(si(H),Ke(y?"Private folder enabled.":"Private folder disabled.")):(Pe.privateFolder=!y,Ke(H.error||"Could not update."))}async function Js(y){Pe.allowPrivate=y;const{ok:f,body:H}=await ma({scope:"org",allowPrivate:y});f?(si(H),Ke(y?"Members may now create private folders.":"Private folders disabled for your organization.")):(Pe.allowPrivate=!y,Ke(H.error||"Could not update."))}async function Xs(){ii.value="",Hn.value=!0;const y={};dn("readOnly")||(y.readOnly=Zn.value);const f={scope:vo.value,config:y};nn.value||(f.enabled=Pe.enabled);const{ok:H,body:k}=await ma(f);if(Hn.value=!1,!H){ii.value=k.error||"Could not save settings.";return}si(k),Ke(nn.value?"Organization local-storage settings saved.":"Local-storage settings saved.")}async function Wa(){wi.value=!0,cn.value=null,oi.value={};const{ok:y,body:f}=await vp();wi.value=!1,cn.value=y&&f.health?f.health:{status:"down",detail:f.error||"Probe failed."};const H={};if(Array.isArray(f.mounts))for(const k of f.mounts)H[k.id]={status:k.status,detail:k.detail};oi.value=H,On.value=Date.now(),ai()}function es(y){return y==="ok"?C.success:y==="degraded"?C.warning:C.danger}const ts=[{id:"apis-external",label:"APIs — External",icon:"globe"},{id:"drives-external",label:"Drives — External",icon:"server"},{id:"drives-local",label:"Drives — Local",icon:"monitor"}],ns=j("apis-external");function bo(y){return B.value||ns.value===y}const Xe=j("");let is=null;function Ke(y){Xe.value=y,clearTimeout(is),is=setTimeout(()=>Xe.value="",2200)}const zt=St({current:"",next:"",confirm:""}),li=j(""),Qs=j(!1);function os(){if(Qs.value=!1,!zt.current)return li.value="Enter your current password.";if(zt.next.length<8)return li.value="New password must be at least 8 characters.";if(zt.next!==zt.confirm)return li.value="New passwords do not match.";li.value="Validated. Connecting to the account service is pending — no password endpoint yet.",zt.current=zt.next=zt.confirm=""}const ss=j("");function ea(){ss.value="Verification link would be sent once the account service is wired up."}function Ka(y){const f=y.target.files&&y.target.files[0];if(!f)return;if(f.size>1.5*1024*1024){Ke("Image too large (max ~1.5 MB).");return}const H=new FileReader;H.onload=()=>{_e.avatar=String(H.result),Ke("Photo updated.")},H.readAsDataURL(f)}function Ga(){_e.avatar="",Ke("Photo removed.")}const as=ye(()=>{var H,k,qe;const f=(_e.displayName||_e.name||s.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((H=f[0])==null?void 0:H[0])||"P")+(((k=f[1])==null?void 0:k[0])||((qe=f[0])==null?void 0:qe[1])||"V")).toUpperCase()}),ji=j(!1),fn=j(""),yo=j(""),Si=j(""),hn=j([]);function xo(y){const f="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let H="";for(let k=0;kxo(4).toLowerCase()+"-"+xo(4).toLowerCase()),Si.value=""}function qa(){_e.twoFactor=!1,hn.value=[],ji.value=!1}const pn=navigator.userAgent;function na(){return/Edg\//.test(pn)?"Edge":/OPR\//.test(pn)?"Opera":/Chrome\//.test(pn)?"Chrome":/Firefox\//.test(pn)?"Firefox":/Safari\//.test(pn)?"Safari":"Browser"}function Ya(){return/Windows/.test(pn)?"Windows":/Mac OS X/.test(pn)?"macOS":/Android/.test(pn)?"Android":/iPhone|iPad/.test(pn)?"iOS":/Linux/.test(pn)?"Linux":"Unknown OS"}const Ja=Date.now(),Ti=j([]),Wi=j(!1),Ki=j(""),Et=St({email:"",password:"",role:"user",organization:""}),zn=j(""),bn=j(!1),Gi=j(""),Pi=ye(()=>{const y=[{value:"user",label:"User"},{value:"admin",label:"Admin"}];return u.value&&y.push({value:"superadmin",label:"Superadmin"}),y}),Ft=j([]);async function Ci(){if(!d.value)return;const y=await sp();y.ok&&(Ft.value=y.organizations.slice().sort((f,H)=>f.name.localeCompare(H.name)))}const ls=ye(()=>{const y=Ft.value.map(f=>({value:f.id,label:f.name}));return u.value&&y.unshift({value:"",label:"No organization"}),y});async function Li(){if(!d.value)return;Wi.value=!0,Ki.value="";const y=await tp();if(Wi.value=!1,!y.ok){Ki.value=y.status===403?"Manager role required.":"Could not load users.";return}Ti.value=y.users.slice().sort((f,H)=>f.email.localeCompare(H.email))}function Ai(y){try{const f=y.data||{},H=Object.keys(f)[0];return H&&f[H]&&f[H].message||y.message||y.error||"Invalid input."}catch{return y.error||"Could not create user."}}async function us(){zn.value="";const y=Et.email.trim().toLowerCase();if(!y.includes("@"))return zn.value="Enter a valid email.";if(Et.password.length<8)return zn.value="Password must be at least 8 characters.";bn.value=!0;const f=u.value?Et.organization:s.organization,{ok:H,body:k}=await np(y,Et.password,Et.role,f);if(bn.value=!1,!H)return zn.value=Ai(k);Et.email="",Et.password="",Et.role="user",Et.organization="",Ke("User created."),Li()}async function Xa(y){const{ok:f,body:H}=await op(y.id);if(Gi.value="",!f)return Ke(H.error||"Could not remove user.");Ke("User removed."),Li()}const ot=St({id:"",email:"",role:"user",verified:!1,password:"",organization:""}),In=j(""),wo=j(!1),Kt=ye(()=>!!ot.id&&ot.email===s.email);function Mi(y){Gi.value="",ot.id=y.id,ot.email=y.email,ot.role=y.role||"user",ot.verified=!!y.verified,ot.password="",ot.organization=y.organization||"",In.value=""}function ia(){ot.id="",In.value=""}async function $n(){In.value="";const y=ot.email.trim().toLowerCase();if(!y.includes("@"))return In.value="Enter a valid email.";if(ot.password&&ot.password.length<8)return In.value="New password must be at least 8 characters (or leave blank).";const f={email:y,role:ot.role,verified:ot.verified};u.value&&(f.organization=ot.organization),ot.password&&(f.password=ot.password),wo.value=!0;const{ok:H,body:k}=await ip(ot.id,f);if(wo.value=!1,!H)return In.value=Ai(k);Ke("User updated."),ia(),Li()}const ko=St({name:""}),yn=j(""),So=j(!1),Nn=j(""),xn=St({id:"",name:""}),wn=j(""),cs=ye(()=>{const y={};for(const f of Ti.value)f.organization&&(y[f.organization]=(y[f.organization]||0)+1);return y});async function Dn(){yn.value="";const y=ko.name.trim();if(!y)return yn.value="Enter an organization name.";So.value=!0;const{ok:f,body:H}=await ap(y);if(So.value=!1,!f)return yn.value=Ai(H);ko.name="",Ke("Organization created."),Ci()}function To(y){Nn.value="",xn.id=y.id,xn.name=y.name,wn.value=""}function oa(){xn.id="",wn.value=""}async function Po(){wn.value="";const y=xn.name.trim();if(!y)return wn.value="Enter an organization name.";const{ok:f,body:H}=await rp(xn.id,y);if(!f)return wn.value=Ai(H);Ke("Organization renamed."),oa(),Ci(),Li()}async function Qa(y){const{ok:f,body:H}=await lp(y.id);if(Nn.value="",!f)return Ke(H.error||"Could not delete organization.");Ke("Organization deleted."),Ci()}function Fn(){const y={_app:"PilotVault",_kind:"settings-export",exportedAt:new Date().toISOString(),email:s.email,prefs:{..._e},themeMode:oo.value},f=new Blob([JSON.stringify(y,null,2)],{type:"application/json"}),H=URL.createObjectURL(f),k=document.createElement("a");k.href=H,k.download=`pilotvault-settings-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(k),k.click(),k.remove(),URL.revokeObjectURL(H),Ke("Settings exported.")}const Co=j("");function Ei(y){const f=y.target.files&&y.target.files[0];if(!f)return;const H=new FileReader;H.onload=()=>{try{const k=JSON.parse(String(H.result)),qe=k.prefs||k;if(!Vc(qe))throw new Error("bad shape");k.themeMode&&Aa(k.themeMode),Gr(_e.fontSize),qr(_e.reduceMotion),Co.value="Settings imported and applied."}catch{Co.value="That file is not a valid PilotVault settings export."}},H.readAsText(f),y.target.value=""}const yt=St({understand:!1,typed:"",cooldown:0,armed:!1,msg:""});let Gt=null;const Oi=ye(()=>s.email||"DELETE MY ACCOUNT"),Lo=ye(()=>yt.understand&&yt.typed===Oi.value);function ds(){Lo.value&&(yt.armed=!0,yt.cooldown=5,clearInterval(Gt),Gt=setInterval(()=>{yt.cooldown--,yt.cooldown<=0&&clearInterval(Gt)},1e3))}$t(Lo,y=>{!y&&yt.armed&&(yt.armed=!1,yt.cooldown=0,clearInterval(Gt))});function Ao(){if(!(!yt.armed||yt.cooldown>0)){try{localStorage.removeItem("pv_prefs")}catch{}yt.msg="Account deletion requires the account service. Local data was cleared and you were signed out.",setTimeout(()=>l("logout"),900)}}return _i(()=>{ie=setInterval(()=>ze.value=Date.now(),1e3),Ci(),Li(),U(),Za(),tn(),Hi()}),Ho(()=>{clearInterval(ie),clearInterval(Gt),clearTimeout(is)}),(y,f)=>(p(),g("div",xm,[r("div",wm,[f[65]||(f[65]=r("div",null,[r("div",{class:"eyebrow"},"Preferences"),r("h2",{class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},"Settings")],-1)),r("div",km,[E(X,{name:"search",size:16,class:"text-ink-muted"}),ne(r("input",{"onUpdate:modelValue":f[0]||(f[0]=H=>R.value=H),placeholder:"Search settings…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[Se,R.value]]),R.value?(p(),g("button",{key:0,class:"text-ink-muted hover:text-ink","aria-label":"Clear search",onClick:f[1]||(f[1]=H=>R.value="")},[E(X,{name:"x",size:15})])):N("",!0)])]),r("div",Sm,[ne(r("nav",Tm,[(p(!0),g(ue,null,Fe(T.value,H=>(p(),g("button",{key:H.id,class:Ee(["flex items-center gap-2.5 rounded px-3 py-2.5 text-left text-sm transition",[A.value===H.id?H.danger?"bg-danger-soft font-semibold text-danger-fg":"bg-accent-soft font-semibold text-accent-soft-fg":H.danger?"font-medium text-danger-fg hover:bg-danger-soft":"font-medium text-ink-secondary hover:bg-surface-2"]]),onClick:k=>A.value=H.id},[E(X,{name:H.icon,size:17},null,8,["name"]),r("span",Cm,S(H.label),1)],10,Pm))),128))],512),[[xh,!B.value]]),r("div",Lm,[B.value&&!q.value.length?(p(),g("div",Am," No settings match “"+S(R.value)+"”. ",1)):N("",!0),(p(!0),g(ue,null,Fe(q.value,H=>(p(),g(ue,{key:H.id},[B.value?(p(),g("div",Mm,[E(X,{name:H.icon,size:14},null,8,["name"]),$(" "+S(H.label),1)])):N("",!0),H.id==="account"?(p(),g("div",Em,[E(Me,{title:"Full name",desc:"Shown to your team on flights and audit logs.",keywords:"full name account"},{default:Le(()=>[ne(r("input",{"onUpdate:modelValue":f[2]||(f[2]=k=>Oe(_e).name=k),class:"field w-56",placeholder:"Jane Operator",onBlur:f[3]||(f[3]=k=>Ke("Saved."))},null,544),[[Se,Oe(_e).name]])]),_:1}),E(Me,{title:"Username",desc:"Your unique handle within PilotVault.",keywords:"username handle"},{default:Le(()=>[r("div",Om,[f[66]||(f[66]=r("span",{class:"text-sm text-ink-muted"},"@",-1)),ne(r("input",{"onUpdate:modelValue":f[4]||(f[4]=k=>Oe(_e).username=k),class:"field w-48",placeholder:"jane",onBlur:f[5]||(f[5]=k=>Ke("Saved."))},null,544),[[Se,Oe(_e).username]])])]),_:1}),E(Me,{title:"Email address",desc:"Used for sign-in and notifications.",keywords:"email verification verify"},{default:Le(()=>[r("div",zm,[r("span",Im,S(t.email||"—"),1),r("span",$m,[E(X,{name:"mail",size:12}),f[67]||(f[67]=$(" Unverified ",-1))])])]),_:1}),E(Me,{title:"Role",desc:"Your access level in PilotVault.",keywords:"role admin user superadmin access rights permissions"},{default:Le(()=>[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",b(t.role)])},[E(X,{name:v(t.role),size:12},null,8,["name"]),$(S(h(t.role)),1)],2)]),_:1}),E(Me,{title:"Organization",desc:"The organization your account belongs to.",keywords:"organization org tenant company"},{default:Le(()=>[r("span",{class:Ee(["text-sm",t.organizationName?"text-ink":"text-ink-muted"])},S(t.organizationName||(u.value?"All organizations":"None")),3)]),_:1}),E(Me,{block:"",title:"Verify email",desc:"Confirm ownership to enable password resets and alerts.",keywords:"verify email resend"},{default:Le(()=>[r("button",{class:"btn-ghost",onClick:ea},"Send verification link"),ss.value?(p(),g("p",Nm,S(ss.value),1)):N("",!0)]),_:1}),E(Me,{block:"",title:"Change password",desc:"Use at least 8 characters.",keywords:"password change current new"},{default:Le(()=>[r("div",Dm,[ne(r("input",{"onUpdate:modelValue":f[6]||(f[6]=k=>zt.current=k),type:"password",class:"field",placeholder:"Current password"},null,512),[[Se,zt.current]]),ne(r("input",{"onUpdate:modelValue":f[7]||(f[7]=k=>zt.next=k),type:"password",class:"field",placeholder:"New password"},null,512),[[Se,zt.next]]),ne(r("input",{"onUpdate:modelValue":f[8]||(f[8]=k=>zt.confirm=k),type:"password",class:"field",placeholder:"Confirm new password"},null,512),[[Se,zt.confirm]]),r("div",Fm,[r("button",{class:"btn-accent",onClick:os},"Update password"),li.value?(p(),g("span",{key:0,class:Ee(["text-xs",Qs.value?"text-success-fg":"text-ink-muted"])},S(li.value),3)):N("",!0)])])]),_:1})])):H.id==="appearance"?(p(),g("div",Rm,[E(Me,{title:"Theme",desc:"Light, dark, or follow your system.",keywords:"theme light dark system appearance"},{default:Le(()=>[E(Tn,{modelValue:Ce.value,"onUpdate:modelValue":f[9]||(f[9]=k=>Ce.value=k),options:fe},null,8,["modelValue"])]),_:1}),E(Me,{title:"Font size",desc:"Scales the entire interface for readability.",keywords:"font size accessibility text"},{default:Le(()=>[E(Tn,{modelValue:Oe(_e).fontSize,"onUpdate:modelValue":f[10]||(f[10]=k=>Oe(_e).fontSize=k),options:Be},null,8,["modelValue"])]),_:1}),E(Me,{title:"Reduce motion",desc:"Minimise animations and transitions.",keywords:"reduce motion accessibility animation"},{default:Le(()=>[E(sn,{modelValue:Oe(_e).reduceMotion,"onUpdate:modelValue":f[11]||(f[11]=k=>Oe(_e).reduceMotion=k)},null,8,["modelValue"])]),_:1}),E(Me,{title:"Language",desc:"Interface language.",keywords:"language locale"},{default:Le(()=>[ne(r("select",{"onUpdate:modelValue":f[12]||(f[12]=k=>Oe(_e).language=k),class:"field w-48"},[(p(),g(ue,null,Fe(Ie,([k,qe])=>r("option",{key:k,value:k},S(qe),9,Bm)),64))],512),[[At,Oe(_e).language]])]),_:1}),E(Me,{title:"Region",desc:"Affects number, unit and date defaults.",keywords:"region country locale"},{default:Le(()=>[ne(r("select",{"onUpdate:modelValue":f[13]||(f[13]=k=>Oe(_e).region=k),class:"field w-48"},[(p(!0),g(ue,null,Fe(Oe(Ge),([k,qe])=>(p(),g("option",{key:k,value:k},S(qe),9,Um))),128))],512),[[At,Oe(_e).region]])]),_:1}),E(Me,{title:"Date format",desc:"How calendar dates are displayed.",keywords:"date format"},{default:Le(()=>[ne(r("select",{"onUpdate:modelValue":f[14]||(f[14]=k=>Oe(_e).dateFormat=k),class:"field w-48"},[(p(),g(ue,null,Fe(we,([k,qe])=>r("option",{key:k,value:k},S(qe),9,Vm)),64))],512),[[At,Oe(_e).dateFormat]])]),_:1}),E(Me,{title:"Time format",desc:"12- or 24-hour clock.",keywords:"time format clock 12 24 hour"},{default:Le(()=>[E(Tn,{modelValue:Oe(_e).timeFormat,"onUpdate:modelValue":f[15]||(f[15]=k=>Oe(_e).timeFormat=k),options:$e},null,8,["modelValue"])]),_:1}),E(Me,{title:"Preview",desc:"How timestamps appear across the app.",keywords:"preview date time"},{default:Le(()=>[r("span",Zm,S(He.value),1)]),_:1}),f[68]||(f[68]=r("p",{class:"mt-3 text-xs text-ink-muted"}," Language & region are stored now; full localisation ships with the account service. ",-1))])):H.id==="integrations"?(p(),g("div",Hm,[B.value?N("",!0):(p(),g("div",jm,[(p(),g(ue,null,Fe(ts,k=>r("button",{key:k.id,type:"button",class:Ee(["-mb-px inline-flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2 text-sm font-semibold transition",ns.value===k.id?"border-accent text-ink":"border-transparent text-ink-secondary hover:text-ink"]),onClick:qe=>ns.value=k.id},[E(X,{name:k.icon,size:16},null,8,["name"]),$(S(k.label),1)],10,Wm)),64))])),bo("apis-external")?(p(),g("div",Km,[r("div",Gm,[r("div",qm,[E(X,{name:"radio",size:20})]),f[69]||(f[69]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"OpenSky Network"),r("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))]),oe.loaded&&!oe.available?(p(),g("div",Ym,[E(X,{name:"lock",size:14,class:"mr-1 inline"}),f[70]||(f[70]=$(" OpenSky is currently disabled by your administrator. Contact them to enable it. ",-1))])):N("",!0),oe.canEditOrg?(p(),g("div",Jm,[f[71]||(f[71]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(Tn,{modelValue:je.value,"onUpdate:modelValue":f[16]||(f[16]=k=>je.value=k),options:rt},null,8,["modelValue"])])):N("",!0),me.value?(p(),at(Me,{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:Le(()=>[E(sn,{"model-value":oe.orgEnabled,disabled:!oe.available,"onUpdate:modelValue":O},null,8,["model-value","disabled"])]),_:1})):(p(),at(Me,{key:3,title:"Enable OpenSky",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin opensky"},{default:Le(()=>[E(sn,{"model-value":oe.enabled,disabled:!oe.available||!oe.orgEnabled,"onUpdate:modelValue":O},null,8,["model-value","disabled"])]),_:1})),!me.value&&oe.available&&!oe.orgEnabled?(p(),g("div",Xm,[E(X,{name:"lock",size:13,class:"mr-1 inline"}),f[73]||(f[73]=$("OpenSky is turned off for your organization",-1)),oe.canEditOrg?(p(),g("span",Qm,[...f[72]||(f[72]=[$(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):N("",!0),f[74]||(f[74]=$(". ",-1))])):N("",!0),me.value?(p(),g("div",eg,[E(X,{name:"users",size:13,class:"mr-1 inline"}),f[75]||(f[75]=$("These are organization-wide settings — they apply to everyone in ",-1)),r("span",tg,S(t.organizationName||"your organization"),1),f[76]||(f[76]=$(". Leave a field blank to let each user choose their own; a value set here overrides the user's. ",-1))])):te.value?(p(),g("div",ng," As a superadmin you manage the global OpenSky configuration in the API Server panel. The effective configuration is shown below. ")):N("",!0),oe.available&&!me.value?(p(),g("div",ig,[r("div",og,[r("div",sg,[E(X,{name:"signal",size:15}),f[77]||(f[77]=$("Credit usage ",-1))]),xe.value?(p(),g("span",ag,"Checked "+S(Y()),1)):N("",!0)]),Ne.value?(p(),g(ue,{key:0},[Ne.value.remaining!=null?(p(),g(ue,{key:0},[r("div",rg,[r("span",lg,S(Ve(Ne.value.remaining)),1),r("span",ug,"/ "+S(Ve(Ne.value.daily))+" credits left today",1)]),r("div",cg,[r("div",{class:Ee(["h-full rounded-full transition-all",st.value]),style:Bo({width:dt.value+"%"})},null,6)]),r("div",dg," Used "+S(Ve(Ne.value.daily-Ne.value.remaining))+" today · "+S(Ne.value.probeCost)+" credit"+S(Ne.value.probeCost===1?"":"s")+" per query · "+S(Ne.value.mode),1)],64)):(p(),g(ue,{key:1},[r("div",fg,[f[78]||(f[78]=$("Daily allowance: ",-1)),r("span",hg,S(Ve(Ne.value.daily)),1),f[79]||(f[79]=$(" credits",-1))]),r("div",pg,S(Ne.value.probeCost)+" credit"+S(Ne.value.probeCost===1?"":"s")+" per query · "+S(Ne.value.mode)+". OpenSky only reports live remaining credits for authenticated requests — add OAuth2 credentials below to track usage. ",1)],64))],64)):(p(),g("div",mg,[...f[80]||(f[80]=[$(" Run ",-1),r("span",{class:"font-semibold text-ink-secondary"},"Test connection",-1),$(" below to fetch your live OpenSky credit balance. ",-1)])]))])):N("",!0),E(Me,{title:"OpenSky plan",desc:"Your account tier — sets the daily credit allowance.",keywords:"plan tier credits"},{default:Le(()=>[Te("plan")?(p(),g("span",gg,[$(S((vt.find(k=>k.value===se("plan").effective)||{}).label||se("plan").effective||"—")+" ",1),Ae("plan")?(p(),g("span",vg,[E(X,{name:"lock",size:10}),$(S(Ae("plan")),1)])):N("",!0)])):(p(),at(Tn,{key:1,modelValue:le.plan,"onUpdate:modelValue":f[17]||(f[17]=k=>le.plan=k),options:vt},null,8,["modelValue"]))]),_:1}),E(Me,{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:Le(()=>[Te("bbox")?(p(),g("span",_g,[$(S(w(se("bbox").effective)||se("bbox").effective||"—")+" ",1),Ae("bbox")?(p(),g("span",bg,[E(X,{name:"lock",size:10}),$(S(Ae("bbox")),1)])):N("",!0)])):(p(),g("div",yg,[ne(r("select",{"onUpdate:modelValue":f[18]||(f[18]=k=>W.value=k),class:"field w-64"},[me.value?N("",!0):(p(),g("option",xg,"Automatic (by location)")),(p(),g(ue,null,Fe(kt,k=>r("optgroup",{key:k.label,label:k.label},[(p(!0),g(ue,null,Fe(k.options,qe=>(p(),g("option",{key:qe.value,value:qe.value},S(qe.label),9,kg))),128))],8,wg)),64)),f[81]||(f[81]=r("option",{value:"__custom__"},"Custom…",-1))],512),[[At,W.value]]),re.value?(p(),g("p",Sg," Live map follows drone location → your device location → your Region ("+S(be.value)+"). ",1)):N("",!0),V.value?ne((p(),g("input",{key:1,"onUpdate:modelValue":f[19]||(f[19]=k=>le.bbox=k),class:"field w-64 font-mono",placeholder:"50.5,3.2,53.7,7.3"},null,512)),[[Se,le.bbox]]):N("",!0)]))]),_:1}),E(Me,{title:"OAuth2 client ID",desc:"Optional — leave blank for anonymous access (lower limits).",keywords:"oauth client id credentials"},{default:Le(()=>[Te("clientId")?(p(),g("span",Tg,[$(S(se("clientId").effective||"—")+" ",1),Ae("clientId")?(p(),g("span",Pg,[E(X,{name:"lock",size:10}),$(S(Ae("clientId")),1)])):N("",!0)])):ne((p(),g("input",{key:1,"onUpdate:modelValue":f[20]||(f[20]=k=>le.clientId=k),class:"field w-64",placeholder:"your-api-client"},null,512)),[[Se,le.clientId]])]),_:1}),E(Me,{title:"OAuth2 client secret",desc:"Paired with the client ID for authenticated access.",keywords:"oauth client secret credentials password"},{default:Le(()=>[Te("clientSecret")?(p(),g("span",Cg,[$(S(se("clientSecret").effective||"—")+" ",1),Ae("clientSecret")?(p(),g("span",Lg,[E(X,{name:"lock",size:10}),$(S(Ae("clientSecret")),1)])):N("",!0)])):ne((p(),g("input",{key:1,"onUpdate:modelValue":f[21]||(f[21]=k=>le.clientSecret=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[Se,le.clientSecret]])]),_:1}),oe.available&&!oe.allowAnonymous?(p(),g("div",Ag," Anonymous access is disabled by the administrator — OpenSky needs OAuth2 credentials from some layer to work. ")):N("",!0),r("div",Mg,[te.value?N("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:ae.value||!oe.available,onClick:ke},S(ae.value?"Saving…":me.value?"Save organization settings":"Save settings"),9,Eg)),me.value?N("",!0):(p(),g("div",Og,[f[84]||(f[84]=r("label",{class:"text-xs text-ink-muted"},"Test area",-1)),ne(r("select",{"onUpdate:modelValue":f[22]||(f[22]=k=>de.value=k),class:"field w-44"},[f[82]||(f[82]=r("option",{value:"__default__"},"Default bounding box",-1)),(p(),g(ue,null,Fe(Ye,k=>r("optgroup",{key:k.label,label:k.label},[(p(!0),g(ue,null,Fe(k.options,qe=>(p(),g("option",{key:qe.value,value:qe.value},S(qe.label),9,Ig))),128))],8,zg)),64)),f[83]||(f[83]=r("option",{value:"__custom__"},"Custom…",-1))],512),[[At,de.value]]),wt.value?ne((p(),g("input",{key:0,"onUpdate:modelValue":f[23]||(f[23]=k=>bt.value=k),class:"field w-44 font-mono",placeholder:"lamin,lomin,lamax,lomax"},null,512)),[[Se,bt.value]]):N("",!0)])),me.value?N("",!0):(p(),g("button",{key:2,class:"btn-ghost",disabled:tt.value||!oe.available,onClick:an},S(tt.value?"Testing…":"Test connection"),9,$g)),ce.value?(p(),g("span",Ng,S(ce.value),1)):N("",!0),ee.value&&!me.value?(p(),g("span",{key:4,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",so(ee.value.status)])},[f[85]||(f[85]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(ee.value.detail||ee.value.status),1)],2)):N("",!0)])])):N("",!0),bo("drives-external")?(p(),g(ue,{key:2},[r("div",Dg,[r("div",Fg,[r("div",Rg,[E(X,{name:"server",size:20})]),f[86]||(f[86]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"File Transfer (FTP / SFTP)"),r("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))]),lt.loaded&&!lt.available?(p(),g("div",Bg,[E(X,{name:"lock",size:14,class:"mr-1 inline"}),f[87]||(f[87]=$(" File transfer is currently disabled by your administrator. Contact them to enable it. ",-1))])):N("",!0),lt.canEditOrg?(p(),g("div",Ug,[f[88]||(f[88]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(Tn,{modelValue:ei.value,"onUpdate:modelValue":f[24]||(f[24]=k=>ei.value=k),options:rt},null,8,["modelValue"])])):N("",!0),gn.value?(p(),at(Me,{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:Le(()=>[E(sn,{"model-value":lt.orgEnabled,disabled:!lt.available,"onUpdate:modelValue":Ws},null,8,["model-value","disabled"])]),_:1})):(p(),at(Me,{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:Le(()=>[E(sn,{"model-value":lt.enabled,disabled:!lt.available||!lt.orgEnabled,"onUpdate:modelValue":Ws},null,8,["model-value","disabled"])]),_:1})),!gn.value&<.available&&!lt.orgEnabled?(p(),g("div",Vg,[E(X,{name:"lock",size:13,class:"mr-1 inline"}),f[90]||(f[90]=$("File transfer is turned off for your organization",-1)),lt.canEditOrg?(p(),g("span",Zg,[...f[89]||(f[89]=[$(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):N("",!0),f[91]||(f[91]=$(". ",-1))])):N("",!0),gn.value?(p(),g("div",Hg,[E(X,{name:"users",size:13,class:"mr-1 inline"}),f[92]||(f[92]=$("These are organization-wide settings — they apply to everyone in ",-1)),r("span",jg,S(t.organizationName||"your organization"),1),f[93]||(f[93]=$(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):Wo.value?(p(),g("div",Wg," As a superadmin you manage the global file-transfer configuration in the API Server panel. The effective configuration is shown below. ")):N("",!0),E(Me,{title:"Protocol",desc:"SFTP (over SSH), FTPS (FTP over TLS), or plain FTP.",keywords:"protocol sftp ftps ftp"},{default:Le(()=>[Wt("protocol")?(p(),g("span",Kg,[$(S(Zs(ge("protocol").effective))+" ",1),Pt("protocol")?(p(),g("span",Gg,[E(X,{name:"lock",size:10}),$(S(Pt("protocol")),1)])):N("",!0)])):(p(),at(Tn,{key:1,modelValue:ft.protocol,"onUpdate:modelValue":f[25]||(f[25]=k=>ft.protocol=k),options:Vs},null,8,["modelValue"]))]),_:1}),E(Me,{title:"Host",desc:"Server hostname or IP address.",keywords:"host server address"},{default:Le(()=>[Wt("host")?(p(),g("span",qg,[$(S(ge("host").effective||"—")+" ",1),Pt("host")?(p(),g("span",Yg,[E(X,{name:"lock",size:10}),$(S(Pt("host")),1)])):N("",!0)])):ne((p(),g("input",{key:1,"onUpdate:modelValue":f[26]||(f[26]=k=>ft.host=k),class:"field w-64",placeholder:"files.example.com"},null,512)),[[Se,ft.host]])]),_:1}),E(Me,{title:"Port",desc:"Leave blank for the protocol default (22 for SFTP, 21 for FTP/FTPS).",keywords:"port"},{default:Le(()=>[Wt("port")?(p(),g("span",Jg,[$(S(ge("port").effective||"default")+" ",1),Pt("port")?(p(),g("span",Xg,[E(X,{name:"lock",size:10}),$(S(Pt("port")),1)])):N("",!0)])):ne((p(),g("input",{key:1,"onUpdate:modelValue":f[27]||(f[27]=k=>ft.port=k),inputmode:"numeric",class:"field w-24 font-mono",placeholder:"22"},null,512)),[[Se,ft.port]])]),_:1}),E(Me,{title:"Username",desc:"Account used to authenticate.",keywords:"username login account"},{default:Le(()=>[Wt("username")?(p(),g("span",Qg,[$(S(ge("username").effective||"—")+" ",1),Pt("username")?(p(),g("span",ev,[E(X,{name:"lock",size:10}),$(S(Pt("username")),1)])):N("",!0)])):ne((p(),g("input",{key:1,"onUpdate:modelValue":f[28]||(f[28]=k=>ft.username=k),class:"field w-64",placeholder:"user"},null,512)),[[Se,ft.username]])]),_:1}),E(Me,{title:"Password",desc:"Password auth for FTP/FTPS, or SFTP password login. Leave blank to use a key.",keywords:"password secret credentials"},{default:Le(()=>[Wt("password")?(p(),g("span",tv,[$(S(ge("password").effective||"—")+" ",1),Pt("password")?(p(),g("span",nv,[E(X,{name:"lock",size:10}),$(S(Pt("password")),1)])):N("",!0)])):ne((p(),g("input",{key:1,"onUpdate:modelValue":f[29]||(f[29]=k=>ft.password=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[Se,ft.password]])]),_:1}),jt.value==="sftp"?(p(),at(Me,{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:Le(()=>[Wt("privateKey")?(p(),g("span",iv,[$(S(ge("privateKey").effective||"—")+" ",1),Pt("privateKey")?(p(),g("span",ov,[E(X,{name:"lock",size:10}),$(S(Pt("privateKey")),1)])):N("",!0)])):ne((p(),g("textarea",{key:1,"onUpdate:modelValue":f[30]||(f[30]=k=>ft.privateKey=k),rows:"3",class:"field w-full font-mono text-xs",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512)),[[Se,ft.privateKey]])]),_:1})):N("",!0),jt.value==="sftp"?(p(),at(Me,{key:8,title:"Private key passphrase",desc:"Passphrase protecting the SSH private key, if any.",keywords:"passphrase key secret"},{default:Le(()=>[Wt("keyPassphrase")?(p(),g("span",sv,[$(S(ge("keyPassphrase").effective||"—")+" ",1),Pt("keyPassphrase")?(p(),g("span",av,[E(X,{name:"lock",size:10}),$(S(Pt("keyPassphrase")),1)])):N("",!0)])):ne((p(),g("input",{key:1,"onUpdate:modelValue":f[31]||(f[31]=k=>ft.keyPassphrase=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[Se,ft.keyPassphrase]])]),_:1})):N("",!0),jt.value==="sftp"?(p(),at(Me,{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:Le(()=>[Wt("hostKeyFingerprint")?(p(),g("span",rv,[$(S(ge("hostKeyFingerprint").effective||"—")+" ",1),Pt("hostKeyFingerprint")?(p(),g("span",lv,[E(X,{name:"lock",size:10}),$(S(Pt("hostKeyFingerprint")),1)])):N("",!0)])):ne((p(),g("input",{key:1,"onUpdate:modelValue":f[32]||(f[32]=k=>ft.hostKeyFingerprint=k),class:"field w-full font-mono text-xs",placeholder:"SHA256:…"},null,512)),[[Se,ft.hostKeyFingerprint]])]),_:1})):N("",!0),jt.value==="ftps"?(p(),at(Me,{key:10,title:"TLS verification",desc:"Skip only for self-signed test servers.",keywords:"tls certificate verify insecure ftps"},{default:Le(()=>[Wt("insecureSkipVerify")?(p(),g("span",uv,[$(S(ge("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),Pt("insecureSkipVerify")?(p(),g("span",cv,[E(X,{name:"lock",size:10}),$(S(Pt("insecureSkipVerify")),1)])):N("",!0)])):(p(),at(Tn,{key:1,modelValue:ft.insecureSkipVerify,"onUpdate:modelValue":f[33]||(f[33]=k=>ft.insecureSkipVerify=k),options:jo},null,8,["modelValue"]))]),_:1})):N("",!0),E(Me,{title:"Base path",desc:"Working directory and health-check target, e.g. /uploads.",keywords:"base path directory folder root"},{default:Le(()=>[Wt("basePath")?(p(),g("span",dv,[$(S(ge("basePath").effective||"—")+" ",1),Pt("basePath")?(p(),g("span",fv,[E(X,{name:"lock",size:10}),$(S(Pt("basePath")),1)])):N("",!0)])):ne((p(),g("input",{key:1,"onUpdate:modelValue":f[34]||(f[34]=k=>ft.basePath=k),class:"field w-64 font-mono",placeholder:"/uploads"},null,512)),[[Se,ft.basePath]])]),_:1}),r("div",hv,[Wo.value?N("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:ro.value||!lt.available,onClick:Ha},S(ro.value?"Saving…":gn.value?"Save organization settings":"Save settings"),9,pv)),gn.value?N("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:lo.value||!lt.available,onClick:ja},S(lo.value?"Testing…":"Test connection"),9,mv)),Ui.value?(p(),g("span",gv,S(Ui.value),1)):N("",!0),yi.value&&!gn.value?(p(),g("span",vv,"Checked "+S(Hs()),1)):N("",!0),Mn.value&&!gn.value?(p(),g("span",{key:4,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Ks(Mn.value.status)])},[f[94]||(f[94]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(Mn.value.detail||Mn.value.status),1)],2)):N("",!0)])]),r("div",_v,[r("div",bv,[r("div",yv,[E(X,{name:"cloud",size:20})]),f[95]||(f[95]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"WebDAV"),r("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))]),ut.loaded&&!ut.available?(p(),g("div",xv,[E(X,{name:"lock",size:14,class:"mr-1 inline"}),f[96]||(f[96]=$(" WebDAV is currently disabled by your administrator. Contact them to enable it. ",-1))])):N("",!0),ut.canEditOrg?(p(),g("div",wv,[f[97]||(f[97]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(Tn,{modelValue:En.value,"onUpdate:modelValue":f[35]||(f[35]=k=>En.value=k),options:rt},null,8,["modelValue"])])):N("",!0),it.value?(p(),at(Me,{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:Le(()=>[E(sn,{"model-value":ut.orgEnabled,disabled:!ut.available,"onUpdate:modelValue":qs},null,8,["model-value","disabled"])]),_:1})):(p(),at(Me,{key:3,title:"Enable WebDAV",desc:"Turn the plugin on for your account in the Web App.",keywords:"enable disable plugin webdav"},{default:Le(()=>[E(sn,{"model-value":ut.enabled,disabled:!ut.available||!ut.orgEnabled,"onUpdate:modelValue":qs},null,8,["model-value","disabled"])]),_:1})),!it.value&&ut.available&&!ut.orgEnabled?(p(),g("div",kv,[E(X,{name:"lock",size:13,class:"mr-1 inline"}),f[99]||(f[99]=$("WebDAV is turned off for your organization",-1)),ut.canEditOrg?(p(),g("span",Sv,[...f[98]||(f[98]=[$(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):N("",!0),f[100]||(f[100]=$(". ",-1))])):N("",!0),it.value?(p(),g("div",Tv,[E(X,{name:"users",size:13,class:"mr-1 inline"}),f[101]||(f[101]=$("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Pv,S(t.organizationName||"your organization"),1),f[102]||(f[102]=$(". Leave the connection blank to let each user configure their own; a connection set here overrides the user's. ",-1))])):fo.value?(p(),g("div",Cv," As a superadmin you manage the global WebDAV configuration in the API Server panel. The effective configuration is shown below. ")):N("",!0),E(Me,{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:Le(()=>[un("baseURL")?(p(),g("span",Lv,[$(S(ln("baseURL").effective||"—")+" ",1),Dt("baseURL")?(p(),g("span",Av,[E(X,{name:"lock",size:10}),$(S(Dt("baseURL")),1)])):N("",!0)])):ne((p(),g("input",{key:1,"onUpdate:modelValue":f[36]||(f[36]=k=>Bt.baseURL=k),class:"field w-full font-mono text-xs",placeholder:"https://cloud.example.com/remote.php/dav/files/alice/"},null,512)),[[Se,Bt.baseURL]])]),_:1}),E(Me,{title:"Username",desc:"Account used to authenticate (leave blank for a public share).",keywords:"username login account"},{default:Le(()=>[un("username")?(p(),g("span",Mv,[$(S(ln("username").effective||"—")+" ",1),Dt("username")?(p(),g("span",Ev,[E(X,{name:"lock",size:10}),$(S(Dt("username")),1)])):N("",!0)])):ne((p(),g("input",{key:1,"onUpdate:modelValue":f[37]||(f[37]=k=>Bt.username=k),class:"field w-64",placeholder:"user"},null,512)),[[Se,Bt.username]])]),_:1}),E(Me,{title:"Password",desc:"Password or app-specific token for HTTP Basic auth.",keywords:"password secret credentials token"},{default:Le(()=>[un("password")?(p(),g("span",Ov,[$(S(ln("password").effective||"—")+" ",1),Dt("password")?(p(),g("span",zv,[E(X,{name:"lock",size:10}),$(S(Dt("password")),1)])):N("",!0)])):ne((p(),g("input",{key:1,"onUpdate:modelValue":f[38]||(f[38]=k=>Bt.password=k),type:"password",class:"field w-64",placeholder:"••••••••"},null,512)),[[Se,Bt.password]])]),_:1}),E(Me,{title:"TLS verification",desc:"Only affects HTTPS. Skip only for self-signed test servers.",keywords:"tls certificate verify insecure https"},{default:Le(()=>[un("insecureSkipVerify")?(p(),g("span",Iv,[$(S(ln("insecureSkipVerify").effective==="true"?"Skip verification":"Verify certificate")+" ",1),Dt("insecureSkipVerify")?(p(),g("span",$v,[E(X,{name:"lock",size:10}),$(S(Dt("insecureSkipVerify")),1)])):N("",!0)])):(p(),at(Tn,{key:1,modelValue:Bt.insecureSkipVerify,"onUpdate:modelValue":f[39]||(f[39]=k=>Bt.insecureSkipVerify=k),options:Gs},null,8,["modelValue"]))]),_:1}),E(Me,{title:"Base path",desc:"Working directory under the server URL and health-check target, e.g. /Documents.",keywords:"base path directory folder root"},{default:Le(()=>[un("basePath")?(p(),g("span",Nv,[$(S(ln("basePath").effective||"—")+" ",1),Dt("basePath")?(p(),g("span",Dv,[E(X,{name:"lock",size:10}),$(S(Dt("basePath")),1)])):N("",!0)])):ne((p(),g("input",{key:1,"onUpdate:modelValue":f[40]||(f[40]=k=>Bt.basePath=k),class:"field w-64 font-mono",placeholder:"/Documents"},null,512)),[[Se,Bt.basePath]])]),_:1}),r("div",Fv,[fo.value?N("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:uo.value||!ut.available,onClick:mo},S(uo.value?"Saving…":it.value?"Save organization settings":"Save settings"),9,Rv)),it.value?N("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:co.value||!ut.available,onClick:ni},S(co.value?"Testing…":"Test connection"),9,Bv)),Zi.value?(p(),g("span",Uv,S(Zi.value),1)):N("",!0),vn.value&&!it.value?(p(),g("span",Vv,"Checked "+S(Ct()),1)):N("",!0),rn.value&&!it.value?(p(),g("span",{key:4,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Lt(rn.value.status)])},[f[103]||(f[103]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(rn.value.detail||rn.value.status),1)],2)):N("",!0)])])],64)):N("",!0),bo("drives-local")?(p(),g("div",Zv,[r("div",Hv,[r("div",jv,[E(X,{name:"monitor",size:20})]),f[104]||(f[104]=r("div",{class:"min-w-0"},[r("div",{class:"text-sm font-semibold text-ink"},"Local Storage"),r("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))]),Pe.loaded&&!Pe.available?(p(),g("div",Wv,[E(X,{name:"lock",size:14,class:"mr-1 inline"}),f[105]||(f[105]=$(" Local storage is currently disabled by your administrator. Contact them to enable it. ",-1))])):Pe.loaded&&!Pe.rootConfigured?(p(),g("div",Kv,[E(X,{name:"alertTriangle",size:14,class:"mr-1 inline"}),f[106]||(f[106]=$(" No storage root has been configured by your administrator yet. ",-1))])):N("",!0),Pe.canEditOrg?(p(),g("div",Gv,[f[107]||(f[107]=r("div",{class:"text-xs text-ink-muted"},"Manage your own settings, or organization-wide settings that apply to every user.",-1)),E(Tn,{modelValue:_n.value,"onUpdate:modelValue":f[41]||(f[41]=k=>_n.value=k),options:rt},null,8,["modelValue"])])):N("",!0),nn.value?(p(),at(Me,{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:Le(()=>[E(sn,{"model-value":Pe.orgEnabled,disabled:!Pe.available,"onUpdate:modelValue":Mt},null,8,["model-value","disabled"])]),_:1})):(p(),at(Me,{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:Le(()=>[E(sn,{"model-value":Pe.enabled,disabled:!Pe.available||!Pe.orgEnabled,"onUpdate:modelValue":Mt},null,8,["model-value","disabled"])]),_:1})),!nn.value&&Pe.available&&!Pe.orgEnabled?(p(),g("div",qv,[E(X,{name:"lock",size:13,class:"mr-1 inline"}),f[109]||(f[109]=$("Local storage is turned off for your organization",-1)),Pe.canEditOrg?(p(),g("span",Yv,[...f[108]||(f[108]=[$(" — switch to ",-1),r("span",{class:"font-semibold"},"Organization",-1),$(" to turn it back on",-1)])])):N("",!0),f[110]||(f[110]=$(". ",-1))])):N("",!0),nn.value?(p(),g("div",Jv,[E(X,{name:"users",size:13,class:"mr-1 inline"}),f[111]||(f[111]=$("These are organization-wide settings — they apply to everyone in ",-1)),r("span",Xv,S(t.organizationName||"your organization"),1),f[112]||(f[112]=$(", who all share the organization folder. Members can additionally enable a private folder inside it. ",-1))])):ki.value?(p(),g("div",Qv," As a superadmin you manage the global storage root in the API Server panel. The effective configuration is shown below. ")):N("",!0),nn.value?(p(),at(Me,{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:Le(()=>[E(sn,{"model-value":Pe.allowPrivate,disabled:!Pe.available,"onUpdate:modelValue":Js},null,8,["model-value","disabled"])]),_:1})):N("",!0),nn.value?N("",!0):(p(),g(ue,{key:9},[E(Me,{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:Le(()=>[r("div",e_,[(p(!0),g(ue,null,Fe(Pe.mounts,k=>(p(),g("div",{key:k.id,class:"flex flex-wrap items-center gap-2"},[r("span",t_,S(k.path),1),k.kind==="shared"?(p(),g("span",n_,[E(X,{name:"users",size:10}),f[113]||(f[113]=$("Shared with your organization",-1))])):(p(),g("span",i_,[E(X,{name:"lock",size:10}),f[114]||(f[114]=$("Private to you",-1))])),oi.value[k.id]?(p(),g("span",{key:2,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-semibold",es(oi.value[k.id].status)])},[f[115]||(f[115]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(oi.value[k.id].status),1)],2)):N("",!0)]))),128)),Pe.mounts.length?N("",!0):(p(),g("div",o_,S(Pe.rootConfigured?"No folder assigned yet.":"Waiting for the administrator to configure a storage root."),1))])]),_:1}),Pe.isOrgUser&&Pe.allowPrivate?(p(),at(Me,{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:Le(()=>[E(sn,{"model-value":Pe.privateFolder,disabled:!Pe.available||!Pe.orgEnabled,"onUpdate:modelValue":ri},null,8,["model-value","disabled"])]),_:1})):Pe.isOrgUser&&!Pe.allowPrivate?(p(),g("div",s_,[E(X,{name:"lock",size:13,class:"mr-1 inline"}),f[116]||(f[116]=$("Private folders are turned off by your organization. ",-1))])):N("",!0)],64)),E(Me,{title:"Access mode",desc:"Read-only prevents uploads, deletes and folder creation.",keywords:"read only write access mode permission"},{default:Le(()=>[dn("readOnly")?(p(),g("span",a_,[$(S(Ys(Ue("readOnly").effective))+" ",1),mt("readOnly")?(p(),g("span",r_,[E(X,{name:"lock",size:10}),$(S(mt("readOnly")),1)])):N("",!0)])):(p(),at(Tn,{key:1,modelValue:Zn.value,"onUpdate:modelValue":f[42]||(f[42]=k=>Zn.value=k),options:go},null,8,["modelValue"]))]),_:1}),r("div",l_,[ki.value?N("",!0):(p(),g("button",{key:0,class:"btn-accent",disabled:Hn.value||!Pe.available,onClick:Xs},S(Hn.value?"Saving…":nn.value?"Save organization settings":"Save settings"),9,u_)),nn.value?N("",!0):(p(),g("button",{key:1,class:"btn-ghost",disabled:wi.value||!Pe.available,onClick:Wa},S(wi.value?"Testing…":"Test folder"),9,c_)),ii.value?(p(),g("span",d_,S(ii.value),1)):N("",!0),On.value&&!nn.value?(p(),g("span",f_,"Checked "+S(Xo()),1)):N("",!0),cn.value&&!nn.value?(p(),g("span",{key:4,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",es(cn.value.status)])},[f[117]||(f[117]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(cn.value.detail||cn.value.status),1)],2)):N("",!0)])])):N("",!0)])):H.id==="profile"?(p(),g("div",h_,[E(Me,{block:"",title:"Profile photo",desc:"PNG or JPG, up to ~1.5 MB. Stored on this device.",keywords:"avatar photo picture"},{default:Le(()=>[r("div",p_,[Oe(_e).avatar?(p(),g("img",{key:0,src:Oe(_e).avatar,alt:"Avatar",class:"h-16 w-16 rounded-full object-cover"},null,8,m_)):(p(),g("div",g_,S(as.value),1)),r("div",v_,[r("label",__,[E(X,{name:"upload",size:15,class:"mr-1.5 inline"}),f[118]||(f[118]=$("Upload ",-1)),r("input",{type:"file",accept:"image/*",class:"hidden",onChange:Ka},null,32)]),Oe(_e).avatar?(p(),g("button",{key:0,class:"btn-ghost",onClick:Ga},"Remove")):N("",!0)])])]),_:1}),E(Me,{title:"Display name",desc:"The name shown on your public profile.",keywords:"display name profile"},{default:Le(()=>[ne(r("input",{"onUpdate:modelValue":f[43]||(f[43]=k=>Oe(_e).displayName=k),class:"field w-56",placeholder:"Jane O.",onBlur:f[44]||(f[44]=k=>Ke("Saved."))},null,544),[[Se,Oe(_e).displayName]])]),_:1}),E(Me,{block:"",title:"Bio",desc:"A short description others can see.",keywords:"bio about description"},{default:Le(()=>[ne(r("textarea",{"onUpdate:modelValue":f[45]||(f[45]=k=>Oe(_e).bio=k),rows:"3",maxlength:"240",class:"field w-full resize-none",placeholder:"Flight director, North yard operations…",onBlur:f[46]||(f[46]=k=>Ke("Saved."))},null,544),[[Se,Oe(_e).bio]]),r("div",b_,S((Oe(_e).bio||"").length)+"/240",1)]),_:1}),E(Me,{title:"Show email on profile",desc:"Let teammates see your email address.",keywords:"show email public visibility"},{default:Le(()=>[E(sn,{modelValue:Oe(_e).showEmail,"onUpdate:modelValue":f[47]||(f[47]=k=>Oe(_e).showEmail=k)},null,8,["modelValue"])]),_:1})])):H.id==="security"?(p(),g("div",y_,[E(Me,{block:"",title:"Two-factor authentication",desc:"Require a one-time code at sign-in.",keywords:"two factor 2fa authentication security"},{default:Le(()=>[r("div",x_,[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",Oe(_e).twoFactor?"bg-success-soft text-success-fg":"bg-surface-2 text-ink-secondary"])},[f[119]||(f[119]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(Oe(_e).twoFactor?"Enabled":"Disabled"),1)],2),!Oe(_e).twoFactor&&!ji.value?(p(),g("button",{key:0,class:"btn-accent",onClick:ta},"Enable 2FA")):Oe(_e).twoFactor?(p(),g("button",{key:1,class:"btn-ghost",onClick:qa},"Disable")):N("",!0)]),ji.value?(p(),g("div",w_,[r("div",k_,[f[121]||(f[121]=r("div",{class:"grid h-28 w-28 place-items-center rounded bg-white p-2"},[r("svg",{viewBox:"0 0 100 100",class:"h-full w-full"},[r("rect",{width:"100",height:"100",fill:"#fff"}),r("g",{fill:"#0F1E3D"},[r("rect",{x:"6",y:"6",width:"24",height:"24"}),r("rect",{x:"70",y:"6",width:"24",height:"24"}),r("rect",{x:"6",y:"70",width:"24",height:"24"}),r("rect",{x:"12",y:"12",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"76",y:"12",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"12",y:"76",width:"12",height:"12",fill:"#fff"}),r("rect",{x:"40",y:"10",width:"8",height:"8"}),r("rect",{x:"52",y:"20",width:"8",height:"8"}),r("rect",{x:"40",y:"40",width:"8",height:"8"}),r("rect",{x:"60",y:"44",width:"8",height:"8"}),r("rect",{x:"44",y:"60",width:"8",height:"8"}),r("rect",{x:"70",y:"60",width:"8",height:"8"}),r("rect",{x:"80",y:"72",width:"8",height:"8"}),r("rect",{x:"60",y:"80",width:"8",height:"8"})])])],-1)),r("div",S_,[f[120]||(f[120]=r("div",{class:"text-xs text-ink-secondary"},"Scan with an authenticator app, or enter this secret:",-1)),r("div",T_,S(fn.value),1),r("div",P_,[ne(r("input",{"onUpdate:modelValue":f[48]||(f[48]=k=>yo.value=k),inputmode:"numeric",maxlength:"6",class:"field w-28 font-mono tracking-[0.3em]",placeholder:"000000"},null,512),[[Se,yo.value]]),r("button",{class:"btn-accent",onClick:rs},"Verify & enable")]),Si.value?(p(),g("p",C_,S(Si.value),1)):N("",!0)])])])):N("",!0),Oe(_e).twoFactor&&hn.value.length?(p(),g("div",L_,[f[122]||(f[122]=r("div",{class:"text-xs font-semibold text-ink"},"Recovery codes",-1)),f[123]||(f[123]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Store these somewhere safe — each works once.",-1)),r("div",A_,[(p(!0),g(ue,null,Fe(hn.value,k=>(p(),g("span",{key:k,class:"select-all"},S(k),1))),128))])])):N("",!0),f[124]||(f[124]=r("p",{class:"mt-2 text-xs text-ink-muted"},"Prototype — codes are generated locally until the account service verifies them.",-1))]),_:1}),E(Me,{block:"",title:"Active sessions",desc:"Devices currently signed in to your account.",keywords:"sessions devices logout sign out remote"},{default:Le(()=>[r("div",M_,[r("div",E_,[r("div",O_,[E(X,{name:"monitor",size:18})]),r("div",z_,[r("div",I_,[$(S(na())+" on "+S(Ya())+" ",1),f[125]||(f[125]=r("span",{class:"ml-1 rounded-full bg-success-soft px-2 py-0.5 text-[10px] font-semibold text-success-fg"},"This device",-1))]),r("div",$_,"Signed in "+S(Oe(fu)(Oe(Ja))),1)]),r("button",{class:"btn-ghost",onClick:f[49]||(f[49]=k=>l("logout"))},"Log out")])]),f[126]||(f[126]=r("button",{class:"btn-ghost mt-2 opacity-60",disabled:"",title:"Requires the account service"}," Log out all other devices ",-1)),f[127]||(f[127]=r("p",{class:"mt-2 text-xs text-ink-muted"}," Only this session is visible from the browser; enumerating and revoking remote sessions needs the account service. ",-1))]),_:1})])):H.id==="team"?(p(),g("div",N_,[ot.id?(p(),g("div",D_,[E(Me,{block:"",title:`Edit user — ${ot.email}`,desc:"Update details, change role, reset password, or set verified.",keywords:"edit user update role password verified organization"},{default:Le(()=>[r("div",F_,[r("div",R_,[ne(r("input",{"onUpdate:modelValue":f[50]||(f[50]=k=>ot.email=k),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[Se,ot.email]]),ne(r("select",{"onUpdate:modelValue":f[51]||(f[51]=k=>ot.role=k),class:"field w-32",disabled:Kt.value,title:Kt.value?"You cannot change your own role":""},[(p(!0),g(ue,null,Fe(Pi.value,k=>(p(),g("option",{key:k.value,value:k.value},S(k.label),9,U_))),128))],8,B_),[[At,ot.role]])]),u.value?ne((p(),g("select",{key:0,"onUpdate:modelValue":f[52]||(f[52]=k=>ot.organization=k),class:"field",title:"Organization"},[(p(!0),g(ue,null,Fe(ls.value,k=>(p(),g("option",{key:k.value,value:k.value},S(k.label),9,V_))),128))],512)),[[At,ot.organization]]):N("",!0),ne(r("input",{"onUpdate:modelValue":f[53]||(f[53]=k=>ot.password=k),type:"password",class:"field",placeholder:"New password (leave blank to keep current)"},null,512),[[Se,ot.password]]),r("label",Z_,[E(sn,{modelValue:ot.verified,"onUpdate:modelValue":f[54]||(f[54]=k=>ot.verified=k)},null,8,["modelValue"]),f[128]||(f[128]=$(" Email verified ",-1))]),r("div",H_,[r("button",{class:"btn-accent",disabled:wo.value,onClick:$n},S(wo.value?"Saving…":"Save changes"),9,j_),r("button",{class:"btn-ghost",onClick:ia},"Cancel"),In.value?(p(),g("span",W_,S(In.value),1)):N("",!0),Kt.value?(p(),g("span",K_,"Editing your own account — role locked.")):N("",!0)])])]),_:1},8,["title"])])):(p(),g("div",G_,[E(Me,{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:Le(()=>[r("div",q_,[r("div",Y_,[ne(r("input",{"onUpdate:modelValue":f[55]||(f[55]=k=>Et.email=k),type:"email",class:"field flex-1",placeholder:"name@pilotvault.local"},null,512),[[Se,Et.email]]),ne(r("select",{"onUpdate:modelValue":f[56]||(f[56]=k=>Et.role=k),class:"field w-32"},[(p(!0),g(ue,null,Fe(Pi.value,k=>(p(),g("option",{key:k.value,value:k.value},S(k.label),9,J_))),128))],512),[[At,Et.role]])]),u.value?ne((p(),g("select",{key:0,"onUpdate:modelValue":f[57]||(f[57]=k=>Et.organization=k),class:"field",title:"Organization"},[(p(!0),g(ue,null,Fe(ls.value,k=>(p(),g("option",{key:k.value,value:k.value},S(k.label),9,X_))),128))],512)),[[At,Et.organization]]):(p(),g("div",Q_,[f[129]||(f[129]=$(" New users join your organization: ",-1)),r("span",e1,S(t.organizationName||"—"),1)])),ne(r("input",{"onUpdate:modelValue":f[58]||(f[58]=k=>Et.password=k),type:"password",class:"field",placeholder:"Temporary password (min 8 chars)"},null,512),[[Se,Et.password]]),r("div",t1,[r("button",{class:"btn-accent",disabled:bn.value,onClick:us},S(bn.value?"Creating…":"Create user"),9,n1),zn.value?(p(),g("span",i1,S(zn.value),1)):N("",!0)])])]),_:1})])),r("div",o1,[r("div",s1,[f[130]||(f[130]=r("div",null,[r("div",{class:"eyebrow"},"Team"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All users")],-1)),r("button",{class:"btn-ghost",disabled:Wi.value,onClick:Li},S(Wi.value?"Loading…":"Refresh"),9,a1)]),Ki.value?(p(),g("div",r1,S(Ki.value),1)):!Ti.value.length&&!Wi.value?(p(),g("div",l1,"No users yet.")):(p(),g("div",u1,[r("table",c1,[r("thead",null,[r("tr",d1,[(p(),g(ue,null,Fe(["User","Role","Organization","Status",""],k=>r("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"},S(k),1)),64))])]),r("tbody",null,[(p(!0),g(ue,null,Fe(Ti.value,k=>(p(),g("tr",{key:k.id,class:Ee(["border-b border-line last:border-0",ot.id===k.id?"bg-accent-soft":""])},[r("td",f1,[r("span",h1,S(k.email),1),k.email===t.email?(p(),g("span",p1,"(you)")):N("",!0)]),r("td",m1,[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",b(k.role||"user")])},[E(X,{name:v(k.role||"user"),size:12},null,8,["name"]),$(S(h(k.role||"user")),1)],2)]),r("td",g1,[r("span",{class:Ee(["text-sm",k.organizationName?"text-ink-secondary":"text-ink-muted"])},S(k.organizationName||"—"),3)]),r("td",v1,[r("span",{class:Ee(["text-xs",k.verified?"text-success-fg":"text-ink-muted"])},S(k.verified?"Verified":"Unverified"),3)]),r("td",_1,[Gi.value===k.id?(p(),g(ue,{key:0},[f[131]||(f[131]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Remove?",-1)),r("button",{class:"btn-ghost mr-1",onClick:f[59]||(f[59]=qe=>Gi.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:qe=>Xa(k)}," Remove ",8,b1)],64)):(p(),g("div",y1,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:qe=>Mi(k)},[E(X,{name:"settings",size:14}),f[132]||(f[132]=$(" Edit ",-1))],8,x1),k.email!==t.email?(p(),g("button",{key:0,class:"btn-ghost inline-flex items-center gap-1.5",onClick:qe=>Gi.value=k.id},[E(X,{name:"trash",size:14}),f[133]||(f[133]=$(" Remove ",-1))],8,w1)):N("",!0)]))])],2))),128))])])]))])])):H.id==="organizations"?(p(),g("div",k1,[xn.id?(p(),g("div",S1,[E(Me,{block:"",title:"Rename organization",desc:"Update the organization's display name.",keywords:"rename organization edit"},{default:Le(()=>[r("div",T1,[ne(r("input",{"onUpdate:modelValue":f[60]||(f[60]=k=>xn.name=k),class:"field",placeholder:"Organization name",onKeyup:iu(Po,["enter"])},null,544),[[Se,xn.name]]),r("div",P1,[r("button",{class:"btn-accent",onClick:Po},"Save changes"),r("button",{class:"btn-ghost",onClick:oa},"Cancel"),wn.value?(p(),g("span",C1,S(wn.value),1)):N("",!0)])])]),_:1})])):(p(),g("div",L1,[E(Me,{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:Le(()=>[r("div",A1,[ne(r("input",{"onUpdate:modelValue":f[61]||(f[61]=k=>ko.name=k),class:"field",placeholder:"e.g. Northwind Aerial",onKeyup:iu(Dn,["enter"])},null,544),[[Se,ko.name]]),r("div",M1,[r("button",{class:"btn-accent",disabled:So.value,onClick:Dn},S(So.value?"Creating…":"Create organization"),9,E1),yn.value?(p(),g("span",O1,S(yn.value),1)):N("",!0)])])]),_:1})])),r("div",z1,[r("div",{class:"flex items-center justify-between px-5 py-4"},[f[134]||(f[134]=r("div",null,[r("div",{class:"eyebrow"},"Tenancy"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"All organizations")],-1)),r("button",{class:"btn-ghost",onClick:Ci},"Refresh")]),Ft.value.length?(p(),g("div",$1,[r("table",N1,[r("thead",null,[r("tr",D1,[(p(),g(ue,null,Fe(["Organization","Members",""],k=>r("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"},S(k),1)),64))])]),r("tbody",null,[(p(!0),g(ue,null,Fe(Ft.value,k=>(p(),g("tr",{key:k.id,class:Ee(["border-b border-line last:border-0",xn.id===k.id?"bg-accent-soft":""])},[r("td",F1,[r("span",R1,[E(X,{name:"grid",size:14,class:"text-ink-muted"}),$(S(k.name),1)])]),r("td",B1,S(cs.value[k.id]||0),1),r("td",U1,[Nn.value===k.id?(p(),g(ue,{key:0},[f[135]||(f[135]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:f[62]||(f[62]=qe=>Nn.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:qe=>Qa(k)}," Delete ",8,V1)],64)):(p(),g("div",Z1,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5",onClick:qe=>To(k)},[E(X,{name:"settings",size:14}),f[136]||(f[136]=$(" Rename ",-1))],8,H1),r("button",{class:"btn-ghost inline-flex items-center gap-1.5",disabled:(cs.value[k.id]||0)>0,title:(cs.value[k.id]||0)>0?"Reassign or remove members first":"",onClick:qe=>Nn.value=k.id},[E(X,{name:"trash",size:14}),f[137]||(f[137]=$(" Delete ",-1))],8,j1)]))])],2))),128))])])])):(p(),g("div",I1,"No organizations yet."))])])):H.id==="advanced"?(p(),g("div",W1,[r("div",K1,[E(Me,{title:"Export data",desc:"Download your settings and profile as JSON.",keywords:"export data download backup"},{default:Le(()=>[r("button",{class:"btn-ghost",onClick:Fn},[E(X,{name:"download",size:15,class:"mr-1.5 inline"}),f[138]||(f[138]=$("Export",-1))])]),_:1}),E(Me,{block:"",title:"Import data",desc:"Restore settings from a previous export.",keywords:"import data upload restore"},{default:Le(()=>[r("label",G1,[E(X,{name:"upload",size:15,class:"mr-1.5 inline"}),f[139]||(f[139]=$("Choose file… ",-1)),r("input",{type:"file",accept:"application/json,.json",class:"hidden",onChange:Ei},null,32)]),Co.value?(p(),g("p",q1,S(Co.value),1)):N("",!0)]),_:1})]),r("div",Y1,[r("div",J1,[E(X,{name:"alertTriangle",size:18}),f[140]||(f[140]=r("h3",{class:"text-sm font-bold uppercase tracking-caps"},"Danger zone",-1))]),f[145]||(f[145]=r("p",{class:"mt-1 text-xs text-ink-secondary"},"Deleting your account is permanent and cannot be undone.",-1)),r("div",X1,[f[144]||(f[144]=r("div",{class:"text-sm font-semibold text-ink"},"Delete account",-1)),r("label",Q1,[ne(r("input",{"onUpdate:modelValue":f[63]||(f[63]=k=>yt.understand=k),type:"checkbox",class:"mt-0.5 h-4 w-4 accent-[var(--danger)]"},null,512),[[Ca,yt.understand]]),f[141]||(f[141]=$(" I understand this permanently deletes my account and all associated data. ",-1))]),r("div",eb,[r("label",tb,[f[142]||(f[142]=$("Type ",-1)),r("span",nb,S(Oi.value),1),f[143]||(f[143]=$(" to confirm",-1))]),ne(r("input",{"onUpdate:modelValue":f[64]||(f[64]=k=>yt.typed=k),class:"field w-full max-w-[360px] font-mono",placeholder:Oi.value},null,8,ib),[[Se,yt.typed]])]),r("div",ob,[yt.armed?(p(),g("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:yt.cooldown>0,onClick:Ao},S(yt.cooldown>0?`Confirm in ${yt.cooldown}s…`:"Permanently delete account"),9,ab)):(p(),g("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:!Lo.value,onClick:ds}," Delete account… ",8,sb)),yt.armed&&yt.cooldown>0?(p(),g("span",rb,"Cooling-off period — read once more.")):N("",!0)]),yt.msg?(p(),g("p",lb,S(yt.msg),1)):N("",!0)])])])):N("",!0)],64))),128))])]),E(mh,{name:"fade"},{default:Le(()=>[Xe.value?(p(),g("div",ub,[E(X,{name:"check",size:16,class:"text-success-fg"}),$(S(Xe.value),1)])):N("",!0)]),_:1})]))}},db=ym(cb,[["__scopeId","data-v-f495a614"]]),fb={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},hb={class:"flex flex-wrap items-center gap-3"},pb={class:"inline-flex rounded-lg border border-line bg-surface-1 p-0.5"},mb=["onClick"],gb={class:"ml-auto flex items-center gap-2"},vb=["href"],_b={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},bb={class:"eyebrow"},yb={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},xb={key:0,class:"panel p-5"},wb={class:"mb-4 flex items-center justify-between"},kb={class:"eyebrow"},Sb={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},Tb={class:"block"},Pb={class:"block"},Cb={class:"block"},Lb={class:"block"},Ab={key:0,value:""},Mb=["value"],Eb={class:"block"},Ob={class:"block"},zb={class:"block"},Ib={class:"block"},$b={class:"block"},Nb=["value"],Db={class:"block"},Fb=["value"],Rb={class:"block"},Bb=["value"],Ub={class:"block"},Vb={class:"mt-3 block"},Zb={key:0,class:"mt-3 grid grid-cols-2 gap-3 max-[760px]:grid-cols-1"},Hb={class:"block"},jb={class:"block"},Wb={class:"block"},Kb={class:"block"},Gb={class:"col-span-2 block max-[760px]:col-span-1"},qb={class:"mt-4 flex items-center gap-3"},Yb=["disabled"],Jb={key:0,class:"text-sm text-danger-fg"},Xb={class:"panel overflow-hidden p-0"},Qb={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},ey={key:1,class:"grid place-items-center px-5 py-16 text-center"},ty={key:2,class:"overflow-x-auto"},ny={class:"w-full border-collapse text-sm"},iy={class:"text-left"},oy={class:"whitespace-nowrap px-5 py-3 font-mono text-ink"},sy={key:0,class:"text-ink-muted"},ay={class:"px-5 py-3 text-ink-secondary"},ry=["title"],ly={class:"px-5 py-3 font-mono text-ink-secondary"},uy={class:"px-5 py-3 text-ink-secondary"},cy={class:"px-5 py-3"},dy=["onClick"],fy={class:"whitespace-nowrap px-5 py-3 text-right"},hy=["onClick"],py=["onClick"],my=["onClick"],gy={key:0,class:"border-b border-line bg-surface-2"},vy={colspan:"7",class:"px-5 py-3"},_y={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},by={class:"text-ink-secondary"},yy={class:"text-ink"},xy={class:"text-ink-secondary"},wy={class:"text-ink"},ky={class:"text-ink-secondary"},Sy={class:"font-mono text-ink"},Ty={key:0,class:"text-ink-secondary"},Py={class:"text-ink"},Cy={key:0,class:"mt-2 space-y-1"},Ly={key:1,class:"mt-2 text-xs text-success-fg"},Ay={key:0,class:"panel p-5"},My={class:"mb-4 flex items-center justify-between"},Ey={class:"eyebrow"},Oy={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},zy={class:"block"},Iy={class:"block"},$y={class:"block"},Ny={class:"block"},Dy={class:"block"},Fy={class:"block"},Ry=["value"],By={class:"mt-3 flex flex-wrap gap-6"},Uy={class:"flex items-center gap-2 text-sm text-ink-secondary"},Vy={class:"flex items-center gap-2 text-sm text-ink-secondary"},Zy={class:"mt-4 flex items-center gap-3"},Hy=["disabled"],jy={key:0,class:"text-sm text-danger-fg"},Wy={class:"panel overflow-hidden p-0"},Ky={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Gy={key:1,class:"grid place-items-center px-5 py-16 text-center"},qy={key:2,class:"overflow-x-auto"},Yy={class:"w-full border-collapse text-sm"},Jy={class:"text-left"},Xy={class:"px-5 py-3 font-semibold text-ink"},Qy={class:"px-5 py-3 text-ink-secondary"},ex={class:"px-5 py-3 font-mono text-ink-secondary"},tx={class:"px-5 py-3"},nx={key:1,class:"text-ink-muted"},ix={class:"px-5 py-3"},ox={class:"whitespace-nowrap px-5 py-3 text-right"},sx=["onClick"],ax=["onClick"],rx=["onClick"],lx={__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",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"},l=j("flights"),u=j([]),d=j([]),h=j(!1),v=j("");async function b(){h.value=!0,v.value="";const[Y,M]=await Promise.all([Rc(),kp()]);(!Y.ok||!M.ok)&&(v.value=Y.status===503||M.status===503?"Logbook storage is not configured on the API Server (service account missing).":"Could not load the logbook."),u.value=Y.drones,d.value=M.flights,h.value=!1}_i(b);function C(Y){const M=Y.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 T=j("");function A(Y){T.value=T.value===Y?"":Y}const R=[{value:"open",label:"Open"},{value:"specific",label:"Specific"},{value:"certified",label:"Certified"}],B=[{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"}],Z=[{value:"",label:"Auto (from drone)"},{value:"manual",label:"Manual"},{value:"automatic",label:"Automatic (FDR)"}];function F(){var Y;return{operationDate:new Date().toISOString().slice(0,10),startTime:"",endTime:"",drone:((Y=u.value[0])==null?void 0:Y.id)||"",areaRoute:"",maxAltitudeAgl:"",pilotName:i.email,certificateRef:"",category:"open",purpose:"commercial",loggingPath:"",rawFdrLogUrl:"",authorisationRef:"",weather:"",airspaceRef:"",observer:"",incidents:"",notes:""}}const he=j(!1),pe=j(""),q=St(F()),Ce=j(""),fe=j(!1),Be=j(!1);function $e(){Object.assign(q,F()),pe.value="",Ce.value="",Be.value=!1,he.value=!0}function Ie(Y){Object.assign(q,{operationDate:(Y.operationDate||"").slice(0,10),startTime:Y.startTime||"",endTime:Y.endTime||"",drone:Y.drone||"",areaRoute:Y.areaRoute||"",maxAltitudeAgl:Y.maxAltitudeAgl||"",pilotName:Y.pilotName||"",certificateRef:Y.certificateRef||"",category:Y.category||"open",purpose:Y.purpose||"commercial",loggingPath:Y.loggingPath||"",rawFdrLogUrl:Y.rawFdrLogUrl||"",authorisationRef:Y.authorisationRef||"",weather:Y.weather||"",airspaceRef:Y.airspaceRef||"",observer:Y.observer||"",incidents:Y.incidents||"",notes:Y.notes||""}),pe.value=Y.id,Ce.value="",Be.value=!!(Y.weather||Y.airspaceRef||Y.observer||Y.incidents||Y.notes),he.value=!0}function Ge(){he.value=!1,pe.value=""}async function be(){var z;if(Ce.value="",!q.drone){Ce.value="Select a drone first (add one on the Drones tab).";return}fe.value=!0;const Y={...q,maxAltitudeAgl:Number(q.maxAltitudeAgl)||0},M=pe.value?await Tp(pe.value,Y):await Sp(Y);if(fe.value=!1,!M.ok){Ce.value=((z=M.body)==null?void 0:z.error)||"Could not save the flight.";return}he.value=!1,await b()}const we=j("");async function ze(Y){const M=await Pp(Y.id);we.value="",M.ok&&await b()}const ie=["","C0","C1","C2","C3","C4","C5","C6"];function He(){return{name:"",model:"",serial:"",operatorNumber:"",mtomGrams:"",isToy:!1,autologsFlights:!1,cClass:""}}const oe=j(!1),je=j(""),le=St(He()),ce=j(""),ae=j(!1);function tt(){Object.assign(le,He()),je.value="",ce.value="",oe.value=!0}function ee(Y){Object.assign(le,{name:Y.name||"",model:Y.model||"",serial:Y.serial||"",operatorNumber:Y.operatorNumber||"",mtomGrams:Y.mtomGrams||"",isToy:!!Y.isToy,autologsFlights:!!Y.autologsFlights,cClass:Y.cClass||""}),je.value=Y.id,ce.value="",oe.value=!0}function xe(){oe.value=!1,je.value=""}async function Ne(){var z;if(ce.value="",!le.name.trim()){ce.value="Give the drone a name.";return}ae.value=!0;const Y={...le,mtomGrams:Number(le.mtomGrams)||0},M=je.value?await xp(je.value,Y):await yp(Y);if(ae.value=!1,!M.ok){ce.value=((z=M.body)==null?void 0:z.error)||"Could not save the drone.";return}oe.value=!1,await b()}const dt=j("");async function st(Y){var z;const M=await wp(Y.id);dt.value="",M.ok?await b():ce.value=((z=M.body)==null?void 0:z.error)||"Could not delete the drone."}const Ve=ye(()=>{const Y=d.value.length,M=d.value.filter(vt=>{var rt;return(((rt=vt.compliance)==null?void 0:rt.redFlags)||[]).length}).length,z=d.value.filter(vt=>{var rt;return(rt=vt.compliance)==null?void 0:rt.required}).length;return{total:Y,flagged:M,required:z,fleet:u.value.length}});return(Y,M)=>(p(),g("div",fb,[r("div",hb,[r("div",pb,[(p(),g(ue,null,Fe([["flights","Flights"],["drones","Drones"]],z=>r("button",{key:z[0],class:Ee(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",l.value===z[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:vt=>l.value=z[0]},S(z[1]),11,mb)),64))]),r("div",gb,[r("a",{href:Oe(Cp)(),class:"btn-ghost inline-flex items-center gap-2",title:"Download a compliance CSV (Trafikstyrelsen / police disclosure)"},[E(X,{name:"download",size:15}),M[29]||(M[29]=$(" Export CSV ",-1))],8,vb),l.value==="flights"?(p(),g("button",{key:0,class:"btn-accent inline-flex items-center gap-2",onClick:$e},[E(X,{name:"plus",size:15}),M[30]||(M[30]=$(" Log flight ",-1))])):(p(),g("button",{key:1,class:"btn-accent inline-flex items-center gap-2",onClick:tt},[E(X,{name:"plus",size:15}),M[31]||(M[31]=$(" Add drone ",-1))]))])]),r("div",_b,[(p(!0),g(ue,null,Fe([{label:"Flights logged",value:Ve.value.total,tone:"neutral"},{label:"Require logbook",value:Ve.value.required,tone:"neutral"},{label:"Compliance flags",value:Ve.value.flagged,tone:Ve.value.flagged?"danger":"success"},{label:"Registered drones",value:Ve.value.fleet,tone:"neutral"}],z=>(p(),g("div",{key:z.label,class:"panel p-5"},[r("div",bb,S(z.label),1),r("div",{class:Ee(["mt-2 text-[30px] font-bold leading-none tracking-tightest",z.tone==="danger"?"text-danger-fg":z.tone==="success"?"text-success-fg":"text-ink"])},S(z.value),3)]))),128))]),v.value?(p(),g("div",yb,S(v.value),1)):N("",!0),l.value==="flights"?(p(),g(ue,{key:1},[he.value?(p(),g("div",xb,[r("div",wb,[r("div",null,[r("div",kb,S(pe.value?"Edit entry":"New entry"),1),M[32]||(M[32]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Logbook flight (BEK 1649 §5)",-1))]),r("button",{class:"btn-icon",onClick:Ge},[E(X,{name:"x",size:16})])]),r("div",Sb,[r("label",Tb,[M[33]||(M[33]=r("span",{class:"eyebrow mb-1 block"},"Date",-1)),ne(r("input",{"onUpdate:modelValue":M[0]||(M[0]=z=>q.operationDate=z),type:"date",class:"field"},null,512),[[Se,q.operationDate]])]),r("label",Pb,[M[34]||(M[34]=r("span",{class:"eyebrow mb-1 block"},"Start",-1)),ne(r("input",{"onUpdate:modelValue":M[1]||(M[1]=z=>q.startTime=z),type:"time",class:"field"},null,512),[[Se,q.startTime]])]),r("label",Cb,[M[35]||(M[35]=r("span",{class:"eyebrow mb-1 block"},"End",-1)),ne(r("input",{"onUpdate:modelValue":M[2]||(M[2]=z=>q.endTime=z),type:"time",class:"field"},null,512),[[Se,q.endTime]])]),r("label",Lb,[M[36]||(M[36]=r("span",{class:"eyebrow mb-1 block"},"Drone",-1)),ne(r("select",{"onUpdate:modelValue":M[3]||(M[3]=z=>q.drone=z),class:"field"},[u.value.length?N("",!0):(p(),g("option",Ab,"— add a drone first —")),(p(!0),g(ue,null,Fe(u.value,z=>(p(),g("option",{key:z.id,value:z.id},S(z.name)+S(z.model?` · ${z.model}`:""),9,Mb))),128))],512),[[At,q.drone]])]),r("label",Eb,[M[37]||(M[37]=r("span",{class:"eyebrow mb-1 block"},"Max altitude (m AGL)",-1)),ne(r("input",{"onUpdate:modelValue":M[4]||(M[4]=z=>q.maxAltitudeAgl=z),type:"number",min:"0",class:"field",placeholder:"120"},null,512),[[Se,q.maxAltitudeAgl]])]),r("label",Ob,[M[38]||(M[38]=r("span",{class:"eyebrow mb-1 block"},"Area / route",-1)),ne(r("input",{"onUpdate:modelValue":M[5]||(M[5]=z=>q.areaRoute=z),class:"field",placeholder:"Field N of Roskilde, grid survey"},null,512),[[Se,q.areaRoute]])]),r("label",zb,[M[39]||(M[39]=r("span",{class:"eyebrow mb-1 block"},"Remote pilot name",-1)),ne(r("input",{"onUpdate:modelValue":M[6]||(M[6]=z=>q.pilotName=z),class:"field",placeholder:"Full name"},null,512),[[Se,q.pilotName]])]),r("label",Ib,[M[40]||(M[40]=r("span",{class:"eyebrow mb-1 block"},"Certificate ref",-1)),ne(r("input",{"onUpdate:modelValue":M[7]||(M[7]=z=>q.certificateRef=z),class:"field",placeholder:"A2 / STS cert no."},null,512),[[Se,q.certificateRef]])]),r("label",$b,[M[41]||(M[41]=r("span",{class:"eyebrow mb-1 block"},"Logging path",-1)),ne(r("select",{"onUpdate:modelValue":M[8]||(M[8]=z=>q.loggingPath=z),class:"field"},[(p(),g(ue,null,Fe(Z,z=>r("option",{key:z.value,value:z.value},S(z.label),9,Nb)),64))],512),[[At,q.loggingPath]])]),r("label",Db,[M[42]||(M[42]=r("span",{class:"eyebrow mb-1 block"},"Category",-1)),ne(r("select",{"onUpdate:modelValue":M[9]||(M[9]=z=>q.category=z),class:"field"},[(p(),g(ue,null,Fe(R,z=>r("option",{key:z.value,value:z.value},S(z.label),9,Fb)),64))],512),[[At,q.category]])]),r("label",Rb,[M[43]||(M[43]=r("span",{class:"eyebrow mb-1 block"},"Purpose",-1)),ne(r("select",{"onUpdate:modelValue":M[10]||(M[10]=z=>q.purpose=z),class:"field"},[(p(),g(ue,null,Fe(B,z=>r("option",{key:z.value,value:z.value},S(z.label),9,Bb)),64))],512),[[At,q.purpose]])]),r("label",Ub,[M[44]||(M[44]=r("span",{class:"eyebrow mb-1 block"},"Authorisation ref",-1)),ne(r("input",{"onUpdate:modelValue":M[11]||(M[11]=z=>q.authorisationRef=z),class:"field",placeholder:"Specific-category ref"},null,512),[[Se,q.authorisationRef]])])]),r("label",Vb,[M[45]||(M[45]=r("span",{class:"eyebrow mb-1 block"},"FDR log URL (automatic path)",-1)),ne(r("input",{"onUpdate:modelValue":M[12]||(M[12]=z=>q.rawFdrLogUrl=z),class:"field",placeholder:"Link to the stored flight-data-recorder export"},null,512),[[Se,q.rawFdrLogUrl]])]),r("button",{class:"mt-4 flex items-center gap-1.5 text-sm font-semibold text-accent",onClick:M[13]||(M[13]=z=>Be.value=!Be.value)},[E(X,{name:Be.value?"x":"plus",size:14},null,8,["name"]),M[46]||(M[46]=$(" Operational details (weather, airspace, incidents) ",-1))]),Be.value?(p(),g("div",Zb,[r("label",Hb,[M[47]||(M[47]=r("span",{class:"eyebrow mb-1 block"},"Weather / wind",-1)),ne(r("input",{"onUpdate:modelValue":M[14]||(M[14]=z=>q.weather=z),class:"field",placeholder:"6 m/s NW, CAVOK"},null,512),[[Se,q.weather]])]),r("label",jb,[M[48]||(M[48]=r("span",{class:"eyebrow mb-1 block"},"Airspace / NOTAM ref",-1)),ne(r("input",{"onUpdate:modelValue":M[15]||(M[15]=z=>q.airspaceRef=z),class:"field"},null,512),[[Se,q.airspaceRef]])]),r("label",Wb,[M[49]||(M[49]=r("span",{class:"eyebrow mb-1 block"},"Observer",-1)),ne(r("input",{"onUpdate:modelValue":M[16]||(M[16]=z=>q.observer=z),class:"field"},null,512),[[Se,q.observer]])]),r("label",Kb,[M[50]||(M[50]=r("span",{class:"eyebrow mb-1 block"},"Incidents / anomalies",-1)),ne(r("input",{"onUpdate:modelValue":M[17]||(M[17]=z=>q.incidents=z),class:"field",placeholder:"RTH trigger, GPS dropout…"},null,512),[[Se,q.incidents]])]),r("label",Gb,[M[51]||(M[51]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),ne(r("textarea",{"onUpdate:modelValue":M[18]||(M[18]=z=>q.notes=z),rows:"2",class:"field"},null,512),[[Se,q.notes]])])])):N("",!0),r("div",qb,[r("button",{class:"btn-accent",disabled:fe.value,onClick:be},S(fe.value?"Saving…":pe.value?"Save changes":"Log flight"),9,Yb),r("button",{class:"btn-ghost",onClick:Ge},"Cancel"),Ce.value?(p(),g("span",Jb,S(Ce.value),1)):N("",!0)])])):N("",!0),r("div",Xb,[h.value?(p(),g("div",Qb,"Loading…")):d.value.length?(p(),g("div",ty,[r("table",ny,[r("thead",null,[r("tr",iy,[(p(),g(ue,null,Fe(["Date","Drone","Area / route","Alt","Pilot","Compliance",""],z=>r("th",{key:z,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"},S(z),1)),64))])]),r("tbody",null,[(p(!0),g(ue,null,Fe(d.value,z=>{var vt,rt,kt,x;return p(),g(ue,{key:z.id},[r("tr",{class:Ee(["border-b border-line last:border-0",pe.value===z.id?"bg-accent-soft":""])},[r("td",oy,[$(S((z.operationDate||"").slice(0,10))+" ",1),z.startTime?(p(),g("span",sy,S(z.startTime),1)):N("",!0)]),r("td",ay,S(z.droneName||"—"),1),r("td",{class:"max-w-[220px] truncate px-5 py-3 text-ink-secondary",title:z.areaRoute},S(z.areaRoute||"—"),9,ry),r("td",ly,S(z.maxAltitudeAgl?z.maxAltitudeAgl+" m":"—"),1),r("td",uy,S(z.pilotName||"—"),1),r("td",cy,[r("button",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",s[C(z).tone]]),onClick:_=>A(z.id)},[C(z).tone==="danger"?(p(),at(X,{key:0,name:"alertTriangle",size:12})):C(z).tone==="success"?(p(),at(X,{key:1,name:"check",size:12})):N("",!0),$(" "+S(C(z).label),1)],10,dy)]),r("td",fy,[we.value===z.id?(p(),g(ue,{key:0},[M[54]||(M[54]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:M[19]||(M[19]=_=>we.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:_=>ze(z)},"Delete",8,hy)],64)):(p(),g(ue,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:_=>Ie(z)},[E(X,{name:"sliders",size:13}),M[55]||(M[55]=$(" Edit",-1))],8,py),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:_=>we.value=z.id},[E(X,{name:"trash",size:13})],8,my)],64))])],2),T.value===z.id?(p(),g("tr",gy,[r("td",vy,[r("div",_y,[r("span",by,[M[56]||(M[56]=$("Logging path: ",-1)),r("b",yy,S(((vt=z.compliance)==null?void 0:vt.loggingPath)||"—"),1)]),r("span",xy,[M[57]||(M[57]=$("Category: ",-1)),r("b",wy,S(z.category||"—"),1)]),r("span",ky,[M[58]||(M[58]=$("Retain until: ",-1)),r("b",Sy,S((z.retentionUntil||"").slice(0,10)||"—"),1)]),(rt=z.compliance)!=null&&rt.exempt?(p(),g("span",Ty,[M[59]||(M[59]=$("Exempt: ",-1)),r("b",Py,S(z.compliance.exemptReason),1)])):N("",!0)]),(((kt=z.compliance)==null?void 0:kt.redFlags)||[]).length?(p(),g("ul",Cy,[(p(!0),g(ue,null,Fe(z.compliance.redFlags,(_,w)=>(p(),g("li",{key:w,class:"flex items-start gap-2 text-xs text-danger-fg"},[E(X,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),$(" "+S(_),1)]))),128))])):(x=z.compliance)!=null&&x.exempt?N("",!0):(p(),g("div",Ly,"No compliance gaps detected."))])])):N("",!0)],64)}),128))])])])):(p(),g("div",ey,[E(X,{name:"book",size:26,class:"text-ink-muted"}),M[52]||(M[52]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No flights logged yet",-1)),M[53]||(M[53]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Log your first operation to start the 5-year retention record.",-1))]))])],64)):(p(),g(ue,{key:2},[oe.value?(p(),g("div",Ay,[r("div",My,[r("div",null,[r("div",Ey,S(je.value?"Edit drone":"New drone"),1),M[60]||(M[60]=r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft registry",-1))]),r("button",{class:"btn-icon",onClick:xe},[E(X,{name:"x",size:16})])]),r("div",Oy,[r("label",zy,[M[61]||(M[61]=r("span",{class:"eyebrow mb-1 block"},"Name",-1)),ne(r("input",{"onUpdate:modelValue":M[20]||(M[20]=z=>le.name=z),class:"field",placeholder:"Mavic-01"},null,512),[[Se,le.name]])]),r("label",Iy,[M[62]||(M[62]=r("span",{class:"eyebrow mb-1 block"},"Model",-1)),ne(r("input",{"onUpdate:modelValue":M[21]||(M[21]=z=>le.model=z),class:"field",placeholder:"DJI Mavic 3 Enterprise"},null,512),[[Se,le.model]])]),r("label",$y,[M[63]||(M[63]=r("span",{class:"eyebrow mb-1 block"},"Serial",-1)),ne(r("input",{"onUpdate:modelValue":M[22]||(M[22]=z=>le.serial=z),class:"field"},null,512),[[Se,le.serial]])]),r("label",Ny,[M[64]||(M[64]=r("span",{class:"eyebrow mb-1 block"},"Operator no.",-1)),ne(r("input",{"onUpdate:modelValue":M[23]||(M[23]=z=>le.operatorNumber=z),class:"field",placeholder:"DNK…"},null,512),[[Se,le.operatorNumber]])]),r("label",Dy,[M[65]||(M[65]=r("span",{class:"eyebrow mb-1 block"},"MTOM (grams)",-1)),ne(r("input",{"onUpdate:modelValue":M[24]||(M[24]=z=>le.mtomGrams=z),type:"number",min:"0",class:"field",placeholder:"920"},null,512),[[Se,le.mtomGrams]])]),r("label",Fy,[M[66]||(M[66]=r("span",{class:"eyebrow mb-1 block"},"C-class",-1)),ne(r("select",{"onUpdate:modelValue":M[25]||(M[25]=z=>le.cClass=z),class:"field"},[(p(),g(ue,null,Fe(ie,z=>r("option",{key:z,value:z},S(z||"— none —"),9,Ry)),64))],512),[[At,le.cClass]])])]),r("div",By,[r("label",Uy,[ne(r("input",{"onUpdate:modelValue":M[26]||(M[26]=z=>le.autologsFlights=z),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[Ca,le.autologsFlights]]),M[67]||(M[67]=$(" Auto-logs flights (onboard FDR) ",-1))]),r("label",Vy,[ne(r("input",{"onUpdate:modelValue":M[27]||(M[27]=z=>le.isToy=z),type:"checkbox",class:"h-4 w-4 accent-[var(--accent)]"},null,512),[[Ca,le.isToy]]),M[68]||(M[68]=$(" Toy drone (logbook-exempt) ",-1))])]),r("div",Zy,[r("button",{class:"btn-accent",disabled:ae.value,onClick:Ne},S(ae.value?"Saving…":je.value?"Save changes":"Add drone"),9,Hy),r("button",{class:"btn-ghost",onClick:xe},"Cancel"),ce.value?(p(),g("span",jy,S(ce.value),1)):N("",!0)])])):N("",!0),r("div",Wy,[h.value?(p(),g("div",Ky,"Loading…")):u.value.length?(p(),g("div",qy,[r("table",Yy,[r("thead",null,[r("tr",Jy,[(p(),g(ue,null,Fe(["Name","Model","MTOM","Class","FDR",""],z=>r("th",{key:z,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"},S(z),1)),64))])]),r("tbody",null,[(p(!0),g(ue,null,Fe(u.value,z=>(p(),g("tr",{key:z.id,class:Ee(["border-b border-line last:border-0",je.value===z.id?"bg-accent-soft":""])},[r("td",Xy,S(z.name),1),r("td",Qy,S(z.model||"—"),1),r("td",ex,S(z.mtomGrams?z.mtomGrams+" g":"—"),1),r("td",tx,[z.cClass?(p(),g("span",{key:0,class:Ee(["inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",s.accent])},S(z.cClass),3)):(p(),g("span",nx,"—")),z.isToy?(p(),g("span",{key:2,class:Ee(["ml-1 inline-flex rounded-full px-2 py-0.5 text-[11px] font-semibold",s.neutral])},"toy",2)):N("",!0)]),r("td",ix,[r("span",{class:Ee(["text-xs",z.autologsFlights?"text-success-fg":"text-ink-muted"])},S(z.autologsFlights?"yes":"no"),3)]),r("td",ox,[dt.value===z.id?(p(),g(ue,{key:0},[M[71]||(M[71]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:M[28]||(M[28]=vt=>dt.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:vt=>st(z)},"Delete",8,sx)],64)):(p(),g(ue,{key:1},[r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:vt=>ee(z)},[E(X,{name:"sliders",size:13}),M[72]||(M[72]=$(" Edit",-1))],8,ax),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:vt=>dt.value=z.id},[E(X,{name:"trash",size:13})],8,rx)],64))])],2))),128))])])])):(p(),g("div",Gy,[E(X,{name:"drone",size:26,class:"text-ink-muted"}),M[69]||(M[69]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No drones registered",-1)),M[70]||(M[70]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Register the airframes you fly to log flights against them.",-1))]))])],64))]))}},ux={class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},cx={class:"flex flex-wrap items-center gap-3"},dx={class:"inline-flex flex-wrap rounded-lg border border-line bg-surface-1 p-0.5"},fx=["onClick"],hx={class:"ml-auto"},px={class:"grid grid-cols-4 gap-4 max-[900px]:grid-cols-2"},mx={class:"eyebrow"},gx={key:0,class:"panel border-danger/40 p-4 text-sm text-danger-fg"},vx={key:1,class:"panel p-5"},_x={class:"mb-4 flex items-center justify-between"},bx={class:"eyebrow"},yx={class:"mt-0.5 text-base font-semibold text-ink"},xx={class:"grid grid-cols-3 gap-3 max-[760px]:grid-cols-1"},wx={class:"col-span-2 block max-[760px]:col-span-1"},kx={class:"block"},Sx=["value"],Tx={class:"block"},Px=["value"],Cx={class:"block"},Lx=["value"],Ax={class:"block"},Mx={class:"block"},Ex={class:"block"},Ox={class:"block"},zx=["value"],Ix={class:"block"},$x={class:"block"},Nx={class:"block"},Dx=["value"],Fx={class:"mt-3 block"},Rx={key:0,class:"mt-3"},Bx={class:"eyebrow mb-1 block"},Ux={key:1,class:"mt-3 text-xs text-ink-muted"},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={class:"mt-3 text-sm font-medium text-ink-secondary"},qx={class:"mt-1 text-xs text-ink-muted"},Yx={key:2,class:"overflow-x-auto"},Jx={class:"w-full border-collapse text-sm"},Xx={class:"text-left"},Qx={class:"px-5 py-3"},e0={class:"font-semibold text-ink"},t0={key:0,class:"font-mono text-[11px] text-ink-muted"},n0={class:"px-5 py-3 text-ink-secondary"},i0={class:"px-5 py-3 text-ink-secondary"},o0={class:"px-5 py-3"},s0=["onClick"],a0={key:0,class:"mt-0.5 font-mono text-[10.5px] text-ink-muted"},r0={class:"px-5 py-3 font-mono text-ink-secondary"},l0={class:"whitespace-nowrap px-5 py-3 text-right"},u0=["onClick"],c0=["onClick"],d0=["href"],f0=["onClick"],h0=["onClick"],p0=["onClick"],m0={key:0,class:"border-b border-line bg-surface-2"},g0={colspan:"6",class:"px-5 py-3"},v0={class:"flex flex-wrap gap-x-8 gap-y-1.5 text-xs"},_0={class:"text-ink-secondary"},b0={class:"text-ink"},y0={class:"text-ink-secondary"},x0={class:"text-ink"},w0={key:0,class:"text-ink-secondary"},k0={class:"text-ink"},S0={key:1,class:"text-ink-secondary"},T0={class:"font-mono text-ink"},P0={key:2,class:"text-ink-secondary"},C0={class:"font-mono text-ink"},L0={class:"text-ink-secondary"},A0={class:"text-ink"},M0={key:0,class:"mt-2 space-y-1"},E0={key:1,class:"mt-2 text-xs text-success-fg"},O0={key:2,class:"mt-2 text-xs text-ink-secondary"},z0={class:"flex max-h-[90vh] w-full max-w-[920px] flex-col overflow-hidden rounded-lg border border-line bg-surface-1 shadow-2xl"},I0={class:"flex items-center gap-3 border-b border-line px-5 py-3"},$0={class:"min-w-0"},N0={class:"truncate text-sm font-semibold text-ink"},D0={class:"truncate font-mono text-[11px] text-ink-muted"},F0={class:"ml-auto flex items-center gap-2"},R0=["href"],B0=["href"],U0={class:"flex-1 overflow-auto bg-surface-2"},V0=["src","alt"],Z0=["src","title"],H0={key:2,class:"grid place-items-center px-6 py-16 text-center"},j0={class:"mt-1 text-xs text-ink-muted"},W0=["href"],K0={__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(x=>[x.value,x.label])),u=[{value:"pilot",label:"Pilot"},{value:"aircraft",label:"Aircraft"},{value:"organization",label:"Organization"},{value:"client",label:"Client"},{value:"other",label:"Other"}],d=[{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"}],v=j([]),b=j([]),C=j(!1),T=j("");async function A(){C.value=!0,T.value="";const[x,_]=await Promise.all([Lp(),Rc()]);x.ok||(T.value=x.status===503?"Document storage is not configured on the API Server (service account missing).":"Could not load documents."),v.value=x.documents,b.value=_.drones||[],C.value=!1}_i(A);const R=j("all"),B=[["all","All"],["expiring","Expiring soon"],["expired","Expired"],["pending","Pending review"],["archived","Archived"]],Z=ye(()=>{const x=v.value;switch(R.value){case"expiring":return x.filter(_=>{var w;return((w=_.expiry)==null?void 0:w.state)==="expiring_soon"&&_.status!=="archived"});case"expired":return x.filter(_=>{var w;return((w=_.expiry)==null?void 0:w.state)==="expired"&&_.status!=="archived"});case"pending":return x.filter(_=>_.status==="pending_review");case"archived":return x.filter(_=>_.status==="archived");default:return x.filter(_=>_.status!=="archived")}});function F(x){if(x.status==="archived")return{tone:"neutral",label:"Superseded",icon:""};const _=x.expiry||{};return _.state==="expired"?{tone:"danger",label:"Expired",icon:"alertTriangle"}:_.state==="expiring_soon"?{tone:"warning",label:`Expires in ${_.daysUntilExpiry}d`,icon:"clock"}:_.state==="valid"?{tone:"success",label:"Valid",icon:"check"}:{tone:"neutral",label:"No expiry",icon:""}}const he=j("");function pe(x){he.value=he.value===x?"":x}function q(x){return x.ownerDrone?x.ownerDroneName||"Aircraft":x.ownerRef?x.ownerRef:x.ownerType==="pilot"?"Pilot":x.ownerType?x.ownerType.charAt(0).toUpperCase()+x.ownerType.slice(1):"—"}const Ce=["png","jpg","jpeg","gif","webp","svg","bmp","avif"],fe=["pdf","txt","csv","log","json","md","html","htm","xml"];function Be(x){const _=(x||"").split(".").pop().toLowerCase();return Ce.includes(_)?"image":fe.includes(_)?"frame":"none"}const $e=j(null),Ie=ye(()=>$e.value?Be($e.value.fileName):"none"),Ge=ye(()=>$e.value?Op($e.value.id):"");function be(x){$e.value=x}function we(){$e.value=null}function ze(x){x.key==="Escape"&&$e.value&&we()}_i(()=>window.addEventListener("keydown",ze)),Ho(()=>window.removeEventListener("keydown",ze));function ie(){return{title:"",docType:"certificate",ownerType:"pilot",ownerDrone:"",ownerRef:"",reference:"",jurisdiction:"",issueDate:"",expiryDate:"",status:"active",accessTier:"ops",notes:""}}const He=j(!1),oe=j(""),je=j(""),le=j(""),ce=St(ie()),ae=j(null),tt=j(null),ee=j(""),xe=j(!1);function Ne(){ae.value=null,tt.value&&(tt.value.value="")}function dt(){Object.assign(ce,ie()),oe.value="",je.value="",le.value="",Ne(),ee.value="",He.value=!0}function st(x){Object.assign(ce,{title:x.title||"",docType:x.docType||"certificate",ownerType:x.ownerType||"pilot",ownerDrone:x.ownerDrone||"",ownerRef:x.ownerRef||"",reference:x.reference||"",jurisdiction:x.jurisdiction||"",issueDate:x.issueDate||"",expiryDate:x.expiryDate||"",status:x.status||"active",accessTier:x.accessTier||"ops",notes:x.notes||""}),oe.value=x.id,je.value="",le.value="",Ne(),ee.value="",He.value=!0}function Ve(x){st(x),oe.value="",je.value=x.id,le.value=x.title,ce.status="active"}function Y(){He.value=!1,oe.value="",je.value=""}function M(x){var _;ae.value=((_=x.target.files)==null?void 0:_[0])||null}async function z(){var _;if(ee.value="",!ce.title.trim()){ee.value="Give the document a title.";return}xe.value=!0;let x;if(oe.value)x=await Mp(oe.value,{...ce});else{const w={...ce};je.value&&(w.replaces=je.value),x=await Ap(w,ae.value)}if(xe.value=!1,!x.ok){ee.value=((_=x.body)==null?void 0:_.error)||"Could not save the document.";return}He.value=!1,oe.value="",je.value="",await A()}const vt=j("");async function rt(x){var w;const _=await Ep(x.id);vt.value="",_.ok?await A():ee.value=((w=_.body)==null?void 0:w.error)||"Could not delete the document."}const kt=ye(()=>{const x=v.value.filter(_=>_.status!=="archived");return{total:x.length,expiring:x.filter(_=>{var w;return((w=_.expiry)==null?void 0:w.state)==="expiring_soon"}).length,expired:x.filter(_=>{var w;return((w=_.expiry)==null?void 0:w.state)==="expired"}).length,pending:v.value.filter(_=>_.status==="pending_review").length}});return(x,_)=>(p(),g("div",ux,[r("div",cx,[r("div",dx,[(p(),g(ue,null,Fe(B,w=>r("button",{key:w[0],class:Ee(["rounded-md px-3.5 py-1.5 text-sm font-semibold transition",R.value===w[0]?"bg-accent-soft text-accent-soft-fg":"text-ink-secondary hover:text-ink"]),onClick:K=>R.value=w[0]},S(w[1]),11,fx)),64))]),r("div",hx,[r("button",{class:"btn-accent inline-flex items-center gap-2",onClick:dt},[E(X,{name:"upload",size:15}),_[13]||(_[13]=$(" Add document ",-1))])])]),r("div",px,[(p(!0),g(ue,null,Fe([{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"}],w=>(p(),g("div",{key:w.label,class:"panel p-5"},[r("div",mx,S(w.label),1),r("div",{class:Ee(["mt-2 text-[30px] font-bold leading-none tracking-tightest",w.tone==="danger"?"text-danger-fg":w.tone==="warning"?"text-amber-fg":w.tone==="success"?"text-success-fg":w.tone==="accent"?"text-accent-soft-fg":"text-ink"])},S(w.value),3)]))),128))]),T.value?(p(),g("div",gx,S(T.value),1)):N("",!0),He.value?(p(),g("div",vx,[r("div",_x,[r("div",null,[r("div",bx,S(oe.value?"Edit document":je.value?"New version":"New document"),1),r("div",yx,S(je.value?`Supersedes “${le.value}”`:"Compliance & operational document"),1)]),r("button",{class:"btn-icon",onClick:Y},[E(X,{name:"x",size:16})])]),r("div",xx,[r("label",wx,[_[14]||(_[14]=r("span",{class:"eyebrow mb-1 block"},"Title",-1)),ne(r("input",{"onUpdate:modelValue":_[0]||(_[0]=w=>ce.title=w),class:"field",placeholder:"A2 Remote Pilot Certificate — J. Dariusz"},null,512),[[Se,ce.title]])]),r("label",kx,[_[15]||(_[15]=r("span",{class:"eyebrow mb-1 block"},"Type",-1)),ne(r("select",{"onUpdate:modelValue":_[1]||(_[1]=w=>ce.docType=w),class:"field"},[(p(),g(ue,null,Fe(s,w=>r("option",{key:w.value,value:w.value},S(w.label),9,Sx)),64))],512),[[At,ce.docType]])]),r("label",Tx,[_[16]||(_[16]=r("span",{class:"eyebrow mb-1 block"},"Owner type",-1)),ne(r("select",{"onUpdate:modelValue":_[2]||(_[2]=w=>ce.ownerType=w),class:"field"},[(p(),g(ue,null,Fe(u,w=>r("option",{key:w.value,value:w.value},S(w.label),9,Px)),64))],512),[[At,ce.ownerType]])]),r("label",Cx,[_[18]||(_[18]=r("span",{class:"eyebrow mb-1 block"},"Aircraft (if any)",-1)),ne(r("select",{"onUpdate:modelValue":_[3]||(_[3]=w=>ce.ownerDrone=w),class:"field"},[_[17]||(_[17]=r("option",{value:""},"— none —",-1)),(p(!0),g(ue,null,Fe(b.value,w=>(p(),g("option",{key:w.id,value:w.id},S(w.name)+S(w.model?` · ${w.model}`:""),9,Lx))),128))],512),[[At,ce.ownerDrone]])]),r("label",Ax,[_[19]||(_[19]=r("span",{class:"eyebrow mb-1 block"},"Owner reference",-1)),ne(r("input",{"onUpdate:modelValue":_[4]||(_[4]=w=>ce.ownerRef=w),class:"field",placeholder:"Client name / serial / site"},null,512),[[Se,ce.ownerRef]])]),r("label",Mx,[_[20]||(_[20]=r("span",{class:"eyebrow mb-1 block"},"Reference / number",-1)),ne(r("input",{"onUpdate:modelValue":_[5]||(_[5]=w=>ce.reference=w),class:"field",placeholder:"Cert / registration / policy no."},null,512),[[Se,ce.reference]])]),r("label",Ex,[_[21]||(_[21]=r("span",{class:"eyebrow mb-1 block"},"Jurisdiction",-1)),ne(r("input",{"onUpdate:modelValue":_[6]||(_[6]=w=>ce.jurisdiction=w),class:"field",placeholder:"DK / EASA / FAA"},null,512),[[Se,ce.jurisdiction]])]),r("label",Ox,[_[22]||(_[22]=r("span",{class:"eyebrow mb-1 block"},"Access tier",-1)),ne(r("select",{"onUpdate:modelValue":_[7]||(_[7]=w=>ce.accessTier=w),class:"field"},[(p(),g(ue,null,Fe(h,w=>r("option",{key:w.value,value:w.value},S(w.label),9,zx)),64))],512),[[At,ce.accessTier]])]),r("label",Ix,[_[23]||(_[23]=r("span",{class:"eyebrow mb-1 block"},"Issue date",-1)),ne(r("input",{"onUpdate:modelValue":_[8]||(_[8]=w=>ce.issueDate=w),type:"date",class:"field"},null,512),[[Se,ce.issueDate]])]),r("label",$x,[_[24]||(_[24]=r("span",{class:"eyebrow mb-1 block"},"Expiry date",-1)),ne(r("input",{"onUpdate:modelValue":_[9]||(_[9]=w=>ce.expiryDate=w),type:"date",class:"field"},null,512),[[Se,ce.expiryDate]])]),r("label",Nx,[_[25]||(_[25]=r("span",{class:"eyebrow mb-1 block"},"Status",-1)),ne(r("select",{"onUpdate:modelValue":_[10]||(_[10]=w=>ce.status=w),class:"field"},[(p(),g(ue,null,Fe(d,w=>r("option",{key:w.value,value:w.value},S(w.label),9,Dx)),64))],512),[[At,ce.status]])])]),r("label",Fx,[_[26]||(_[26]=r("span",{class:"eyebrow mb-1 block"},"Notes",-1)),ne(r("textarea",{"onUpdate:modelValue":_[11]||(_[11]=w=>ce.notes=w),rows:"2",class:"field",placeholder:"Conditions, renewal contacts, anything worth recording"},null,512),[[Se,ce.notes]])]),oe.value?(p(),g("div",Ux,[..._[28]||(_[28]=[$(" Editing updates metadata only. To replace the file, close this and use ",-1),r("b",{class:"text-ink-secondary"},"New version",-1),$(" on the document — the old version is kept for audit. ",-1)])])):(p(),g("div",Rx,[r("span",Bx,"File "+S(je.value?"(new version)":"(optional)"),1),r("input",{ref_key:"fileInput",ref:tt,type:"file",class:"field",onChange:M},null,544),_[27]||(_[27]=r("p",{class:"mt-1 text-xs text-ink-muted"}," Stored in PocketBase for now (object storage later). Max 50 MB. ",-1))])),r("div",Vx,[r("button",{class:"btn-accent",disabled:xe.value,onClick:z},S(xe.value?"Saving…":oe.value?"Save changes":je.value?"Upload new version":"Add document"),9,Zx),r("button",{class:"btn-ghost",onClick:Y},"Cancel"),ee.value?(p(),g("span",Hx,S(ee.value),1)):N("",!0)])])):N("",!0),r("div",jx,[C.value?(p(),g("div",Wx,"Loading…")):Z.value.length?(p(),g("div",Yx,[r("table",Jx,[r("thead",null,[r("tr",Xx,[(p(),g(ue,null,Fe(["Title","Type","Owner","Expiry","Ver",""],w=>r("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"},S(w),1)),64))])]),r("tbody",null,[(p(!0),g(ue,null,Fe(Z.value,w=>{var K,W;return p(),g(ue,{key:w.id},[r("tr",{class:Ee(["border-b border-line last:border-0",oe.value===w.id?"bg-accent-soft":""])},[r("td",Qx,[r("div",e0,S(w.title),1),w.reference?(p(),g("div",t0,S(w.reference),1)):N("",!0)]),r("td",n0,S(Oe(l)[w.docType]||w.docType||"—"),1),r("td",i0,S(q(w)),1),r("td",o0,[r("button",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",i[F(w).tone]]),onClick:V=>pe(w.id)},[F(w).icon?(p(),at(X,{key:0,name:F(w).icon,size:12},null,8,["name"])):N("",!0),$(" "+S(F(w).label),1)],10,s0),w.expiryDate?(p(),g("div",a0,S(w.expiryDate),1)):N("",!0)]),r("td",r0,"v"+S(w.version||1),1),r("td",l0,[vt.value===w.id?(p(),g(ue,{key:0},[_[29]||(_[29]=r("span",{class:"mr-2 text-xs text-ink-muted"},"Delete?",-1)),r("button",{class:"btn-ghost mr-1",onClick:_[12]||(_[12]=V=>vt.value="")},"Cancel"),r("button",{class:"rounded bg-danger px-3 py-1.5 text-sm font-semibold text-white transition hover:brightness-110",onClick:V=>rt(w)},"Delete",8,u0)],64)):(p(),g(ue,{key:1},[w.hasFile?(p(),g("button",{key:0,class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Preview",onClick:V=>be(w)},[E(X,{name:"eye",size:13})],8,c0)):N("",!0),w.hasFile?(p(),g("a",{key:1,href:Oe(hr)(w.id),class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Download file"},[E(X,{name:"download",size:13})],8,d0)):N("",!0),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",title:"Upload new version",onClick:V=>Ve(w)},[E(X,{name:"upload",size:13})],8,f0),r("button",{class:"btn-ghost mr-1 inline-flex items-center gap-1",onClick:V=>st(w)},[E(X,{name:"sliders",size:13}),_[30]||(_[30]=$(" Edit",-1))],8,h0),r("button",{class:"btn-ghost inline-flex items-center gap-1",onClick:V=>vt.value=w.id},[E(X,{name:"trash",size:13})],8,p0)],64))])],2),he.value===w.id?(p(),g("tr",m0,[r("td",g0,[r("div",v0,[r("span",_0,[_[31]||(_[31]=$("Status: ",-1)),r("b",b0,S(w.status||"—"),1)]),r("span",y0,[_[32]||(_[32]=$("Access: ",-1)),r("b",x0,S(w.accessTier||"—"),1)]),w.jurisdiction?(p(),g("span",w0,[_[33]||(_[33]=$("Jurisdiction: ",-1)),r("b",k0,S(w.jurisdiction),1)])):N("",!0),w.issueDate?(p(),g("span",S0,[_[34]||(_[34]=$("Issued: ",-1)),r("b",T0,S(w.issueDate),1)])):N("",!0),w.expiryDate?(p(),g("span",P0,[_[35]||(_[35]=$("Expires: ",-1)),r("b",C0,S(w.expiryDate),1)])):N("",!0),r("span",L0,[_[36]||(_[36]=$("File: ",-1)),r("b",A0,S(w.hasFile?w.fileName:"none"),1)])]),(((K=w.expiry)==null?void 0:K.flags)||[]).length?(p(),g("ul",M0,[(p(!0),g(ue,null,Fe(w.expiry.flags,(V,re)=>(p(),g("li",{key:re,class:Ee(["flex items-start gap-2 text-xs",w.expiry.state==="expired"?"text-danger-fg":w.expiry.state==="expiring_soon"?"text-amber-fg":"text-ink-secondary"])},[E(X,{name:"alertTriangle",size:13,class:"mt-px shrink-0"}),$(" "+S(V),1)],2))),128))])):((W=w.expiry)==null?void 0:W.state)==="valid"?(p(),g("div",E0,"In force — no action needed.")):N("",!0),w.notes?(p(),g("div",O0,[_[37]||(_[37]=r("span",{class:"text-ink-muted"},"Notes:",-1)),$(" "+S(w.notes),1)])):N("",!0)])])):N("",!0)],64)}),128))])])])):(p(),g("div",Kx,[E(X,{name:"fileText",size:26,class:"text-ink-muted"}),r("div",Gx,S(R.value==="all"?"No documents on file yet":"Nothing in this view"),1),r("div",qx,S(R.value==="all"?"Add certificates, registrations, insurance and authorisations to track their expiry.":"Try a different filter."),1)]))]),(p(),at(lf,{to:"body"},[$e.value?(p(),g("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:Kr(we,["self"])},[r("div",z0,[r("div",I0,[r("div",$0,[r("div",N0,S($e.value.title),1),r("div",D0,S($e.value.fileName),1)]),r("div",F0,[r("a",{href:Ge.value,target:"_blank",rel:"noopener",class:"btn-ghost inline-flex items-center gap-1.5",title:"Open in new tab"},[E(X,{name:"globe",size:14}),_[38]||(_[38]=$(" New tab ",-1))],8,R0),r("a",{href:Oe(hr)($e.value.id),class:"btn-ghost inline-flex items-center gap-1.5",title:"Download"},[E(X,{name:"download",size:14}),_[39]||(_[39]=$(" Download ",-1))],8,B0),r("button",{class:"btn-icon",title:"Close",onClick:we},[E(X,{name:"x",size:16})])])]),r("div",U0,[Ie.value==="image"?(p(),g("img",{key:0,src:Ge.value,alt:$e.value.title,class:"mx-auto block max-w-full"},null,8,V0)):Ie.value==="frame"?(p(),g("iframe",{key:1,src:Ge.value,class:"h-[74vh] w-full border-0 bg-white",title:$e.value.title},null,8,Z0)):(p(),g("div",H0,[E(X,{name:"fileText",size:28,class:"text-ink-muted"}),_[41]||(_[41]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"Preview isn't available for this file type",-1)),r("div",j0,S($e.value.fileName),1),r("a",{href:Oe(hr)($e.value.id),class:"btn-accent mt-4 inline-flex items-center gap-2"},[E(X,{name:"download",size:15}),_[40]||(_[40]=$(" Download instead ",-1))],8,W0)]))])])])):N("",!0)]))]))}},G0={class:"grid h-full grid-cols-[248px_1fr] max-[900px]:grid-cols-1"},q0={class:"flex flex-col border-r border-line bg-surface-1 px-4 py-5 max-[900px]:hidden"},Y0={class:"flex items-center gap-2.5 px-2 pb-5"},J0={class:"flex flex-col gap-0.5"},X0=["onClick"],Q0={class:"mt-auto flex flex-col gap-2.5"},ew={class:"rounded-lg bg-surface-2 p-3"},tw={class:"flex items-center gap-2"},nw={class:"text-xs font-semibold text-ink"},iw={class:"mt-1.5 block font-mono text-[10.5px] text-ink-muted"},ow={class:"flex items-center gap-2.5 px-2 py-1"},sw={class:"grid h-8 w-8 place-items-center rounded-full bg-[var(--navy-800)] text-xs font-bold text-white"},aw={class:"min-w-0 flex-1"},rw={class:"truncate text-[13px] font-semibold text-ink"},lw={class:"flex items-center gap-1.5 text-[11px] text-ink-muted"},uw=["title"],cw={class:"overflow-y-auto"},dw={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)"}},fw={class:"mt-0.5 text-[22px] font-bold tracking-tightest text-ink"},hw={class:"ml-auto flex items-center gap-3"},pw={class:"flex h-10 w-60 items-center gap-2 rounded border border-line-strong bg-surface-1 px-3 max-[1100px]:hidden"},mw={key:0,class:"mx-auto flex max-w-[1240px] flex-col gap-5 p-7"},gw={class:"grid grid-cols-4 gap-4 max-[1100px]:grid-cols-2 max-[560px]:grid-cols-1"},vw={class:"flex items-center justify-between"},_w={class:"eyebrow"},bw={class:"mt-2.5 text-[34px] font-bold leading-none tracking-tightest text-ink"},yw={class:"grid grid-cols-[1.6fr_1fr] gap-5 max-[1100px]:grid-cols-1"},xw={class:"panel p-5"},ww={class:"mb-3.5 flex items-center justify-between"},kw={class:"flex items-center gap-2"},Sw={class:"relative z-[1200]"},Tw={class:"panel absolute right-0 z-[1200] mt-1.5 w-72 p-3.5 shadow-lg"},Pw={class:"flex items-center justify-between gap-3"},Cw={class:"mb-1.5 flex items-center justify-between"},Lw={class:"font-mono text-[11px] text-ink-muted"},Aw=["value"],Mw={key:0,class:"mt-1.5 text-[11px] text-ink-muted"},Ew={key:0,class:"mt-2.5 text-xs text-ink-muted"},Ow={key:1,class:"mt-2.5 text-xs text-ink-muted"},zw={key:2,class:"mt-2.5 text-xs text-ink-muted"},Iw={class:"panel p-5"},$w={class:"mb-3.5 flex items-center justify-between"},Nw={class:"grid place-items-center py-10 text-center"},Dw={class:"panel overflow-hidden p-0"},Fw={class:"flex items-center justify-between px-5 py-4"},Rw={class:"flex gap-2"},Bw={key:0,class:"px-5 py-12 text-center text-sm text-ink-muted"},Uw={key:1,class:"overflow-x-auto"},Vw={class:"w-full border-collapse text-sm"},Zw={class:"text-left"},Hw=["onClick"],jw={class:"px-5 py-3 font-mono font-bold text-ink"},Ww={class:"px-5 py-3 text-ink-secondary"},Kw={class:"px-5 py-3"},Gw={class:"px-5 py-3 font-mono text-ink-secondary"},qw={class:"px-5 py-3"},Yw={key:0,class:"flex items-center gap-2"},Jw={class:"h-1.5 w-12 overflow-hidden rounded bg-surface-2"},Xw={class:"font-mono text-xs text-ink-secondary"},Qw={key:1,class:"font-mono text-xs text-ink-muted"},e2={class:"px-5 py-3 font-mono text-ink-secondary"},t2={class:"px-5 py-3 text-right"},n2=["onClick"],i2={key:1,class:"p-7"},o2={class:"mb-4 flex flex-wrap items-center gap-3"},s2={class:"font-mono text-mode font-bold text-ink"},a2={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"},r2={key:1,class:"ml-auto flex flex-wrap gap-1.5"},l2=["onClick"],u2={key:0,class:"panel grid place-items-center p-16 text-center"},c2={class:"pill"},d2={class:"pill"},f2={class:"pill"},h2={class:"mt-1 text-sm font-semibold text-ink"},p2={class:"pill"},m2={class:"mt-1 font-mono text-sm font-bold tabular text-ink"},g2={class:"grid grid-cols-2 gap-4 max-[820px]:grid-cols-1"},v2={class:"panel p-4"},_2={class:"flex items-center gap-4"},b2={class:"h-9 flex-1 overflow-hidden rounded border border-line bg-surface-2"},y2={class:"readout"},x2={class:"panel p-4"},w2={class:"readout"},k2={class:"panel p-4"},S2={class:"space-y-1.5 text-sm"},T2={class:"flex justify-between"},P2={class:"text-ink"},C2={class:"flex justify-between"},L2={class:"text-ink"},A2={class:"flex justify-between"},M2={class:"font-mono tabular text-ink"},E2={class:"flex justify-between"},O2={class:"font-mono tabular text-ink"},z2={class:"panel p-4"},I2={class:"space-y-1.5 text-sm"},$2={class:"flex justify-between"},N2={class:"font-mono tabular text-ink"},D2={class:"flex justify-between"},F2={class:"font-mono tabular text-ink"},R2={class:"flex justify-between"},B2={class:"font-mono tabular text-ink"},U2={class:"panel col-span-2 p-4 max-[820px]:col-span-1"},V2={class:"panel p-4"},Z2={class:"flex flex-wrap gap-2"},H2={class:"mt-2 min-h-[16px] text-xs text-ink-muted"},j2={class:"panel p-4"},W2={class:"h-[180px] overflow-y-auto font-mono text-xs"},K2={class:"text-ink-muted"},G2={class:"font-semibold text-accent"},q2={class:"break-all text-ink"},Y2={key:5,class:"p-7"},J2={class:"panel grid place-items-center p-16 text-center"},X2={class:"mt-3 text-sm font-medium text-ink-secondary"},Q2={key:0,class:"mt-1 text-xs text-ink-muted"},ek={key:1,class:"mt-1 text-xs text-ink-muted"},tk="34,-25,72,45",nk={__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=St({}),d=St({}),h=j(null),v=j(!1),b=St([]),C=j(""),T=j([]),A=St({unavailable:!1,detail:"",loaded:!1,plan:"",recommendedInterval:30}),R=ye(()=>T.value.filter(U=>!U.onGround).length),B=j(!1);let Z=null;const F=[{value:"auto",label:"Auto"},{value:15,label:"15s"},{value:30,label:"30s"},{value:60,label:"60s"},{value:120,label:"120s"}],he=ye(()=>{if(_e.airTrafficInterval==="auto")return A.recommendedInterval||30;const U=Number(_e.airTrafficInterval);return Number.isFinite(U)&&U>0?U:30}),pe=j(null);let q=!1;function Ce(){if(!(q||pe.value!==null)){if(typeof navigator>"u"||!navigator.geolocation){pe.value=!1;return}q=!0,navigator.geolocation.getCurrentPosition(U=>{pe.value={lat:U.coords.latitude,lng:U.coords.longitude},q=!1},()=>{pe.value=!1,q=!1},{timeout:8e3,maximumAge:6e5})}}function fe(U,O,ke){const Ye=U&&U.telemetry||{},gt=Ye[O],bt=Ye[ke];return typeof gt=="number"&&typeof bt=="number"&&(gt||bt)?{lat:gt,lng:bt}:null}function Be(){const U=fe(ee.value,"latitude","longitude")||tt.value.map(Ye=>fe(u[Ye],"latitude","longitude")).find(Boolean);if(U){const Ye=pr(U.lat,U.lng);if(Ye)return Ye.bbox}const O=fe(ee.value,"phoneLatitude","phoneLongitude")||tt.value.map(Ye=>fe(u[Ye],"phoneLatitude","phoneLongitude")).find(Boolean);if(O){const Ye=pr(O.lat,O.lng);if(Ye)return Ye.bbox}if(Ce(),pe.value){const Ye=pr(pe.value.lat,pe.value.lng);if(Ye)return Ye.bbox}const ke=mm(_e.region);return ke||tk}async function $e(){if(!_e.showAirTraffic)return;const U=_e.autoBbox?Be():void 0,{states:O,unavailable:ke,detail:Ye,plan:gt,recommendedInterval:bt}=await hp(U);T.value=O,A.unavailable=ke,A.detail=Ye,A.plan=gt||"",bt&&(A.recommendedInterval=bt),A.loaded=!0}function Ie(){Z&&clearInterval(Z),Z=setInterval(()=>{we.value==="Overview"&&_e.showAirTraffic&&$e()},he.value*1e3)}function Ge(){$e(),Ie()}function be(){Z&&clearInterval(Z),Z=null}const we=j("Overview"),ze=[["grid","Overview"],["radio","Live flights"],["route","Routes"],["calendar","Schedule"],["book","Logbook"],["fileText","Documents"],["server","Drives"],["settings","Settings"]],ie=ye(()=>(ze.find(([,U])=>U===we.value)||["grid"])[0]),He=j(""),oe=j(""),je=j("");let le=null,ce=null,ae=!1;const tt=ye(()=>Object.keys(u).sort((U,O)=>(u[O].online?1:0)-(u[U].online?1:0)||U.localeCompare(O))),ee=ye(()=>h.value?u[h.value]:null),xe=ye(()=>ee.value&&ee.value.telemetry||{}),Ne=ye(()=>!!(ee.value&&ee.value.online)),dt=ye(()=>{const U=xe.value;return typeof U.latitude=="number"&&typeof U.longitude=="number"&&(U.latitude||U.longitude)?{lat:U.latitude,lng:U.longitude}:null}),st=ye(()=>h.value&&d[h.value]||[]),Ve=ye(()=>{const U=xe.value;return typeof U.velocityX=="number"&&typeof U.velocityY=="number"?Math.hypot(U.velocityX,U.velocityY):null});function Y(U){return U.online?U.connected?["In flight","success"]:["Standby","accent"]:["Offline","neutral"]}function M(U){const O=U&&U.telemetry||{};return typeof O.velocityX=="number"&&typeof O.velocityY=="number"?Math.hypot(O.velocityX,O.velocityY):null}const z=ye(()=>tt.value.map(U=>{const O=u[U],ke=O.telemetry||{},[Ye,gt]=Y(O);return{id:U,mission:O.model||(O.connected?"Drone linked":O.online?"App online":"No signal"),status:Ye,tone:gt,alt:typeof ke.altitude=="number"?ke.altitude.toFixed(0)+" m":"—",battery:typeof ke.batteryPercent=="number"?ke.batteryPercent:null,speed:M(O)}})),vt=ye(()=>tt.value.filter(U=>u[U].online).length),rt=ye(()=>tt.value.filter(U=>u[U].online&&u[U].connected).length),kt=ye(()=>tt.value.filter(U=>!u[U].online).length),x=ye(()=>{const U=tt.value.map(O=>{var ke;return(ke=u[O].telemetry)==null?void 0:ke.batteryPercent}).filter(O=>typeof O=="number");return U.length?Math.round(U.reduce((O,ke)=>O+ke,0)/U.length):null}),_=ye(()=>[{label:"Active flights",value:String(rt.value),delta:`${vt.value} online`,tone:"success",icon:"radio"},{label:"Avg battery",value:x.value==null?"—":x.value+"%",delta:x.value==null?"no telemetry":x.value<40?"low — watch":"nominal",tone:x.value!=null&&x.value<40?"danger":"neutral",icon:"battery"},{label:"Fleet size",value:String(tt.value.length),delta:`${rt.value} in flight`,tone:"neutral",icon:"grid"},{label:"Offline",value:String(kt.value),delta:kt.value?"needs attention":"all reachable",tone:kt.value?"warning":"success",icon:"signal"}]),w={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"},K={success:"text-success-fg",danger:"text-danger-fg",warning:"text-amber-fg",neutral:"text-ink-muted",accent:"text-accent-soft-fg"},W=ye(()=>{var ke,Ye,gt;const O=(s.email||"PV").split("@")[0].split(/[.\-_ ]+/).filter(Boolean);return((((ke=O[0])==null?void 0:ke[0])||"P")+(((Ye=O[1])==null?void 0:Ye[0])||((gt=O[0])==null?void 0:gt[1])||"V")).toUpperCase()}),V={superadmin:"Superadmin",admin:"Admin",user:"Operator"},re=ye(()=>V[s.role]||"Operator"),te=ye(()=>s.organizationName||(s.role==="superadmin"?"All organizations":"No organization"));function Q(U){var ke;u[U.deviceId]=U;const O=U.telemetry||{};typeof O.latitude=="number"&&typeof O.longitude=="number"&&(O.latitude||O.longitude)&&(d[U.deviceId]||(d[U.deviceId]=[]),d[U.deviceId].push([O.latitude,O.longitude]),d[U.deviceId].length>1e3&&d[U.deviceId].shift()),(!h.value||U.online&&!((ke=u[h.value])!=null&&ke.online))&&(h.value=U.deviceId)}function G(U){delete u[U],delete d[U],h.value===U&&(h.value=tt.value[0]||null)}function me(U){b.unshift({t:du(Date.now()),tag:U.type||"?",text:JSON.stringify(se(U))}),b.length>200&&b.pop()}function se(U){const O={...U};return delete O.type,O}function Te(){const U=location.protocol==="https:"?"wss":"ws";le=new WebSocket(`${U}://${location.host}/bff/ws`),le.onopen=()=>v.value=!0,le.onclose=()=>{v.value=!1,ae||(ce=setTimeout(Te,1500))},le.onerror=()=>le&&le.close(),le.onmessage=O=>{let ke;try{ke=JSON.parse(O.data)}catch{return}ke.type==="snapshot"?(ke.devices||[]).forEach(Q):ke.type==="update"&&ke.device?(Q(ke.device),ke.event&&ke.device.deviceId===h.value&&me(ke.event)):ke.type==="removed"&&ke.deviceId&&G(ke.deviceId)}}async function Ae(){if(!h.value)return je.value="No device selected.";if(!He.value.trim())return je.value="Enter a command name.";let U;if(oe.value.trim())try{U=JSON.parse(oe.value)}catch{return je.value="Payload is not valid JSON."}const{ok:O,body:ke}=await zp(h.value,He.value.trim(),U);je.value=O?`Sent "${He.value.trim()}".`:`Error: ${ke.error||"failed"}`}function Ze(U,O,ke=""){return typeof U=="number"?U.toFixed(O)+ke:"—"}function et(U){h.value=U,we.value="Live flights"}return $t(we,U=>{U==="Overview"&&$e()}),$t(()=>_e.showAirTraffic,U=>{U?$e():T.value=[]}),$t(he,Ie),_i(async()=>{(await ep()).forEach(Q),Te(),Ge()}),Ho(()=>{ae=!0,ce&&clearTimeout(ce),le&&le.close(),be()}),(U,O)=>{var ke,Ye,gt,bt,en;return p(),g("div",G0,[r("aside",q0,[r("div",Y0,[E(Hc,{size:26}),O[11]||(O[11]=r("span",{class:"text-[19px] tracking-tightest"},[r("span",{class:"font-medium text-ink-secondary"},"Pilot"),r("span",{class:"font-bold text-ink"},"Vault")],-1))]),r("nav",J0,[(p(),g(ue,null,Fe(ze,([de,wt])=>r("button",{key:wt,class:Ee(["flex items-center gap-3 rounded px-3 py-2.5 text-left text-sm transition",we.value===wt?"bg-accent-soft font-semibold text-accent-soft-fg":"font-medium text-ink-secondary hover:bg-surface-2"]),onClick:an=>we.value=wt},[E(X,{name:de,size:18,stroke:we.value===wt?2.2:1.8},null,8,["name","stroke"]),$(" "+S(wt),1)],10,X0)),64))]),r("div",Q0,[r("div",ew,[r("div",tw,[r("span",{class:Ee(["h-2 w-2 rounded-full",v.value?"bg-ready":"bg-caution"])},null,2),r("span",nw,S(v.value?"Link healthy":"Reconnecting…"),1)]),r("span",iw,"API gateway · "+S(v.value?"streaming":"retrying"),1)]),r("div",ow,[r("div",sw,S(W.value),1),r("div",aw,[r("div",rw,S(t.email||"Operator"),1),r("div",lw,[E(X,{name:"grid",size:11,class:"shrink-0"}),r("span",{class:"truncate",title:`${re.value} · ${te.value}`},S(re.value)+" · "+S(te.value),9,uw)])]),r("button",{class:"text-ink-muted transition hover:text-ink",title:"Log out","aria-label":"Log out",onClick:O[0]||(O[0]=de=>l("logout"))},[E(X,{name:"logout",size:16})])])])]),r("main",cw,[r("header",dw,[r("div",null,[O[12]||(O[12]=r("div",{class:"eyebrow"},"Live operations",-1)),r("h1",fw,S(we.value),1)]),r("div",hw,[r("div",pw,[E(X,{name:"search",size:16,class:"text-ink-muted"}),ne(r("input",{"onUpdate:modelValue":O[1]||(O[1]=de=>C.value=de),placeholder:"Search drones, routes…",class:"w-full border-none bg-transparent text-sm text-ink outline-none placeholder:text-ink-muted"},null,512),[[Se,C.value]])]),r("button",{class:"btn-accent flex items-center gap-2",onClick:O[2]||(O[2]=de=>we.value="Live flights")},[E(X,{name:"radio",size:16}),O[13]||(O[13]=$(" Live flights ",-1))])])]),we.value==="Overview"?(p(),g("div",mw,[r("div",gw,[(p(!0),g(ue,null,Fe(_.value,de=>(p(),g("div",{key:de.label,class:"panel p-5"},[r("div",vw,[r("span",_w,S(de.label),1),E(X,{name:de.icon,size:16,class:"text-ink-muted"},null,8,["name"])]),r("div",bw,S(de.value),1),r("span",{class:Ee(["mt-2 block font-mono text-[11px]",K[de.tone]])},S(de.delta),3)]))),128))]),r("div",yw,[r("div",xw,[r("div",ww,[O[18]||(O[18]=r("div",null,[r("div",{class:"eyebrow"},"Airspace"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Live map")],-1)),r("div",kw,[Oe(_e).showAirTraffic&&R.value?(p(),g("span",{key:0,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",w.accent]),title:"Live aircraft from OpenSky Network"},[E(X,{name:"radio",size:12}),$(S(R.value)+" aircraft ",1)],2)):N("",!0),rt.value?(p(),g("span",{key:1,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",w.success])},[O[14]||(O[14]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(rt.value)+" drones ",1)],2)):N("",!0),r("div",Sw,[r("button",{type:"button",class:Ee(["grid h-7 w-7 place-items-center rounded-md text-ink-muted transition hover:bg-surface-2 hover:text-ink",B.value?"bg-surface-2 text-ink":""]),title:"Map settings","aria-label":"Map settings",onClick:O[3]||(O[3]=de=>B.value=!B.value)},[E(X,{name:"settings",size:16})],2),B.value?(p(),g(ue,{key:0},[r("div",{class:"fixed inset-0 z-[1190]",onClick:O[4]||(O[4]=de=>B.value=!1)}),r("div",Tw,[O[17]||(O[17]=r("div",{class:"eyebrow mb-2.5"},"Map settings",-1)),r("label",Pw,[O[15]||(O[15]=r("span",{class:"text-sm text-ink-secondary"},"Show live air traffic",-1)),E(sn,{modelValue:Oe(_e).showAirTraffic,"onUpdate:modelValue":O[5]||(O[5]=de=>Oe(_e).showAirTraffic=de)},null,8,["modelValue"])]),r("div",{class:Ee(["mt-3.5",Oe(_e).showAirTraffic?"":"pointer-events-none opacity-40"])},[r("div",Cw,[O[16]||(O[16]=r("span",{class:"text-sm text-ink-secondary"},"Refresh interval",-1)),r("span",Lw,"every "+S(he.value)+"s",1)]),ne(r("select",{"onUpdate:modelValue":O[6]||(O[6]=de=>Oe(_e).airTrafficInterval=de),class:"field"},[(p(),g(ue,null,Fe(F,de=>r("option",{key:de.value,value:de.value},S(de.label)+S(de.value==="auto"?` (plan: ${A.recommendedInterval}s)`:""),9,Aw)),64))],512),[[At,Oe(_e).airTrafficInterval]]),A.plan?(p(),g("p",Mw," OpenSky plan: "+S(A.plan),1)):N("",!0)],2)])],64)):N("",!0)])])]),E(mu,{position:dt.value,trail:st.value,aircraft:Oe(_e).showAirTraffic?T.value:[]},null,8,["position","trail","aircraft"]),Oe(_e).showAirTraffic?A.loaded&&A.unavailable?(p(),g("p",Ow,S(A.detail||"Live air traffic is unavailable."),1)):(p(),g("p",zw," Live air traffic from OpenSky Network · updates every "+S(he.value)+"s ",1)):(p(),g("p",Ew," Live air traffic hidden · enable it in Map settings "))]),r("div",Iw,[r("div",$w,[O[19]||(O[19]=r("div",null,[r("div",{class:"eyebrow"},"Today"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Schedule")],-1)),E(X,{name:"clock",size:16,class:"text-ink-muted"})]),r("div",Nw,[E(X,{name:"calendar",size:24,class:"text-ink-muted"}),O[20]||(O[20]=r("div",{class:"mt-2 text-sm font-medium text-ink-secondary"},"No missions scheduled",-1)),O[21]||(O[21]=r("div",{class:"mt-0.5 text-xs text-ink-muted"},"Scheduling is not wired to a backend yet.",-1))])])]),r("div",Dw,[r("div",Fw,[O[24]||(O[24]=r("div",null,[r("div",{class:"eyebrow"},"Fleet"),r("div",{class:"mt-0.5 text-base font-semibold text-ink"},"Aircraft status")],-1)),r("div",Rw,[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",w.success])},[O[22]||(O[22]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(rt.value)+" in flight ",1)],2),kt.value?(p(),g("span",{key:0,class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",w.warning])},[O[23]||(O[23]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(kt.value)+" offline ",1)],2)):N("",!0)])]),z.value.length?(p(),g("div",Uw,[r("table",Vw,[r("thead",null,[r("tr",Zw,[(p(),g(ue,null,Fe(["Aircraft","Mission","Status","Alt","Battery","Speed",""],de=>r("th",{key:de,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"},S(de),1)),64))])]),r("tbody",null,[(p(!0),g(ue,null,Fe(z.value,(de,wt)=>(p(),g("tr",{key:de.id,class:Ee(["cursor-pointer transition hover:bg-surface-2",wtet(de.id)},[r("td",jw,S(de.id),1),r("td",Ww,S(de.mission),1),r("td",Kw,[r("span",{class:Ee(["inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[11px] font-semibold",w[de.tone]])},[O[25]||(O[25]=r("span",{class:"h-1.5 w-1.5 rounded-full bg-current"},null,-1)),$(S(de.status),1)],2)]),r("td",Gw,S(de.alt),1),r("td",qw,[de.battery!=null?(p(),g("div",Yw,[r("div",Jw,[r("div",{class:Ee(["h-full",de.battery<40?"bg-caution":"bg-ready"]),style:Bo({width:de.battery+"%"})},null,6)]),r("span",Xw,S(de.battery)+"%",1)])):(p(),g("span",Qw,"—"))]),r("td",e2,[$(S(de.speed==null?"—":de.speed.toFixed(1))+" ",1),O[26]||(O[26]=r("span",{class:"text-ink-muted"},"m/s",-1))]),r("td",t2,[r("button",{class:"btn-ghost inline-flex items-center gap-1.5 whitespace-nowrap",onClick:Kr(an=>et(de.id),["stop"])},[E(X,{name:"play",size:14}),O[27]||(O[27]=$(" Track ",-1))],8,n2)])],10,Hw))),128))])])])):(p(),g("div",Bw," No aircraft connected yet. Devices appear here as they come online. "))])])):we.value==="Live flights"?(p(),g("div",i2,[r("div",o2,[r("span",s2,S(h.value||"No device selected"),1),ee.value&&!Ne.value?(p(),g("span",a2,"Offline")):N("",!0),tt.value.length?(p(),g("div",r2,[(p(!0),g(ue,null,Fe(tt.value,de=>(p(),g("button",{key:de,class:Ee(["flex items-center gap-2 rounded border px-3 py-1.5 font-mono text-xs font-bold transition",de===h.value?"border-accent bg-accent-soft text-accent-soft-fg":"border-line bg-surface-1 text-ink-secondary hover:border-line-strong"]),onClick:wt=>h.value=de},[r("span",{class:Ee(["h-2 w-2 rounded-full",u[de].online?"bg-ready":"bg-ink-muted"])},null,2),$(" "+S(de),1)],10,l2))),128))])):N("",!0)]),tt.value.length?(p(),g(ue,{key:1},[r("div",{class:Ee(["mb-4 grid gap-3",!Ne.value&&ee.value?"opacity-60":""]),style:{"grid-template-columns":"repeat(auto-fit, minmax(150px, 1fr))"}},[r("div",c2,[O[30]||(O[30]=r("div",{class:"eyebrow"},"Registration",-1)),r("div",{class:Ee(["mt-1 text-sm font-semibold",Ne.value?((ke=ee.value)==null?void 0:ke.registration)==="success"?"text-success-fg":"text-danger-fg":"text-ink"])},S(Ne.value&&((Ye=ee.value)!=null&&Ye.registration)?ee.value.registration:"—"),3)]),r("div",d2,[O[31]||(O[31]=r("div",{class:"eyebrow"},"Drone link",-1)),r("div",{class:Ee(["mt-1 text-sm font-semibold",Ne.value?(gt=ee.value)!=null&>.connected?"text-success-fg":"text-danger-fg":"text-ink"])},S(ee.value?Ne.value?ee.value.connected?"connected":"no drone":"app offline":"—"),3)]),r("div",f2,[O[32]||(O[32]=r("div",{class:"eyebrow"},"Model",-1)),r("div",h2,S(((bt=ee.value)==null?void 0:bt.model)||"—"),1)]),r("div",p2,[O[33]||(O[33]=r("div",{class:"eyebrow"},"Last update",-1)),r("div",m2,S((en=ee.value)!=null&&en.lastSeenMs?Oe(du)(ee.value.lastSeenMs):"—"),1)])],2),r("div",g2,[r("div",v2,[O[35]||(O[35]=r("div",{class:"mb-3 eyebrow"},"Battery",-1)),r("div",_2,[r("div",b2,[r("div",{class:Ee(["h-full transition-all",typeof xe.value.batteryPercent=="number"?xe.value.batteryPercent<20?"bg-warning":xe.value.batteryPercent<40?"bg-caution":"bg-ready":""]),style:Bo({width:(typeof xe.value.batteryPercent=="number"?xe.value.batteryPercent:0)+"%"})},null,6)]),r("div",y2,[$(S(typeof xe.value.batteryPercent=="number"?xe.value.batteryPercent:"—"),1),O[34]||(O[34]=r("span",{class:"text-sm text-ink-secondary"},"%",-1))])])]),r("div",x2,[O[37]||(O[37]=r("div",{class:"mb-3 eyebrow"},"Altitude",-1)),r("div",w2,[$(S(Ze(xe.value.altitude,1)),1),O[36]||(O[36]=r("span",{class:"text-sm text-ink-secondary"}," m",-1))])]),r("div",k2,[O[42]||(O[42]=r("div",{class:"mb-3 eyebrow"},"Flight",-1)),r("div",S2,[r("div",T2,[O[38]||(O[38]=r("span",{class:"text-ink-secondary"},"Mode",-1)),r("b",P2,S(xe.value.flightMode||"—"),1)]),r("div",C2,[O[39]||(O[39]=r("span",{class:"text-ink-secondary"},"Flying",-1)),r("b",L2,S(xe.value.isFlying==null?"—":xe.value.isFlying?"yes":"no"),1)]),r("div",A2,[O[40]||(O[40]=r("span",{class:"text-ink-secondary"},"GPS sats",-1)),r("b",M2,S(xe.value.satelliteCount==null?"—":xe.value.satelliteCount),1)]),r("div",E2,[O[41]||(O[41]=r("span",{class:"text-ink-secondary"},"Speed (H)",-1)),r("b",O2,S(Ve.value==null?"—":Ze(Ve.value,2," m/s")),1)])])]),r("div",z2,[O[46]||(O[46]=r("div",{class:"mb-3 eyebrow"},"Position",-1)),r("div",I2,[r("div",$2,[O[43]||(O[43]=r("span",{class:"text-ink-secondary"},"Latitude",-1)),r("b",N2,S(Ze(xe.value.latitude,6)),1)]),r("div",D2,[O[44]||(O[44]=r("span",{class:"text-ink-secondary"},"Longitude",-1)),r("b",F2,S(Ze(xe.value.longitude,6)),1)]),r("div",R2,[O[45]||(O[45]=r("span",{class:"text-ink-secondary"},"Vert. speed",-1)),r("b",B2,S(Ze(typeof xe.value.velocityZ=="number"?-xe.value.velocityZ:void 0,2," m/s")),1)])])]),r("div",U2,[O[47]||(O[47]=r("div",{class:"mb-3 eyebrow"},"Track",-1)),E(mu,{position:dt.value,trail:st.value},null,8,["position","trail"])]),r("div",V2,[O[48]||(O[48]=r("div",{class:"mb-3 eyebrow"},"Send command",-1)),r("div",Z2,[ne(r("input",{"onUpdate:modelValue":O[7]||(O[7]=de=>He.value=de),class:"field flex-1",placeholder:"command (e.g. startConnection)"},null,512),[[Se,He.value]]),ne(r("input",{"onUpdate:modelValue":O[8]||(O[8]=de=>oe.value=de),class:"field flex-1",placeholder:"payload JSON (optional)"},null,512),[[Se,oe.value]]),r("button",{class:"btn-accent",onClick:Ae},"Send")]),r("div",H2,S(je.value),1)]),r("div",j2,[O[49]||(O[49]=r("div",{class:"mb-3 eyebrow"},"Event log",-1)),r("div",W2,[(p(!0),g(ue,null,Fe(b,(de,wt)=>(p(),g("div",{key:wt,class:"border-b border-line py-1"},[r("span",K2,S(de.t),1),r("span",G2,S(de.tag),1),r("span",q2,S(de.text),1)]))),128))])])])],64)):(p(),g("div",u2,[E(X,{name:"radio",size:28,class:"text-ink-muted"}),O[28]||(O[28]=r("div",{class:"mt-3 text-sm font-medium text-ink-secondary"},"No aircraft online",-1)),O[29]||(O[29]=r("div",{class:"mt-1 text-xs text-ink-muted"},"Live telemetry appears here once a drone connects.",-1))]))])):we.value==="Logbook"?(p(),at(lx,{key:2,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):we.value==="Documents"?(p(),at(K0,{key:3,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName},null,8,["email","role","organization","organization-name"])):we.value==="Settings"?(p(),at(db,{key:4,email:t.email,role:t.role,organization:t.organization,"organization-name":t.organizationName,onLogout:O[9]||(O[9]=de=>l("logout"))},null,8,["email","role","organization","organization-name"])):(p(),g("div",Y2,[r("div",J2,[E(X,{name:ie.value,size:28,class:"text-ink-muted"},null,8,["name"]),r("div",X2,S(we.value),1),we.value==="Drives"?(p(),g("div",Q2,[O[50]||(O[50]=$(" Browse and transfer files here once a drive is connected. Configure drives in ",-1)),r("button",{class:"font-semibold text-accent hover:underline",onClick:O[10]||(O[10]=de=>we.value="Settings")},"Settings → Integrations"),O[51]||(O[51]=$(". ",-1))])):(p(),g("div",ek,"This section is part of the console shell and has no backend yet."))])]))])])}}},ik={key:0,class:"h-full"},ok={key:1,class:"grid h-full place-items-center text-ink-muted text-sm"},sk={__name:"App",setup(t){const i=j(!1),s=j(null),l=j("user"),u=j(""),d=j(""),h=j("");function v(T){l.value=T&&T.role||"user",u.value=T&&T.organization||"",d.value=T&&T.organizationName||""}_i(async()=>{h.value=(await Jh()).apiBase||"";const T=await ru();T&&(s.value=T.email,v(T),await hu()),i.value=!0});async function b(T){s.value=T,v(await ru()),await hu()}async function C(){Fp(),await Qh(),s.value=null,l.value="user",u.value="",d.value=""}return(T,A)=>i.value?(p(),g("div",ik,[s.value?(p(),at(nk,{key:0,email:s.value,role:l.value,organization:u.value,"organization-name":d.value,onLogout:C},null,8,["email","role","organization","organization-name"])):(p(),at(tm,{key:1,"default-api-base":h.value,onSignedIn:b},null,8,["default-api-base"]))])):(p(),g("div",ok,"Loading…"))}};Kh(sk).mount("#app"); diff --git a/Web App/server/dist/assets/index-CcgvhCJr.css b/Web App/server/dist/assets/index-D7rbxd3q.css similarity index 52% rename from Web App/server/dist/assets/index-CcgvhCJr.css rename to Web App/server/dist/assets/index-D7rbxd3q.css index d3746df..5654cdf 100644 --- a/Web App/server/dist/assets/index-CcgvhCJr.css +++ b/Web App/server/dist/assets/index-D7rbxd3q.css @@ -1 +1 @@ -:root,[data-theme=light]{--navy-950: #0B1730;--navy-900: #0F1E3D;--navy-800: #1B2E52;--navy-700: #26406E;--blue-50: #EAF1FE;--blue-100: #D6E3FD;--blue-200: #B4CDFA;--blue-300: #8FB4F6;--blue-400: #5B93F5;--blue-500: #3D7BF0;--blue-600: #2B62CC;--blue-700: #1F4CA0;--slate-0: #FFFFFF;--slate-50: #F6F7F9;--slate-100: #EEF0F3;--slate-150: #E6E9EE;--slate-200: #DCE0E7;--slate-300: #C5CCD7;--slate-400: #97A1B0;--slate-500: #6B7688;--slate-600: #4C5566;--slate-700: #333B4A;--slate-800: #1E2635;--slate-900: #131A28;--slate-950: #0B111C;--steel: #5A6B85;--green-500: #1F8A5B;--green-100: #DCF1E7;--green-600:#177049;--amber-500: #D9852B;--amber-100: #FBEBD5;--amber-600:#B86C1B;--red-500: #D64545;--red-100: #FBE0E0;--red-600: #B83232;--bg-app: var(--slate-100);--bg-subtle: var(--slate-50);--surface: var(--slate-0);--surface-2: var(--slate-50);--surface-inset: var(--slate-100);--border: var(--slate-200);--border-strong: var(--slate-300);--border-subtle: var(--slate-150);--text-primary: var(--navy-900);--text-secondary:var(--steel);--text-tertiary: var(--slate-400);--text-inverse: var(--slate-0);--text-on-accent:#FFFFFF;--accent: var(--blue-500);--accent-hover: var(--blue-600);--accent-active: var(--blue-700);--accent-soft: var(--blue-50);--accent-soft-fg:var(--blue-700);--focus-ring: color-mix(in srgb, var(--blue-500) 45%, transparent);--success: var(--green-500);--success-soft: var(--green-100);--success-fg: var(--green-600);--warning: var(--amber-500);--warning-soft: var(--amber-100);--warning-fg: var(--amber-600);--danger: var(--red-500);--danger-soft: var(--red-100);--danger-fg: var(--red-600);--overlay: color-mix(in srgb, var(--navy-950) 55%, transparent);--font-sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--font-mono: "Space Mono", ui-monospace, "SF Mono", "JetBrains Mono", monospace;--radius-xs: 4px;--radius-sm: 6px;--radius-md: 10px;--radius-lg: 14px;--radius-xl: 20px;--radius-pill: 999px;--shadow-xs: 0 1px 2px rgba(15,30,61,.06);--shadow-sm: 0 1px 2px rgba(15,30,61,.06), 0 1px 3px rgba(15,30,61,.04);--shadow-md: 0 2px 4px rgba(15,30,61,.06), 0 6px 16px rgba(15,30,61,.08);--shadow-lg: 0 8px 24px rgba(15,30,61,.1), 0 2px 6px rgba(15,30,61,.06);--ease-standard: cubic-bezier(.4, 0, .2, 1);--ease-out: cubic-bezier(.16, 1, .3, 1);--dur-fast: .12s;--dur-base: .2s;color-scheme:light}[data-theme=dark]{--bg-app: var(--navy-950);--bg-subtle: var(--slate-950);--surface: #10203F;--surface-2: #142748;--surface-inset: var(--navy-950);--border: color-mix(in srgb, #FFFFFF 10%, transparent);--border-strong: color-mix(in srgb, #FFFFFF 18%, transparent);--border-subtle: color-mix(in srgb, #FFFFFF 6%, transparent);--text-primary: #F4F7FC;--text-secondary:#8FA0BE;--text-tertiary: #5E6E8C;--text-inverse: var(--navy-900);--text-on-accent:#FFFFFF;--accent: var(--blue-400);--accent-hover: var(--blue-300);--accent-active: var(--blue-200);--accent-soft: color-mix(in srgb, var(--blue-500) 18%, transparent);--accent-soft-fg:var(--blue-300);--focus-ring: color-mix(in srgb, var(--blue-400) 55%, transparent);--success:var(--green-500);--success-soft: color-mix(in srgb, var(--green-500) 22%, transparent);--success-fg:#5FD3A0;--warning:var(--amber-500);--warning-soft: color-mix(in srgb, var(--amber-500) 22%, transparent);--warning-fg:#F0B26A;--danger: var(--red-500);--danger-soft: color-mix(in srgb, var(--red-500) 22%, transparent);--danger-fg: #F08A8A;--overlay: color-mix(in srgb, #000000 62%, transparent);--shadow-xs: 0 1px 2px rgba(0,0,0,.35);--shadow-sm: 0 1px 3px rgba(0,0,0,.4);--shadow-md: 0 4px 12px rgba(0,0,0,.45);--shadow-lg: 0 12px 32px rgba(0,0,0,.5);color-scheme:dark}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Space Grotesk,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.tabular{font-variant-numeric:tabular-nums}.eyebrow{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-size:11px;text-transform:uppercase;letter-spacing:.14em;color:var(--text-tertiary)}.readout{font-variant-numeric:tabular-nums;font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-size:30px;line-height:1;font-weight:500;color:var(--text-primary)}.panel{border-radius:14px;border-width:1px;border-color:var(--border);background-color:var(--surface);--tw-shadow: var(--shadow-xs);--tw-shadow-colored: var(--shadow-xs);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.pill{border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface-2);padding:.5rem .75rem}.field{width:100%;border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface-2);padding:.625rem .75rem;font-size:.875rem;line-height:1.25rem;color:var(--text-primary);outline:2px solid transparent;outline-offset:2px;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.field::-moz-placeholder{color:var(--text-tertiary)}.field::placeholder{color:var(--text-tertiary)}.field{transition-duration:var(--dur-fast)}.field:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--focus-ring)}.btn-accent{border-radius:10px;background-color:var(--accent);padding:.625rem 1rem;font-size:.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-accent:hover{background-color:var(--accent-hover)}.btn-accent:active{--tw-translate-y: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.btn-accent:disabled{opacity:.5}.btn-accent{transition-duration:var(--dur-fast)}.btn-ghost{border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface);padding:.375rem .75rem;font-size:.875rem;line-height:1.25rem;color:var(--text-secondary);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-ghost:hover{border-color:var(--border-strong);color:var(--text-primary)}.btn-ghost:active{--tw-translate-y: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.btn-ghost{transition-duration:var(--dur-fast)}.btn-icon{display:grid;height:2.25rem;width:2.25rem;place-items:center;border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface);color:var(--text-secondary);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-icon:hover{border-color:var(--border-strong);color:var(--text-primary)}.btn-icon{transition-duration:var(--dur-fast)}.pointer-events-none{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.bottom-5{bottom:1.25rem}.right-0{right:0}.right-5{right:1.25rem}.top-0{top:0}.top-5{top:1.25rem}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[1190\]{z-index:1190}.z-\[1200\]{z-index:1200}.col-span-2{grid-column:span 2 / span 2}.mx-auto{margin-left:auto;margin-right:auto}.my-4{margin-top:1rem;margin-bottom:1rem}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-2\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-3\.5{margin-bottom:.875rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-3\.5{margin-top:.875rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.mt-px{margin-top:1px}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-28{height:7rem}.h-4{height:1rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[180px\]{height:180px}.h-\[18px\]{height:18px}.h-\[320px\]{height:320px}.h-\[74vh\]{height:74vh}.h-full{height:100%}.max-h-\[90vh\]{max-height:90vh}.min-h-\[16px\]{min-height:16px}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-24{width:6rem}.w-28{width:7rem}.w-32{width:8rem}.w-4{width:1rem}.w-44{width:11rem}.w-48{width:12rem}.w-56{width:14rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[18px\]{width:18px}.w-\[380px\]{width:380px}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\[1240px\]{max-width:1240px}.max-w-\[1280px\]{max-width:1280px}.max-w-\[220px\]{max-width:220px}.max-w-\[280px\]{max-width:280px}.max-w-\[360px\]{max-width:360px}.max-w-\[420px\]{max-width:420px}.max-w-\[520px\]{max-width:520px}.max-w-\[920px\]{max-width:920px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.translate-x-1{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-6{--tw-translate-x: 1.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize-none{resize:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-\[1\.6fr_1fr\]{grid-template-columns:1.6fr 1fr}.grid-cols-\[210px_1fr\]{grid-template-columns:210px 1fr}.grid-cols-\[248px_1fr\]{grid-template-columns:248px 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-x-8{-moz-column-gap:2rem;column-gap:2rem}.gap-y-1\.5{row-gap:.375rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-all{word-break:break-all}.rounded,.rounded-\[10px\]{border-radius:10px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:14px}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-0{border-width:0px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-r{border-right-width:1px}.border-none{border-style:none}.border-accent{border-color:var(--accent)}.border-line{border-color:var(--border)}.border-line-strong{border-color:var(--border-strong)}.border-transparent{border-color:transparent}.bg-\[var\(--navy-800\)\]{background-color:var(--navy-800)}.bg-accent{background-color:var(--accent)}.bg-accent-soft{background-color:var(--accent-soft)}.bg-amber{background-color:var(--warning)}.bg-amber-soft{background-color:var(--warning-soft)}.bg-caution{background-color:var(--warning)}.bg-current{background-color:currentColor}.bg-danger{background-color:var(--danger)}.bg-danger-soft{background-color:var(--danger-soft)}.bg-ink-muted{background-color:var(--text-tertiary)}.bg-line{background-color:var(--border)}.bg-ready,.bg-success{background-color:var(--success)}.bg-success-soft{background-color:var(--success-soft)}.bg-surface-1{background-color:var(--surface)}.bg-surface-2{background-color:var(--surface-2)}.bg-transparent{background-color:transparent}.bg-warning{background-color:var(--danger)}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-10{padding:2.5rem}.p-16{padding:4rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-3\.5{padding:.875rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-7{padding:1.75rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-8{padding-bottom:2rem}.pr-10{padding-right:2.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[10\.5px\]{font-size:10.5px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[19px\]{font-size:19px}.text-\[22px\]{font-size:22px}.text-\[30px\]{font-size:30px}.text-\[34px\]{font-size:34px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-mode{font-size:18px;line-height:1.2;letter-spacing:-.02em;font-weight:600}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-\[0\.3em\]{letter-spacing:.3em}.tracking-caps{letter-spacing:.14em}.tracking-tightest{letter-spacing:-.02em}.text-accent{color:var(--accent)}.text-accent-soft-fg{color:var(--accent-soft-fg)}.text-amber-fg{color:var(--warning-fg)}.text-danger-fg{color:var(--danger-fg)}.text-ink{color:var(--text-primary)}.text-ink-muted{color:var(--text-tertiary)}.text-ink-secondary{color:var(--text-secondary)}.text-success-fg{color:var(--success-fg)}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.accent-\[var\(--accent\)\]{accent-color:var(--accent)}.accent-\[var\(--danger\)\]{accent-color:var(--danger)}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: var(--shadow-lg);--tw-shadow-colored: var(--shadow-lg);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: var(--shadow-md);--tw-shadow-colored: var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xs{--tw-shadow: var(--shadow-xs);--tw-shadow-colored: var(--shadow-xs);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}html,body,#app{height:100%}html{background-color:var(--bg-app);transition:background-color var(--dur-base) var(--ease-standard)}body{font-family:Space Grotesk,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;color:var(--text-primary);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#app{background-color:var(--bg-app);min-height:100vh;transition:background-color var(--dur-base) var(--ease-standard)}html.reduce-motion *,html.reduce-motion *:before,html.reduce-motion *:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important}.leaflet-container{background:var(--surface-inset);font-family:var(--font-sans)}.leaflet-control-attribution{background:color-mix(in srgb,var(--surface) 82%,transparent)!important;color:var(--text-tertiary)!important}.leaflet-control-attribution a{color:var(--text-secondary)!important}.placeholder\:text-ink-muted::-moz-placeholder{color:var(--text-tertiary)}.placeholder\:text-ink-muted::placeholder{color:var(--text-tertiary)}.first\:mt-0:first-child{margin-top:0}.last\:border-0:last-child{border-width:0px}.hover\:border-line-strong:hover{border-color:var(--border-strong)}.hover\:bg-danger-soft:hover{background-color:var(--danger-soft)}.hover\:bg-surface-2:hover{background-color:var(--surface-2)}.hover\:text-ink:hover{color:var(--text-primary)}.hover\:text-ink-secondary:hover{color:var(--text-secondary)}.hover\:underline:hover{text-decoration-line:underline}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.enabled\:hover\:brightness-110:hover:enabled{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(max-width:1100px){.max-\[1100px\]\:hidden{display:none}.max-\[1100px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[1100px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:900px){.max-\[900px\]\:hidden{display:none}.max-\[900px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[900px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:820px){.max-\[820px\]\:col-span-1{grid-column:span 1 / span 1}.max-\[820px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}@media(max-width:760px){.max-\[760px\]\:col-span-1{grid-column:span 1 / span 1}.max-\[760px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[760px\]\:flex-row{flex-direction:row}.max-\[760px\]\:overflow-x-auto{overflow-x:auto}}@media(max-width:560px){.max-\[560px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}@media(min-width:640px){.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}.fade-enter-active[data-v-f495a614],.fade-leave-active[data-v-f495a614]{transition:opacity .2s}.fade-enter-from[data-v-f495a614],.fade-leave-to[data-v-f495a614]{opacity:0} +:root,[data-theme=light]{--navy-950: #0B1730;--navy-900: #0F1E3D;--navy-800: #1B2E52;--navy-700: #26406E;--blue-50: #EAF1FE;--blue-100: #D6E3FD;--blue-200: #B4CDFA;--blue-300: #8FB4F6;--blue-400: #5B93F5;--blue-500: #3D7BF0;--blue-600: #2B62CC;--blue-700: #1F4CA0;--slate-0: #FFFFFF;--slate-50: #F6F7F9;--slate-100: #EEF0F3;--slate-150: #E6E9EE;--slate-200: #DCE0E7;--slate-300: #C5CCD7;--slate-400: #97A1B0;--slate-500: #6B7688;--slate-600: #4C5566;--slate-700: #333B4A;--slate-800: #1E2635;--slate-900: #131A28;--slate-950: #0B111C;--steel: #5A6B85;--green-500: #1F8A5B;--green-100: #DCF1E7;--green-600:#177049;--amber-500: #D9852B;--amber-100: #FBEBD5;--amber-600:#B86C1B;--red-500: #D64545;--red-100: #FBE0E0;--red-600: #B83232;--bg-app: var(--slate-100);--bg-subtle: var(--slate-50);--surface: var(--slate-0);--surface-2: var(--slate-50);--surface-inset: var(--slate-100);--border: var(--slate-200);--border-strong: var(--slate-300);--border-subtle: var(--slate-150);--text-primary: var(--navy-900);--text-secondary:var(--steel);--text-tertiary: var(--slate-400);--text-inverse: var(--slate-0);--text-on-accent:#FFFFFF;--accent: var(--blue-500);--accent-hover: var(--blue-600);--accent-active: var(--blue-700);--accent-soft: var(--blue-50);--accent-soft-fg:var(--blue-700);--focus-ring: color-mix(in srgb, var(--blue-500) 45%, transparent);--success: var(--green-500);--success-soft: var(--green-100);--success-fg: var(--green-600);--warning: var(--amber-500);--warning-soft: var(--amber-100);--warning-fg: var(--amber-600);--danger: var(--red-500);--danger-soft: var(--red-100);--danger-fg: var(--red-600);--overlay: color-mix(in srgb, var(--navy-950) 55%, transparent);--font-sans: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;--font-mono: "Space Mono", ui-monospace, "SF Mono", "JetBrains Mono", monospace;--radius-xs: 4px;--radius-sm: 6px;--radius-md: 10px;--radius-lg: 14px;--radius-xl: 20px;--radius-pill: 999px;--shadow-xs: 0 1px 2px rgba(15,30,61,.06);--shadow-sm: 0 1px 2px rgba(15,30,61,.06), 0 1px 3px rgba(15,30,61,.04);--shadow-md: 0 2px 4px rgba(15,30,61,.06), 0 6px 16px rgba(15,30,61,.08);--shadow-lg: 0 8px 24px rgba(15,30,61,.1), 0 2px 6px rgba(15,30,61,.06);--ease-standard: cubic-bezier(.4, 0, .2, 1);--ease-out: cubic-bezier(.16, 1, .3, 1);--dur-fast: .12s;--dur-base: .2s;color-scheme:light}[data-theme=dark]{--bg-app: var(--navy-950);--bg-subtle: var(--slate-950);--surface: #10203F;--surface-2: #142748;--surface-inset: var(--navy-950);--border: color-mix(in srgb, #FFFFFF 10%, transparent);--border-strong: color-mix(in srgb, #FFFFFF 18%, transparent);--border-subtle: color-mix(in srgb, #FFFFFF 6%, transparent);--text-primary: #F4F7FC;--text-secondary:#8FA0BE;--text-tertiary: #5E6E8C;--text-inverse: var(--navy-900);--text-on-accent:#FFFFFF;--accent: var(--blue-400);--accent-hover: var(--blue-300);--accent-active: var(--blue-200);--accent-soft: color-mix(in srgb, var(--blue-500) 18%, transparent);--accent-soft-fg:var(--blue-300);--focus-ring: color-mix(in srgb, var(--blue-400) 55%, transparent);--success:var(--green-500);--success-soft: color-mix(in srgb, var(--green-500) 22%, transparent);--success-fg:#5FD3A0;--warning:var(--amber-500);--warning-soft: color-mix(in srgb, var(--amber-500) 22%, transparent);--warning-fg:#F0B26A;--danger: var(--red-500);--danger-soft: color-mix(in srgb, var(--red-500) 22%, transparent);--danger-fg: #F08A8A;--overlay: color-mix(in srgb, #000000 62%, transparent);--shadow-xs: 0 1px 2px rgba(0,0,0,.35);--shadow-sm: 0 1px 3px rgba(0,0,0,.4);--shadow-md: 0 4px 12px rgba(0,0,0,.45);--shadow-lg: 0 12px 32px rgba(0,0,0,.5);color-scheme:dark}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Space Grotesk,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.tabular{font-variant-numeric:tabular-nums}.eyebrow{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-size:11px;text-transform:uppercase;letter-spacing:.14em;color:var(--text-tertiary)}.readout{font-variant-numeric:tabular-nums;font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace;font-size:30px;line-height:1;font-weight:500;color:var(--text-primary)}.panel{border-radius:14px;border-width:1px;border-color:var(--border);background-color:var(--surface);--tw-shadow: var(--shadow-xs);--tw-shadow-colored: var(--shadow-xs);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.pill{border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface-2);padding:.5rem .75rem}.field{width:100%;border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface-2);padding:.625rem .75rem;font-size:.875rem;line-height:1.25rem;color:var(--text-primary);outline:2px solid transparent;outline-offset:2px;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.field::-moz-placeholder{color:var(--text-tertiary)}.field::placeholder{color:var(--text-tertiary)}.field{transition-duration:var(--dur-fast)}.field:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--focus-ring)}.btn-accent{border-radius:10px;background-color:var(--accent);padding:.625rem 1rem;font-size:.875rem;line-height:1.25rem;font-weight:600;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-accent:hover{background-color:var(--accent-hover)}.btn-accent:active{--tw-translate-y: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.btn-accent:disabled{opacity:.5}.btn-accent{transition-duration:var(--dur-fast)}.btn-ghost{border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface);padding:.375rem .75rem;font-size:.875rem;line-height:1.25rem;color:var(--text-secondary);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-ghost:hover{border-color:var(--border-strong);color:var(--text-primary)}.btn-ghost:active{--tw-translate-y: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.btn-ghost{transition-duration:var(--dur-fast)}.btn-icon{display:grid;height:2.25rem;width:2.25rem;place-items:center;border-radius:10px;border-width:1px;border-color:var(--border);background-color:var(--surface);color:var(--text-secondary);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.btn-icon:hover{border-color:var(--border-strong);color:var(--text-primary)}.btn-icon{transition-duration:var(--dur-fast)}.pointer-events-none{pointer-events:none}.\!visible{visibility:visible!important}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.bottom-5{bottom:1.25rem}.right-0{right:0}.right-5{right:1.25rem}.top-0{top:0}.top-5{top:1.25rem}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[1190\]{z-index:1190}.z-\[1200\]{z-index:1200}.col-span-2{grid-column:span 2 / span 2}.mx-auto{margin-left:auto;margin-right:auto}.my-4{margin-top:1rem;margin-bottom:1rem}.-mb-px{margin-bottom:-1px}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-2\.5{margin-bottom:.625rem}.mb-3{margin-bottom:.75rem}.mb-3\.5{margin-bottom:.875rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.ml-1{margin-left:.25rem}.ml-1\.5{margin-left:.375rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-3{margin-top:.75rem}.mt-3\.5{margin-top:.875rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.mt-px{margin-top:1px}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-28{height:7rem}.h-4{height:1rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[180px\]{height:180px}.h-\[18px\]{height:18px}.h-\[320px\]{height:320px}.h-\[74vh\]{height:74vh}.h-full{height:100%}.max-h-\[90vh\]{max-height:90vh}.min-h-\[16px\]{min-height:16px}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-24{width:6rem}.w-28{width:7rem}.w-32{width:8rem}.w-4{width:1rem}.w-40{width:10rem}.w-44{width:11rem}.w-48{width:12rem}.w-56{width:14rem}.w-60{width:15rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[18px\]{width:18px}.w-\[380px\]{width:380px}.w-full{width:100%}.min-w-0{min-width:0px}.max-w-\[1240px\]{max-width:1240px}.max-w-\[1280px\]{max-width:1280px}.max-w-\[220px\]{max-width:220px}.max-w-\[280px\]{max-width:280px}.max-w-\[360px\]{max-width:360px}.max-w-\[420px\]{max-width:420px}.max-w-\[520px\]{max-width:520px}.max-w-\[920px\]{max-width:920px}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.translate-x-1{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-6{--tw-translate-x: 1.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.select-all{-webkit-user-select:all;-moz-user-select:all;user-select:all}.resize-none{resize:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.grid-cols-\[1\.6fr_1fr\]{grid-template-columns:1.6fr 1fr}.grid-cols-\[210px_1fr\]{grid-template-columns:210px 1fr}.grid-cols-\[248px_1fr\]{grid-template-columns:248px 1fr}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.place-items-center{place-items:center}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-x-8{-moz-column-gap:2rem;column-gap:2rem}.gap-y-1\.5{row-gap:.375rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.break-all{word-break:break-all}.rounded,.rounded-\[10px\]{border-radius:10px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:14px}.rounded-md{border-radius:.375rem}.border{border-width:1px}.border-0{border-width:0px}.border-y{border-top-width:1px;border-bottom-width:1px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-r{border-right-width:1px}.border-none{border-style:none}.border-accent{border-color:var(--accent)}.border-line{border-color:var(--border)}.border-line-strong{border-color:var(--border-strong)}.border-transparent{border-color:transparent}.bg-\[var\(--navy-800\)\]{background-color:var(--navy-800)}.bg-accent{background-color:var(--accent)}.bg-accent-soft{background-color:var(--accent-soft)}.bg-amber{background-color:var(--warning)}.bg-amber-soft{background-color:var(--warning-soft)}.bg-caution{background-color:var(--warning)}.bg-current{background-color:currentColor}.bg-danger{background-color:var(--danger)}.bg-danger-soft{background-color:var(--danger-soft)}.bg-ink-muted{background-color:var(--text-tertiary)}.bg-line{background-color:var(--border)}.bg-ready,.bg-success{background-color:var(--success)}.bg-success-soft{background-color:var(--success-soft)}.bg-surface-1{background-color:var(--surface)}.bg-surface-2{background-color:var(--surface-2)}.bg-transparent{background-color:transparent}.bg-warning{background-color:var(--danger)}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-10{padding:2.5rem}.p-16{padding:4rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-3\.5{padding:.875rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-7{padding:1.75rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-12{padding-top:3rem;padding-bottom:3rem}.py-16{padding-top:4rem;padding-bottom:4rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-8{padding-bottom:2rem}.pr-10{padding-right:2.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:Space Mono,ui-monospace,SF Mono,JetBrains Mono,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[10\.5px\]{font-size:10.5px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[13px\]{font-size:13px}.text-\[19px\]{font-size:19px}.text-\[22px\]{font-size:22px}.text-\[30px\]{font-size:30px}.text-\[34px\]{font-size:34px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-mode{font-size:18px;line-height:1.2;letter-spacing:-.02em;font-weight:600}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.leading-none{line-height:1}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-\[0\.3em\]{letter-spacing:.3em}.tracking-caps{letter-spacing:.14em}.tracking-tightest{letter-spacing:-.02em}.text-accent{color:var(--accent)}.text-accent-soft-fg{color:var(--accent-soft-fg)}.text-amber-fg{color:var(--warning-fg)}.text-danger-fg{color:var(--danger-fg)}.text-ink{color:var(--text-primary)}.text-ink-muted{color:var(--text-tertiary)}.text-ink-secondary{color:var(--text-secondary)}.text-success-fg{color:var(--success-fg)}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.accent-\[var\(--accent\)\]{accent-color:var(--accent)}.accent-\[var\(--danger\)\]{accent-color:var(--danger)}.opacity-40{opacity:.4}.opacity-60{opacity:.6}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: var(--shadow-lg);--tw-shadow-colored: var(--shadow-lg);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: var(--shadow-md);--tw-shadow-colored: var(--shadow-md);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: var(--shadow-sm);--tw-shadow-colored: var(--shadow-sm);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xs{--tw-shadow: var(--shadow-xs);--tw-shadow-colored: var(--shadow-xs);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.blur{--tw-blur: blur(8px);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}html,body,#app{height:100%}html{background-color:var(--bg-app);transition:background-color var(--dur-base) var(--ease-standard)}body{font-family:Space Grotesk,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;color:var(--text-primary);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}#app{background-color:var(--bg-app);min-height:100vh;transition:background-color var(--dur-base) var(--ease-standard)}html.reduce-motion *,html.reduce-motion *:before,html.reduce-motion *:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important}.leaflet-container{background:var(--surface-inset);font-family:var(--font-sans)}.leaflet-control-attribution{background:color-mix(in srgb,var(--surface) 82%,transparent)!important;color:var(--text-tertiary)!important}.leaflet-control-attribution a{color:var(--text-secondary)!important}.placeholder\:text-ink-muted::-moz-placeholder{color:var(--text-tertiary)}.placeholder\:text-ink-muted::placeholder{color:var(--text-tertiary)}.first\:mt-0:first-child{margin-top:0}.last\:border-0:last-child{border-width:0px}.hover\:border-line-strong:hover{border-color:var(--border-strong)}.hover\:bg-danger-soft:hover{background-color:var(--danger-soft)}.hover\:bg-surface-2:hover{background-color:var(--surface-2)}.hover\:text-ink:hover{color:var(--text-primary)}.hover\:text-ink-secondary:hover{color:var(--text-secondary)}.hover\:underline:hover{text-decoration-line:underline}.hover\:brightness-110:hover{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.enabled\:hover\:brightness-110:hover:enabled{--tw-brightness: brightness(1.1);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}@media(max-width:1100px){.max-\[1100px\]\:hidden{display:none}.max-\[1100px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[1100px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:900px){.max-\[900px\]\:hidden{display:none}.max-\[900px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[900px\]\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:820px){.max-\[820px\]\:col-span-1{grid-column:span 1 / span 1}.max-\[820px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}@media(max-width:760px){.max-\[760px\]\:col-span-1{grid-column:span 1 / span 1}.max-\[760px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.max-\[760px\]\:flex-row{flex-direction:row}.max-\[760px\]\:overflow-x-auto{overflow-x:auto}}@media(max-width:560px){.max-\[560px\]\:grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}}@media(min-width:640px){.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-between{justify-content:space-between}}.fade-enter-active[data-v-f90edc26],.fade-leave-active[data-v-f90edc26]{transition:opacity .2s}.fade-enter-from[data-v-f90edc26],.fade-leave-to[data-v-f90edc26]{opacity:0} diff --git a/Web App/server/dist/index.html b/Web App/server/dist/index.html index cba5d44..8bc7042 100644 --- a/Web App/server/dist/index.html +++ b/Web App/server/dist/index.html @@ -35,8 +35,8 @@ })() PilotVault — Control Panel - - + +
diff --git a/Web App/server/main.go b/Web App/server/main.go index 94854aa..0fe2ec8 100644 --- a/Web App/server/main.go +++ b/Web App/server/main.go @@ -63,6 +63,9 @@ func main() { mux.HandleFunc("GET /bff/integrations/webdav", app.requireAuth(app.handleGetWebDav)) mux.HandleFunc("PUT /bff/integrations/webdav", app.requireAuth(app.handlePutWebDav)) mux.HandleFunc("POST /bff/integrations/webdav/health", app.requireAuth(app.handleWebDavHealth)) + mux.HandleFunc("GET /bff/integrations/openweather", app.requireAuth(app.handleGetOpenWeather)) + mux.HandleFunc("PUT /bff/integrations/openweather", app.requireAuth(app.handlePutOpenWeather)) + mux.HandleFunc("POST /bff/integrations/openweather/health", app.requireAuth(app.handleOpenWeatherHealth)) // User-management (role + org scoping enforced by the API Server) mux.HandleFunc("GET /bff/users", app.requireAuth(app.handleListUsers)) mux.HandleFunc("POST /bff/users", app.requireAuth(app.handleCreateUser)) diff --git a/Web App/web/src/api.js b/Web App/web/src/api.js index 4e4f132..9b941cb 100644 --- a/Web App/web/src/api.js +++ b/Web App/web/src/api.js @@ -281,6 +281,35 @@ export async function testWebDav() { return { ok: r.ok, status: r.status, body: await r.json().catch(() => ({})) } } +/* ---------- Plugin integrations: OpenWeather ---------- */ + +// Resolved OpenWeather settings for the current user (cascade + masked API key). +export async function getOpenWeather() { + try { + const r = await fetch('/bff/integrations/openweather') + if (!r.ok) return { ok: false, status: r.status, body: await r.json().catch(() => ({})) } + return { ok: true, status: 200, body: await r.json() } + } catch { + return { ok: false, status: 0, body: {} } + } +} + +// Save the caller's editable layer. payload: { scope?, enabled?, config? }. +export async function saveOpenWeather(payload) { + const r = await fetch('/bff/integrations/openweather', { + method: 'PUT', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify(payload), + }) + return { ok: r.ok, status: r.status, body: await r.json().catch(() => ({})) } +} + +// Run a live current-weather probe against the caller's resolved config. +export async function testOpenWeather() { + const r = await fetch('/bff/integrations/openweather/health', { method: 'POST' }) + return { ok: r.ok, status: r.status, body: await r.json().catch(() => ({})) } +} + /* ---------- Logbook: drones ---------- */ export async function getDrones() { diff --git a/Web App/web/src/components/Settings.vue b/Web App/web/src/components/Settings.vue index e816e68..49601e0 100644 --- a/Web App/web/src/components/Settings.vue +++ b/Web App/web/src/components/Settings.vue @@ -14,6 +14,7 @@ import { getFileTransfer, saveFileTransfer, testFileTransfer, getLocalStorage, saveLocalStorage, testLocalStorage, getWebDav, saveWebDav, testWebDav, + getOpenWeather, saveOpenWeather, testOpenWeather, } from '../api.js' const props = defineProps({ @@ -50,7 +51,7 @@ const SECTIONS = computed(() => { const list = [ { id: 'account', label: 'Account', icon: 'user', kw: 'name username email password verification login credentials role' }, { id: 'appearance', label: 'Appearance', icon: 'sliders', kw: 'theme light dark system language region font size accessibility date time format motion' }, - { id: 'integrations', label: 'Integrations', icon: 'radio', kw: 'opensky flights adsb aircraft plugin oauth credentials bounding box plan connection ftp sftp ftps file transfer server host upload download local storage folder drive isolated private read only webdav nextcloud owncloud dav url https' }, + { id: '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' }, { 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' }, ] @@ -79,7 +80,7 @@ function sectionMatches(s) { const ROW_KW = { 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'], + 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'], 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'], @@ -716,6 +717,150 @@ function wdHealthClass(status) { return status === 'ok' ? badgeClass.success : status === 'degraded' ? badgeClass.warning : badgeClass.danger } +/* ---------- integrations: OpenWeather ---------- */ +// Same three-layer cascade as OpenSky (global → org → user); every field resolves +// independently (the API key is a lone secret, so no field group is needed). +const ow = reactive({ + loaded: false, + available: false, + orgEnabled: true, // org master switch (admins toggle it; gates the org's users) + enabled: false, // personal opt-in + canEditOrg: false, + isSuperadmin: false, + scopes: {}, // { user: { editableLayer, fields }, org?: {...} } +}) +const owScope = ref('user') +// All editable fields; the API key is prefilled with the mask and preserved on save. +const OW_KEYS = ['apiKey', 'units', 'lat', 'lon', 'lang'] +const owForm = reactive(Object.fromEntries(OW_KEYS.map((k) => [k, '']))) +const owMsg = ref('') +const owSaving = ref(false) +const owTesting = ref(false) +const owHealth = ref(null) // { status, detail, latencyMs } +const owHealthTs = ref(null) +const OW_HEALTH_KEY = 'pv.openweather.health' + +const OW_UNITS_OPTS = [ + { value: 'metric', label: 'Metric (°C)' }, + { value: 'imperial', label: 'Imperial (°F)' }, + { value: 'standard', label: 'Standard (K)' }, +] + +const owReadOnly = computed(() => ow.isSuperadmin) +const owScopeKey = computed(() => (ow.isSuperadmin ? 'user' : owScope.value)) +const owScopeData = computed(() => ow.scopes[owScopeKey.value] || { editableLayer: 'user', fields: {} }) +const owEditingOrg = computed(() => owScopeKey.value === 'org') + +function owField(k) { + return owScopeData.value.fields[k] || { effective: '', own: '', source: 'unset', locked: false } +} +function owLocked(k) { + return owReadOnly.value || owField(k).locked +} +function owSourceLabel(k) { + const src = owField(k).source + if (src === 'global') return 'Set by administrator' + if (src === 'org') return 'Set by your organization' + return '' +} + +function fillOwForm() { + for (const k of OW_KEYS) owForm[k] = owField(k).own || '' + if (!owForm.units) owForm.units = 'metric' +} + +function applyOpenWeatherView(body) { + ow.available = !!body.available + ow.orgEnabled = body.orgEnabled !== false // default enabled + ow.enabled = !!body.enabled + ow.canEditOrg = !!body.canEditOrg + ow.isSuperadmin = !!body.isSuperadmin + ow.scopes = body.scopes || {} + if (owScope.value === 'org' && !ow.canEditOrg) owScope.value = 'user' + fillOwForm() + ow.loaded = true +} + +watch(owScope, () => { owMsg.value = ''; fillOwForm() }) + +function owHealthAgo() { + if (!owHealthTs.value) return '' + const s = Math.max(0, Math.round((Date.now() - owHealthTs.value) / 1000)) + if (s < 60) return 'just now' + const m = Math.round(s / 60) + if (m < 60) return `${m} min ago` + const h = Math.round(m / 60) + if (h < 24) return `${h} h ago` + return `${Math.round(h / 24)} d ago` +} +function persistOwHealth() { + try { + if (owHealth.value) localStorage.setItem(OW_HEALTH_KEY, JSON.stringify({ health: owHealth.value, ts: owHealthTs.value })) + } catch { /* storage unavailable — non-fatal */ } +} +function restoreOwHealth() { + try { + const raw = localStorage.getItem(OW_HEALTH_KEY) + if (!raw) return + const d = JSON.parse(raw) + if (d && d.health) { owHealth.value = d.health; owHealthTs.value = d.ts || null } + } catch { /* ignore corrupt cache */ } +} + +async function loadOpenWeather() { + restoreOwHealth() + const { ok, body } = await getOpenWeather() + if (ok) applyOpenWeatherView(body) +} + +async function toggleOpenWeather(v) { + const org = owEditingOrg.value + if (org) ow.orgEnabled = v + else ow.enabled = v + const { ok, body } = await saveOpenWeather(org ? { scope: 'org', enabled: v } : { scope: 'user', enabled: v }) + if (ok) { + applyOpenWeatherView(body) + flash(org ? (v ? 'OpenWeather enabled for your organization.' : 'OpenWeather disabled for your organization.') + : (v ? 'OpenWeather enabled.' : 'OpenWeather disabled.')) + } else { + if (org) ow.orgEnabled = !v + else ow.enabled = !v + flash(body.error || 'Could not update.') + } +} + +async function saveOpenWeatherSettings() { + owMsg.value = '' + owSaving.value = true + const config = {} + for (const k of OW_KEYS) { + if (!owLocked(k)) config[k] = owForm[k] + } + const payload = { scope: owScopeKey.value, config } + if (!owEditingOrg.value) payload.enabled = ow.enabled + const { ok, body } = await saveOpenWeather(payload) + owSaving.value = false + if (!ok) { + owMsg.value = body.error || 'Could not save settings.' + return + } + applyOpenWeatherView(body) + flash(owEditingOrg.value ? 'Organization OpenWeather settings saved.' : 'OpenWeather settings saved.') +} + +async function testOpenWeatherConnection() { + owTesting.value = true + owHealth.value = null + const { ok, body } = await testOpenWeather() + owTesting.value = false + owHealth.value = ok && body.health ? body.health : { status: 'down', detail: body.error || 'Probe failed.' } + owHealthTs.value = Date.now() + persistOwHealth() +} +function owHealthClass(status) { + return status === 'ok' ? badgeClass.success : status === 'degraded' ? badgeClass.warning : badgeClass.danger +} + /* ---------- integrations: Local storage (host filesystem) ---------- */ // Same three-layer cascade as OpenSky (global → org → user), but the folder is not // editable: it is derived from identity so each org-less user gets a private folder @@ -1279,6 +1424,7 @@ onMounted(() => { loadOpenSky() loadFileTransfer() loadWebDav() + loadOpenWeather() loadLocalStorage() }) onBeforeUnmount(() => { @@ -1621,6 +1767,130 @@ onBeforeUnmount(() => { + + +
+ +
+
+ +
+
+
OpenWeather
+
+ Current conditions and forecast from the OpenWeather API. Configure the API key and default location your account uses. +
+
+
+ + +
+ + OpenWeather is currently disabled by your administrator. Contact them to enable it. +
+ + +
+
Manage your own settings, or organization-wide settings that apply to every user.
+ +
+ + + + + + + + + + +
+ OpenWeather is turned off for your organization — switch to Organization to turn it back on. +
+ + +
+ These are organization-wide settings — they apply to everyone in + {{ organizationName || 'your organization' }}. Leave the API key blank to let each user configure their own; a key set here overrides the user's. +
+
+ As a superadmin you manage the global OpenWeather configuration in the API Server panel. The effective configuration is shown below. +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + {{ owMsg }} + Checked {{ owHealthAgo() }} + + {{ owHealth.detail || owHealth.status }} + +
+